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:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user