Skip to content

Commit

Permalink
Trim trailing whitespace in php(t) files
Browse files Browse the repository at this point in the history
  • Loading branch information
petk committed Sep 19, 2018
1 parent 0bbc0c9 commit 133f4ac
Show file tree
Hide file tree
Showing 97 changed files with 266 additions and 269 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE
Expand Up @@ -17,7 +17,7 @@ Please answer these questions before submitting your issue. Thanks!



5. What is your machine environment used (including version of kernel & php & gcc) ?
5. What is your machine environment used (including version of kernel & php & gcc) ?



Expand Down
2 changes: 1 addition & 1 deletion config.m4
Expand Up @@ -339,7 +339,7 @@ if test "$PHP_SWOOLE" != "no"; then
AC_DEFINE(SW_USE_REDIS, 1, [enable async-redis support])
PHP_ADD_LIBRARY(hiredis, 1, SWOOLE_SHARED_LIBADD)
fi

if test "$PHP_HTTP2" = "yes" || test "$PHP_NGHTTP2_DIR" != "no"; then
if test "$PHP_NGHTTP2_DIR" != "no"; then
PHP_ADD_INCLUDE("${PHP_NGHTTP2_DIR}/include")
Expand Down
8 changes: 4 additions & 4 deletions examples/coroutine/TestHttpServ.php
Expand Up @@ -69,8 +69,8 @@ public function onRequest($request, $response){
$tcp->on("close", function(swoole_client $cli){
});
$tcp->on("error", function(swoole_client $cli){
});
$tcp->connect('10.100.64.151', 9805);
});
$tcp->connect('10.100.64.151', 9805);

// });
// $udp->on("close", function(swoole_client $cli){
Expand All @@ -87,7 +87,7 @@ public function onRequest($request, $response){
* @return [type] [description]
*/
public function onClose($server, $fd, $from_id){

//echo " on close fd = $fd from_id = $from_id \n";
}

Expand All @@ -110,7 +110,7 @@ public function start(){
'reactor_num' => 4, //亲核
'daemonize' => 1, //守护进程
'backlog' => 128,
'log_file' => '/data/log/test_http_server.log',
'log_file' => '/data/log/test_http_server.log',
);
$th = new TestHttpServer();
$th ->set($setting);
Expand Down
6 changes: 3 additions & 3 deletions examples/coroutine/coro_destruct.php
Expand Up @@ -4,7 +4,7 @@ class T
{
function __construct()
{

}

function test()
Expand All @@ -13,10 +13,10 @@ function test()
}

function __destruct()
{
{
go(function () {
echo "coro start\n";
co::sleep(1.0);
co::sleep(1.0);
echo "coro exit\n";
});
echo "111\n";
Expand Down
2 changes: 1 addition & 1 deletion examples/coroutine/coro_gethost.php
Expand Up @@ -2,7 +2,7 @@
require __DIR__ . "/coro_include.php";
use Swoole\Coroutine as co;

co::create(function () {
co::create(function () {
$ip = co::gethostbyname('www.baidu.com');
var_dump($ip);
});
Expand Down
2 changes: 1 addition & 1 deletion examples/coroutine/coro_invoke.php
Expand Up @@ -16,7 +16,7 @@ function title() {
echo "333invoke_________________________________\n";
$tcpclient = new Swoole\Coroutine\Client(SWOOLE_SOCK_TCP);
var_dump($tcpclient->connect('127.0.0.1', 9501, 1));

}

echo "111\n";
2 changes: 1 addition & 1 deletion examples/coroutine/coro_nested.php
Expand Up @@ -3,7 +3,7 @@
echo "before coro\n";
go(function () {
echo "co[1] start\n";

$client = new Swoole\Coroutine\Client(SWOOLE_SOCK_TCP);
$res = $client->connect('127.0.0.1', 9501, 1);
echo "co[1] connect ret = ".var_export($res,1)."\n";
Expand Down
3 changes: 1 addition & 2 deletions examples/coroutine/coro_set_stack_size.php
Expand Up @@ -8,5 +8,4 @@
echo "no coro exit\n";
});
echo "exec file end\n";



5 changes: 2 additions & 3 deletions examples/coroutine/exception/empty.php
@@ -1,5 +1,5 @@
<?php
go(function () {
go(function () {
try {
echo "before\n";
co::sleep(0.5);
Expand All @@ -12,5 +12,4 @@
}
});
echo "exec file end\n";



12 changes: 6 additions & 6 deletions examples/coroutine/httpmulti.php
Expand Up @@ -24,7 +24,7 @@ public function run()
}

private static function https(){
//--enable-openssl
//--enable-openssl
for($i=0;$i<2;$i++){
$cli = new Swoole\Coroutine\Http\Client('0.0.0.0',443,TRUE );
$cli->set([ 'timeout' => 1]);
Expand Down Expand Up @@ -62,9 +62,9 @@ private static function http(){
}

private static function multihttp(){

error_log(__LINE__.'---------- begin --- multi --------------'.PHP_EOL,3,'/tmp/markyuan');

$cliAA= new Swoole\Coroutine\Http\Client('0.0.0.0', 9510);
$cliAA->set(['timeout' => 1]);
$cliAA->setHeaders([
Expand Down Expand Up @@ -102,8 +102,8 @@ private static function multihttp(){
error_log(__LINE__.'---------- end --- multi --------------'.PHP_EOL,3,'/tmp/markyuan');
}



private static function tcp(){
for($i=0;$i<2;$i++){
$tcp_cli = new Swoole\Coroutine\Client(SWOOLE_SOCK_TCP);
Expand All @@ -130,7 +130,7 @@ private static function tcpmulti(){
$cliAA = new Swoole\Coroutine\Client(SWOOLE_SOCK_TCP);
$cliBB = new Swoole\Coroutine\Client(SWOOLE_SOCK_TCP);
$retAA = $cliAA ->connect("0.0.0.0", 9511);
$retBB = $cliBB ->connect("0.0.0.0", 9511);
$retBB = $cliBB ->connect("0.0.0.0", 9511);
$retAA = $cliAA ->send('test for the coro');
$retBB = $cliBB ->send('test for the coro');
$retAA = $cliAA->recv();
Expand Down
2 changes: 1 addition & 1 deletion examples/coroutine/mysql_query.php
Expand Up @@ -16,7 +16,7 @@ function title() {
echo "333invoke_________________________________\n";
$tcpclient = new Swoole\Coroutine\Client(SWOOLE_SOCK_TCP);
var_dump($tcpclient->connect('127.0.0.1', 9501, 1));

}

echo "111\n";
Expand Down
2 changes: 1 addition & 1 deletion examples/coroutine/reconnect_test.php
Expand Up @@ -21,7 +21,7 @@
return;
}
$mysql->close();
$res = $mysql->connect(['host' => '192.168.244.128', 'user' => 'mha_manager', 'password' => 'mhapass', 'database' => 'tt']);
if ($res == false) {
$response->end("MySQL connect fail!");
Expand Down
4 changes: 2 additions & 2 deletions examples/coroutine/select/1.php
@@ -1,6 +1,6 @@
<?php
$c1 = new chan();
//consumer first with select mode
//consumer first with select mode
$num = 10;
go(function () use ($c1,$num) {
$read_list = [$c1];
Expand All @@ -20,7 +20,7 @@
}
}
});

go(function () use ($c1,$num) {
echo "push start\n";
for ($i=0;$i<$num;$i++)
Expand Down
4 changes: 2 additions & 2 deletions examples/coroutine/select/2.php
Expand Up @@ -10,14 +10,14 @@
echo "pop [#$i] ret:".var_export($ret,1)."\n";
}
});

go(function () use ($c1,$num) {
echo "push start\n";
for ($i=0;$i<$num;$i++)
{
$ret = $c1->push("data-$i");
echo "push [#$i] ret:".var_export($ret,1)."\n";
}

});
echo "main end\n";
1 change: 0 additions & 1 deletion examples/coroutine/select/4.php
Expand Up @@ -20,4 +20,3 @@
}
});
echo "main end\n";

4 changes: 2 additions & 2 deletions examples/coroutine/select/6.php
Expand Up @@ -20,7 +20,7 @@
}
}
});

go(function () use ($c1,$num) {
echo "push start\n";
for ($i=0;$i<$num;$i++)
Expand All @@ -33,6 +33,6 @@
$ret = $c1->push("data-$i");
echo "push [#$i] ret:".var_export($ret,1)."\n";
}

});
echo "main end\n";
10 changes: 5 additions & 5 deletions examples/coroutine/select/7.php
Expand Up @@ -8,9 +8,9 @@
{
$ret = $c2->push("chan2-$i");
echo "chan 2 push [#$i] ret:".var_export($ret,1)."\n";
}
}
});
go(function () use ($c1,$num) {
go(function () use ($c1,$num) {
$read_list = [$c1];
$write_list = null;
$result = chan::select($read_list, $write_list, 2);
Expand All @@ -27,7 +27,7 @@
}
}
});

go(function () use ($c1,$num) {
echo "chan1 push start\n";
for ($i=0;$i<$num;$i++)
Expand All @@ -40,7 +40,7 @@
$ret = $c1->push("chan1-$i");
echo "chan1 push [#$i] ret:".var_export($ret,1)."\n";
}

});

go(function () use ($c2,$num) {
Expand All @@ -49,6 +49,6 @@
{
$ret = $c2->pop();
echo "chan2 pop [#$i] ret:".var_export($ret,1)."\n";
}
}
});
echo "main end\n";
10 changes: 5 additions & 5 deletions examples/coroutine/select/8.php
Expand Up @@ -8,17 +8,17 @@
{
$ret = $c2->push("chan2-$i");
echo "chan 2 push [#$i] ret:".var_export($ret,1)."\n";
}
}
});

go(function () use ($c1,$c2,$num) {
$ori_list = $read_list = [$c1,$c2];
$write_list = null;
$result = chan::select($read_list, $write_list, 2);
echo "select resume res: ".var_export($result,1)."\n";

if ($ori_list)
{
{
foreach ($ori_list as $chan => $ch)
{
for ($i=0;$i<$num;$i++)
Expand All @@ -30,7 +30,7 @@
}
}
});

go(function () use ($c1,$num) {
echo "chan1 push start\n";
for ($i=0;$i<$num;$i++)
Expand All @@ -43,6 +43,6 @@
$ret = $c1->push("chan1-$i");
echo "chan1 push [#$i] ret:".var_export($ret,1)."\n";
}

});
echo "main end\n";
4 changes: 2 additions & 2 deletions examples/coroutine/socket/accept.php
Expand Up @@ -4,8 +4,8 @@
$ret = $sock->bind('127.0.0.1', 9601);
var_dump($ret);
assert($sock->listen(512));
$conn = $sock->accept();
$conn = $sock->accept();

$data = $conn->recv();
var_dump($data);
$json = json_decode($data, true);
Expand Down
2 changes: 1 addition & 1 deletion examples/coroutine/socket/sendto.php
@@ -1,6 +1,6 @@
<?php

echo "start \n";
echo "start \n";
go(function () {
$conn = new Swoole\Coroutine\Socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
$ret = $conn->connect('127.0.0.1', 9601);
Expand Down
8 changes: 4 additions & 4 deletions examples/coroutine/udp_tcp_timeout.php
Expand Up @@ -53,7 +53,7 @@ public function init(){
*/
public function onRequest($request, $response){


//$udp_cli = new Swoole\Coroutine\Client(SWOOLE_SOCK_UDP);
$tcp_cli = new Swoole\Coroutine\Client(SWOOLE_SOCK_TCP);

Expand All @@ -80,7 +80,7 @@ public function onRequest($request, $response){
else{
error_log(" tcp cli timeout \n",3, '/data/log/udp_timeout.log');
}

$response ->end(" swoole response is ok");
}

Expand All @@ -92,7 +92,7 @@ public function onRequest($request, $response){
* @return [type] [description]
*/
public function onClose($server, $fd, $from_id){

//echo " on close fd = $fd from_id = $from_id \n";
}

Expand All @@ -115,7 +115,7 @@ public function start(){
'reactor_num' => 4, //亲核
'daemonize' => 1, //守护进程
'backlog' => 128,
'log_file' => '/data/log/test_http_server.log',
'log_file' => '/data/log/test_http_server.log',
);
$th = new TestHttpServer();
$th ->set($setting);
Expand Down
2 changes: 1 addition & 1 deletion examples/coroutine/websocket.php
Expand Up @@ -4,7 +4,7 @@
'log_file' => '/dev/null'
));
$ws->on("WorkerStart", function (\swoole_server $serv) {

});

$ws->on('open', function ($serv, swoole_http_request $request) {
Expand Down

0 comments on commit 133f4ac

Please sign in to comment.