Changeset 1150

Show
Ignore:
Timestamp:
11/06/08 21:11:06 (2 months ago)
Author:
laurentj
Message:

ticket #385: made some little improvements in jController for optimized edition
little optimisation on sessions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/core/jConfigCompiler.class.php

    r1119 r1150  
    167167                $config->timeZone = "Europe/Paris"; 
    168168#endif 
     169        } 
     170 
     171        if($config->sessions['storage'] == 'files'){ 
     172            $config->sessions['files_path'] = str_replace(array('lib:','app:'), array(LIB_PATH, JELIX_APP_PATH), $config->sessions['files_path']); 
    169173        } 
    170174 
  • trunk/lib/jelix/core/jCoordinator.class.php

    r1077 r1150  
    2828    * @var  array 
    2929    */ 
    30     public $plugins=array(); 
     30    public $plugins = array(); 
    3131 
    3232    /** 
     
    225225 
    226226        $ctrlpath = $selector->getPath(); 
    227  
     227#ifnot ENABLE_OPTIMIZED_SOURCE 
    228228        if(!file_exists($ctrlpath)){ 
    229229            throw new jException('jelix~errors.ad.controller.file.unknow',array($this->actionName,$ctrlpath)); 
    230230        } 
     231#endif 
    231232        require_once($ctrlpath); 
    232233        $class = $selector->getClass(); 
     234#ifnot ENABLE_OPTIMIZED_SOURCE 
    233235        if(!class_exists($class,false)){ 
    234236            throw new jException('jelix~errors.ad.controller.class.unknow',array($this->actionName,$class, $ctrlpath)); 
    235237        } 
    236  
     238#endif 
    237239        $ctrl = new $class($this->request); 
    238240        if($ctrl instanceof jIRestController){ 
    239241            $method = $selector->method = strtolower($_SERVER['REQUEST_METHOD']); 
    240         }elseif(!method_exists($ctrl,$selector->method)){ 
    241             throw new jException('jelix~errors.ad.controller.method.unknow',array($this->actionName,$selector->method, $class, $ctrlpath)); 
     242        }elseif(!method_exists($ctrl, $selector->method)){ 
     243            throw new jException('jelix~errors.ad.controller.method.unknow',array($this->actionName, $selector->method, $class, $ctrlpath)); 
    242244        } 
    243245        return $ctrl; 
  • trunk/lib/jelix/core/jRequest.class.php

    r1096 r1150  
    111111        } 
    112112 
    113         if ($gJConfig->isWindows && $pathinfo && strpos ($pathinfo, $this->urlScript) !== false){ 
     113        if ($gJConfig->isWindows && $pathinfo && strpos($pathinfo, $this->urlScript) !== false){ 
    114114            //under IIS, we may get  /subdir/index.php/mypath/myaction as PATH_INFO, so we fix it 
    115115            $pathinfo = substr ($pathinfo, strlen ($this->urlScript)); 
  • trunk/lib/jelix/core/jSession.class.php

    r1077 r1150  
    3030 
    3131        // do not start the session if the request is made from the command line or if sessions are disabled in configuration 
    32         if($GLOBALS['gJCoord']->request instanceof jCmdLineRequest || !$params['start'])
     32        if ($GLOBALS['gJCoord']->request instanceof jCmdLineRequest || !$params['start'])
    3333            return false; 
    3434        } 
    3535 
    3636        //make sure that the session cookie is only for the current application 
    37         if(!$params['shared_session']) 
     37        if (!$params['shared_session']) 
    3838            session_set_cookie_params ( 0 , $GLOBALS['gJConfig']->urlengine['basePath']); 
    3939 
    40         if($params['storage'] != '')
     40        if ($params['storage'] != '')
    4141 
    4242            /* on debian/ubuntu (maybe others), garbage collector launch probability is set to 0 
     
    4747 
    4848            switch($params['storage']){ 
    49  
    5049                case 'dao': 
    5150                    session_set_save_handler( 
     
    6160 
    6261                case 'files': 
    63                     $path = str_replace(array('lib:','app:'), array(LIB_PATH, JELIX_APP_PATH), $params['files_path']); 
    64                     session_save_path($path); 
    65                     break; 
    66  
    67                 default: 
     62                    session_save_path($params['files_path']); 
    6863                    break; 
    6964            } 
    70  
    7165        } 
    7266 
  • trunk/lib/jelix/core/selector/jSelectorActFast.class.php

    r1074 r1150  
    7272 
    7373    public function getClass(){ 
     74#if ENABLE_OLD_CLASS_NAMING 
    7475        $className = $this->controller.'Ctrl'; 
    75 #if ENABLE_OLD_CLASS_NAMING 
    7676        if(!class_exists($className,false)){ 
    7777            if(class_exists('CT'.$this->controller,false)) 
    7878                $className = 'CT'.$this->controller; 
    7979        } 
     80        return $className; 
     81#else 
     82        return $this->controller.'Ctrl'; 
    8083#endif 
    81         return $className; 
    8284    } 
    8385 
Download in other formats: Unified Diff Zip Archive