當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Console\Application類代碼示例

本文整理匯總了PHP中Illuminate\Console\Application的典型用法代碼示例。如果您正苦於以下問題:PHP Application類的具體用法?PHP Application怎麽用?PHP Application使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Application類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getArtisan

 /**
  * Get the Artisan console instance.
  *
  * @return \Illuminate\Console\Application
  */
 protected function getArtisan()
 {
     if (!is_null($this->artisan)) {
         return $this->artisan;
     }
     $this->app->loadDeferredProviders();
     $this->artisan = ConsoleApplication::make($this->app);
     return $this->artisan->boot();
 }
開發者ID:PHPCoded,項目名稱:freelancer-notes,代碼行數:14,代碼來源:Artisan.php

示例2: getWel

 /**
  * Get the Artisan console instance.
  *
  * @return \Illuminate\Console\Application
  */
 protected function getWel()
 {
     if (!is_null($this->wel)) {
         return $this->wel;
     }
     $this->app->loadDeferredProviders();
     $this->wel = ConsoleApplication::make($this->app);
     return $this->wel->boot();
 }
開發者ID:bruno-barros,項目名稱:w.eloquent-framework,代碼行數:14,代碼來源:Wel.php

示例3: array

 function it_will_run_seeder_with_custom_class_if_told_to(Console $console)
 {
     $console->call('migrate:install')->shouldBeCalled();
     $console->call('migrate:refresh')->shouldBeCalled();
     $console->call('db:seed', array('--class' => 'MyDatabaseSeeder'))->shouldBeCalled();
     $this->appInst->setRequestForConsoleEnvironment()->shouldBeCalled();
     $this->appInst->boot()->shouldBeCalled();
     $this->appInst->make('artisan')->shouldBeCalled();
     $this->appInst->make('artisan')->willReturn($console);
     $this->beConstructedWith(null, '.');
     $this->setMigrateDatabase(true);
     $this->setSeedDatabase(true, 'MyDatabaseSeeder');
     $this->refreshApplication($this->appInst);
 }
開發者ID:visualturk,項目名稱:phpspec-laravel,代碼行數:14,代碼來源:LaravelSpec.php

示例4: runCommand

 /**
  * Runs a command and returns it output
  *
  * @param \Symfony\Component\HttpKernel\Client $client
  * @param                                      $command
  *
  * @return string|\Symfony\Component\Console\Output\StreamOutput
  */
 public function runCommand(Client $client, $command)
 {
     $application = new Application($client->getKernel());
     $application->setAutoExit(false);
     $fp = tmpfile();
     $input = new StringInput($command);
     $output = new StreamOutput($fp);
     $application->run($input, $output);
     fseek($fp, 0);
     $output = '';
     while (!feof($fp)) {
         $output = fread($fp, 4096);
     }
     fclose($fp);
     return $output;
 }
開發者ID:rajeshpillai,項目名稱:dfe-common,代碼行數:24,代碼來源:CommandTestCase.php

示例5: command

 /**
  * Add a new Artisan command event to the schedule.
  *
  * @param  string  $command
  * @param  array  $parameters
  * @return \Illuminate\Console\Scheduling\Event
  */
 public function command($command, array $parameters = [])
 {
     if (class_exists($command)) {
         $command = Container::getInstance()->make($command)->getName();
     }
     return $this->exec(Application::formatCommandString($command), $parameters);
 }
開發者ID:scrubmx,項目名稱:framework,代碼行數:14,代碼來源:Schedule.php

示例6: getArtisan

 /**
  * Get the Artisan console instance.
  *
  * @return Illuminate\Console\Application
  */
 protected function getArtisan()
 {
     if (!is_null($this->artisan)) {
         return $this->artisan;
     }
     return $this->artisan = ConsoleApplication::start($this->app);
 }
開發者ID:defra91,項目名稱:levecchiecredenze.it,代碼行數:12,代碼來源:Artisan.php

示例7: __construct

 public function __construct(Container $container)
 {
     parent::__construct('XenForo Developer Toolkit', '1.0-dev');
     $this->setContainer($container);
     $container['app'] = $this;
     $container->alias('app', 'Robbo\\XfToolkit\\Application');
     $container->bindShared('xenforo', function ($container) {
         return new XenForo($this, new Filesystem());
     });
     $container->alias('xenforo', 'Robbo\\XfToolkit\\XenForo');
     $this->registerBundledCommands();
 }
開發者ID:robclancy,項目名稱:xf-toolkit,代碼行數:12,代碼來源:Application.php

示例8: __construct

 /**
  * Setup the application
  */
 public function __construct()
 {
     parent::__construct('Satellite', '0.1.0');
     // Setup application's dependencies
     $app = new Container();
     $provider = new SatelliteServiceProvider($app);
     $provider->register();
     // Register services
     $this->laravel = $app;
     // Add commands
     $this->resolveCommands(array('Rocketeer\\Satellite\\Console\\Commands\\Setup', 'Rocketeer\\Satellite\\Console\\Commands\\ListApplications', 'Rocketeer\\Satellite\\Console\\Commands\\Deploy', 'Rocketeer\\Satellite\\Console\\Commands\\Update'));
 }
開發者ID:rocketeers,項目名稱:satellite,代碼行數:15,代碼來源:Satellite.php

示例9: run

 public function run()
 {
     if (!$this->checkUser()) {
         echo '<p>' . Lang::get('web-artisan::webartisan.terminal.needlogin') . '</p>';
         return;
     }
     $parts = explode(" ", Input::get('cmd'));
     if (count($parts) < 2) {
         echo '<p>' . Lang::get('web-artisan::webartisan.terminal.invalidcmd') . '</p>';
         return;
     }
     //first is "artisan" so remove it
     unset($parts[0]);
     //second is the command
     $cmd = $parts[1];
     unset($parts[1]);
     $app = app();
     $app->loadDeferredProviders();
     $artisan = ConsoleApplication::start($app);
     $command = $artisan->find($cmd);
     $def = $command->getDefinition();
     $arguments = $def->getArguments();
     $fix = array();
     foreach ($arguments as $argument) {
         $fix[] = $argument->getName();
     }
     $arguments = $fix;
     $params = array();
     //the rest should be the parameter list
     $i = 0;
     //The counter for our argument list
     foreach ($parts as $param) {
         // foo=bar, we don't need to work more
         if (strpos($param, "=") !== false) {
             $param = explode("=", $param, 2);
             $params[$param[0]] = $param[1];
         } else {
             //Do we have an argument or an option?
             if (substr($param, 0, 1) == "-") {
                 $params[$param] = true;
                 //Option, simply set it to true
             } else {
                 //Argument, we need a bit work
                 $params[$arguments[$i]] = $param;
                 ++$i;
             }
         }
     }
     $params['command'] = $cmd;
     $input = new ArrayInput($params);
     $command->run($input, new Output());
 }
開發者ID:m3dweb,項目名稱:bcnbit,代碼行數:52,代碼來源:Cmd.php

示例10: __construct

 /**
  * Console constructor.
  *
  * @param ConfigInterface $config
  * @param Paths           $paths
  * @param string          $version
  */
 public function __construct(ConfigInterface $config, Paths $paths, $version = \F9\Application\Application::VERSION)
 {
     $this->config = $config;
     $this->paths = $paths;
     /** @var Container $app */
     $app = Forge::find('app');
     // the parent is a hijacked copy of the illuminate console application.
     // we hijacked it mainly to override a few properties - such as the title.
     parent::__construct(forge('illuminate.container'), forge('illuminate.events'), $version);
     //$this->bootSettings();
     $this->configureEnvironment();
     // in all cases, register the framework commands
     $this->registerFrameworkCommands();
     // register the cloned artisan commands
     $this->registerArtisanCommands();
 }
開發者ID:formula9,項目名稱:framework,代碼行數:23,代碼來源:Console.php

示例11: setDefaultCommand

 /**
  * Sets the default Command name.
  *
  * @param string $commandName The Command name
  * @static 
  */
 public static function setDefaultCommand($commandName)
 {
     //Method inherited from \Symfony\Component\Console\Application
     return \Illuminate\Console\Application::setDefaultCommand($commandName);
 }
開發者ID:nmkr,項目名稱:basic-starter,代碼行數:11,代碼來源:_ide_helper.php

示例12: getDefaultInputDefinition

 /**
  * Get the default definition.
  *
  * @return \Symfony\Component\Console\Input\InputDefinition
  */
 protected function getDefaultInputDefinition()
 {
     $definition = parent::getDefaultInputDefinition();
     $definition->addOption($this->getApplicationReferenceOption());
     return $definition;
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:11,代碼來源:Application.php

示例13: __construct

 public function __construct(Container $laravel, Dispatcher $events, $version, SymfonyApplication $application)
 {
     $this->application = $application;
     parent::__construct($laravel, $events, $version);
 }
開發者ID:aprezcuba24,項目名稱:CULabsIlluminateBundle,代碼行數:5,代碼來源:Application.php

示例14: getHelp

 /**
  * Display the application's help.
  *
  * @return string
  */
 public function getHelp()
 {
     $help = str_replace($this->getLongVersion(), null, parent::getHelp());
     $state = $this->buildBlock('Current state', $this->getCurrentState());
     $help = sprintf('%s' . PHP_EOL . PHP_EOL . '%s%s', $this->getLongVersion(), $state, $help);
     return $help;
 }
開發者ID:clone1018,項目名稱:rocketeer,代碼行數:12,代碼來源:Console.php

示例15: getDefinition

 /**
  * Overridden so that the application doesn't expect the command
  * name to be the first argument.
  */
 public function getDefinition()
 {
     $inputDefinition = parent::getDefinition();
     // clear out the normal first argument, which is the command name
     $inputDefinition->setArguments();
     return $inputDefinition;
 }
開發者ID:shift31,項目名稱:hostbase-ansible-inventory,代碼行數:11,代碼來源:AnsibleInventoryApplication.php


注:本文中的Illuminate\Console\Application類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。