[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/wact/src/ -> WactDefaultTemplateConfig.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  
  10  require_once('limb/wact/src/WactTemplateConfig.interface.php');
  11  
  12  /**

  13   * class WactDefaultTemplateConfig.

  14   *

  15   * @package wact

  16   * @version $Id: WactDefaultTemplateConfig.class.php 5945 2007-06-06 08:31:43Z pachanga $

  17   */
  18  class WactDefaultTemplateConfig implements WactTemplateConfig
  19  {
  20    protected $is_force_scan = false;
  21    protected $is_force_compile = false;
  22    protected $cache_dir = WACT_CACHE_DIR;
  23    protected $scan_directories = array('limb/wact/src/tags/');
  24    protected $sax_filters = array();
  25    protected $templates_dir = 'templates/';
  26  
  27    function __construct($ini_file_path = '')
  28    {
  29      if(!$ini_file_path)
  30        $ini_file_path = WACT_DEFAULT_CONFIG_DIR . '/config.ini';
  31  
  32      $this->_readSettingsFromConfig($ini_file_path);
  33    }
  34  
  35    function _readSettingsFromConfig($ini_file_path)
  36    {
  37      $settings = parse_ini_file($ini_file_path);
  38      if(isset($settings['force_scan']))
  39        $this->is_force_scan = (boolean)$settings['force_scan'];
  40  
  41      if(isset($settings['force_compile']))
  42        $this->is_force_compile = (boolean)$settings['force_compile'];
  43  
  44      if(isset($settings['cache_dir']))
  45        $this->cache_dir = $settings['cache_dir'];
  46  
  47      if(isset($settings['scan_directories']))
  48        $this->scan_directories = $settings['scan_directories'];
  49  
  50      if(isset($settings['sax_filters']))
  51        $this->sax_filters = $settings['sax_filters'];
  52  
  53      if(isset($settings['templates_dir']))
  54        $this->templates_dir = $settings['templates_dir'];
  55    }
  56  
  57    function isForceScan()
  58    {
  59      return $this->is_force_scan;
  60    }
  61  
  62    function isForceCompile()
  63    {
  64      return $this->is_force_compile;
  65    }
  66  
  67    function getCacheDir()
  68    {
  69      return $this->cache_dir;
  70    }
  71  
  72    function getScanDirectories()
  73    {
  74      return $this->scan_directories;
  75    }
  76  
  77    function getSaxFilters()
  78    {
  79      return $this->sax_filters;
  80    }
  81  
  82    function getTemplatesDir()
  83    {
  84      return $this->templates_dir;
  85    }
  86  }
  87  
  88  ?>


Generated: Mon Dec 1 03:56:46 2008 Cross-referenced by PHPXref 0.7