aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-03-31 20:21:26 +0200
committerIgor Wiedler <igor@wiedler.ch>2012-03-31 20:21:26 +0200
commitb12f9a285546641415d9ea2dd9e3a3dba6527d1a (patch)
tree3a7f4a4e6114db33613782079822cc035ecbb8e0
parent8e2cbe39cdd7672638dbc0d6a0f65a7365db0d91 (diff)
downloadforums-b12f9a285546641415d9ea2dd9e3a3dba6527d1a.tar
forums-b12f9a285546641415d9ea2dd9e3a3dba6527d1a.tar.gz
forums-b12f9a285546641415d9ea2dd9e3a3dba6527d1a.tar.bz2
forums-b12f9a285546641415d9ea2dd9e3a3dba6527d1a.tar.xz
forums-b12f9a285546641415d9ea2dd9e3a3dba6527d1a.zip
[feature/dic] Remove cache factory, now handled by DIC
PHPBB3-10739
-rw-r--r--phpBB/config/parameters.yml4
-rw-r--r--phpBB/config/services.yml15
-rw-r--r--phpBB/includes/cache/factory.php42
3 files changed, 7 insertions, 54 deletions
diff --git a/phpBB/config/parameters.yml b/phpBB/config/parameters.yml
index 8a90c8e99d..da29ae8417 100644
--- a/phpBB/config/parameters.yml
+++ b/phpBB/config/parameters.yml
@@ -1,6 +1,6 @@
parameters:
- cache.acm_type: file
- dbal.driver: dbal_mysqli
+ cache.driver.class: phpbb_cache_driver_file
+ dbal.driver.class: dbal_mysqli
dbal.dbhost:
dbal.dbuser: root
dbal.dbpasswd:
diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml
index 2bf8478f82..09eb993ca6 100644
--- a/phpBB/config/services.yml
+++ b/phpBB/config/services.yml
@@ -1,18 +1,13 @@
services:
- cache_factory:
- class: phpbb_cache_factory
- arguments:
- - %cache.acm_type%
-
cache:
class: phpbb_cache_service
- factory_service: cache_factory
- factory_method: get_service
+ arguments:
+ - @cache.driver
cache.driver:
class: phpbb_cache_driver_interface
- factory_service: cache
- factory_method: get_driver
+ arguments:
+ - %cache.driver.class%
dispatcher:
class: phpbb_event_dispatcher
@@ -27,7 +22,7 @@ services:
class: phpbb_auth
dbal.conn:
- class: %dbal.driver%
+ class: %dbal.driver.class%
calls:
- [sql_connect, [%dbal.dbhost%, %dbal.dbuser%, %dbal.dbpasswd%, %dbal.dbname%, %dbal.dbport%, false, %dbal.new_link%]]
diff --git a/phpBB/includes/cache/factory.php b/phpBB/includes/cache/factory.php
deleted file mode 100644
index 01c4d0b901..0000000000
--- a/phpBB/includes/cache/factory.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
-*
-* @package acm
-* @copyright (c) 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* @package acm
-*/
-class phpbb_cache_factory
-{
- private $acm_type;
-
- public function __construct($acm_type)
- {
- $this->acm_type = $acm_type;
- }
-
- public function get_driver()
- {
- $class_name = 'phpbb_cache_driver_' . $this->acm_type;
- return new $class_name();
- }
-
- public function get_service()
- {
- $driver = $this->get_driver();
- $service = new phpbb_cache_service($driver);
- return $service;
- }
-}