aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/core
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-01-20 16:54:15 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-01-20 16:54:15 +0000
commitcd4091af43fa2d7d3dbe5ad0d583c63f1d96c903 (patch)
treeb60c6980ad85e4a8daf48a10c3ab9e2efa4f29c2 /phpBB/includes/core
parentb55f9854e770ba7c37e0e1914c8570c856cbecf3 (diff)
downloadforums-cd4091af43fa2d7d3dbe5ad0d583c63f1d96c903.tar
forums-cd4091af43fa2d7d3dbe5ad0d583c63f1d96c903.tar.gz
forums-cd4091af43fa2d7d3dbe5ad0d583c63f1d96c903.tar.bz2
forums-cd4091af43fa2d7d3dbe5ad0d583c63f1d96c903.tar.xz
forums-cd4091af43fa2d7d3dbe5ad0d583c63f1d96c903.zip
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
Diffstat (limited to 'phpBB/includes/core')
-rw-r--r--phpBB/includes/core/bootstrap.php32
-rw-r--r--phpBB/includes/core/core.php46
2 files changed, 46 insertions, 32 deletions
diff --git a/phpBB/includes/core/bootstrap.php b/phpBB/includes/core/bootstrap.php
index 4d604dadcc..0a4910b052 100644
--- a/phpBB/includes/core/bootstrap.php
+++ b/phpBB/includes/core/bootstrap.php
@@ -61,44 +61,14 @@ if (defined('IN_CRON'))
// Set some default configuration parameter if the config file does not exist
if (!file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT))
{
- define('CONFIG_ADM_FOLDER', 'adm');
- define('CONFIG_ACM_TYPE', 'file');
-
+ // phpbb::$base_config['config_set'] = false
// This allows common.php or an installation script to do specific actions if the configuration is missing
- define('PHPBB_CONFIG_MISSING', true);
}
else
{
require PHPBB_ROOT_PATH . 'config.' . PHP_EXT;
}
-// Set default configuration variables if phpBB is not installed
-if (!defined('PHPBB_INSTALLED'))
-{
- $dbms = $dbhost = $dbport = $dbname = $dbuser = $dbpasswd = '';
- $table_prefix = 'phpbb_';
-}
-
-if (defined('DEBUG_EXTRA'))
-{
- $base_memory_usage = 0;
- if (function_exists('memory_get_usage'))
- {
- $base_memory_usage = memory_get_usage();
- }
-}
-
-// Load Extensions
-if (!empty($load_extensions))
-{
- $load_extensions = explode(',', $load_extensions);
-
- foreach ($load_extensions as $extension)
- {
- @dl(trim($extension));
- }
-}
-
// Register autoload function
spl_autoload_register('__phpbb_autoload');
diff --git a/phpBB/includes/core/core.php b/phpBB/includes/core/core.php
index 717ff0d4a2..09b6365da2 100644
--- a/phpBB/includes/core/core.php
+++ b/phpBB/includes/core/core.php
@@ -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
@@ -145,6 +162,33 @@ abstract class phpbb
}
/**
+ * 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
*
* @param string $variable The name of the instance to retrieve.