Changeset 1196

Show
Ignore:
Timestamp:
10/12/08 04:19:14 (2 months ago)
Author:
arnoschn
Message:

Fixing AkConfig? cache so that it works with the web installer.
If permissions are insufficient it will store the cache config files in AK_TMP_DIR

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/models/framework_setup.php

    r1190 r1196  
    277277    function getConfigurationFile($settings = array()) 
    278278    { 
    279  
    280  
     279         
     280        $defineAkConfigCacheDir = ''; 
     281        $res = @mkdir(AK_CONFIG_DIR.DS.'cache'.DS.'test',0777,true); 
     282        if (!$res) { 
     283            $defineAkConfigCacheDir =<<<EOD 
     284defined('AK_CONFIG_CACHE_TMP')?null:define('AK_CONFIG_CACHE_TMP',true); 
     285EOD; 
     286 
     287        } 
    281288        $configuration_template = <<<CONFIG 
    282289<?php 
     
    301308define('AK_APP_LOCALES', '%locales'); 
    302309define('AK_PUBLIC_LOCALES', '%locales'); 
     310 
     311$defineAkConfigCacheDir 
    303312 
    304313%AK_URL_REWRITINGdefined('AK_URL_REWRITE_ENABLED') ? null : define('AK_URL_REWRITE_ENABLED', true); 
  • trunk/lib/AkActiveRecord/AkDbSchemaCache.php

    r1185 r1196  
    1616    { 
    1717        $namespace = Ak::sanitize_include($table, 'high'); 
    18         $cacheFile = AK_CONFIG_DIR.DS.'cache'.DS.'activerecord'.DS.$environment.DS.$table.'.php'; 
     18        $cacheDir = AK_CONFIG_DIR; 
     19        if (defined('AK_CONFIG_CACHE_TMP') && AK_CONFIG_CACHE_TMP) { 
     20            $cacheDir  = AK_TMP_DIR.DS.'ak_config'; 
     21        } 
     22        $cacheFile = $cacheDir.DS.'cache'.DS.'activerecord'.DS.$environment.DS.$table.'.php'; 
    1923        return $cacheFile; 
    2024    } 
  • trunk/lib/AkConfig.php

    r1187 r1196  
    106106    { 
    107107        $namespace = Ak::sanitize_include($namespace, 'high'); 
    108         $cacheFile = AK_CONFIG_DIR.DS.'cache'.DS.$environment.DS.$namespace.'.php'; 
     108        $cacheDir = AK_CONFIG_DIR; 
     109        if (defined('AK_CONFIG_CACHE_TMP') && AK_CONFIG_CACHE_TMP) { 
     110            $cacheDir  = AK_TMP_DIR.DS.'ak_config'; 
     111        } 
     112        $cacheFile = $cacheDir.DS.'cache'.DS.$environment.DS.$namespace.'.php'; 
     113         
    109114        return $cacheFile; 
    110115    } 
     
    125130    { 
    126131        switch ($environment) { 
     132            case 'setup': 
     133                return false; 
     134                break; 
    127135            case 'development': 
    128136            case 'testing': 
     
    165173    function _writeCache($config, $namespace, $environment = AK_ENVIRONMENT, $force = false) 
    166174    { 
    167         if (!$force && !$this->_useWriteCache($environment)) return false; 
     175        if (AK_ENVIRONMENT == 'setup' || (!$force &&!$this->_useWriteCache($environment))) return false; 
    168176         
    169177        $var_export = var_export($config,true);