starkley / my-cli
Simple PHP command line interface for personnal project
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/starkley/my-cli
Requires
- php: >=7.2
- php-di/php-di: ^6.1
- splitbrain/php-cli: ^1.1
This package is auto-updated.
Last update: 2025-10-09 23:25:54 UTC
README
Simple PHP command line interface for personnal project.
Features:
- Module creation
NOTE
If your are using Windows, please download a linux terminal like cmder
usage
-
Create a file named
myfasi
without a specific extension in the root of your project -
Once created, copy the following code in this one
<?php define('ROOT', __DIR__); define('DS', DIRECTORY_SEPARATOR); require('vendor/autoload.php'); /** * Contexte courant */ $context = \Console\Context\Myfasi\App::class; /** * Construction du conteneur d'injection de dépendances */ $containerBuilder = new \DI\ContainerBuilder(); $containerBuilder->useAutoWiring(true); $containerBuilder->addDefinitions('vendor/starkley/my-cli/config.php'); $containerBuilder->addDefinitions($context::CONFIG); $container = $containerBuilder->build(); /** * Chargement de la configuration du contexte, qui correspond à l'architecture utilisée * Ex: - myfasi et afia qui ont la meme architecture, * - fasinet, * - grafikart Framework, ... */ $commandContext = (new Console\Boot( $container, $container->get('app.context') ) )->getContext(); $commandContext->run();
Enfin faites
composer dump-autoload -o