diff --git a/cli.php b/cli.php index d2f3de2..098a45d 100644 --- a/cli.php +++ b/cli.php @@ -132,16 +132,17 @@ class cli else $classes[str_replace ("/", "\\", substr ($file, 0, -4))] = $file; } - // Check if there is some classes which can be shorted (classes only in // controllers or only in models $shortClasses = array (); foreach ($classes as $class=>$file) { - if (array_key_exists (substr (strstr ($class, "\\"), 1), $shortClasses)) - unset ($shortClasses[substr (strstr ($class, "\\"), 1)]); + $short = substr (strstr ($class, "\\"), 1); + if ($short === false) $short = $class; + if (array_key_exists ($short, $shortClasses)) + unset ($shortClasses[$short]); else - $shortClasses[substr (strstr ($class, "\\"), 1)] = $class; + $shortClasses[$short] = $class; } if (isset ($argv[0]) && $argv[0] === "-listonly")