From dcc2a54e6387daa5e944651855e73b9281ee4a97 Mon Sep 17 00:00:00 2001 From: jwage Date: Tue, 19 Feb 2008 20:12:46 +0000 Subject: [PATCH] Reversed r3840. Broke tests. --- lib/Doctrine/Builder/Migration.php | 4 ++-- lib/Doctrine/Export.php | 4 ++-- lib/Doctrine/Export/Schema.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Doctrine/Builder/Migration.php b/lib/Doctrine/Builder/Migration.php index 3dcced80e..957d73ce2 100644 --- a/lib/Doctrine/Builder/Migration.php +++ b/lib/Doctrine/Builder/Migration.php @@ -157,10 +157,10 @@ END; { if ($modelsPath) { $models = Doctrine::loadModels($modelsPath); + } else { + $models = Doctrine::getLoadedModels(); } - $models = Doctrine::getLoadedModels(); - $foreignKeys = array(); foreach ($models as $model) { diff --git a/lib/Doctrine/Export.php b/lib/Doctrine/Export.php index f31ee19ea..00e733d40 100644 --- a/lib/Doctrine/Export.php +++ b/lib/Doctrine/Export.php @@ -1047,10 +1047,10 @@ class Doctrine_Export extends Doctrine_Connection_Module { if ($directory !== null) { $models = Doctrine::loadModels($directory); + } else { + $models = Doctrine::getLoadedModels(); } - $models = Doctrine::getLoadedModels(); - $this->exportClasses($models); } diff --git a/lib/Doctrine/Export/Schema.php b/lib/Doctrine/Export/Schema.php index ddaeeea10..91f8fdb17 100644 --- a/lib/Doctrine/Export/Schema.php +++ b/lib/Doctrine/Export/Schema.php @@ -45,11 +45,11 @@ class Doctrine_Export_Schema public function buildSchema($directory = null, $models = array()) { if ($directory) { - Doctrine::loadModels($directory); + $loadedModels = Doctrine::loadModels($directory); + } else { + $loadedModels = Doctrine::getLoadedModels(); } - $loadedModels = Doctrine::getLoadedModels(); - $array = array(); $parent = new ReflectionClass('Doctrine_Record');