From: <gem...@li...> - 2012-05-21 09:00:55
|
Revision: 694 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=694&view=rev Author: mennodekker Date: 2012-05-21 09:00:49 +0000 (Mon, 21 May 2012) Log Message: ----------- Fixed apc cache slam Modified Paths: -------------- trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2012-05-20 19:48:24 UTC (rev 693) +++ trunk/library/classes/Gems/User/UserLoader.php 2012-05-21 09:00:49 UTC (rev 694) @@ -349,6 +349,7 @@ static $urls; if (! is_array($urls)) { + $urls = array(); if ($this->cache) { $cacheId = GEMS_PROJECT_NAME . '__' . get_class($this) . '__organizations_url'; $urls = $this->cache->load($cacheId); @@ -356,14 +357,15 @@ $cacheId = false; } - if (! $urls) { + // When we don't use cache or cache reports 'false' for a miss or expiration + // then try to reload the data + if ($cacheId === false || $urls === false) { try { $data = $this->db->fetchPairs("SELECT gor_id_organization, gor_url_base FROM gems__organizations WHERE gor_active=1 AND gor_url_base IS NOT NULL"); } catch (Zend_Db_Exception $zde) { // Table might not be filled $data = array(); } - $urls = array(); foreach ($data as $orgId => $urlsBase) { foreach (explode(' ', $urlsBase) as $url) { if ($url) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |