diff --git a/public/include/autoloader.inc.php b/public/include/autoloader.inc.php index c81a4812..f04988c2 100644 --- a/public/include/autoloader.inc.php +++ b/public/include/autoloader.inc.php @@ -17,6 +17,7 @@ require_once(INCLUDE_DIR . '/config/error_codes.inc.php'); require_once(CLASS_DIR . '/base.class.php'); require_once(CLASS_DIR . '/coins/coin_base.class.php'); require_once(CLASS_DIR . '/setting.class.php'); +if (PHP_OS == 'WINNT') require_once(CLASS_DIR . '/memcached.class.php'); // Now decide on which coin class to load and instantiate if (file_exists(CLASS_DIR . '/coins/coin_' . $config['algorithm'] . '.class.php')) { diff --git a/public/index.php b/public/index.php index b1d1d60a..4665a0a6 100644 --- a/public/index.php +++ b/public/index.php @@ -43,14 +43,8 @@ include_once('include/bootstrap.php'); $hts = ($config['https_only'] && (!empty($_SERVER['QUERY_STRING']))) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']."?".$_SERVER['QUERY_STRING'] : "https://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']; ($config['https_only'] && @!$_SERVER['HTTPS']) ? exit(header("Location: ".$hts)):0; -// Rate limiting +// Rate limiting, we use our initilized memcache from bootstrap/autoloader if ($config['memcache']['enabled'] && $config['mc_antidos']['enabled']) { - if (PHP_OS == 'WINNT') { - require_once(CLASS_DIR . '/memcached.class.php'); - } - // memcache antidos needs a memcache handle - $memcache = new Memcached(); - $memcache->addServer($config['memcache']['host'], $config['memcache']['port']); require_once(CLASS_DIR . '/memcache_ad.class.php'); $skip_check = false; // if this is an api call we need to be careful not to time them out for those calls separately