Skip to content

Commit 54f843d

Browse files
committed
update some logic for run and other
1 parent f06d45b commit 54f843d

7 files changed

Lines changed: 12 additions & 11 deletions

File tree

app/Command/ClientCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
use Swoft\Tcp\Protocol;
1414
use Swoole\Coroutine\Client;
1515
use Swoole\Coroutine\Http\Client as HttpCoClient;
16-
use function json_decode;
1716
use const SWOOLE_SOCK_TCP;
1817

1918
/**
20-
* Privide some commads for quick connect tcp, ws server
19+
* Provide some commands for quick connect tcp, ws server
2120
*
2221
* @Command()
2322
*/

app/Command/PharCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function pack(Input $input, Output $output): int
8181

8282
// musual append some files
8383
if ($files = $input->getStringOpt('files')) {
84-
$cpr->setModifies(Str::explode($files, ','));
84+
$cpr->setModifies(Str::explode($files));
8585
$output->liteInfo("will only pack input files to the exists phar: $outFile");
8686
}
8787

app/Command/ServeCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ private function collectInfo(Input $input): bool
193193
* @param Output $output
194194
*
195195
* @example
196-
* {binFile} run -c ws:start -b bin/swoft /path/to/php/swoft
196+
* {binFile} run Default, will start http server
197+
* {binFile} run -c ws:start -b bin/swoft /path/to/swoft
197198
*/
198199
public function run(Input $input, Output $output): void
199200
{

app/Command/SystemCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Swoft\Console\Annotation\Mapping\CommandMapping;
88
use Swoft\Console\Input\Input;
99
use Swoft\Console\Helper\Show;
10+
use function swoole_cpu_num;
1011
use const BASE_PATH;
1112
use const PHP_OS;
1213
use const PHP_VERSION;
@@ -31,7 +32,7 @@ public function info(Input $in): void
3132
$info = [
3233
// "<bold>System environment info</bold>\n",
3334
'OS' => PHP_OS,
34-
'CPU number' => \swoole_cpu_num(),
35+
'CPU number' => swoole_cpu_num(),
3536
'Php version' => PHP_VERSION,
3637
'Swoole version' => SWOOLE_VERSION,
3738
'Swoft version' => Swoft::VERSION,

app/Listener/BeforeConsoleRunListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace Swoft\Cli\Listener;
1212

13+
use Swoft\Console\Application;
1314
use Swoft\Console\ConsoleEvent;
1415
use Swoft\Event\Annotation\Mapping\Listener;
1516
use Swoft\Event\EventHandlerInterface;
@@ -31,7 +32,7 @@ public function handle(EventInterface $event): void
3132
$configFile = getcwd() . '/swoftcli.yml';
3233

3334
if (file_exists($configFile)) {
34-
/** @var \Swoft\Console\Application $app */
35+
/** @var Application $app */
3536
$app = $event->getTarget();
3637
$data = Yaml::parseFile($configFile);
3738

app/SwoftCLI.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
use Swoft\Stdlib\Helper\Sys;
77
use Swoft\SwoftApplication;
88
use function dirname;
9-
use function file_exists;
10-
use function getcwd;
119
use function ini_set;
10+
use const PHP_VERSION_ID;
1211

1312
/**
1413
* Class SwoftCLI
@@ -22,7 +21,7 @@ protected function afterInit(): void
2221
$this->setRuntimePath(Sys::getTempDir());
2322

2423
// fix: on php73 preg_* error
25-
if (\PHP_VERSION_ID > 70300) {
24+
if (PHP_VERSION_ID > 70300) {
2625
ini_set('pcre.jit', 'off');
2726
}
2827

app/bean.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types=1);
22

3-
use Swoft\Http\Server\Swoole\RequestListener;
4-
use Swoft\Server\Swoole\SwooleEvent;
3+
// use Swoft\Http\Server\Swoole\RequestListener;
4+
// use Swoft\Server\Swoole\SwooleEvent;
55

66
return [
77
'cliRouter' => [

0 commit comments

Comments
 (0)