Merge pull request #13606 from milan-corpoflow/patch-1

Fix loading ShellHelpers from plugins
This commit is contained in:
Mark Story 2019-09-04 21:07:20 -04:00 committed by GitHub
commit 46068ac65b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -806,12 +806,12 @@ class Shell extends CakeObject {
return $this->_helpers[$name];
}
list($plugin, $helperClassName) = pluginSplit($name, true);
$helperClassName = Inflector::camelize($name) . "ShellHelper";
App::uses($helperClassName, $plugin . "Console/Helper");
if (!class_exists($helperClassName)) {
$helperClassNameShellHelper = Inflector::camelize($helperClassName) . "ShellHelper";
App::uses($helperClassNameShellHelper, $plugin . "Console/Helper");
if (!class_exists($helperClassNameShellHelper)) {
throw new RuntimeException("Class " . $helperClassName . " not found");
}
$helper = new $helperClassName($this->stdout);
$helper = new $helperClassNameShellHelper($this->stdout);
$this->_helpers[$name] = $helper;
return $helper;
}