public function isCompiletimeCommand($commandIdentifier)
{
$commandIdentifierParts = explode(':', $commandIdentifier);
if (count($commandIdentifierParts) !== 3) {
return false;
}
if (isset($this->compiletimeCommands[$commandIdentifier])) {
return true;
}
unset($commandIdentifierParts[2]);
$shortControllerIdentifier = implode(':', $commandIdentifierParts);
foreach ($this->compiletimeCommands as $fullControllerIdentifier => $isCompiletimeCommandController) {
list($packageKey, $controllerName, $commandName) = explode(':', $fullControllerIdentifier);
$packageKeyParts = explode('.', $packageKey);
$packageKeyPartsCount = count($packageKeyParts);
for ($offset = 0; $offset < $packageKeyPartsCount; $offset++) {
$possibleCommandControllerIdentifier = implode('.', array_slice($packageKeyParts, $offset)) . ':' . $controllerName;
if (substr($fullControllerIdentifier, -2, 2) === ':*') {
if ($possibleCommandControllerIdentifier === $shortControllerIdentifier) {
return true;
}
} else {
$possibleCommandControllerIdentifier .= ':' . $commandName;
if ($possibleCommandControllerIdentifier === $commandIdentifier) {
return true;
}
}
}
}
return false;
}