Show
Ignore:
Timestamp:
05/25/06 02:58:10 (6 years ago)
Author:
john
Message:

Major changes to environment added boot.php and Trax class to hold framwork config

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/active_record.php

    r199 r201  
    20062006    function establish_connection() { 
    20072007        # Connect to the database and throw an error if the connect fails. 
    2008       if(!array_key_exists('ACTIVE_RECORD_DB',$GLOBALS) 
    2009      || !is_object($GLOBALS['ACTIVE_RECORD_DB']) 
    2010      || $this->force_reconnect) { 
    2011             if(array_key_exists("use", $GLOBALS['TRAX_DB_SETTINGS'][TRAX_MODE])) { 
    2012                 $connection_settings = $GLOBALS['TRAX_DB_SETTINGS'][$GLOBALS['TRAX_DB_SETTINGS'][TRAX_MODE]['use']]; 
     2008        if(!is_object(Trax::$active_record_connection) || $this->force_reconnect) { 
     2009            if(array_key_exists("use", Trax::$database_settings[TRAX_ENV])) { 
     2010                $connection_settings = Trax::$database_settings[Trax::$database_settings[TRAX_ENV]['use']]; 
    20132011            } else { 
    2014                 $connection_settings = $GLOBALS['TRAX_DB_SETTINGS'][TRAX_MODE]; 
     2012                $connection_settings = Trax::$database_settings[TRAX_ENV]; 
    20152013            } 
    20162014            # Override database name if param is set 
     
    20202018            # Set optional Pear parameters 
    20212019            if(isset($connection_settings['persistent'])) { 
    2022                 $connection_options['persistent'] = 
    2023                     $connection_settings['persistent']; 
    2024             } 
    2025             $GLOBALS['ACTIVE_RECORD_DB'] =& DB::Connect($connection_settings, $connection_options); 
    2026         } 
    2027         if(!$this->is_error($GLOBALS['ACTIVE_RECORD_DB'])) { 
    2028             self::$db = $GLOBALS['ACTIVE_RECORD_DB']; 
     2020                $connection_options['persistent'] = $connection_settings['persistent']; 
     2021            } 
     2022            Trax::$active_record_connection =& DB::Connect($connection_settings, $connection_options); 
     2023        } 
     2024        if(!$this->is_error(Trax::$active_record_connection)) { 
     2025            self::$db = Trax::$active_record_connection; 
    20292026        } else { 
    2030             $this->raise($GLOBALS['ACTIVE_RECORD_DB']->getMessage()); 
     2027            $this->raise(Trax::$active_record_connection->getMessage()); 
    20312028        } 
    20322029        self::$db->setFetchMode($this->fetch_mode); 
     
    23252322     */ 
    23262323    function log_query($sql) { 
    2327         if(TRAX_MODE == "development" && $sql) { 
     2324        if(TRAX_ENV == "development" && $sql) { 
    23282325            $GLOBALS['ACTIVE_RECORD_SQL_LOG'][] = $sql;        
    23292326        }