Skip to content
Browse files

Fixed namespaces registering

  • Loading branch information...
1 parent 2579518 commit fae6e1eb8a4698fefe2990b0b933ee2da2e94f67 @cristianoc72 cristianoc72 committed Mar 20, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/Propel/Silex/PropelServiceProvider.php
View
8 src/Propel/Silex/PropelServiceProvider.php
@@ -54,7 +54,13 @@ public function register(Application $app)
if (isset($app['propel.internal_autoload']) && true === $app['propel.internal_autoload']) {
set_include_path($modelPath.PATH_SEPARATOR.get_include_path());
} else {
- $app['autoloader']->registerNamespace('model', $modelPath);
+ //model namespaces are subdir of $modelPath directory
+ $dir = new \DirectoryIterator($modelPath);
+ foreach ($dir as $fileInfo) {
+ if ($fileInfo->isDir()) {
+ $app['autoloader']->registerNamespace($fileInfo->getFilename(), $modelPath);
+ }
+ }
}
if (!class_exists('Propel')) {

0 comments on commit fae6e1e

Please sign in to comment.
Something went wrong with that request. Please try again.