Created
June 12, 2014 10:19
-
-
Save ayonliu/a1c2b46459b1e4574691 to your computer and use it in GitHub Desktop.
How to use HessianPHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'src/HessianClient.php'; | |
$fp = fopen(dirname(__FILE__).'/unit_tests/ok.png', "r"); | |
$options = new HessianOptions(); | |
$options->version = 2; | |
$options->transport = "http"; | |
// hessian server address | |
$url = 'http://localhost/hessian/testReceive.php'; | |
//echo "Testing in url $this->url<br>"; | |
$proxy = new HessianClient($url, $options); | |
//$fp = 'hello'; | |
$data['fp'] = $fp; | |
header('Content-Type: image/png'); | |
// request server method: getFile() | |
echo $proxy->getFile($data['fp']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'src/HessianService.php'; | |
/** | |
* | |
*/ | |
class FileClass | |
{ | |
function getFile($file) | |
{ | |
//return $file . ' hessian'; | |
return $file; | |
} | |
} | |
$testService = new FileClass(); | |
$server = new HessianService($testService, array('displayInfo' => true)); | |
$server->handle(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment