function getValue($hash) { //$cache = JFactory::getCache('_onepage',''); if (isset(self::$cachedResult)) { if (!empty(OPCcache::$cachedResult[$hash])) { return OPCcache::$cachedResult[$hash]; } } $res = OPCcache::get($hash); if (!empty($res)) { return $res; } }
function getPrefered() { $db = JFactory::getDBO(); $q = 'select template from #__template_styles where home = 1 and client_id = 0 limit 0,1'; $db->setQuery($q); $template = $db->loadResult(); $colors2 = OPCcache::get('css_' . $template); if (!empty($colors2)) { $colors = $colors2; return $colors; } $templateDir = JPATH_SITE . DS . 'templates' . DS . $template; if (!file_exists($templateDir)) { return; } $files = JFolder::files($templateDir, '.css', true, true, array()); $colors = array(); $this->getColors($files, $colors); OPCcache::store($colors, 'css_' . $template); return $colors; }