00001 <?php 00002 /** 00003 * File containing the lazy configuration for the PersistentObject components. 00004 * 00005 * @version 0.4 00006 * @package Gauffr 00007 * @copyright Copyright (c) 2009-2010 Guillaume Kulakowski and contributors 00008 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2.0 00009 */ 00010 00011 /** 00012 * The GauffrLazyPersistentSessionConfiguration classes. 00013 * 00014 * Lazy configuration for PersistentObject Components. 00015 * 00016 * @version 0.4 00017 * @brief Lazy configuration for PersistentObject 00018 */ 00019 class GauffrLazyPersistentSessionConfiguration implements ezcBaseConfigurationInitializer 00020 { 00021 00022 /** 00023 * Configure the ezcPersistentSession object 00024 * @param string $instance DB instance name 00025 * @return A ezcPersistentSession instance 00026 */ 00027 public static function configureObject( $instance ) 00028 { 00029 $db = ezcDbInstance::get(Gauffr::GAUFFR_DB_INSTANCE); 00030 00031 switch ( $instance ) 00032 { 00033 case Gauffr::GAUFFR_DB_INSTANCE: 00034 $session = new ezcPersistentSession( 00035 $db, 00036 new ezcPersistentCodeManager( Gauffr::$gauffrMappingDir ) 00037 ); 00038 } 00039 return $session; 00040 } 00041 00042 } 00043 00044 ?>