Changeset 464

Show
Ignore:
Timestamp:
01/13/08 20:57:27 (12 months ago)
Author:
padams
Message:

- added config id override in config file and caller.
- fixed cache bug where objects were attempted to be replced when they did not exist.

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/conf/owa-config-dist.php

    r452 r464  
    8282//define('OWA_CACHE_OBJECTS', true); 
    8383 
     84/** 
     85 * CONFIGURATION ID 
     86 * 
     87 * Override to load an alternative user configuration 
     88 */ 
     89  
     90//define('OWA_CONFIGURATION_ID', '1'); 
    8491 
    8592 
  • trunk/modules/base/classes/cache.php

    r448 r464  
    114114                if (!in_array($collection, $this->non_persistant_collections)): 
    115115                        // check to make sure the dirty collection exists and object is not already in there. 
    116                         if (!empty($this->dirty_objs[$collection]) || !in_array($hkey, $this->dirty_objs[$collection])): 
     116                        if (!empty($this->dirty_objs[$collection])): 
     117                                if(!in_array($hkey, $this->dirty_objs[$collection])): 
     118                                        $this->dirty_objs[$collection][] = $hkey; 
     119                                        //$this->debug(print_r($this->dirty_objs, true)); 
     120                                        $this->dirty_collections[$collection] = true;  
     121                                        $this->debug(sprintf('Added Object to Dirty List - Collection: %s, id: %s', $collection, $hkey)); 
     122                                        $this->statistics['dirty']++; 
     123                                endif; 
     124                        else: 
    117125                                $this->dirty_objs[$collection][] = $hkey; 
    118126                                //$this->debug(print_r($this->dirty_objs, true)); 
     
    121129                                $this->statistics['dirty']++; 
    122130                        endif; 
     131                         
    123132                // check to see if cache file exists and remove it just in case the collection 
    124133                // was recently added to the non persistant list. 
  • trunk/owa_caller.php

    r463 r464  
    138138                        endif; 
    139139                         
     140                        /* CONFIGURATION ID */ 
     141                         
     142                        if (defined('OWA_CONFIGURATION_ID')): 
     143                                $this->c->set('base', 'configuration_id', OWA_CONFIGURATION_ID); 
     144                        endif; 
     145                         
    140146                endif; 
    141147                         
     
    180186                        $this->c->load($this->c->get('base', 'configuration_id')); 
    181187                endif; 
    182  
     188                 
     189                /** 
     190                 * Post User Config Framework Setup 
     191                 * 
     192                 */ 
     193                 
     194                // Looks for log handler constant from config file 
     195                if (defined('OWA_ERROR_HANDLER')): 
     196                        $this->c->set('base', 'error_handler', OWA_ERROR_HANDLER); 
     197                endif; 
     198                 
     199                // Sets the correct mode of the error logger now that final config values are in place 
     200                // This will flush buffered msgs that were thrown up untill this point 
     201                $this->e->setHandler($this->c->get('base', 'error_handler')); 
     202                 
     203                // Create Request Container 
     204                $this->params = &owa_requestContainer::getInstance(); 
     205                 
     206                // Load the core API 
     207                $this->api = &owa_coreAPI::singleton(); 
     208                $this->api->caller_config_overrides = $config; 
     209                 
     210                // should only be called once to load all modules 
     211                $this->api->setupFramework(); 
     212                 
     213                // needed in standalone installs where site_id is not set in config file. 
     214                if ($this->params['site_id']): 
     215                        $this->c->set('base', 'site_id', $this->params['site_id']); 
     216                endif; 
    183217                 
    184218                // re-fetch the array now that overrides have been applied. 
     
    186220                $this->config = $this->c->fetch('base'); 
    187221 
    188                  
    189                 /** 
    190                  * Post Config Framework Setup 
    191                  * 
    192                  */ 
    193                  
    194                 // Looks for log handler constant from config file 
    195                 if (defined('OWA_ERROR_HANDLER')): 
    196                         $this->c->set('base', 'error_handler', OWA_ERROR_HANDLER); 
    197                 endif; 
    198                  
    199                  
    200                 // Sets the correct mode of the error logger now that final config values are in place 
    201                 // This will flush buffered msgs that were thrown up untill this point 
    202                 $this->e->setHandler($this->c->get('base', 'error_handler')); 
    203                  
    204                 // Create Request Container 
    205                 $this->params = &owa_requestContainer::getInstance(); 
    206                  
    207                 // Load the core API 
    208                 $this->api = &owa_coreAPI::singleton(); 
    209                 $this->api->caller_config_overrides = $config; 
    210                  
    211                 // should only be called once to load all modules 
    212                 $this->api->setupFramework(); 
    213                  
    214                 // needed in standalone installs where site_id is not set in config file. 
    215                 if ($this->params['site_id']): 
    216                         $this->c->set('base', 'site_id', $this->params['site_id']); 
    217                 endif; 
    218                  
    219222                return; 
    220223         
  • trunk/owa_php.php

    r462 r464  
    4545                 
    4646        } 
    47          
    48          
    49         /* 
    50 function __construct($config = null) { 
    51                 //return; 
    52                 return $this->owa_caller($config); 
    53          
    54         } 
    55  
    56 */ 
    5747 
    5848}