new3den / console
Console library
Installs: 77
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/new3den/console
Requires
- php: >=8.0
- jolicode/jolinotif: ^2.2
- psr/container: *
- psy/psysh: ^0.10
- symfony/console: ^5.2
Requires (Dev)
- roave/security-advisories: dev-master
- symfony/var-dumper: ^5.2
This package is not auto-updated.
Last update: 2025-10-05 10:41:48 UTC
README
Requirements
- PSR-11 compatible container
- PHP8.0 or higher
bin/console example
<?php declare(strict_types=1); $autoloaderPath = __DIR__ . '/../vendor/autoload.php'; if(!file_exists($autoloaderPath)) { throw new RuntimeException('Error, composer is not setup correctly.. Please run composer install'); } $autoloader = require $autoloaderPath; # Container $container = new \League\Container\Container(); # Autowiring $container->delegate(new \League\Container\ReflectionContainer()); # Load the CLI $cli = new \New3den\Console\Console($container, $autoloader); # Define the class scope to load commands from $cli->setCommandsNamespace('New3den\\Commands'); # Define the name $cli->setConsoleName('New3den'); # Define the version $cli->setVersion('1.0.0'); # Run the cli $cli->run();
Command example
<?php declare(strict_types=1); namespace New3den\Commands; /** * @property string $stringInput */ class Command extends \New3den\Console\ConsoleCommand { protected string $signature = 'command {--stringInput=Hello World : Some string to pass into the command }'; protected string $description = 'This is an example command'; public function handle(): void { $this->out($this->stringInput); } }