recca0120/terminal
Composer 安装命令:
composer require recca0120/terminal
包简介
run laravel artisan command in web application
README 文档
README
Laravel Terminal
Installation
composer require recca0120/terminal --dev
OR
Add Presenter to your composer.json file:
"require-dev": { "recca0120/terminal": "^1.6.8" }
Now, run a composer update on the command line from the root of your project:
composer update
Registering the Package
Include the service provider within app/config/app.php. The service povider is needed for the generator artisan command.
'providers' => [ ... Recca0120\Terminal\TerminalServiceProvider::class, ... ];
publish
artisan vendor:publish --provider="Recca0120\Terminal\TerminalServiceProvider"
URL
http://localhost/path/to/terminal
config
return [ 'enabled' => env('APP_DEBUG'), 'whitelists' => ['127.0.0.1', 'your ip'], 'route' => [ 'prefix' => 'terminal', 'as' => 'terminal.', // if you use laravel 5.1, remember to remove web middleware 'middleware' => ['web'], // if you need auth, you need use web and auth middleware // 'middleware' => ['web', 'auth'] ], 'commands' => [ \Recca0120\Terminal\Console\Commands\Artisan::class, \Recca0120\Terminal\Console\Commands\ArtisanTinker::class, \Recca0120\Terminal\Console\Commands\Cleanup::class, \Recca0120\Terminal\Console\Commands\Find::class, \Recca0120\Terminal\Console\Commands\Mysql::class, \Recca0120\Terminal\Console\Commands\Tail::class, \Recca0120\Terminal\Console\Commands\Vi::class, // add your command ], ];
Available Commands
- artisan
- artisan tinker
- find
- mysql
- tail
- vi
Find
not full support, but you can delete file use this function (please check file permission)
find ./vendor -name tests -type d -maxdepth 4 -delete
Add Your Command
Add Command Class
// src/Console/Commands/Mysql.php namespace Recca0120\Terminal\Console\Commands; use Illuminate\Console\Command; use Illuminate\Foundation\Inspiring; use Recca0120\Terminal\Contracts\TerminalCommand; class Inspire extends Command implements TerminalCommand { /** * The name and signature of the console command. * * @var string */ protected $signature = 'inspire'; /** * The console command description. * * @var string */ protected $description = 'Display an inspiring quote'; /** * Execute the console command. * * @return mixed */ public function handle() { $this->comment(PHP_EOL.Inspiring::quote().PHP_EOL); } }
ScreenShot
Available Commands
$ help
Artisan List
$ artisan
Migrate
$ artisan migrate --seed
Artisan Tinker
$ artisan tinker
MySQL
$ mysql mysql> select * from users; # change connection mysql> use sqlite; mysql> select * from users;
Find Command
$ find ./ -name * -maxdepth 1
Find and Delete
$ find ./storage/logs -name * -maxdepth 1 -delete
Vi
$ vi server.php
Tail
$ tail $ tail --line=1 $ tail server.php $ tail server.php --line 5
Cleanup
$ cleanup
recca0120/terminal 适用场景与选型建议
recca0120/terminal 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 418.61k 次下载、GitHub Stars 达 878, 最近一次更新时间为 2015 年 11 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「web」 「console」 「terminal」 「laravel」 「artisan」 「web artisan」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 recca0120/terminal 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 recca0120/terminal 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 recca0120/terminal 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This class provides you with an easy-to-use interface to progress bars.
A Laravel package to retrieve data from Google Search Console
A fork of runcmf/runtracy
Additional artisan commands for Laravel
Model of a web-based resource
PHP Terminal emulator controller utilizing ANSI escape sequence coding.
统计信息
- 总下载量: 418.61k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 884
- 点击次数: 33
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-10