mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/11015] Allow full dbms class name in config.php
PHPBB3-11015
This commit is contained in:
parent
0d4a289778
commit
fc5385c2a5
1 changed files with 22 additions and 6 deletions
|
@ -43,8 +43,8 @@ class phpbb_di_extension_config extends Extension
|
||||||
require($this->config_file);
|
require($this->config_file);
|
||||||
|
|
||||||
$container->setParameter('core.table_prefix', $table_prefix);
|
$container->setParameter('core.table_prefix', $table_prefix);
|
||||||
$container->setParameter('cache.driver.class', $this->fix_acm_type($acm_type));
|
$container->setParameter('cache.driver.class', $this->convert_30_acm_type($acm_type));
|
||||||
$container->setParameter('dbal.driver.class', 'phpbb_db_driver_'.$dbms);
|
$container->setParameter('dbal.driver.class', $this->convert_30_dbms($dbms));
|
||||||
$container->setParameter('dbal.dbhost', $dbhost);
|
$container->setParameter('dbal.dbhost', $dbhost);
|
||||||
$container->setParameter('dbal.dbuser', $dbuser);
|
$container->setParameter('dbal.dbuser', $dbuser);
|
||||||
$container->setParameter('dbal.dbpasswd', $dbpasswd);
|
$container->setParameter('dbal.dbpasswd', $dbpasswd);
|
||||||
|
@ -66,12 +66,12 @@ class phpbb_di_extension_config extends Extension
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert old (3.0) values to 3.1 class names
|
* Convert 3.0 ACM type to 3.1 cache driver class name
|
||||||
*
|
*
|
||||||
* @param style $acm_type ACM type
|
* @param string $acm_type ACM type
|
||||||
* @return ACM type class
|
* @return cache driver class
|
||||||
*/
|
*/
|
||||||
protected function fix_acm_type($acm_type)
|
protected function convert_30_acm_type($acm_type)
|
||||||
{
|
{
|
||||||
if (preg_match('#^[a-z]+$#', $acm_type))
|
if (preg_match('#^[a-z]+$#', $acm_type))
|
||||||
{
|
{
|
||||||
|
@ -80,4 +80,20 @@ class phpbb_di_extension_config extends Extension
|
||||||
|
|
||||||
return $acm_type;
|
return $acm_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert 3.0 dbms to 3.1 db driver class name
|
||||||
|
*
|
||||||
|
* @param string $dbms dbms parameter
|
||||||
|
* @return db driver class
|
||||||
|
*/
|
||||||
|
protected function convert_30_dbms($dbms)
|
||||||
|
{
|
||||||
|
if (!preg_match('#^phpbb_db_driver_#', $dbms))
|
||||||
|
{
|
||||||
|
return 'phpbb_db_driver_'.$dbms;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $dbms;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue