wilkques / console
v3.0.0
2024-09-25 07:12 UTC
Requires
- php: >=5.5
- league/climate: >=3.8
- wilkques/container: >=4.0.0
- wilkques/php-helper: >=5.14.0
README
composer require wilkques/console
How to use
-
Add PHP command file (path default ./Console)
<?php use Wilkques\Console\Command; class DoSomethingCommand extends Command { /** * signature * * @var string */ public $signature = "do:something {--debug=false: debug mode (default false)} {--list=false: get list (default false)}"; /** * description * * @var string */ public $description = "do something"; /** * handle this command */ public function handle() { // do something } }
-
in terminal run
vi artisan
& Add PHP coderequire_once 'vendor/autoload.php'; $command = $argv; array_shift($command); console() ->setCommandRootPath("<set console dir path>") // if you want change path ->setComposerPath("<composer.json path>") // if you want change ->build() ->handle($command);
-
in terminal run
php artisan do:something --debug=true