import console command in classes
This commit is contained in:
+5
-2
@@ -27,9 +27,12 @@
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Core\Console\Commands;
|
||||
namespace Espo\Classes\ConsoleCommands;
|
||||
|
||||
use Espo\Core\ServiceFactory;
|
||||
use Espo\Core\{
|
||||
ServiceFactory,
|
||||
Console\Commands\Command,
|
||||
};
|
||||
|
||||
use Throwable;
|
||||
|
||||
@@ -79,12 +79,14 @@ class CommandManager
|
||||
protected function getClassName(string $command) : string
|
||||
{
|
||||
$className =
|
||||
$this->metadata->get(['app', 'consoleCommands', $command, 'className']) ??
|
||||
$this->metadata->get(['app', 'consoleCommands', lcfirst($command), 'className']) ??
|
||||
'Espo\\Core\\Console\\Commands\\' . $command;
|
||||
|
||||
if (!class_exists($className)) {
|
||||
$msg = "Command '{$command}' does not exist.";
|
||||
|
||||
echo $msg . "\n";
|
||||
|
||||
throw new Error($msg);
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
{}
|
||||
{
|
||||
"import": {
|
||||
"className": "Espo\\Classes\\ConsoleCommands\\Import"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user