Change-Id: Ib5366851ed72f6ba5857f5a186e29f256cc340ec
Reviewed-on: http://gerrit.tine20.com/customers/1488
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
// setup cache if available
if (is_array($classes) && Tinebase_Core::getCache()) {
$masterFiles = array();
// setup cache if available
if (is_array($classes) && Tinebase_Core::getCache()) {
$masterFiles = array();
$dirname = dirname(__FILE__) . '/../../';
foreach ($classes as $class => $namespace) {
$masterFiles[] = $dirname . str_replace('_', '/', $class) . '.php';
}
$dirname = dirname(__FILE__) . '/../../';
foreach ($classes as $class => $namespace) {
$masterFiles[] = $dirname . str_replace('_', '/', $class) . '.php';
}
try {
$cache = new Zend_Cache_Frontend_File(array(
'master_files' => $masterFiles,
try {
$cache = new Zend_Cache_Frontend_File(array(
'master_files' => $masterFiles,
));
$cache->setBackend(Tinebase_Core::getCache()->getBackend());
$cacheId = '_handle_' . sha1(Zend_Json_Encoder::encode($classes));
));
$cache->setBackend(Tinebase_Core::getCache()->getBackend());
$cacheId = '_handle_' . sha1(Zend_Json_Encoder::encode($classes));
+
+ $server = $cache->load($cacheId);
+ if ($server instanceof Zend_Json_Server) {
+ return $server;
+ }
+
} catch (Zend_Cache_Exception $zce) {
if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__
. " Failed to create cache. Exception: \n". $zce);
}
}
} catch (Zend_Cache_Exception $zce) {
if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__
. " Failed to create cache. Exception: \n". $zce);
}
}
- if (isset($cache) && $cache->test($cacheId)) {
- $server = $cache->load($cacheId);
- if ($server instanceof Zend_Json_Server) {
- return $server;
- }
- }
-
$server = new Zend_Json_Server();
$server->setAutoEmitResponse(false);
$server->setAutoHandleExceptions(false);
$server = new Zend_Json_Server();
$server->setAutoEmitResponse(false);
$server->setAutoHandleExceptions(false);