Show
Ignore:
Timestamp:
06/26/09 04:44:49 (9 months ago)
Author:
bermi
Message:

Using Ak::trace() to display transaction failures

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/AkActiveRecord/AkDbAdapter.php

    r1252 r1326  
    7979        return !empty($this->connection); 
    8080    } 
    81      
    82  
    83     /** 
    84      * @static  
     81 
     82 
     83    /** 
     84     * @static 
    8585     * @param array $database_settings 
    8686     * @return AkDbAdapter 
     
    9797                $database_specifications = Ak::getSettings('database', false, $settings_hash); 
    9898            } else if (is_string($database_specifications)){ 
    99                  
     99 
    100100                $environment_settings = Ak::getSettings('database', false, $database_specifications); 
    101                  
     101 
    102102                if (!empty($environment_settings)){ 
    103103                    $database_specifications = $environment_settings; 
     
    109109                    if (isset($database_settings) && !file_exists(AK_CONFIG_DIR.DS.'database.yml')) { 
    110110                        trigger_error(Ak::t("You are still using the old config/config.php database configuration. Please upgrade to use the config/database.yml configuration."), E_USER_NOTICE); 
    111                     }  
     111                    } 
    112112                    if (!file_exists(AK_CONFIG_DIR.DS.'database.yml')) { 
    113113                        trigger_error(Ak::t("Could not find the database configuration file in %dbconfig.",array('%dbconfig'=>AK_CONFIG_DIR.DS.'database.yml')),E_USER_ERROR); 
     
    115115                        trigger_error(Ak::t("Could not find the database profile '%profile_name' in config/database.yml.",array('%profile_name'=>$database_specifications)),E_USER_ERROR); 
    116116                    } 
    117                      
    118                      
     117 
     118 
    119119                    $return = false; 
    120120                    return $return; 
     
    180180 
    181181    } 
    182      
     182 
    183183    function _getDbSettingsFromDsn($dsn) 
    184184    { 
     
    189189        return $result; 
    190190    } 
    191      
     191 
    192192    function type() 
    193193    { 
     
    355355    function failTransaction() 
    356356    { 
     357        if(AK_DEBUG && !empty($this->connection->debug)){ 
     358            Ak::trace(ak_backtrace(), null, null, null, false); 
     359        } 
    357360        return $this->connection->FailTrans(); 
    358361    } 
     
    384387            if (($available_tables = AkDbSchemaCache::get('avaliable_tables')) === false) { 
    385388                if(empty($available_tables)){ 
    386                     $available_tables = $this->connection->MetaTables();                 
     389                    $available_tables = $this->connection->MetaTables(); 
    387390                } 
    388391                AkDbSchemaCache::set('avaliable_tables', $available_tables); 
     
    394397        return $available_tables; 
    395398    } 
    396      
     399 
    397400    function tableExists($table_name) 
    398401    { 
     
    406409        return true; 
    407410    } 
    408      
     411 
    409412    /** 
    410413     * caching the meta info 
     
    413416     * @return unknown 
    414417     */ 
    415      
     418 
    416419    function getColumnDetails($table_name) 
    417420    {