[*] MO: Improve performance with smarty cache on blocktopmenu

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15725 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-05-29 09:28:53 +00:00
parent 9de076b775
commit 4980999ef5
2 changed files with 21 additions and 13 deletions
+4 -6
View File
@@ -787,14 +787,12 @@ class ShopCore extends ObjectModel
*/
public static function isFeatureActive()
{
if (!Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE'))
return false;
static $feature_active = null;
static $total = null;
if ($feature_active === null)
$feature_active = Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && (count(Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'shop')) > 1);
if (is_null($total))
$total = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'shop');
return ($total > 1) ? true : false;
return $feature_active;
}
public function copyShopData($old_id, $tables_import = false, $deleted = false)