2013-04-24 56 views
0

有沒有辦法與Phpfox沒有memcache服務?因爲我使用的是hostgator共享服務器,其中共享服務器不提供任何memcache服務,只能在專用服務器上使用。phpfox沒有工作沒有memcache支持?

我正在使用Phpfox1.5以前託管在亞馬遜服務器,其中提供mecache服務,但它非常昂貴,所以我想從亞馬遜更改我的網站hostgator託管服務。

Fatal error: Class 'Memcache' not found in /home/latisse/public_html/spicypeeps.com/include/library/phpfox/cache/storage/memcache.class.php on line 64

回答

1

當然,僅僅包括在它的上面有this class文件:

<?php 
// Dummy Memcache for a development environment where Memcache is not installed. Part of mmvc library, https://github.com/kajala/mmvc 
// Dependencies: none 

//if (defined('MEMCACHE_COMPRESSED')) 
// die("Memcache seems to be already installed, MemcacheDummy.php should never be included in this case\n"); 

define('MEMCACHE_COMPRESSED', 1234); // dummy value 

/** 
* Dummy Memcache class for a development environment where Memcache is not installed. 
* Note that this class does not do ANYTHING and it is only a convenience for 
* the development environment and should never be used in production server. 
*/ 
class Memcache 
{ 
    function __construct() 
    { 
    } 

    function connect($host, $port) 
    { 
     assert(is_string($host)); 
     assert(is_numeric($port)); 
     return true; 
    } 

    function set($key, $obj, $compressed=false, $expires=0) 
    { 
     assert(is_string($key)); 
     assert($compressed === false || $compressed == MEMCACHE_COMPRESSED); 
     assert(is_numeric($expires)); 
     return true; 
    } 

    function get($key) 
    { 
     assert(is_string($key) || is_array($key)); 
     return false; 
    } 
} 

?> 

注:該代碼是不是我的,它是在BSD許可證下授權。原作者:link

+0

我需要爲生產環境這幫助我 – user2089985 2013-04-24 12:06:02

+1

它會在生產環境中工作,但你應該只安裝內存緩存。 – 2013-04-24 12:09:21

+0

我沒有機會安裝memcache共享主機hostgator帳戶,他告訴他們不能爲共享主機提供memcache服務? – user2089985 2013-04-24 12:13:31