| +----------------------------------------------------------------------+ */ $VERSION='$Id: memcache.php,v 1.1.2.3 2008/08/28 18:07:54 mikl Exp $'; define('DATE_FORMAT', 'Y/m/d H:i:s'); define('GRAPH_SIZE', 200); define('MAX_ITEM_DUMP', 50); // Allow local configuration: change local values in (this file).local.php $file = $_SERVER['SCRIPT_FILENAME']; $local = preg_replace('/(.*)(\.php)$/', '$1.local$2', $file); if (is_readable($local)) { // echo "
Loading local config from $local
"; require $local; } if (!defined('ADMIN_USERNAME')) { define('ADMIN_USERNAME', 'memcache'); } if (!defined('ADMIN_PASSWORD')) { define('ADMIN_PASSWORD', 'password'); } if (empty($MEMCACHE_SERVERS)) { $MEMCACHE_SERVERS[] = 'mymemcache-server1:11211'; // add more as an array $MEMCACHE_SERVERS[] = 'mymemcache-server2:11211'; // add more as an array } ////////// END OF DEFAULT CONFIG AREA ///////////////////////////////////////////////////////////// ///////////////// Password protect //////////////////////////////////////////////////////////////// if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] != ADMIN_USERNAME ||$_SERVER['PHP_AUTH_PW'] != ADMIN_PASSWORD) { Header("WWW-Authenticate: Basic realm=\"Memcache Login\""); Header("HTTP/1.0 401 Unauthorized"); echo <<