public function create() { $c = new Pimple(); $c['concrete'] = function ($c) { return new \Concrete\Concrete(); }; $c['command.about'] = function ($c) { return new \Concrete\Command\AboutCommand(); }; $c['command.build'] = function ($c) { return new \Concrete\Command\BuildCommand($c); }; $c['commands'] = function ($c) { return array($c['command.about'], $c['command.build']); }; $c['git.version'] = function ($c) { return new \Concrete\Processor\GitTagVersion(); }; $c['application'] = function ($c) { $versionProc = $c['git.version']; $application = new \Symfony\Component\Console\Application('Concrete PHAR Compiler for PHP', $versionProc->process('{{version}}')); $application->addCommands($c['commands']); return $application; }; return $c; }
public function testRefreshJobs() { $cli = new \Symfony\Component\Console\Application(); $cli->addCommands(array(new \ebussola\job\console\RefreshJobsCommand(), new \ebussola\job\console\ListJobsCommand())); $refresh_tester = new \Symfony\Component\Console\Tester\CommandTester($cli->find('jobschedule:refresh')); $list_tester = new \Symfony\Component\Console\Tester\CommandTester($cli->find('jobschedule:list')); // stage 1 $refresh_tester->execute(array('command' => 'jobschedule:refresh')); $output = $refresh_tester->getDisplay(); $this->assertContains('Jobs Reloaded', $output); $list_tester->execute(array('command' => 'jobschedule:list')); $output = $list_tester->getDisplay(); $this->assertContains('[1]', $output); $this->assertContains('[2]', $output); $this->assertContains('[3]', $output); $this->assertContains('[4]', $output); $this->assertContains('[5]', $output); $this->assertContains('[6]', $output); // stage 2 $refresh_tester->execute(array('command' => 'jobschedule:refresh')); $output = $refresh_tester->getDisplay(); $this->assertContains('Jobs Reloaded', $output); $list_tester->execute(array('command' => 'jobschedule:list')); $output = $list_tester->getDisplay(); $this->assertNotContains('[1]', $output); $this->assertNotContains('[2]', $output); $this->assertContains('[3]', $output); $this->assertContains('[4]', $output); $this->assertContains('[5]', $output); $this->assertContains('[6]', $output); }
function run() { $app = new \Symfony\Component\Console\Application(); foreach ($this->commands() as $command) { $app->add(new $command()); } $app->run(); }
/** * @return void */ public function invoke() { try { $this->login(); $this->post(); } catch (\Exception $e) { $app = new Symfony\Component\Console\Application(); $app->renderException($e, $this->output); } }
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); }
public function setUp() { $conn = \Doctrine\DBAL\DriverManager::getConnection(array('driver' => 'pdo_sqlite', 'user' => 'root', 'password' => '', 'memory' => true)); $this->data = new \ebussola\job\jobdata\Doctrine($conn, $this->table_name); $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array('db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($conn))); $cli = new \Symfony\Component\Console\Application(); $cli->setHelperSet($helperSet); $cli->addCommands(array(new \ebussola\job\console\InitCommand())); $cmd_tester = new \Symfony\Component\Console\Tester\CommandTester($cli->find('jobschedule:init')); $cmd_tester->execute(array('command' => 'jobschedule:init', 'table_name' => $this->table_name)); //Insert some data $conn->insert($this->table_name, array('id' => 1, 'expires_on' => strtotime('+1 hour'), 'runner_class' => 'ebussola\\job\\runner', 'schedule' => '@daily', 'command' => 'foo')); $conn->insert($this->table_name, array('id' => 2, 'expires_on' => strtotime('+1 hour'), 'runner_class' => 'ebussola\\job\\runner', 'schedule' => '@daily', 'command' => 'bar')); }
/** * Registers services on the given app. * * This method should only be used to configure services and parameters. * It should not get services. * * @param Application $app An Application instance */ public function register(Application $app) { $app['console.options'] = $app->share(function () { return array('name' => 'Silex Application', 'version' => Application::VERSION); }); $app['console.commands'] = $app->share(function () { return array(); }); $app['console'] = $app->share(function (Application $app) { $options = $app['console.options']; $console = new \Symfony\Component\Console\Application($options['name'], $options['version']); $console->getHelperSet()->set(new SilexHelper($app)); $console->addCommands($app['console.commands']); return $console; }); }
/** * @param \Nette\DI\Container * @param \Symfony\Component\Console\Helper\HelperSet * @return \Symfony\Component\Console\Application */ public static function createConsole(\Nette\DI\Container $container, \Symfony\Component\Console\Helper\HelperSet $helperSet = NULL) { $console = new \Symfony\Component\Console\Application(Framework::NAME . " Command Line Interface", Framework::VERSION); if (!$helperSet) { $helperSet = new \Symfony\Component\Console\Helper\HelperSet(); $helperSet->set(new \Doctrine\ODM\MongoDB\Tools\Console\Helper\DocumentManagerHelper($container->documentManager), 'dm'); $helperSet->set(new \Symfony\Component\Console\Helper\DialogHelper(), 'dialog'); } $console->setHelperSet($helperSet); $console->setCatchExceptions(FALSE); $commands = array(); foreach (array_keys($container->findByTag('consoleCommand')) as $name) { $commands[] = $container->getService($name); } $console->addCommands($commands); return $console; }
function run() { $this->dmx = new \DmxHttp\Controller\DMXPost(); $this->dmx->addDevice(new Spot(6)); $this->dmx->addDevice(new Spot(12)); $this->dmx->addDevice(new Spot(18)); $this->dmx->addDevice(new Spot(24)); $this->dmx->addDevice(new Spot(30)); $this->dmx->addDevice(new Spot(36)); $this->dmx->addDevice(new Spot(42)); $this->dmx->addDevice(new Spot(48)); $this->dmx->addDevice(new Scanner(300)); $this->dmx->addDevice(new Scanner(305)); $this->dmx->addDevice(new Scanner(310)); $this->dmx->addDevice(new Scanner(314)); $console = new \Symfony\Component\Console\Application(); $console->register("ls")->setDefinition(array())->setDescription("list devices")->setCode(function (\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) { $table = new \Symfony\Component\Console\Helper\Table($output); $table->setHeaders(array('Start Channel', 'Type', 'status')); foreach ($this->dmx->getDevices() as $device) { $table->addRow([$device->getStartChannel(), get_class($device), '[' . implode(',', $device->getChannels()) . ']']); } $table->render(); }); $console->register("run")->setDefinition(array(new InputArgument('device', InputArgument::REQUIRED, 'start channel of a device'), new InputArgument('method', InputArgument::REQUIRED, 'method'), new InputArgument('args', InputArgument::IS_ARRAY, 'arguments')))->setDescription("set command")->setCode(function (InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) { $device = null; foreach ($this->dmx->getDevices() as $_device) { if ($_device->getStartChannel() == $input->getArgument("device")) { $device = $_device; break; } } if ($device === null) { $output->writeln("<error>can't find device</error>"); return 1; } $method = $input->getArgument("method"); $args = $input->getArgument("args"); call_user_func_array([$device, $method], $args); $this->dmx->send(); }); $console->run(); }
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) { } }
} if (!$autoload) { throw new RuntimeException('Install dependencies to run the console.'); } use Doctrine\Common\Annotations\AnnotationRegistry; AnnotationRegistry::registerLoader(array($autoload, 'loadClass')); $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_USER_ERROR); } require $configFile; foreach ($GLOBALS as $helperSetCandidate) { if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) { $helperSet = $helperSetCandidate; break; } } } else { trigger_error('Configuration file [' . $configFile . '] does not exist. See https://github.com/doctrine/phpcr-odm/wiki/Command-line-tool-configuration', E_USER_ERROR); } $helperSet = $helperSet ?: new \Symfony\Component\Console\Helper\HelperSet(); $cli = new \Symfony\Component\Console\Application('Doctrine ODM PHPCR Command Line Interface', Doctrine\ODM\PHPCR\Version::VERSION); $cli->setCatchExceptions(true); $cli->setHelperSet($helperSet); $cli->addCommands(array(new \PHPCR\Util\Console\Command\NodeDumpCommand(), new \PHPCR\Util\Console\Command\NodeMoveCommand(), new \PHPCR\Util\Console\Command\NodeRemoveCommand(), new \PHPCR\Util\Console\Command\NodesUpdateCommand(), new \PHPCR\Util\Console\Command\NodeTouchCommand(), new \PHPCR\Util\Console\Command\NodeTypeListCommand(), new \PHPCR\Util\Console\Command\NodeTypeRegisterCommand(), new \PHPCR\Util\Console\Command\WorkspaceCreateCommand(), new \PHPCR\Util\Console\Command\WorkspaceDeleteCommand(), new \PHPCR\Util\Console\Command\WorkspaceExportCommand(), new \PHPCR\Util\Console\Command\WorkspaceImportCommand(), new \PHPCR\Util\Console\Command\WorkspaceListCommand(), new \PHPCR\Util\Console\Command\WorkspacePurgeCommand(), new \PHPCR\Util\Console\Command\WorkspaceQueryCommand(), new \Doctrine\ODM\PHPCR\Tools\Console\Command\DocumentMigrateClassCommand(), new \Doctrine\ODM\PHPCR\Tools\Console\Command\GenerateProxiesCommand(), new \Doctrine\ODM\PHPCR\Tools\Console\Command\DumpQueryBuilderReferenceCommand(), new \Doctrine\ODM\PHPCR\Tools\Console\Command\InfoDoctrineCommand(), new \Doctrine\ODM\PHPCR\Tools\Console\Command\RegisterSystemNodeTypesCommand())); if (isset($extraCommands) && !empty($extraCommands)) { $cli->addCommands($extraCommands); } $cli->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');
private function getTerminalWidth() { $application = new \Symfony\Component\Console\Application(); $dimensions = $application->getTerminalDimensions(); return $dimensions[0] ?: 120; }
<?php /* * This file is part of rg\broker. * * (c) ResearchGate GmbH <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ require __DIR__ . '/config.php'; require __DIR__ . '/autoload.php'; $cli = new \Symfony\Component\Console\Application('rg\\broker', '0.1.0'); $cli->setCatchExceptions(true); $cli->addCommands(array(new \rg\broker\commands\AddRepository(), new \rg\broker\commands\RemoveRepository())); $cli->run();
<?php require_once 'Doctrine/Common/ClassLoader.php'; $classLoader = new \Doctrine\Common\ClassLoader('Doctrine'); $classLoader->register(); $classLoader = new \Doctrine\Common\ClassLoader('Symfony'); $classLoader->register(); $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(); $cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\DBAL\Version::VERSION); $cli->setCatchExceptions(true); $cli->setHelperSet($helperSet); $cli->addCommands(array(new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), new \Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand())); $cli->run();
* 147 Stepaside Park, Stepaside, Dublin 18, Ireland. * Barry O'Donovan <barry _at_ opensolutions.ie> * * @copyright Copyright (c) 2011 Open Source Solutions Limited * @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License, version 3 (GPLv3) * @author Open Source Solutions Limited <info _at_ opensolutions.ie> * @author Barry O'Donovan <barry _at_ opensolutions.ie> */ /** * Doctrine CLI script */ //ini_set('memory_limit', -1); require_once dirname(__FILE__) . '/../vendor/autoload.php'; require_once dirname(__FILE__) . '/utils.inc'; if (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == '--database') { $db = $_SERVER['argv'][2]; array_splice($_SERVER['argv'], 1, 2); } else { $db = 'default'; } $application = get_zend_application(); $em = get_doctrine2_entity_manager($application, $db); $helpers = array('db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)); $cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION); $cli->setCatchExceptions(true); $helperSet = $cli->getHelperSet(); foreach ($helpers as $name => $helper) { $helperSet->set($helper, $name); } Doctrine\ORM\Tools\Console\ConsoleRunner::addCommands($cli); $cli->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();
<?php $application = new \Symfony\Component\Console\Application('SlimApi', '@package_version@'); $application->addCommands($container->get('commands')); $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();
<?php /** * * * * */ require_once __DIR__ . '/../vendor/autoload.php'; $console = new \Symfony\Component\Console\Application(); //$console->add(new Cotya\TideGauge\Console\Analyze()); $flatten_spans = function (&$spans) { $result = []; foreach ($spans as $span) { if (!isset($result[$span['a']['title']])) { $result[$span['a']['title']] = [$span['a']['title'], max($span['e']) - min($span['b']), count($span['b'])]; } else { $result[$span['a']['title']][1] += max($span['e']) - min($span['b']); $result[$span['a']['title']][2] += count($span['b']); } } return $result; }; $console->register('analyze')->setDefinition(array())->setDescription('Displays the files in the given directory')->setCode(function (\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) use($flatten_spans) { $file = __DIR__ . '/../local/trace_17186.json'; $file = __DIR__ . '/../local/trace_17717.json'; $trace = json_decode(file_get_contents($file), true); $appInfo = array_shift($trace['spans']); $output->writeln('App run info:'); $table = new \Symfony\Component\Console\Helper\Table($output); $table->setRows(array(array('id', $trace['id']), array('TransactionName', $trace['tx']), array('PHP Version:', $appInfo['a']['php']), array('title:', $appInfo['a']['title'])));
<?php namespace PartKeepr\Console; use PartKeepr\PartKeepr; include "src/backend/PartKeepr/PartKeepr.php"; PartKeepr::initializeClassLoaders(); PartKeepr::initializeConfig(); $cli = new \Symfony\Component\Console\Application('PartKeepr Console', \PartKeepr\PartKeeprVersion::PARTKEEPR_VERSION); $cli->setCatchExceptions(true); try { PartKeepr::initializeDoctrine(); $helperSet = $cli->getHelperSet(); $helpers = array('db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper(PartKeepr::getEM()->getConnection()), 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper(PartKeepr::getEM())); foreach ($helpers as $name => $helper) { $helperSet->set($helper, $name); } } catch (\Exception $e) { } $cli->addCommands(array(new \PartKeepr\Console\Commands\MinifyJSCommand(), new \PartKeepr\Console\Commands\ListServicesCommand(), new \PartKeepr\Console\Commands\ListCallsCommand(), new \PartKeepr\Console\Commands\DescribeCallCommand(), new \PartKeepr\Console\Commands\DescribeTypeCommand())); $cli->run();
<?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();
<?php $vendorDir = __DIR__ . '/../lib/vendor'; require_once $vendorDir . '/doctrine-common/lib/Doctrine/Common/ClassLoader.php'; $classLoader = new \Doctrine\Common\ClassLoader('Doctrine', dirname($vendorDir)); $classLoader->register(); $classLoader = new \Doctrine\Common\ClassLoader('Symfony', $vendorDir); $classLoader->register(); $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(); $cli = new \Symfony\Component\Console\Application('Doctrine ODM MongoDB Command Line Interface', Doctrine\ODM\MongoDB\Version::VERSION); $cli->setCatchExceptions(true); $cli->setHelperSet($helperSet); $cli->addCommands(array(new \Doctrine\ODM\MongoDB\Tools\Console\Command\Schema\CreateCommand(), new \Doctrine\ODM\MongoDB\Tools\Console\Command\Schema\DropCommand())); $cli->run();
<?php error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 'On'); chdir(__DIR__); $loader = (require '../vendor/autoload.php'); $cli = new \Symfony\Component\Console\Application('Drest Client Command Line Interface Tool', DrestClient\Version::VERSION); $cli->setCatchExceptions(true); $cli->addCommands(array(new DrestClient\Tools\Console\Command\GenerateClasses())); $cli->run();
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see * <http://www.doctrine-project.org>. */ Phar::mapPhar(); require_once 'phar://' . __FILE__ . '/Doctrine/Common/ClassLoader.php'; $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\\Common', 'phar://' . __FILE__); $classLoader->register(); $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\\DBAL', 'phar://' . __FILE__); $classLoader->register(); $classLoader = new \Doctrine\Common\ClassLoader('Symfony', 'phar://' . __FILE__ . '/Doctrine'); $classLoader->register(); $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array('dialog' => new \Symfony\Component\Console\Helper\DialogHelper())); $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\DiffCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand())); $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 $em = (require_once __DIR__ . '/bootstrap.php'); $cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION); $cli->setCatchExceptions(true); $cli->setHelperSet(new Symfony\Component\Console\Helper\HelperSet(array('db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)))); $cli->addCommands(array(new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(), new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(), new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(), new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(), new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(), new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(), new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(), new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(), new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(), new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(), new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(), new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(), new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(), new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand())); $cli->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();
<?php chdir('..'); require_once 'Doctrine/Common/ClassLoader.php'; $classLoader = new \Doctrine\Common\ClassLoader('Doctrine'); $classLoader->register(); $classLoader = new \Doctrine\Common\ClassLoader('Symfony', 'Doctrine'); $classLoader->register(); //$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php'; $configFile = 'bin/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(); $cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\ORM\Version::VERSION); $cli->setCatchExceptions(true); $cli->setHelperSet($helperSet); $cli->addCommands(array(new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(), new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(), new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(), new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(), new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(), new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(), new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(), new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(), new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(), new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(), new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(), new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(), new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(), new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand())); $cli->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();