0

memcache サービスなしで Phpfox を使用する方法はありますか? 私はhostgator共有サーバーを使用しているため、memcacheサービスを提供しない共有サーバーは専用サーバーでのみ利用可能です。

私は Phpfox1.5 を使用していますが、以前は mecache サービスが利用可能な Amazon サーバーでホストされていましたが、非常にコストがかかるため、サイトを Amazon から Hostgator ホスティング サービスに変更したいと考えています。

致命的なエラー: 64 行目の /home/latisse/public_html/spicypeeps.com/include/library/phpfox/cache/storage/memcache.class.php にクラス 'Memcache' が見つかりません

4

1 に答える 1

1

もちろん、このクラスを含むファイルをその上に含めるだけです。

<?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 ライセンスの下でライセンスされています。原作者:リンク

于 2013-04-24T12:01:30.093 に答える