XOOPS Cube Legacy base repository
Revision | 618ded4a8ef666931da749bc512543226ede4632 (tree) |
---|---|
Zeit | 2011-11-21 22:56:26 |
Autor | nbuy <nbuy@704c...> |
Commiter | nbuy |
Caching active modules for speedup
git-svn-id: https://xoopscube.svn.sourceforge.net/svnroot/xoopscube/Package_Legacy/trunk@1059 704cf05f-ae62-4b0e-a484-234ee0250e75
@@ -71,6 +71,11 @@ class Legacy_Controller extends XCube_Controller | ||
71 | 71 | var $mSetBlockCachePolicy = null; |
72 | 72 | |
73 | 73 | /** |
74 | + * @var XoopsModule[] | |
75 | + */ | |
76 | + var $mActiveModules = null; | |
77 | + | |
78 | + /** | |
74 | 79 | * @var XCube_Delegate |
75 | 80 | */ |
76 | 81 | var $mSetModuleCachePolicy = null; |
@@ -767,9 +772,13 @@ class Legacy_Controller extends XCube_Controller | ||
767 | 772 | // Auto pre-loading for Module. |
768 | 773 | // |
769 | 774 | if ($this->mRoot->getSiteConfig('Legacy', 'AutoPreload') == 1) { |
775 | + if ($this->mActiveModules) $moduleObjects = $this->mActiveModules; | |
776 | + else { | |
770 | 777 | $moduleHandler =& xoops_gethandler('module'); |
771 | 778 | $criteria = new Criteria('isactive', 1); |
779 | + $this->mActiveModules = | |
772 | 780 | $moduleObjects =& $moduleHandler->getObjects($criteria); |
781 | + } | |
773 | 782 | foreach ($moduleObjects as $moduleObject) { |
774 | 783 | $mod_dir = $moduleObject->getVar('dirname'); |
775 | 784 | $dir = XOOPS_ROOT_PATH . '/modules/' . $mod_dir . $dirname . '/'; |