本文整理汇总了PHP中Symfony\Component\Console\Command\Command::isEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::isEnabled方法的具体用法?PHP Command::isEnabled怎么用?PHP Command::isEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Console\Command\Command
的用法示例。
在下文中一共展示了Command::isEnabled方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isEnabled
/**
* {@inheritdoc}
*/
public function isEnabled()
{
if (null === $this->profiler) {
return false;
}
return parent::isEnabled();
}
示例2: isEnabled
/**
* {@inheritDoc}
*/
public function isEnabled()
{
if (version_compare(phpversion(), '5.4.0', '<')) {
return false;
}
return parent::isEnabled();
}
示例3: isEnabled
/**
* {@inheritdoc}
*/
public function isEnabled()
{
if (!class_exists('Symfony\\Component\\Process\\Process')) {
return false;
}
return parent::isEnabled();
}
示例4: add
/**
* Adds a command object.
*
* If a command with the same name already exists, it will be overridden.
*
* @param Command $command A Command object
*
* @return Command The registered command
*
* @api
*/
public function add(Command $command)
{
$command->setApplication($this);
if (!$command->isEnabled()) {
$command->setApplication(null);
return;
}
if (null === $command->getDefinition()) {
throw new \LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($command)));
}
$this->commands[$command->getName()] = $command;
foreach ($command->getAliases() as $alias) {
$this->commands[$alias] = $command;
}
return $command;
}
示例5: add
/**
* Adds a command object.
*
* If a command with the same name already exists, it will be overridden.
*
* @param Command $command A Command object
*
* @return Command The registered command
*
* @api
*/
public function add(Command $command)
{
$command->setApplication($this);
if (!$command->isEnabled()) {
$command->setApplication(null);
return;
}
$this->commands[$command->getName()] = $command;
foreach ($command->getAliases() as $alias) {
$this->commands[$alias] = $command;
}
return $command;
}
示例6: isEnabled
/**
* {@inheritdoc}
*/
public function isEnabled()
{
return $this->decoratedCommand->isEnabled();
}
示例7: isEnabled
public function isEnabled()
{
return $this->innerCommand->isEnabled();
}
示例8: isEnabled
/**
* {@inheritdoc}
*/
public function isEnabled()
{
$enabled = parent::isEnabled();
// Hide the command in the list, if necessary.
if ($enabled && $this->hiddenInList) {
global $argv;
$enabled = !isset($argv[1]) || $argv[1] != 'list';
}
return $enabled;
}
示例9: isEnabled
/**
* {@inheritdoc}
*/
public function isEnabled()
{
return class_exists(BaseLintCommand::class) && parent::isEnabled();
}