static function run($container) { $application = new \Symfony\Component\Console\Application(); $application->add(new ViewCommand(null, $container)); $application->add(new BatchCommand(null, $container)); $application->add(new AssetsCommand(null, $container)); $application->add(new ControllerCommand(null, $container)); $application->add(new CacheCommand(null, $container)); $application->run(); }
public function application() { $app = new \Symfony\Component\Console\Application('Atshell', static::VERSION); $app->add(new InitCommand()); $app->add(new ConfigCommand()); $app->add(new EditCommand()); $app->add(new ProjectsCommand()); $app->add(new UpCommand()); // project specified commands $project = $this->findProject(getcwd()); if ($project) { } }
function run() { $app = new \Symfony\Component\Console\Application(); foreach ($this->commands() as $command) { $app->add(new $command()); } $app->run(); }
public function testRunWithoutProblems() { $input = $this->getMock('Symfony\\Component\\Console\\Input\\InputInterface'); $output = $this->getMock('Symfony\\Component\\Console\\Output\\OutputInterface'); $output->expects($this->any())->method('getFormatter')->will($this->returnValue($this->getMock('Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface'))); $command = new TaskList(); $command->setContainer(self::$DI['cli']); $application = new \Symfony\Component\Console\Application(); $application->add($command); $setupCommand = $application->find('task-manager:task:list'); $setupCommand->execute($input, $output); }
<?php require_once __DIR__ . '/../../../../../autoload.php'; $application = new Symfony\Component\Console\Application(); $application->add(new \BWC\Component\WWDAPI\OTE\Command\Step01Command()); $application->add(new \BWC\Component\WWDAPI\OTE\Command\CheckAvailabilityCommand()); $application->add(new \BWC\Component\WWDAPI\OTE\Command\NameGenDbCommand()); $application->add(new \BWC\Component\WWDAPI\OTE\Command\OrderDomainsCommand()); $application->add(new \BWC\Component\WWDAPI\OTE\Command\CreateShopperCommand()); $application->add(new \BWC\Component\WWDAPI\OTE\Command\OrderDomainTransfersCommand()); $application->add(new \BWC\Component\WWDAPI\OTE\Command\DomainInfoCommand()); $application->add(new \BWC\Component\WWDAPI\OTE\Command\OrderDomainRenewalsCommand()); $application->add(new \BWC\Component\WWDAPI\OTE\Command\OrderDomainPrivacyCommand()); $application->run();
#!/usr/bin/env php <?php require_once __DIR__ . '/../autoload.php'; $app = new \Symfony\Component\Console\Application('lightsaml', '1.0'); $input = new \Symfony\Component\Console\Input\ArgvInput(); $app->add(new \LightSaml\Command\BuildSPMetadataCommand()); $app->run($input);
#!/usr/bin/env php <?php //Bootstrap our Silex application $app = (require __DIR__ . '/app/app.php'); // The console app $console = new Symfony\Component\Console\Application('Sailthru Awesomeness', '0.2'); $finder = new Symfony\Component\Finder\Finder(); $finder->files()->in(__DIR__ . '/src')->name('*Command.php'); foreach ($finder as $file) { $class = sprintf('SailthruToolkit\\Command\\%s', $file->getBasename('.php')); $r = new \ReflectionClass($class); if ($r->isSubclassOf('SailthruToolkit\\Command\\AbstractSailThruCommand') && !$r->isAbstract()) { $console->add($r->newInstance($app)); } } $console->run();
* http://www.native5.com/licenses/LICENSE-1.0 * or in the "license" file accompanying this file. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * PHP version 5.3+ * * @category Scheme Execution * @package None * @author Shamik Datta <*****@*****.**> * @copyright 2012 Native5. All Rights Reserved * @license See attached LICENSE for details * @version GIT: $gitid$ * @link http://www.docs.native5.com */ require 'vendor/autoload.php'; // Switch to the application root chdir(__DIR__ . '/../../../'); // This will take awhile set_time_limit(0); // Need native5 app \Native5\Application::init(); //$GLOBALS['logger']->info("Running manageSchemes..."); // The console application $application = new \Symfony\Component\Console\Application('Discount Schemes Manager', '0.1'); $application->add(new \Akzo\Scheme\Command\ExecuteSchemeCommand()); $application->add(new \Akzo\Scheme\Command\GeneratePDFCommand()); $application->run();
#!/usr/bin/php <?php /** * * User: migue * Date: 15/02/15 * Time: 14:13 */ require_once __DIR__ . '/../vendor/autoload.php'; $app = new \Symfony\Component\Console\Application('MozJpegPhp', '1.0.3'); $app->add(new \MozJpegPhp\App\OptimizeJpegCommand()); $app->add(new \MozJpegPhp\App\ExifInfoCommand()); $app->run();
<?php if (!is_file(__DIR__ . '/../vendor/autoload.php')) { echo 'Could not find "autoload.php". Did you run "composer install --dev"?' . PHP_EOL; exit(1); } require_once __DIR__ . '/../vendor/autoload.php'; $app = new \Symfony\Component\Console\Application(); $app->add(new PHPStubs\Cli\GenerateCommand()); $app->add(new PHPStubs\Cli\ExtractNonRefinedCommand()); $app->run();
// Support for using the Doctrine ORM convention of providing a `cli-config.php` file. $configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php'; $helperSet = null; if (file_exists($configFile)) { if (!is_readable($configFile)) { trigger_error('Configuration file [' . $configFile . '] does not have read permission.', E_ERROR); } require $configFile; foreach ($GLOBALS as $helperSetCandidate) { if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) { $helperSet = $helperSetCandidate; break; } } } $helperSet = $helperSet ?: new \Symfony\Component\Console\Helper\HelperSet(); if (class_exists('\\Symfony\\Component\\Console\\Helper\\QuestionHelper')) { $helperSet->set(new \Symfony\Component\Console\Helper\QuestionHelper(), 'question'); } else { $helperSet->set(new \Symfony\Component\Console\Helper\DialogHelper(), 'dialog'); } $cli = new \Symfony\Component\Console\Application('Doctrine Migrations', \Doctrine\DBAL\Migrations\MigrationsVersion::VERSION()); $cli->setCatchExceptions(true); $cli->setHelperSet($helperSet); $cli->addCommands(array(new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\LatestCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand())); if ($helperSet->has('em')) { $cli->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand()); } $input = file_exists('migrations-input.php') ? include 'migrations-input.php' : null; $output = file_exists('migrations-output.php') ? include 'migrations-output.php' : null; $cli->run($input, $output);
<?php /** * Search for autoload.php file. * * Based on phpunit/phpunit package by Sebastian Bergmann. * URL: https://github.com/sebastianbergmann/phpunit/blob/master/phpunit */ foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) { if (file_exists($file)) { define('COMPOSER_AUTOLOAD_FILE', $file); break; } } unset($file); if (!defined('COMPOSER_AUTOLOAD_FILE')) { fwrite(STDERR, 'You need to set up the project dependencies using the following commands:' . PHP_EOL . 'wget http://getcomposer.org/composer.phar' . PHP_EOL . 'php composer.phar install' . PHP_EOL); die(1); } require COMPOSER_AUTOLOAD_FILE; // Setup cli commands $runCmd = new \DocParser\Command\RunCommand(); $application = new \Symfony\Component\Console\Application(); $application->add($runCmd); $application->setDefaultCommand($runCmd->getName()); $application->run();
#!/usr/bin/php5 <?php require __DIR__ . '/vendor/autoload.php'; if (!defined('ROOT')) { define('ROOT', __DIR__); } $app = new \Symfony\Component\Console\Application(); $app->add(new \Flock\Console\Command\MailerCommand()); $app->run();
#!/usr/bin/php <?php @(include_once __DIR__ . '/../vendor/autoload.php') || @(include_once __DIR__ . '/../../../autoload.php'); use Symfony\Component\Console\Input\ArgvInput; use Jerive\CsvTool\Command as Cmd; $input = new ArgvInput(); $app = new Symfony\Component\Console\Application(); ini_set('auto_detect_line_endings', true); $app->add(new Cmd\CutCommand()); $app->add(new Cmd\CallbackCommand()); $app->add(new Cmd\AppendCommand()); $app->add(new Cmd\MergeCommand()); $app->add(new Cmd\PadCommand()); $app->run(new ArgvInput());
<?php $autoload = (require __DIR__ . '/vendor/autoload.php'); // Load configuration file or attempt to build a new one define("APP_PATH", __DIR__); define("CONFIG_FILE", APP_PATH . "/" . "config.yml"); if (!is_file(CONFIG_FILE)) { echo "Please run the installer first: './install.sh'.\n"; exit(1); } // Build ACME client $config = Symfony\Component\Yaml\Yaml::parse(file_get_contents(CONFIG_FILE)); $db = $config["db"]; $dsn = "{$db["driver"]}://{$db["user"]}:{$db["pass"]}@{$db["host"]}/{$db["dbname"]}"; $params = array('params' => array('database' => $dsn, 'api' => $config["api"], 'challenge' => $config["challenge"])); $client = new \Octopuce\Acme\Client($params); // Build Console $console = new Symfony\Component\Console\Application("Letsencrypt SSL CLI", "0.1"); $console->add(new \Symfony\Component\Console\Command\HelpCommand()); $console->add(new \Symfony\Component\Console\Command\ListCommand()); //$console->add(new \Octopuce\Acme\Cli\Command\Enumerate(null, $client)); $console->add(new \Octopuce\Acme\Cli\Command\NewAccount(null, $client)); $console->add(new \Octopuce\Acme\Cli\Command\NewOwnership(null, $client)); //$console->add(new \Octopuce\Acme\Cli\Command\ChallengeOwnership(null, $client)); $console->add(new \Octopuce\Acme\Cli\Command\SignCertificate(null, $client)); $console->add(new \Octopuce\Acme\Cli\Command\RevokeCertificate(null, $client)); $console->add(new \Octopuce\Acme\Cli\Command\UpdateCertificate(null, $client));
#!/usr/bin/env php <?php use Symfony\Component\Yaml\Yaml; if (PHP_VERSION_ID < 50400) { file_put_contents('php://stderr', sprintf("Bazinga Installer requires PHP 5.4 version or higher and your system has\n" . "PHP %s version installed.\n\n" . "To solve this issue, upgrade your PHP installation or install Symfony manually\n" . "executing the following command:\n\n" . "composer create-project symfony/framework-standard-edition <project-name> <symfony-version>\n\n", PHP_VERSION)); exit(1); } if (file_exists(__DIR__ . '/Libraries/autoload.php')) { require __DIR__ . '/Libraries/autoload.php'; } else { echo 'Missing autoload.php, update by the composer.' . PHP_EOL; exit(2); } if (is_dir(__DIR__ . '/.git')) { exec('git --git-dir=' . __DIR__ . '/.git rev-parse --verify HEAD 2> /dev/null', $output); $appVersion = substr($output[0], 0, 10); } else { $appVersion = '1.1.8-DEV'; } // Windows uses Path instead of PATH if (!isset($_SERVER['PATH']) && isset($_SERVER['Path'])) { $_SERVER['PATH'] = $_SERVER['Path']; } $config = Yaml::parse(file_get_contents(__DIR__ . '/Configuration/config.yml')); $app = new Symfony\Component\Console\Application('Bazinga Installer', $appVersion); $app->add(new Langeland\Bazinga\Command\CreateCommand($config)); $app->run();
<?php require __DIR__ . '/vendor/autoload.php'; $application = new \Symfony\Component\Console\Application(); $application->add(new \AppBundle\Command\GreetCommand()); $application->add(new \AppBundle\Command\BacgrounderCommand()); $application->add(new \AppBundle\Command\ServicesCommand()); $application->add(new \AppBundle\Command\ChatServerCommand()); $application->run();
#!/usr/bin/env php <?php set_time_limit(0); date_default_timezone_set('Europe/London'); require_once __DIR__ . '/vendor/autoload.php'; $app = new Symfony\Component\Console\Application('Sainsburys Crawler', '0.0.1'); $app->add(new Sainsburys\Commands\ScraperCommand()); $app->run();
<?php require_once __DIR__ . '/bootstrap.php'; $application = new \Symfony\Component\Console\Application(); $application->add(new \Prsr\Component\Command\Avito()); $application->run();
} else { $manifest[$alreadyExistVersion] = $newPharManifest; } } catch (Exception $exception) { $output->write("Exception `" . get_class($exception) . "` caught.\n"); $output->write($exception->getMessage()); // Remove this tag dir. $run("rm -rf {$releases}/{$tag}"); } } // Write manifest to manifest.json. file_put_contents("{$releases}/manifest.json", json_encode($manifest, JSON_PRETTY_PRINT)); // Remove deployer dir. $run("rm -rf {$releases}/deployer"); }); $console->add($updateDeployerCommand); $updateDocumentationCommand = new \Symfony\Component\Console\Command\Command('update:documentation'); $updateDocumentationCommand->setCode(function ($input, $output) use($app) { $run = function ($command) use($app) { $process = new \Symfony\Component\Process\Process('cd ' . $app['docs.path'] . ' && ' . $command); $process->mustRun(); return $process->getOutput(); }; if (is_file($app['docs.path'] . '/README.md')) { $output->write($run('git reset --hard origin/master')); $output->write($run('git pull https://github.com/deployphp/docs.git master 2>&1')); } else { $output->write($run('git clone --depth 1 https://github.com/deployphp/docs.git . 2>&1')); } }); $console->add($updateDocumentationCommand);
<?php /** * @var \MiniFrame\Di\Di $diImpl */ $environment = strtolower(getenv('APPLICATION_ENV')); $diImpl = (include realpath(__DIR__ . '/../') . '/configs/bootstrap.php'); $diImpl->get('configs')->logger->name = 'console'; $diImpl->get('error_catcher')->register(); $consoleApp = new \Symfony\Component\Console\Application($diImpl->get('configs')->console_application->name); $consoleApp->getHelperSet()->set(new \MiniFrame\ConsoleApplication\DiHelper($diImpl)); /** * Diğer komutları buradan ekleyebilirsiniz: * * $symfonyConsoleApp->add(new \Application\Console\MyCommand()); */ /** * Doctrine ile ilgili komutlar özel olarak ekleniyor. */ $doctrineConn = \Doctrine\DBAL\DriverManager::getConnection(array('driver' => 'pdo_mysql', 'pdo' => $diImpl->get('pdo'))); $consoleApp->getHelperSet()->set(new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($doctrineConn)); $consoleApp->getHelperSet()->set(new \Symfony\Component\Console\Helper\DialogHelper(), 'dialog'); $consoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand()); $consoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand()); $consoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand()); $consoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand()); $consoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\LatestCommand()); $consoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand()); $consoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand()); $consoleApp->run();
* Create a console application with the Mongrate commands. */ if (!extension_loaded('mongo')) { // Instead of throwing a \RuntimeException, which isn't friendly when running the .phar file // for the first time when trying to get set up, exit with an error message instead. echo "The MongoDB extension must be installed.\n"; echo "See https://secure.php.net/manual/en/mongo.installation.php\n"; exit(1); } require_once 'vendor/autoload.php'; $loader = new \Symfony\Component\ClassLoader\UniversalClassLoader(); $loader->registerNamespaces(array('Mongrate' => 'src')); $loader->register(); $app = new \Symfony\Component\Console\Application(); try { $app->add(new \Mongrate\Command\ToggleMigrationCommand()); $app->add(new \Mongrate\Command\UpCommand()); $app->add(new \Mongrate\Command\DownCommand()); $app->add(new \Mongrate\Command\GenerateMigrationCommand()); $app->add(new \Mongrate\Command\ListCommand()); $app->add(new \Mongrate\Command\TestMigrationCommand()); $app->add(new \Mongrate\Command\TestAllCommand()); $app->add(new \Mongrate\Command\UpAllCommand()); } catch (\MongoConnectionException $e) { fwrite(STDERR, "MongoDB connection failed.\n" . $e->getMessage() . "\n"); exit(1); } $app->add(new \Mongrate\Command\SelfUpdateCommand()); $app->setName('Mongrate migration tool'); if (defined('MONGRATE_VERSION')) { // Running in the Phar.
<?php if (!($loader = (include __DIR__ . '/vendor/autoload.php'))) { die('You must set up the project dependencies.'); } //Init dotenv $dotenv = new Dotenv\Dotenv(__DIR__); $dotenv->load(); //Init console $app = new \Symfony\Component\Console\Application(); $app->add(new App\Commands\MpdProxyCommand()); $app->run();
#!/usr/bin/env php <?php require __DIR__ . '/../vendor/autoload.php'; $application = new Symfony\Component\Console\Application(); $application->add(new \Ftor\Commands\InitCommand()); $application->run();
<?php $environment = strtolower(getenv('APPLICATION_ENV')); if (!$environment) { echo 'APPLICATION_ENV must be configured!' . PHP_EOL; exit(255); } $di = (include realpath(__DIR__ . '/../') . '/configs/bootstrap.php'); $di->get('config')->logger->default_name = 'console'; $di->get('error_catcher')->register(); $di->get('error_catcher')->setFatalCallback(function ($message) use($di) { $di->get('logger_helper')->getLogger()->emergency($message); }); $di->get('error_catcher')->setExceptionCallback(function (\Exception $exception) use($di) { $di->get('logger_helper')->getLogger()->error($exception); }); $doctrineConn = \Doctrine\DBAL\DriverManager::getConnection(array('driver' => 'pdo_mysql', 'pdo' => $di->get('pdo'))); $symfonyConsoleApp = new \Symfony\Component\Console\Application(); $symfonyConsoleApp->getHelperSet()->set(new \Pozitim\Console\DiHelper($di)); $symfonyConsoleApp->getHelperSet()->set(new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($doctrineConn)); $symfonyConsoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand()); $symfonyConsoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand()); $symfonyConsoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand()); $symfonyConsoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand()); $symfonyConsoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\LatestCommand()); $symfonyConsoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand()); $symfonyConsoleApp->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand()); $symfonyConsoleApp->add(new \Pozitim\CI\Console\ComposeRunnerCommand()); $symfonyConsoleApp->run();
#!/usr/bin/env php <?php require __DIR__ . '/vendor/autoload.php'; $app = new \Symfony\Component\Console\Application(); $app->add(new \B2k\QlessDemo\Command\QlessStatusCommand()); $app->add(new \B2k\QlessDemo\Command\AddJobCommand()); $app->run();
<?php /** * This file is part of the metadata package * * @author Daniel Schröder <*****@*****.**> */ $dir = explode(DIRECTORY_SEPARATOR, __DIR__); while (!file_exists('vendor/autoload.php')) { if (empty($dir) || !chdir(implode(DIRECTORY_SEPARATOR, $dir))) { break; } array_pop($dir); } require 'vendor/autoload.php'; $application = new \Symfony\Component\Console\Application(); $application->add(new \GravityMedia\Metadata\Command\ExportId3v1Command()); $application->add(new \GravityMedia\Metadata\Command\ExportId3v2Command()); $application->add(new \GravityMedia\Metadata\Command\ImportId3v1Command()); $application->add(new \GravityMedia\Metadata\Command\ImportId3v2Command()); $application->run();
#!/usr/bin/env php <?php $composerAutoloader = __DIR__ . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'autoload.php'; if (!file_exists($composerAutoloader)) { exit(PHP_EOL . 'This script requires the autoloader file created at install time by Composer. Looked for "' . $composerAutoloader . '" without success.'); } require $composerAutoloader; $application = new \Symfony\Component\Console\Application(); $application->add(new \Aoe\TYPO3DbWatcher\Console\Command\TimestampCommand()); $application->run();
#!/usr/bin/env php <?php if (file_exists(__DIR__ . '/../../autoload.php')) { require __DIR__ . '/../../autoload.php'; } else { require __DIR__ . '/vendor/autoload.php'; } $app = new Symfony\Component\Console\Application('Jai', '1.0'); $app->add(new Jai\Installer\Console\NewInstaller()); $app->run();
{ protected function configure() { $this->setName('test')->setDescription('Tests generated providers'); } protected function execute(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) { require_once __DIR__ . '/IssueBodyTextProvider.php'; require_once __DIR__ . '/IssueTitleTextProvider.php'; require_once __DIR__ . '/IssueCommentTextProvider.php'; $bodyProvider = new IssueBodyTextProvider(new \Faker\Generator()); $titleProvider = new IssueTitleTextProvider(new \Faker\Generator()); $commentProvider = new IssueCommentTextProvider(new \Faker\Generator()); $output->writeln('Generating 20 issue bodies, up to 200 character length:'); for ($i = 1; $i <= 20; $i++) { $output->writeln(sprintf('Body %d: <info>%s</info>', $i, $bodyProvider->realText(200, 2))); } $output->writeln('Generating 20 issue titles, up to 100 character length:'); for ($i = 1; $i <= 20; $i++) { $output->writeln(sprintf('Title %d: <info>%s</info>', $i, $titleProvider->realText(100, 2))); } $output->writeln('Generating 20 issue comments, up to 100 character length:'); for ($i = 1; $i <= 20; $i++) { $output->writeln(sprintf('Comment %d: <info>%s</info>', $i, $commentProvider->realText(100, 2))); } } } $app = new \Symfony\Component\Console\Application(); $app->add(new ExtractCommand()); $app->add(new TestCommand()); $app->run();