Changeset 538

Show
Ignore:
Timestamp:
2008年10月04日 16時22分56秒 (2 months ago)
Author:
iteman
Message:

- Updated.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/Piece/ORM.php

    r511 r538  
    3838namespace Piece; 
    3939 
    40 use Piece::ORM::Config::ConfigFactory; 
     40use Piece::ORM::Config::Reader; 
    4141use Piece::ORM::Context; 
    4242use Piece::ORM::Mapper::MapperFactory; 
     
    9292     * 
    9393     * First this method tries to load a configuration from a configuration file in 
    94      * the given configration directory using 
    95      * Piece::ORM::Config::ConfigFactory::factory(). The method creates a new object 
    96      * if the load failed. 
     94     * the given configration directory using a Piece::ORM::Config::Reader object. 
     95     * The method creates a new object if the load failed. 
    9796     * Second this method sets the configuration to the current context. And also 
    9897     * this method sets the configuration directory for the mapper configuration, and 
     
    111110        Registry::setContext(new Context()); 
    112111        $context = Registry::getContext(); 
    113         $config = ConfigFactory::factory($configDirectory, $cacheDirectory); 
    114         $context->setConfiguration($config); 
    115112        $context->setMapperConfigDirectory($mapperConfigDirectory); 
    116113        $context->setCacheDirectory($cacheDirectory); 
     114 
     115        $reader = new Reader($configDirectory); 
     116        $config = $reader->read(); 
     117        $context->setConfiguration($config); 
     118 
    117119        $defaultDatabase = $config->getDefaultDatabase(); 
    118120        if (!is_null($defaultDatabase)) {