1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-07 16:15:22 +02:00

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
This commit is contained in:
Chris Smith 2009-06-04 15:37:53 +00:00
parent 710604caa3
commit cd1c5de3a5
5 changed files with 20 additions and 10 deletions

View File

@ -28,6 +28,8 @@ if (!class_exists('acm_memory'))
*/
class acm extends acm_memory
{
var $extension = 'apc';
function acm()
{
// Call the parent constructor

View File

@ -29,6 +29,8 @@ if (!class_exists('acm_memory'))
*/
class acm extends acm_memory
{
var $extension = 'eaccelerator';
var $serialize_header = '#phpbb-serialized#';
function acm()

View File

@ -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;

View File

@ -37,6 +37,13 @@ class acm_memory
global $phpbb_root_path;
$this->cache_dir = $phpbb_root_path . 'cache/';
if (!isset($this->extension) || !extension_loaded($this->extension))
{
global $acm_type;
trigger_error("Could not find required extension [{$this->extension}] for the ACM module $acm_type.", E_USER_ERROR);
}
}
/**

View File

@ -28,6 +28,8 @@ if (!class_exists('acm_memory'))
*/
class acm extends acm_memory
{
var $extension = 'xcache';
function acm()
{
// Call the parent constructor