Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ZPHP/Common/Terminal.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function clearScreen()
public static function setStyle($c)
{
if (self::$enable_color) {
echo "\033[" . $c . 'm';
echo "\033[" , $c , 'm';
}
}

Expand Down
2 changes: 1 addition & 1 deletion ZPHP/Socket/Callback/HttpServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ abstract public function onSend($fd, $data);

public function onStart()
{
echo 'server start, swoole version: ' . SWOOLE_VERSION . PHP_EOL;
echo 'server start, swoole version: ' , SWOOLE_VERSION , PHP_EOL;
$config = ZConfig::getField('cache', 'locale');
$this->cache = ZCache::getInstance($config['adapter'], $config);
}
Expand Down
2 changes: 1 addition & 1 deletion ZPHP/Socket/Callback/WSServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public function close($fd, $code = self::CLOSE_NORMAL, $reason = '')

public function log($msg)
{
echo $msg."\n";
echo $msg,"\n";
}
}

2 changes: 1 addition & 1 deletion ZPHP/View/Adapter/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function display()
$data = \json_encode($this->model);
if(isset($_GET['jsoncallback'])) {
Utils::header("Content-Type", 'application/x-javascript; charset=utf-8');
echo $_GET['jsoncallback'].'('.$data.')';
echo $_GET['jsoncallback'],'(',$data,')';
} else {
Utils::header("Content-Type", "application/json; charset=utf-8");
echo $data;
Expand Down
4 changes: 2 additions & 2 deletions bin/swoole_http_server.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ private function getStaticFile($file, $path = 'webroot')
"config::"
]);
if (empty($opt['path'])) {
echo "examples: php swoole_http_server.php --path=/home/www/zphpdemo --config=default --ip=0.0.0.0 --port=9501 --worker=4 -d" . PHP_EOL;
echo "path is required" . PHP_EOL;
echo "examples: php swoole_http_server.php --path=/home/www/zphpdemo --config=default --ip=0.0.0.0 --port=9501 --worker=4 -d" , PHP_EOL;
echo "path is required" , PHP_EOL;
return;
}

Expand Down
16 changes: 8 additions & 8 deletions build.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
require 'ZPHP/Common/Dir.php';
echo "pls enter app path:".PHP_EOL;
echo "pls enter app path:",PHP_EOL;
$app_path = trim(fgets(STDIN));

if(is_dir($app_path)) {
echo 'dir is exist'.PHP_EOL;
echo 'dir is exist',PHP_EOL;
return;
}

Expand All @@ -23,7 +23,7 @@
);
foreach($dirList as $realPath) {
if(ZPHP\Common\Dir::make($app_path.DIRECTORY_SEPARATOR.$realPath)) {
echo $realPath." done...".PHP_EOL;
echo $realPath," done...",PHP_EOL;
}
}
$mainTxt = '<?php
Expand All @@ -32,7 +32,7 @@
require \''.__DIR__.'\'. DIRECTORY_SEPARATOR . \'ZPHP\' . DIRECTORY_SEPARATOR . \'ZPHP.php\';
ZPHP::run($rootPath);';
file_put_contents($app_path.DIRECTORY_SEPARATOR.'webroot'.DIRECTORY_SEPARATOR.'main.php', $mainTxt);
echo "main.php done...".PHP_EOL;
echo "main.php done...",PHP_EOL;

$ctrlTxt = '<?php
namespace ctrl\main;
Expand Down Expand Up @@ -74,9 +74,9 @@ public function main()

';
file_put_contents($app_path.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.'ctrl'.DIRECTORY_SEPARATOR.'main'.DIRECTORY_SEPARATOR.'main.php', $ctrlTxt);
echo "ctrl done...".PHP_EOL;
echo "ctrl done...",PHP_EOL;

echo "pls enter project_name:".PHP_EOL;
echo "pls enter project_name:",PHP_EOL;
$project_name = trim(fgets(STDIN));

$configTxt = '<?php
Expand All @@ -94,8 +94,8 @@ public function main()
);
';
file_put_contents($app_path.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'default'.DIRECTORY_SEPARATOR.'config.php', $configTxt);
echo "config done...".PHP_EOL;
echo "finish...".PHP_EOL;
echo "config done...",PHP_EOL;
echo "finish...",PHP_EOL;
}


Expand Down