From 9329b16ab13f3a4caf107df358c3c58bda2dcd8a Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Wed, 3 Nov 2010 18:35:31 +0100 Subject: [task/acm-refactor] Refactor the ACM classes to have a common interface. They are now refered to as cache drivers rather than ACM classes. The additional utility functions from the original cache class have been moved to the cache_service. The class loader is now instantiated without a cache instance and passed one as soon as it is constructed to allow autoloading the cache classes. PHPBB3-9983 --- phpBB/common.php | 12 +- phpBB/docs/coding-guidelines.html | 2 +- phpBB/download/file.php | 12 +- phpBB/includes/acm/acm_apc.php | 82 --- phpBB/includes/acm/acm_eaccelerator.php | 119 ----- phpBB/includes/acm/acm_file.php | 730 --------------------------- phpBB/includes/acm/acm_memcache.php | 136 ----- phpBB/includes/acm/acm_memory.php | 437 ---------------- phpBB/includes/acm/acm_null.php | 154 ------ phpBB/includes/acm/acm_xcache.php | 119 ----- phpBB/includes/cache.php | 435 ---------------- phpBB/includes/cache/driver/apc.php | 76 +++ phpBB/includes/cache/driver/base.php | 24 + phpBB/includes/cache/driver/eaccelerator.php | 113 +++++ phpBB/includes/cache/driver/file.php | 730 +++++++++++++++++++++++++++ phpBB/includes/cache/driver/interface.php | 104 ++++ phpBB/includes/cache/driver/memcache.php | 130 +++++ phpBB/includes/cache/driver/memory.php | 437 ++++++++++++++++ phpBB/includes/cache/driver/null.php | 154 ++++++ phpBB/includes/cache/driver/xcache.php | 113 +++++ phpBB/includes/cache/factory.php | 52 ++ phpBB/includes/cache/service.php | 452 +++++++++++++++++ phpBB/includes/class_loader.php | 21 +- phpBB/install/database_update.php | 11 +- phpBB/install/index.php | 7 +- phpBB/style.php | 15 +- 26 files changed, 2430 insertions(+), 2247 deletions(-) delete mode 100644 phpBB/includes/acm/acm_apc.php delete mode 100644 phpBB/includes/acm/acm_eaccelerator.php delete mode 100644 phpBB/includes/acm/acm_file.php delete mode 100644 phpBB/includes/acm/acm_memcache.php delete mode 100644 phpBB/includes/acm/acm_memory.php delete mode 100644 phpBB/includes/acm/acm_null.php delete mode 100644 phpBB/includes/acm/acm_xcache.php delete mode 100644 phpBB/includes/cache.php create mode 100644 phpBB/includes/cache/driver/apc.php create mode 100644 phpBB/includes/cache/driver/base.php create mode 100644 phpBB/includes/cache/driver/eaccelerator.php create mode 100644 phpBB/includes/cache/driver/file.php create mode 100644 phpBB/includes/cache/driver/interface.php create mode 100644 phpBB/includes/cache/driver/memcache.php create mode 100644 phpBB/includes/cache/driver/memory.php create mode 100644 phpBB/includes/cache/driver/null.php create mode 100644 phpBB/includes/cache/driver/xcache.php create mode 100644 phpBB/includes/cache/factory.php create mode 100644 phpBB/includes/cache/service.php (limited to 'phpBB') diff --git a/phpBB/common.php b/phpBB/common.php index 96b782a229..fc6009eb21 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -187,8 +187,6 @@ if (!empty($load_extensions) && function_exists('dl')) // Include files require($phpbb_root_path . 'includes/class_loader.' . $phpEx); -require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx); -require($phpbb_root_path . 'includes/cache.' . $phpEx); require($phpbb_root_path . 'includes/template.' . $phpEx); require($phpbb_root_path . 'includes/session.' . $phpEx); require($phpbb_root_path . 'includes/auth.' . $phpEx); @@ -203,13 +201,15 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); // Set PHP error handler to ours set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); -// Cache must be loaded before class loader -$cache = new cache(); - // Setup class loader first -$class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx, $cache); +$class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx); $class_loader->register(); +// set up caching +$acm = phpbb_cache_factory::create($acm_type)->get_acm(); +$class_loader->set_acm($acm); +$cache = new phpbb_cache_service($acm); + // Instantiate some basic classes $request = new phpbb_request(); $user = new user(); diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 766242ab83..c0ebb7450e 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -203,7 +203,7 @@ class ...