コード例 #1
0
ファイル: basic.php プロジェクト: jlaso/console
<?php

include_once __DIR__ . '/../vendor/autoload.php';
use JLaso\Console as JLasoConsole;
$options = JLasoConsole\ArgumentsHelper::getInstance()->addHelpOption()->addOption("verbose", JLasoConsole\ConsoleOptionType::NO_ARG(), "Verbosity")->addOption("env", JLasoConsole\ConsoleOptionType::OPTIONAL(), "Environment", "dev")->setAlternatives(array("dev", "prod"))->bind($help = true);
echo "The 'env' argument is " . $options['env'] . "\n";
echo isset($options['verbose']) ? "You have add 'verbose' argument\n" : "";
コード例 #2
0
ファイル: regenerate-db.php プロジェクト: jlaso/notify
<?php

include_once __DIR__ . '/../vendor/autoload.php';
use JLaso\Notify\Domain\Service\DI\Container;
use JLaso\Console as JLasoConsole;
$options = JLasoConsole\ArgumentsHelper::getInstance()->addHelpOption()->addOption("env", JLasoConsole\ConsoleOptionType::OPTIONAL(), "Environment", "dev")->setAlternatives(["dev", "prod"])->bind($help = true);
Container::setEnv($options['env']);
$container = Container::getInstance();
$repositories = ['user-repository'];
foreach ($repositories as $repository) {
    $container->get($repository)->initSchema();
}