rreynaldo / baby-cli
There is no license information available for the latest version (dev-main) of this package.
Baby Starter Project
dev-main
2021-09-08 19:35 UTC
Requires
- monolog/monolog: ^2.2
- php-di/php-di: ^6.3
- rreynaldo/baby: dev-main
This package is auto-updated.
Last update: 2025-04-09 04:27:33 UTC
README
Install
composer create-project rreynaldo/baby-cli:dev-main my_project_name
Create your first Command in folder src/Commands
<?php
namespace App\Commands;
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Logger\ConsoleLogger;
use Symfony\Component\Console\Output\OutputInterface;
class AppTestCommand extends Command
{
protected static $defaultName = 'app:test:command';
protected ContainerInterface $container;
/**
* AppTestCommand constructor.
*/
public function __construct(ContainerInterface $container)
{
parent::__construct();
$this->container = $container;
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->container->get('console-logger')->info('Running');
return Command::SUCCESS;
}
}
Create your first Scheluder in folder src/Schedules
<?php
namespace App\Commands;
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Logger\ConsoleLogger;
use Symfony\Component\Console\Output\OutputInterface;
class AppTestCommand extends Command
{
protected static $defaultName = 'app:test:command';
protected ContainerInterface $container;
/**
* AppTestCommand constructor.
*/
public function __construct(ContainerInterface $container)
{
parent::__construct();
$this->container = $container;
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->container->get('console-logger')->info('Running');
return Command::SUCCESS;
}
}