]> git.andy128k.dev Git - ipf.git/commitdiff
intercept directory not found exception from loadModels
authorDmitryPuchkov <devnull@localhost>
Wed, 3 Sep 2008 16:20:42 +0000 (19:20 +0300)
committerDmitryPuchkov <devnull@localhost>
Wed, 3 Sep 2008 16:20:42 +0000 (19:20 +0300)
ipf/orm.php

index 7a11103e4d08b475a5ff887c1b9b2fc237ba2912..f728ac50eac16ca13304e22d87ae53848b1587d6 100644 (file)
@@ -243,8 +243,12 @@ final class IPF_ORM {
     public static function loadModels($directory, $modelLoading = null)
     {
         $loadedModels = array();
-        $it = new DirectoryIterator($directory.DIRECTORY_SEPARATOR.'_generated');
-        foreach ($it as $file) {
+        try{
+            $it = new DirectoryIterator($directory.DIRECTORY_SEPARATOR.'_generated');
+        }catch(RuntimeException $e){
+           return $loadedModels;
+        }
+       foreach ($it as $file) {
             $e = explode('.', $file->getFileName());
             if (end($e) === 'php') {
                $className = $e[0];