1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

i am not sure if people will like the config layout i test here... it requires the framework at least being present

git-svn-id: file:///svn/phpbb/trunk@9281 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2009-01-20 16:54:15 +00:00
parent b55f9854e7
commit cd4091af43
19 changed files with 154 additions and 219 deletions

View File

@@ -81,7 +81,24 @@ abstract class phpbb
* @var array The phpBB configuration array
*/
public static $config = array();
/**#@-*/
/**
* @var array The base configuration array
*/
public static $base_config = array(
'table_prefix' => 'phpbb_',
'admin_folder' => 'adm',
'acm_type' => 'file',
'config_set' => false,
'extensions_set' => false,
'memory_usage' => 0,
'debug' => false,
'debug_extra' => false,
'installed' => false,
);
/**#@+
* Permission constant
@@ -144,6 +161,33 @@ abstract class phpbb
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
/**
* Set base configuration - called from config.php file
*/
public static function set_config($config)
{
phpbb::$base_config = array_merge(phpbb::$base_config, $config);
phpbb::$base_config['config_set'] = true;
if (phpbb::$base_config['debug_extra'] && function_exists('memory_get_usage'))
{
phpbb::$base_config['memory_usage'] = memory_get_usage();
}
// Load Extensions
if (!empty(phpbb::$base_config['extensions']) && !phpbb::$base_config['extensions_set'])
{
$load_extensions = explode(',', phpbb::$base_config['extensions']);
foreach ($load_extensions as $extension)
{
@dl(trim($extension));
}
phpbb::$base_config['extensions_set'] = true;
}
}
/**
* Get instance of static property
*