Source for file class.modrewritebase.php

Documentation is available at class.modrewritebase.php

  1. <?php
  2. /**
  3.  * Includes base mod rewrite class.
  4.  *
  5.  * @author      Murat Purc <murat@purc.de>
  6.  * @date        24.09.2008
  7.  * @package     Contenido
  8.  * @subpackage  ModRewrite
  9.  */
  10.  
  11.  
  12. defined('CON_FRAMEWORK'or die('Illegal call');
  13.  
  14.  
  15. /**
  16.  * Abstract base mod rewrite class.
  17.  *
  18.  * Provides some common features such as common debugging, globals/configuration
  19.  * access for childs.
  20.  *
  21.  * @author      Murat Purc <murat@purc.de>
  22.  * @date        24.09.2008
  23.  * @package     Contenido
  24.  * @subpackage  ModRewrite
  25.  */
  26. abstract class ModRewriteBase {
  27.  
  28.     /**
  29.      * Debugger instance
  30.      *
  31.      * @var  Contenido_mpDebug 
  32.      */
  33.     protected static $_oDebug;
  34.  
  35.     /**
  36.      * Globals instance
  37.      *
  38.      * @var mpGlobals 
  39.      */
  40.     protected static $_oGlobals;
  41.  
  42.  
  43.     /**
  44.      * Initialization, is to call at least once by an child.
  45.      */
  46.     protected static function initialize({
  47.         self::$_oDebug   Contenido_mpDebug::getInstance();
  48.         self::$_oGlobals mpGlobals::getInstance();
  49.     }
  50.  
  51.  
  52.     /**
  53.      * Returns enabled state of mod rewrite plugin
  54.      *
  55.      * @return  bool 
  56.      */
  57.     public static function isEnabled(){
  58.         return (self::getConfig('use'0== 1true false;
  59.     }
  60.  
  61.  
  62.     /**
  63.      * Returns configuration of mod rewrite, content of gobal $cfg['mod_rewrite']
  64.      *
  65.      * @param   string  $key  Name of configuration key
  66.      * @return  mixed   Desired value mr configuration, either the full configuration
  67.      *                   or one of the desired subpart
  68.      */
  69.     public static function getConfig($key=null$default=null{
  70.         $aCfg self::$_oGlobals->get('cfg/mod_rewrite');
  71.         if ($key == null{
  72.             return $aCfg;
  73.         elseif ((string) $key !== ''{
  74.             return (isset($aCfg[$key])) $aCfg[$key$default;
  75.         else {
  76.             return $default;
  77.         }
  78.     }
  79.  
  80. }

Documentation generated on Sun, 08 Feb 2009 22:00:32 +0100 by phpDocumentor 1.4.1