Permalink
Browse files

task netteLoader: lists only non-PSR-0 classes

  • Loading branch information...
1 parent 41c6e15 commit e29b6aa055b203d667077d46eef216f5ba3885d4 @dg dg committed Jan 15, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 tasks/netteLoader.php
View
@@ -19,7 +19,10 @@
// update NetteLoader.php
$list = array();
foreach ($robot->getIndexedClasses() as $class => $file) {
- $list[strtolower($class)] = strtr(substr($file, strlen($folder)), '\\', '/');
+ $item = strtr(substr($file, strlen($folder), -4), '/', '\\');
+ if ($class !== 'Nette' . $item) {
+ $list[$class] = strtr($item, '\\', '/');
+ }
}
ksort($list);
$s = var_export($list, TRUE);
@@ -29,7 +32,7 @@
$scriptFile = $folder . '/Loaders/NetteLoader.php';
$script = file_get_contents($scriptFile);
- $script = preg_replace('#= array.*\)#sU', "= $s", $script, -1, $count);
+ $script = preg_replace('#list = array.*\)#sU', "list = $s", $script, -1, $count);
if ($count !== 1) {
throw new Exception('NetteLoader injection failed.');
}

0 comments on commit e29b6aa

Please sign in to comment.