Development

Changeset 20450

You must first sign up to be able to contribute.

Changeset 20450

Show
Ignore:
Timestamp:
07/23/09 20:36:39 (4 years ago)
Author:
henrik
Message:

property caching of the parsed yml file the first time it is loaded

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfTabMenuPeytzPlugin/lib/sfTabMenuPeytz.class.php

    r20404 r20450  
    1313{ 
    1414    /** 
     15     * The Yaml file parsed, is set the first time the yml file is parsed 
     16     * 
     17     * @var array 
     18     */ 
     19    static public $_ParsedYamlFile = null; 
     20    /** 
    1521     * Default configuration 
    1622     * 
     
    9197    { 
    9298        //Settings 
    93         $configFile = sfConfig::get('sf_app_dir') . '/config/tabs.yml'; 
    94         if (!file_exists($configFile)) { 
    95             return; 
    96         } 
    97          
    98         $config = sfYaml::load($configFile); 
     99        if (!self::$_ParsedYamlFile) { 
     100            $configFile = sfConfig::get('sf_app_dir') . '/config/tabs.yml'; 
     101            if (!file_exists($configFile)) { 
     102                return; 
     103            } 
     104             
     105            self::$_ParsedYamlFile = sfYaml::load($configFile); 
     106        } 
     107         
     108        $config = self::$_ParsedYamlFile; 
    99109         
    100110        //If the tabs settings hasent been found