AntonLV 9 år sedan
förälder
incheckning
8e9acdab40

+ 5 - 3
inc/classes/BxDolCmts.php

@@ -270,8 +270,10 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
 
     public static function &getSystems ()
     {
-        if (!isset($GLOBALS['bx_dol_cmts_systems'])) {
-            $GLOBALS['bx_dol_cmts_systems'] = BxDolDb::getInstance()->fromCache('sys_objects_cmts', 'getAllWithKey', '
+        $sKey = 'bx_dol_cache_memory_cmts_systems';
+
+        if (!isset($GLOBALS[$sKey])) {
+            $GLOBALS[$sKey] = BxDolDb::getInstance()->fromCache('sys_objects_cmts', 'getAllWithKey', '
                 SELECT
                     `ID` as `system_id`,
                     `Name` AS `name`,
@@ -303,7 +305,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
                     `ClassFile` AS `class_file`
                 FROM `sys_objects_cmts`', 'name');
         }
-        return $GLOBALS['bx_dol_cmts_systems'];
+        return $GLOBALS[$sKey];
     }
 
     public function init ($iId)

+ 3 - 3
inc/classes/BxDolContentInfo.php

@@ -148,7 +148,7 @@ class BxDolContentInfo extends BxDolFactory implements iBxDolFactoryObject
 
     public static function &getSystems()
     {
-        $sKey = 'bx_dol_content_info_systems';
+        $sKey = 'bx_dol_cache_memory_content_info_systems';
 
         if(!isset($GLOBALS[$sKey]))
             $GLOBALS[$sKey] = BxDolDb::getInstance()->fromCache('sys_objects_content_info', 'getAllWithKey', '
@@ -169,7 +169,7 @@ class BxDolContentInfo extends BxDolFactory implements iBxDolFactoryObject
 
     public static function &getGrids()
     {
-        $sKey = 'bx_dol_content_info_grids';
+        $sKey = 'bx_dol_cache_memory_content_info_grids';
 
         if(!isset($GLOBALS[$sKey]))
             $GLOBALS[$sKey] = BxDolDb::getInstance()->fromCache('sys_objects_content_info_grids', 'getAllWithKey', '
@@ -187,7 +187,7 @@ class BxDolContentInfo extends BxDolFactory implements iBxDolFactoryObject
 
     public static function &getSystemsByAlertType($sAlertType)
     {
-        $sKey = 'bx_dol_content_info_systems_' . $sAlertType;
+        $sKey = 'bx_dol_cache_memory_content_info_systems_' . $sAlertType;
 
         if(!isset($GLOBALS[$sKey])) {
             $aSystems = BxDolContentInfo::getSystems();

+ 5 - 3
inc/classes/BxDolFavorite.php

@@ -90,8 +90,10 @@ class BxDolFavorite extends BxDolObject
 
     public static function &getSystems()
     {
-        if(!isset($GLOBALS['bx_dol_favorite_systems']))
-            $GLOBALS['bx_dol_favorite_systems'] = BxDolDb::getInstance()->fromCache('sys_objects_favorite', 'getAllWithKey', '
+        $sKey = 'bx_dol_cache_memory_favorite_systems';
+
+        if(!isset($GLOBALS[$sKey]))
+            $GLOBALS[$sKey] = BxDolDb::getInstance()->fromCache('sys_objects_favorite', 'getAllWithKey', '
                 SELECT
                     `id` as `id`,
                     `name` AS `name`,
@@ -108,7 +110,7 @@ class BxDolFavorite extends BxDolObject
                     `class_file` AS `class_file`
                 FROM `sys_objects_favorite`', 'name');
 
-        return $GLOBALS['bx_dol_favorite_systems'];
+        return $GLOBALS[$sKey];
     }
 
     public static function onAuthorDelete ($iAuthorId)

+ 5 - 3
inc/classes/BxDolFeature.php

@@ -80,8 +80,10 @@ class BxDolFeature extends BxDolObject
 
     public static function &getSystems()
     {
-        if(!isset($GLOBALS['bx_dol_feature_systems']))
-            $GLOBALS['bx_dol_feature_systems'] = BxDolDb::getInstance()->fromCache('sys_objects_feature', 'getAllWithKey', '
+        $sKey = 'bx_dol_cache_memory_feature_systems';
+
+        if(!isset($GLOBALS[$sKey]))
+            $GLOBALS[$sKey] = BxDolDb::getInstance()->fromCache('sys_objects_feature', 'getAllWithKey', '
                 SELECT
                     `id` as `id`,
                     `name` AS `name`,
@@ -96,7 +98,7 @@ class BxDolFeature extends BxDolObject
                     `class_file` AS `class_file`
                 FROM `sys_objects_feature`', 'name');
 
-        return $GLOBALS['bx_dol_feature_systems'];
+        return $GLOBALS[$sKey];
     }
 
 	/**

+ 5 - 3
inc/classes/BxDolLiveUpdatesQuery.php

@@ -19,8 +19,10 @@ class BxDolLiveUpdatesQuery extends BxDolDb
 
 	public function getSystems()
     {
-        if(!isset($GLOBALS['bx_dol_live_updates_systems']))
-            $GLOBALS['bx_dol_live_updates_systems'] = BxDolDb::getInstance()->fromCache('sys_objects_live_updates', 'getAllWithKey', '
+        $sKey = 'bx_dol_cache_memory_live_updates_systems';
+
+        if(!isset($GLOBALS[$sKey]))
+            $GLOBALS[$sKey] = BxDolDb::getInstance()->fromCache('sys_objects_live_updates', 'getAllWithKey', '
                 SELECT
                     `id` as `id`,
                     `name` AS `name`,
@@ -29,7 +31,7 @@ class BxDolLiveUpdatesQuery extends BxDolDb
                     `active` AS `active`
                 FROM `sys_objects_live_updates`', 'name');
 
-        return $GLOBALS['bx_dol_live_updates_systems'];
+        return $GLOBALS[$sKey];
     }
 }
 

+ 5 - 3
inc/classes/BxDolReport.php

@@ -129,8 +129,10 @@ class BxDolReport extends BxDolObject
 
     public static function &getSystems()
     {
-        if(!isset($GLOBALS['bx_dol_report_systems']))
-            $GLOBALS['bx_dol_report_systems'] = BxDolDb::getInstance()->fromCache('sys_objects_report', 'getAllWithKey', '
+        $sKey = 'bx_dol_cache_memory_report_systems';
+
+        if(!isset($GLOBALS[$sKey]))
+            $GLOBALS[$sKey] = BxDolDb::getInstance()->fromCache('sys_objects_report', 'getAllWithKey', '
                 SELECT
                     `id` as `id`,
                     `name` AS `name`,
@@ -146,7 +148,7 @@ class BxDolReport extends BxDolObject
                     `class_file` AS `class_file`
                 FROM `sys_objects_report`', 'name');
 
-        return $GLOBALS['bx_dol_report_systems'];
+        return $GLOBALS[$sKey];
     }
 
     public static function onAuthorDelete ($iAuthorId)

+ 5 - 3
inc/classes/BxDolView.php

@@ -88,8 +88,10 @@ class BxDolView extends BxDolObject
 
     public static function &getSystems()
     {
-        if(!isset($GLOBALS['bx_dol_view_systems']))
-            $GLOBALS['bx_dol_view_systems'] = BxDolDb::getInstance()->fromCache('sys_objects_view', 'getAllWithKey', '
+        $sKey = 'bx_dol_cache_memory_view_systems';
+
+        if(!isset($GLOBALS[$sKey]))
+            $GLOBALS[$sKey] = BxDolDb::getInstance()->fromCache('sys_objects_view', 'getAllWithKey', '
                 SELECT
                     `id` as `id`,
                     `name` AS `name`,
@@ -104,7 +106,7 @@ class BxDolView extends BxDolObject
                     `class_file` AS `class_file`
                 FROM `sys_objects_view`', 'name');
 
-        return $GLOBALS['bx_dol_view_systems'];
+        return $GLOBALS[$sKey];
     }
 
     public static function onAuthorDelete ($iAuthorId)

+ 5 - 3
inc/classes/BxDolVote.php

@@ -122,8 +122,10 @@ class BxDolVote extends BxDolObject
 
     public static function &getSystems()
     {
-        if(!isset($GLOBALS['bx_dol_vote_systems']))
-            $GLOBALS['bx_dol_vote_systems'] = BxDolDb::getInstance()->fromCache('sys_objects_vote', 'getAllWithKey', '
+        $sKey = 'bx_dol_cache_memory_vote_systems';
+
+        if(!isset($GLOBALS[$sKey]))
+            $GLOBALS[$sKey] = BxDolDb::getInstance()->fromCache('sys_objects_vote', 'getAllWithKey', '
                 SELECT
                     `ID` as `id`,
                     `Name` AS `name`,
@@ -143,7 +145,7 @@ class BxDolVote extends BxDolObject
                     `ClassFile` AS `class_file`
                 FROM `sys_objects_vote`', 'name');
 
-        return $GLOBALS['bx_dol_vote_systems'];
+        return $GLOBALS[$sKey];
     }
 
     public static function onAuthorDelete ($iAuthorId)

+ 9 - 0
studio/classes/BxDolStudioInstaller.php

@@ -874,6 +874,15 @@ class BxDolStudioInstaller extends BxDolInstallerUtils
         $oCache = $this->oDb->getDbCacheObject();
 
         $bResult = $oCache->removeAllByPrefix('db_');
+        $bResult &= $this->oDb->cleanMemoryAll();
+
+        $aKeys = array_keys($GLOBALS);
+        $aKeysPrefixes = array('bx_dol_cache_memory_');
+        foreach($aKeysPrefixes as $sKeyPrefix)
+            foreach($aKeys as $sKey)
+                if(substr($sKey, 0, strlen($sKeyPrefix)) == $sKeyPrefix)
+                    unset($GLOBALS[$sKey]);
+
         return $bResult ? BX_DOL_STUDIO_INSTALLER_SUCCESS : BX_DOL_STUDIO_INSTALLER_FAILED;
     }