23 Star 90 Fork 25

inhere/php-console

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
alone 681 Bytes
一键复制 编辑 原始数据 按行查看 历史
Inhere 提交于 2021-11-29 23:02 +08:00 . style: run code inspect for test example resource
#!/usr/env/php
<?php
/**
* only run a controller.
*/
use Inhere\Console\Examples\Controller\HomeController;
use Inhere\Console\IO\Input;
use Inhere\Console\IO\Output;
use Toolkit\Cli\Color;
define('BASE_PATH', dirname(__DIR__));
require dirname(__DIR__) . '/test/bootstrap.php';
$input = new Input();
$ctrl = new HomeController($input, new Output());
$ctrl->setDetached();
try {
exit($ctrl->run([$input->getCommand()]));
} catch (Exception $e) {
$message = Color::apply('error', $e->getMessage());
echo sprintf("%s\nFile %s:%d\nTrace:\n%s\n",
$message, $e->getFile(), $e->getLine(), $e->getTraceAsString()
);
}
// can also: see './alone-app' file
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/inhere/php-console.git
git@gitee.com:inhere/php-console.git
inhere
php-console
php-console
master

搜索帮助