Skip to content

Commit

Permalink
new hprose for PHP with pecl.
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Apr 2, 2015
1 parent d2bdf0b commit 5a1d6c3
Show file tree
Hide file tree
Showing 52 changed files with 29 additions and 5,127 deletions.
18 changes: 9 additions & 9 deletions php5.3/Hprose.php → Hprose.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* *
* hprose for php 5.3+ *
* *
* LastModified: Apr 1, 2015 *
* LastModified: Apr 2, 2015 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/
Expand Down Expand Up @@ -54,19 +54,19 @@ function hprose_unserialize($data, $simple = false) {
}
}

require('Hprose/HttpClient.php');
require('Hprose/HttpService.php');
require('Hprose/Swoole/HttpService.php');
require('Hprose/Http/Client.php');
require('Hprose/Http/Service.php');
require('Hprose/Swoole/Http/Service.php');
require('Hprose/Filter/JSONRPC/ClientFilter.php');
require('Hprose/Filter/JSONRPC/ServiceFilter.php');
require('Hprose/Filter/XMLRPC/ClientFilter.php');
require('Hprose/Filter/XMLRPC/ServiceFilter.php');

class_alias('Hprose\\HttpClient', 'HproseHttpClient');
class_alias('Hprose\\HttpService', 'HproseHttpService');
class_alias('Hprose\\HttpServer', 'HproseHttpServer');
class_alias('Hprose\\Swoole\\HttpService', 'HproseSwooleHttpService');
class_alias('Hprose\\Swoole\\HttpServer', 'HproseSwooleHttpServer');
class_alias('Hprose\\Http\\Client', 'HproseHttpClient');
class_alias('Hprose\\Http\\Service', 'HproseHttpService');
class_alias('Hprose\\Http\\Server', 'HproseHttpServer');
class_alias('Hprose\\Swoole\\Http\\Service', 'HproseSwooleHttpService');
class_alias('Hprose\\Swoole\\Http\\Server', 'HproseSwooleHttpServer');
class_alias('Hprose\\Filter\\JSONRPC\\ClientFilter', 'HproseJSONRPCClientFilter');
class_alias('Hprose\\Filter\\JSONRPC\\ServiceFilter', 'HproseJSONRPCServiceFilter');
class_alias('Hprose\\Filter\\XMLRPC\\ClientFilter', 'HproseXMLRPCClientFilter');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions php5.3/Hprose/HttpClient.php → Hprose/Http/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

/**********************************************************\
* *
* Hprose/HttpClient.php *
* Hprose/Http/Client.php *
* *
* hprose http client class for php 5.3+ *
* *
* LastModified: Mar 26, 2015 *
* LastModified: Apr 2, 2015 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/

namespace Hprose {
class HttpClient extends Client {
namespace Hprose\Http {
class Client extends \Hprose\Client {
private static $cookieManager = array();
private $host = '';
private $path = '';
Expand Down
18 changes: 11 additions & 7 deletions php5.3/Hprose/HttpService.php → Hprose/Http/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

/**********************************************************\
* *
* Hprose/HttpServer.php *
* Hprose/Http/Server.php *
* *
* hprose http server class for php 5.3+ *
* *
* LastModified: Mar 29, 2015 *
* LastModified: Apr 2, 2015 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/

namespace Hprose {
class HttpService extends Service {
namespace Hprose\Http {
class Service extends \Hprose\Service {
private $crossDomain = false;
private $P3P = false;
private $get = true;
Expand Down Expand Up @@ -87,8 +87,12 @@ public function removeAccessControlAllowOrigin($origin) {
unset($this->origins[strtolower($origin)]);
}
public function handle() {
$request = file_get_contents("php://input");

if (isset($HTTP_RAW_POST_DATA)) {
$request = $HTTP_RAW_POST_DATA;
}
else {
$request = file_get_contents("php://input");
}
$context = new \stdClass();
$context->server = $this;
$context->userdata = new \stdClass();
Expand Down Expand Up @@ -136,7 +140,7 @@ public function handle() {
}
}

class HttpServer extends HttpService {
class Server extends Service {
public function start() {
$this->handle();
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* *
* hprose swoole http service library for php 5.3+ *
* *
* LastModified: Apr 1, 2015 *
* LastModified: Apr 2, 2015 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/

namespace Hprose\Swoole {
class HttpService extends \Hprose\Service {
namespace Hprose\Swoole\Http {
class Service extends \Hprose\Service {
private $crossDomain = false;
private $P3P = false;
private $get = true;
Expand Down Expand Up @@ -138,7 +138,7 @@ public function handle($request, $response) {
}
}

class HttpServer extends HttpService {
class Server extends Service {
private $http;
public function __construct($host, $port) {
$this->http = new \swoole_http_server($host, $port);
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"autoload": {
"classmap": [
"./php5/"
"./"
]
}
}
158 changes: 0 additions & 158 deletions php5/HproseBaseHttpClient.php

This file was deleted.

55 changes: 0 additions & 55 deletions php5/HproseClassManager.php

This file was deleted.

Loading

0 comments on commit 5a1d6c3

Please sign in to comment.