Skip to content
Permalink
Browse files

Logging shell aliasing conflicts

  • Loading branch information...
lorenzo committed Sep 13, 2014
1 parent 5248fd0 commit 65e8bcbeb9f1b5e24844dcd6fe8a372272b4538b
Showing with 17 additions and 1 deletion.
  1. +17 −1 src/Console/ShellDispatcher.php
@@ -14,11 +14,13 @@
*/
namespace Cake\Console;
use Cake\Console\ConsoleIo;
use Cake\Console\Exception\MissingShellException;
use Cake\Core\App;
use Cake\Core\Configure;
use Cake\Core\Exception\Exception;
use Cake\Core\Plugin;
use Cake\Log\Log;
use Cake\Shell\Task\CommandTask;
use Cake\Utility\Inflector;
@@ -193,7 +195,9 @@ protected function _dispatch() {
public function addShortPluginAliases() {
$plugins = Plugin::loaded();
$task = new CommandTask();
$io = new ConsoleIo();
$task = new CommandTask($io);
$io->setLoggers(false);
$list = $task->getShellList();
$fixed = array_flip($list['app']) + array_flip($list['CORE']);
$aliases = [];
@@ -204,12 +208,24 @@ public function addShortPluginAliases() {
}
foreach ($list[$plugin] as $shell) {
if (isset($aliases[$shell])) {
$other = $aliased[$shell];
Log::write(
'debug',
"command '$shell' in plugin '$plugin' was not aliased, conflicts with '$other'",
['console']
);
}
$aliases += [$shell => $plugin];
}
}
foreach ($aliases as $shell => $plugin) {
if (isset($fixed[$shell])) {
Log::write(
'debug',
"command '$shell' in plugin '$plugin' was not aliased, conflicts with another shell"
);
continue;
}
static::alias($shell, "$plugin.$shell");

0 comments on commit 65e8bcb

Please sign in to comment.
You can’t perform that action at this time.