本文整理汇总了PHP中Illuminate\Console\Application类的典型用法代码示例。如果您正苦于以下问题:PHP Application类的具体用法?PHP Application怎么用?PHP Application使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Application类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: extractNamespace
/**
* Returns the namespace part of the command name.
*
* This method is not part of public API and should not be used directly.
*
* @param string $name The full name of the command
* @param string $limit The maximum number of parts of the namespace
* @return string The namespace of the command
* @static
*/
public static function extractNamespace($name, $limit = null)
{
//Method inherited from \Symfony\Component\Console\Application
return \Illuminate\Console\Application::extractNamespace($name, $limit);
}
开发者ID:jorzhikgit,项目名称:MLM-Nexus,代码行数:15,代码来源:_ide_helper.php
示例15: getArtisan
/**
* Get the Artisan application instance.
*
* @return \Illuminate\Console\Application
*/
protected function getArtisan()
{
if (is_null($this->artisan)) {
$art = new Artisan($this->app, $this->events, $this->app->version());
return $this->artisan = $art->resolveCommands($this->commands);
}
return $this->artisan;
}
开发者ID:dedesite,项目名称:illuminato,代码行数:13,代码来源:Kernel.php
示例16: __construct
/**
* Application constructor.
*
* @param \Illuminate\Container\Container $container
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @param $version
*/
public function __construct(Container $container, Dispatcher $events, $version)
{
parent::__construct($container, $events, $version);
$this->container = $container;
}
开发者ID:notadd,项目名称:framework,代码行数:12,代码来源:Application.php
示例17: 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
示例18: 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
示例19: __construct
/**
* Scanner constructor.
*
* @param Container|null $container
* @param Dispatcher|null $events
*/
public function __construct(Container $container = null, Dispatcher $events = null)
{
$container = $container ?: new Container();
$this->bindings($container, [EventServiceProvider::class, FilesystemServiceProvider::class, PipelineServiceProvider::class, AliasesServiceProvider::class, ConfigServiceProvider::class, VulnDBServiceProvider::class]);
$events = $events ?: $container->make('events');
parent::__construct($container, $events, static::VERSION);
$this->setName('Wordpress Vulnerabilities Scanner');
}
开发者ID:Zae,项目名称:wp-vulnerabilities,代码行数:14,代码来源:Scanner.php
示例20: __construct
public function __construct($container)
{
parent::__construct('forge-cli', 0.1);
$this->setLaravel($container);
// Register the deploy command
$this->add(new DeployCommand());
$this->add(new AddSiteCommand());
}
开发者ID:bramdevries,项目名称:forge-cli,代码行数:8,代码来源:Console.php
注:本文中的Illuminate\Console\Application类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论