mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-05 17:08:56 +02:00
Check if classes exists.
This commit is contained in:
@@ -38,6 +38,11 @@ class Factory
|
||||
|
||||
$commandName = str_replace(' ', '_', ucwords(str_replace('/', ' ', $commandName)));
|
||||
$className = 'Mage\\Command\\BuiltIn\\' . $commandName . 'Command';
|
||||
|
||||
if (!class_exists($className)) {
|
||||
throw new Exception('Command "' . $commandName . '" not found.');
|
||||
}
|
||||
|
||||
/** @var AbstractCommand $instance */
|
||||
$instance = new $className;
|
||||
if (!is_a($instance, "Mage\Command\AbstractCommand")) {
|
||||
|
||||
Reference in New Issue
Block a user