Example #1
0
 /**
  * Returns object instance
  *
  * @return oxUtilsObject
  */
 public static function getInstance()
 {
     // disable caching for test modules
     if (defined('OXID_PHP_UNIT')) {
         self::$_instance = null;
     }
     if (!self::$_instance instanceof UtilsObject) {
         $oUtilsObject = new UtilsObject();
         // set the not overloaded(by modules) version early so oxnew can be used internally
         self::$_instance = $oUtilsObject;
         // null for classNameProvider because it is generated in the constructor
         $classNameProvider = null;
         $moduleVariablesCache = $oUtilsObject->oxNew('oxFileCache');
         $shopIdCalculator = $oUtilsObject->oxNew('oxShopIdCalculator', $moduleVariablesCache);
         $subShopSpecific = $oUtilsObject->oxNew('oxSubShopSpecificFileCache', $shopIdCalculator);
         $moduleVariablesLocator = $oUtilsObject->oxNew('oxModuleVariablesLocator', $subShopSpecific, $shopIdCalculator);
         $moduleChainsGenerator = $oUtilsObject->oxNew('oxModuleChainsGenerator', $moduleVariablesLocator);
         //generate UtilsObject again by oxnew to allow overloading by modules
         self::$_instance = $oUtilsObject->oxNew('oxUtilsObject', $classNameProvider, $moduleChainsGenerator, $shopIdCalculator);
     }
     return self::$_instance;
 }