2024-05-08 17:00:16 +02:00
|
|
|
<?php
|
2024-05-09 12:01:42 +02:00
|
|
|
/* memcached and php-memcached must be installed */
|
2024-05-08 17:00:16 +02:00
|
|
|
|
|
|
|
$enable_memcache = false;
|
|
|
|
|
|
|
|
if(!$enable_memcache) {
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Server & port details
|
|
|
|
$server = '127.0.0.1';
|
|
|
|
$port = 11211;
|
|
|
|
|
2024-05-08 23:01:21 +02:00
|
|
|
// Log all hits
|
|
|
|
$enable_memcache_logging = false;
|
|
|
|
|
|
|
|
// Time in seconds to cache data
|
|
|
|
$memcache_ttl = 14400;
|
|
|
|
|
2024-05-08 17:00:16 +02:00
|
|
|
/* PLEASE DO NOT EDIT BELOW THIS LINE */
|
|
|
|
|
|
|
|
// Initiate a new object of memcache
|
|
|
|
$memcacheD = new Memcached();
|
|
|
|
|
|
|
|
// Add server
|
|
|
|
if ($memcacheD->addServer($server, $port)) {
|
|
|
|
// file_put_contents($logdir . '/debug.log', "\n".format_log_date() . ' Added memcache ' .$server . ':' . $port, FILE_APPEND);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
file_put_contents($logdir . '/debug.log', "\n".format_log_date() . ' Failed to add memcache ' .$server . ':' . $port, FILE_APPEND);
|
|
|
|
}
|
|
|
|
|