本文整理匯總了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();
}