mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/dic] Remove cache factory, now handled by DIC
PHPBB3-10739
This commit is contained in:
parent
8e2cbe39cd
commit
b12f9a2855
3 changed files with 7 additions and 54 deletions
|
@ -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:
|
||||
|
|
|
@ -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%]]
|
||||
|
||||
|
|
42
phpBB/includes/cache/factory.php
vendored
42
phpBB/includes/cache/factory.php
vendored
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue