From cd1c5de3a508ec851b11baf4095449c66ee6c770 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Thu, 4 Jun 2009 15:37:53 +0000 Subject: Finished I hope, appropriate errors when modules are missing. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9540 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acm/acm_memcache.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'phpBB/includes/acm/acm_memcache.php') diff --git a/phpBB/includes/acm/acm_memcache.php b/phpBB/includes/acm/acm_memcache.php index 1ec37f1b3b..0544d23996 100644 --- a/phpBB/includes/acm/acm_memcache.php +++ b/phpBB/includes/acm/acm_memcache.php @@ -16,16 +16,6 @@ if (!defined('IN_PHPBB')) exit; } -if (!extension_loaded('memcache') || !defined('PHPBB_ACM_MEMCACHE_HOST')) -{ - // Memcached will not work, include the null ACM at least the - // board will still work. - // @todo Could change this for a simple error though. - require("${phpbb_root_path}includes/acm/acm_null.$phpEx"); - - return; -} - // Include the abstract base if (!class_exists('acm_memory')) { @@ -48,6 +38,8 @@ if (!defined('PHPBB_ACM_MEMCACHE_COMPRESS')) */ class acm extends acm_memory { + var $extension = 'memcache'; + var $memcache; var $flags = 0; @@ -56,6 +48,11 @@ class acm extends acm_memory // Call the parent constructor parent::acm_memory(); + if (!defined('PHPBB_ACM_MEMCACHE_HOST')) + { + trigger_error('Missing required constant [PHPBB_ACM_MEMCACHE_HOST] for memcache ACM module.', E_USER_ERROR); + } + $this->memcache = new Memcache; $this->memcache->connect(PHPBB_ACM_MEMCACHE_HOST, PHPBB_ACM_MEMCACHE_PORT); $this->flags = (PHPBB_ACM_MEMCACHE_COMPRESS) ? MEMCACHE_COMPRESSED : 0; -- cgit v1.2.1