1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-29 04:55:02 +03:00

fix проблемы с включенным у некоторых хостингов в include_path пути до Zend

This commit is contained in:
Mzhelskiy Maxim 2010-05-22 11:58:49 +00:00
parent 66848b9577
commit 4f5d90a0ad
10 changed files with 22 additions and 23 deletions

View file

@ -9,7 +9,7 @@
* *
* $Id$ * $Id$
*/ */
require_once "Zend/Cache/Backend/Memcached.php"; require_once LS_DKCACHE_PATH."Zend/Cache/Backend/Memcached.php";
class Dklab_Cache_Backend_MemcachedMultiload extends Zend_Cache_Backend_Memcached class Dklab_Cache_Backend_MemcachedMultiload extends Zend_Cache_Backend_Memcached
{ {

View file

@ -7,7 +7,7 @@
* *
* $Id$ * $Id$
*/ */
require_once "Zend/Cache/Backend/Interface.php"; require_once LS_DKCACHE_PATH."Zend/Cache/Backend/Interface.php";
class Dklab_Cache_Backend_Profiler implements Zend_Cache_Backend_Interface class Dklab_Cache_Backend_Profiler implements Zend_Cache_Backend_Interface
{ {

View file

@ -8,7 +8,7 @@
* *
* $Id$ * $Id$
*/ */
require_once "Zend/Cache/Backend/Interface.php"; require_once LS_DKCACHE_PATH."Zend/Cache/Backend/Interface.php";
class Dklab_Cache_Backend_TagEmuWrapper implements Zend_Cache_Backend_Interface class Dklab_Cache_Backend_TagEmuWrapper implements Zend_Cache_Backend_Interface
{ {

View file

@ -87,12 +87,12 @@ abstract class Zend_Cache
$frontendClass = 'Zend_Cache_' . ($frontend != 'Core' ? 'Frontend_' : '') . $frontend; $frontendClass = 'Zend_Cache_' . ($frontend != 'Core' ? 'Frontend_' : '') . $frontend;
// For perfs reasons, we do not use the Zend_Loader::loadClass() method // For perfs reasons, we do not use the Zend_Loader::loadClass() method
// (security controls are explicit) // (security controls are explicit)
require_once str_replace('_', DIRECTORY_SEPARATOR, $frontendClass) . '.php'; require_once LS_DKCACHE_PATH.str_replace('_', DIRECTORY_SEPARATOR, $frontendClass) . '.php';
} else { } else {
// we use a custom frontend // we use a custom frontend
$frontendClass = 'Zend_Cache_Frontend_' . $frontend; $frontendClass = 'Zend_Cache_Frontend_' . $frontend;
// To avoid security problems in this case, we use Zend_Loader to load the custom class // To avoid security problems in this case, we use Zend_Loader to load the custom class
require_once 'Zend/Loader.php'; require_once LS_DKCACHE_PATH.'Zend/Loader.php';
$file = str_replace('_', DIRECTORY_SEPARATOR, $frontendClass) . '.php'; $file = str_replace('_', DIRECTORY_SEPARATOR, $frontendClass) . '.php';
if (!(Zend_Loader::isReadable($file))) { if (!(Zend_Loader::isReadable($file))) {
self::throwException("file $file not found in include_path"); self::throwException("file $file not found in include_path");
@ -106,12 +106,12 @@ abstract class Zend_Cache
$backendClass = 'Zend_Cache_Backend_' . $backend; $backendClass = 'Zend_Cache_Backend_' . $backend;
// For perfs reasons, we do not use the Zend_Loader::loadClass() method // For perfs reasons, we do not use the Zend_Loader::loadClass() method
// (security controls are explicit) // (security controls are explicit)
require_once str_replace('_', DIRECTORY_SEPARATOR, $backendClass) . '.php'; require_once LS_DKCACHE_PATH.str_replace('_', DIRECTORY_SEPARATOR, $backendClass) . '.php';
} else { } else {
// we use a custom backend // we use a custom backend
$backendClass = 'Zend_Cache_Backend_' . $backend; $backendClass = 'Zend_Cache_Backend_' . $backend;
// To avoid security problems in this case, we use Zend_Loader to load the custom class // To avoid security problems in this case, we use Zend_Loader to load the custom class
require_once 'Zend/Loader.php'; require_once LS_DKCACHE_PATH.'Zend/Loader.php';
$file = str_replace('_', DIRECTORY_SEPARATOR, $backendClass) . '.php'; $file = str_replace('_', DIRECTORY_SEPARATOR, $backendClass) . '.php';
if (!(Zend_Loader::isReadable($file))) { if (!(Zend_Loader::isReadable($file))) {
self::throwException("file $file not found in include_path"); self::throwException("file $file not found in include_path");
@ -137,7 +137,7 @@ abstract class Zend_Cache
public static function throwException($msg) public static function throwException($msg)
{ {
// For perfs reasons, we use this dynamic inclusion // For perfs reasons, we use this dynamic inclusion
require_once 'Zend/Cache/Exception.php'; require_once LS_DKCACHE_PATH.'Zend/Cache/Exception.php';
throw new Zend_Cache_Exception($msg); throw new Zend_Cache_Exception($msg);
} }

View file

@ -188,7 +188,7 @@ class Zend_Cache_Backend
* @see Zend_Loader * @see Zend_Loader
* @see Zend_Log * @see Zend_Log
*/ */
require_once 'Zend/Loader.php'; require_once LS_DKCACHE_PATH.'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Log'); Zend_Loader::loadClass('Zend_Log');
} catch (Zend_Exception $e) { } catch (Zend_Exception $e) {
Zend_Cache::throwException('Logging feature is enabled but the Zend_Log class is not available'); Zend_Cache::throwException('Logging feature is enabled but the Zend_Log class is not available');

View file

@ -23,12 +23,12 @@
/** /**
* @see Zend_Cache_Backend_Interface * @see Zend_Cache_Backend_Interface
*/ */
require_once 'Zend/Cache/Backend/Interface.php'; require_once LS_DKCACHE_PATH.'Zend/Cache/Backend/Interface.php';
/** /**
* @see Zend_Cache_Backend * @see Zend_Cache_Backend
*/ */
require_once 'Zend/Cache/Backend.php'; require_once LS_DKCACHE_PATH.'Zend/Cache/Backend.php';
/** /**

View file

@ -23,12 +23,12 @@
/** /**
* @see Zend_Cache_Backend_Interface * @see Zend_Cache_Backend_Interface
*/ */
require_once 'Zend/Cache/Backend/Interface.php'; require_once LS_DKCACHE_PATH.'Zend/Cache/Backend/Interface.php';
/** /**
* @see Zend_Cache_Backend * @see Zend_Cache_Backend
*/ */
require_once 'Zend/Cache/Backend.php'; require_once LS_DKCACHE_PATH.'Zend/Cache/Backend.php';
/** /**

View file

@ -21,7 +21,7 @@
/** /**
* @see Zend_Exception * @see Zend_Exception
*/ */
require_once 'Zend/Exception.php'; require_once LS_DKCACHE_PATH.'Zend/Exception.php';
/** /**
* @package Zend_Cache * @package Zend_Cache

View file

@ -1,5 +1,4 @@
<?php <?php
if (!defined("PATH_SEPARATOR")) if (!defined("LS_DKCACHE_PATH"))
define("PATH_SEPARATOR", getenv("COMSPEC")? ";" : ":"); define("LS_DKCACHE_PATH", dirname(__FILE__).'/');
ini_set("include_path", ini_get("include_path").PATH_SEPARATOR.dirname(__FILE__));
?> ?>

View file

@ -16,10 +16,10 @@
*/ */
require_once(Config::Get('path.root.engine').'/lib/external/DklabCache/config.php'); require_once(Config::Get('path.root.engine').'/lib/external/DklabCache/config.php');
require_once('Zend/Cache.php'); require_once(LS_DKCACHE_PATH.'Zend/Cache.php');
require_once('Cache/Backend/MemcachedMultiload.php'); require_once(LS_DKCACHE_PATH.'Cache/Backend/MemcachedMultiload.php');
require_once('Cache/Backend/TagEmuWrapper.php'); require_once(LS_DKCACHE_PATH.'Cache/Backend/TagEmuWrapper.php');
require_once('Cache/Backend/Profiler.php'); require_once(LS_DKCACHE_PATH.'Cache/Backend/Profiler.php');
/** /**
* Типы кеширования: file и memory * Типы кеширования: file и memory
@ -63,7 +63,7 @@ class LsCache extends Module {
return false; return false;
} }
if ($this->sCacheType==SYS_CACHE_TYPE_FILE) { if ($this->sCacheType==SYS_CACHE_TYPE_FILE) {
require_once('Zend/Cache/Backend/File.php'); require_once(LS_DKCACHE_PATH.'Zend/Cache/Backend/File.php');
$oCahe = new Zend_Cache_Backend_File( $oCahe = new Zend_Cache_Backend_File(
array( array(
'cache_dir' => Config::Get('sys.cache.dir'), 'cache_dir' => Config::Get('sys.cache.dir'),
@ -76,7 +76,7 @@ class LsCache extends Module {
); );
$this->oBackendCache = new Dklab_Cache_Backend_Profiler($oCahe,array($this,'CalcStats')); $this->oBackendCache = new Dklab_Cache_Backend_Profiler($oCahe,array($this,'CalcStats'));
} elseif ($this->sCacheType==SYS_CACHE_TYPE_MEMORY) { } elseif ($this->sCacheType==SYS_CACHE_TYPE_MEMORY) {
require_once('Zend/Cache/Backend/Memcached.php'); require_once(LS_DKCACHE_PATH.'Zend/Cache/Backend/Memcached.php');
$aConfigMem=Config::Get('memcache'); $aConfigMem=Config::Get('memcache');
$oCahe = new Dklab_Cache_Backend_MemcachedMultiload($aConfigMem); $oCahe = new Dklab_Cache_Backend_MemcachedMultiload($aConfigMem);