aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/class_loader.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2010-11-03 18:35:31 +0100
committerIgor Wiedler <igor@wiedler.ch>2011-01-09 23:49:35 +0100
commit9329b16ab13f3a4caf107df358c3c58bda2dcd8a (patch)
tree0b5faa7111c792565062c93b1c1a44eda50d4664 /phpBB/includes/class_loader.php
parent36e95f939db9b88b8519d956120d161102184ccb (diff)
downloadforums-9329b16ab13f3a4caf107df358c3c58bda2dcd8a.tar
forums-9329b16ab13f3a4caf107df358c3c58bda2dcd8a.tar.gz
forums-9329b16ab13f3a4caf107df358c3c58bda2dcd8a.tar.bz2
forums-9329b16ab13f3a4caf107df358c3c58bda2dcd8a.tar.xz
forums-9329b16ab13f3a4caf107df358c3c58bda2dcd8a.zip
[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
Diffstat (limited to 'phpBB/includes/class_loader.php')
-rw-r--r--phpBB/includes/class_loader.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/phpBB/includes/class_loader.php b/phpBB/includes/class_loader.php
index 5df654799a..fa121341aa 100644
--- a/phpBB/includes/class_loader.php
+++ b/phpBB/includes/class_loader.php
@@ -33,7 +33,7 @@ class phpbb_class_loader
{
private $phpbb_root_path;
private $php_ext;
- private $cache;
+ private $acm;
private $cached_paths = array();
/**
@@ -42,13 +42,14 @@ class phpbb_class_loader
*
* @param string $phpbb_root_path phpBB's root directory containing includes/
* @param string $php_ext The file extension for PHP files
+ * @param phpbb_acm_interface $acm An implementation of the phpBB cache interface.
*/
- public function __construct($phpbb_root_path, $php_ext = '.php', $cache = null)
+ public function __construct($phpbb_root_path, $php_ext = '.php', phpbb_cache_driver_interface $acm = null)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
- $this->set_cache($cache);
+ $this->set_acm($acm);
}
/**
@@ -56,13 +57,13 @@ class phpbb_class_loader
* the class loader will resolve paths by checking for the existance of every
* directory in the class name every time.
*
- * @param acm $cache An implementation of the phpBB cache interface.
+ * @param phpbb_acm_interface $acm An implementation of the phpBB cache interface.
*/
- public function set_cache($cache = null)
+ public function set_acm(phpbb_cache_driver_interface $acm = null)
{
- if ($cache)
+ if ($acm)
{
- $this->cached_paths = $cache->get('class_loader');
+ $this->cached_paths = $acm->get('class_loader');
if ($this->cached_paths === false)
{
@@ -70,7 +71,7 @@ class phpbb_class_loader
}
}
- $this->cache = $cache;
+ $this->acm = $acm;
}
/**
@@ -133,10 +134,10 @@ class phpbb_class_loader
return false;
}
- if ($this->cache)
+ if ($this->acm)
{
$this->cached_paths[$class] = $relative_path;
- $this->cache->put('class_loader', $this->cached_paths);
+ $this->acm->put('class_loader', $this->cached_paths);
}
return $path_prefix . $relative_path . $this->php_ext;