From 3f44e99278fbbb64020ec3718a98f853b68e884c Mon Sep 17 00:00:00 2001 From: Silvio Date: Fri, 30 Jul 2010 15:11:49 -0300 Subject: Supporting database order --- lib/sfIsisImporterManager.class.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/sfIsisImporterManager.class.php b/lib/sfIsisImporterManager.class.php index 460c080..756de8c 100644 --- a/lib/sfIsisImporterManager.class.php +++ b/lib/sfIsisImporterManager.class.php @@ -7,12 +7,12 @@ class sfIsisImporterManager extends IsisConnector { /** - * @var string $loglevel Log level. + * @var string $loglevel Log level */ var $loglevel = 'info'; /** - * @var int $processed Number of processed entries. + * @var int $processed Number of processed entries */ var $processed = 0; @@ -83,9 +83,21 @@ class sfIsisImporterManager extends IsisConnector */ public function databases() { + $databases = array(); + foreach (glob(sfConfig::get('sf_lib_dir') ."/cinisis/schemas/*.yaml") as $file) { - $databases[] = basename($file, '.yaml'); + $database = basename($file, '.yaml'); + $options = sfYaml::load($file); + + if (isset($options['db']['order'])) + { + $databases[$options['db']['order']] = $database; + } + else + { + $this->log("Database config $database has no order option, skipping."); + } } return $databases; -- cgit v1.2.3