示例#1
0
 /**
  * Class constructor
  * 
  * @return  void
  */
 private function __construct()
 {
     $this->_conf = Woops_Core_Config_Getter::getInstance();
     $this->_env = Woops_Core_Env_Getter::getInstance();
     $this->_request = Woops_Core_Request_Getter::getInstance();
     $this->_db = Woops_Database_Layer::getInstance()->getEngine();
     $this->_str = Woops_String_Utils::getInstance();
     $this->_pageId = $this->_getPageId();
     $this->_langName = $this->_getLanguage();
     $this->_page = $this->_getPage($this->_pageId, $this->_langName);
     $this->_template = $this->_getTemplate($this->_page->id_templates);
 }
示例#2
0
#                WOOPS - Web Object Oriented Programming System                #
#                                                                              #
#                               COPYRIGHT NOTICE                               #
#                                                                              #
# Copyright (C) 2009 Jean-David Gadina - www.xs-labs.com                       #
# All rights reserved                                                          #
################################################################################
# $Id$
// As we are building cached version of classes, we don't want the WOOPS class
// manager to load classes from the cache, as this will result in an
// infinite number of calls to this script, through a socket.
define('WOOPS_CLASS_CACHE_MODE_OFF', true);
// Includes the initialization script
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'init.inc.php';
// Gets incomming GET variables
$GETVARS = Woops_Core_Request_Getter::getInstance()->classCache;
// Checks the GET variables
if ($GETVARS && isset($GETVARS['className'])) {
    // Name and path of the class to build
    $CLASSNAME = $GETVARS['className'];
    // Path to the cache directory
    $CACHEDIR = Woops_Core_Env_Getter::getInstance()->getPath('cache/classes/');
    // Checks if the class caching is enabled (or the AOP), and checks the cache directory
    if (Woops_Core_Config_Getter::getInstance()->getVar('classCache', 'enable') || Woops_Core_Config_Getter::getInstance()->getVar('aop', 'enable') && $CACHEDIR && is_dir($CACHEDIR) && is_writeable($CACHEDIR) && !file_exists($CACHEDIR . $CLASSNAME)) {
        // We don't want any error here
        try {
            // Checks if AOP is enabled, and if the class is not an interface
            if (Woops_Core_Config_Getter::getInstance()->getVar('aop', 'enable') && substr($CLASSNAME, -9) !== 'Interface') {
                // Creates an AOP version of the class
                $AOP = new Woops_Core_Aop_Class_Builder($CLASSNAME);
                // Gets the code of the AOP version
示例#3
0
 /**
  * Gets the unique class instance
  * 
  * This method is used to get the unique instance of the class
  * (singleton). If no instance is available, it will create it.
  * 
  * @return  Woops_Core_Request_Getter   The unique instance of the class
  * @see     __construct
  */
 public static function getInstance()
 {
     // Checks if the unique instance already exists
     if (!is_object(self::$_instance)) {
         // Creates the unique instance
         self::$_instance = new self();
     }
     // Returns the unique instance
     return self::$_instance;
 }
示例#4
0
 /**
  * Sets the needed static variables
  * 
  * @return  void
  */
 private static function _setStaticVars()
 {
     self::$_conf = Woops_Core_Config_Getter::getInstance();
     self::$_modManager = Woops_Core_Module_Manager::getInstance();
     self::$_request = Woops_Core_Request_Getter::getInstance();
     self::$_env = Woops_Core_Env_Getter::getInstance();
     self::$_str = Woops_String_Utils::getInstance();
     self::$_moduleVariables = self::$_request->getWoopsVar('mod');
     // Static variables are set
     self::$_hasStatic = true;
 }