[feature/dic] Remove cache factory, now handled by DIC

PHPBB3-10739
This commit is contained in:
Igor Wiedler 2012-03-31 20:21:26 +02:00
parent 8e2cbe39cd
commit b12f9a2855
3 changed files with 7 additions and 54 deletions

View file

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

View file

@ -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%]]

View file

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