0

is there any way working with Phpfox without memcache service? because i am using hostgator shared server, where as shared server which does not provide any memcache service its only available in dedicated servers only.

I am using Phpfox1.5 is previously hosted in amazon server where mecache service available but its very costly for me so i want to change my site from amazon to hostgator hosting service.

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

Spontifixus
  • 6,570
  • 9
  • 45
  • 63
user2089985
  • 125
  • 1
  • 10

1 Answers1

1

Sure, just include a file with this class on top of it:

<?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;
    }
}

?>

Note: the code isn't mine, and it is licensed under the BSD license. Original author: link

Tom van der Woerdt
  • 29,532
  • 7
  • 72
  • 105