From eeb67d27211b42aa0fd36e7dbca31e711bff2a8b Mon Sep 17 00:00:00 2001 From: DmitryPuchkov Date: Wed, 3 Sep 2008 19:20:42 +0300 Subject: [PATCH] intercept directory not found exception from loadModels --- ipf/orm.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ipf/orm.php b/ipf/orm.php index 7a11103..f728ac5 100644 --- a/ipf/orm.php +++ b/ipf/orm.php @@ -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]; -- 2.49.0