Permalink
Browse files

BUGFIX Using SS_ClassLoader in Compass->getAllModules() instead of fo…

…r SilverStripe 3.0 compat
  • Loading branch information...
1 parent 5ef0130 commit c775a36d657d911da0af145d13e41bf70715baea @chillu chillu committed Mar 31, 2011
Showing with 12 additions and 3 deletions.
  1. +12 −3 code/Compass.php
View
@@ -183,14 +183,23 @@ protected function getAllThemes() {
*/
protected function getAllModules() {
$modules = array();
+
+ if(class_exists('SS_ClassLoader')) {
+ // SilverStripe 3.x
+ $classes = SS_ClassLoader::instance()->getManifest()->getClasses();
+ $paths = array_values($classes);
+ } else {
+ // SilverStripe 2.x
+ global $_CLASS_MANIFEST;
+ $paths = $_CLASS_MANIFEST;
+ }
- global $_CLASS_MANIFEST;
- foreach ($_CLASS_MANIFEST as $path) {
+ foreach ($paths as $path) {
if (preg_match('#'.preg_quote(BASE_PATH, '#').'/([^/]+)/#', $path, $matches)) {
$modules[$matches[1]] = $matches[1];
}
}
-
+
return $modules;
}

0 comments on commit c775a36

Please sign in to comment.