Author: mahono
Date: 2008-03-26 17:56:35 +0000 (Wed, 26 Mar 2008)
New Revision: 4120
Modified:
branches/0.10/lib/Doctrine.php
Log:
branches/0.10: tweaked is_dir() check in Doctrine::loadModels()
Modified: branches/0.10/lib/Doctrine.php
===================================================================
--- branches/0.10/lib/Doctrine.php 2008-03-26 11:10:45 UTC (rev 4119)
+++ branches/0.10/lib/Doctrine.php 2008-03-26 17:56:35 UTC (rev 4120)
@@ -556,8 +556,12 @@
$loadedModels = array();
- if ($directory !== null && is_dir($directory)) {
+ if ($directory !== null) {
foreach ((array) $directory as $dir) {
+ if (!is_dir($dir)) {
+ throw new Doctrine_Exception('You must pass a valid path to a directory containing Doctrine models');
+ }
+
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir),
RecursiveIteratorIterator::LEAVES_ONLY);
foreach ($it as $file) {
@@ -589,8 +593,6 @@
}
}
}
- } else {
- throw new Doctrine_Exception('You must pass a valid path to a directory containing Doctrine models');
}
return $loadedModels;