Index: bugs/include/format-html.php
===================================================================
--- bugs/include/format-html.php (revision 284461)
+++ bugs/include/format-html.php (working copy)
@@ -24,6 +24,9 @@
if (empty($dbh))
{
$dbh = MDB2::factory(PEAR_DATABASE_DSN);
+ if (PEAR::isError($dbh)) {
+ trigger_error($dbh->message." [".$dbh->userinfo."]", E_USER_ERROR);
+ }
$dbh->loadModule('Extended');
}
Index: bugs/include/prepend.inc
===================================================================
--- bugs/include/prepend.inc (revision 284461)
+++ bugs/include/prepend.inc (working copy)
@@ -23,11 +23,16 @@
die('Turn off "magic_quotes_gpc" in php.ini!');
}
-// FIXME: Configuration should be elsewhere!
+// This is required because MDB2 is b0rken
+error_reporting(E_ALL ^E_DEPRECATED);
// CONFIG START
-$site = 'php'; // This can be one of php, pear or pecl.
+// Do not change configuration settings here - these are defaults.
+// Instead crate a file `config_local.php` and override settings therein.
+// This can be one of php, pear or pecl.
+$site = 'php';
+
$site_data = array (
'php' => array (
'url' => 'bugs.php.net',
@@ -35,10 +40,11 @@
'email' => 'php-bugs@lists.php.net',
'security_email' => 'security@php.net',
'db' => 'phpbugsdb',
+ 'db_driver' => 'mysqli',
'db_user' => 'nobody',
'db_pass' => '',
'db_host' => 'localhost',
- 'patch_tmp' => '/tmp/patches/',
+ 'patch_tmp' => '/tmp/patches/',
),
'pear' => array (
'url' => 'pear.php.net',
@@ -46,10 +52,11 @@
'email' => 'pear-bugs@lists.php.net',
'security_email' => 'pear-group@php.net',
'db' => 'pear',
+ 'db_driver' => 'mysqli',
'db_user' => 'nobody',
'db_pass' => '',
'db_host' => 'localhost',
- 'patch_tmp' => '/tmp/patches/',
+ 'patch_tmp' => '/tmp/patches/',
),
'pecl' => array (
'url' => 'pecl.php.net',
@@ -57,13 +64,19 @@
'email' => 'pecl-bugs@lists.php.net',
'security_email' => 'security@php.net',
'db' => 'pear',
+ 'db_driver' => 'mysqli',
'db_user' => 'nobody',
'db_pass' => '',
'db_host' => 'localhost',
- 'patch_tmp' => '/tmp/patches/',
+ 'patch_tmp' => '/tmp/patches/',
),
);
+// load config
+if (is_file(dirname(__FILE__).'/config_local.php')) {
+ require_once(dirname(__FILE__).'/config_local.php');
+}
+
define('DEVBOX', true);
if (!defined('PEAR_CHANNELNAME'))
@@ -81,7 +94,7 @@
$main_include_path = realpath(dirname(__FILE__).'/../');
$templates_path = realpath(dirname(__FILE__).'/../../');
define('BUG_PATCHTRACKER_TMPDIR', $site_data[$site]['patch_tmp']);
-define('PEAR_DATABASE_DSN', "mysqli://{$site_data[$site]['db_user']}:{$site_data[$site]['db_pass']}@{$site_data[$site]['db_host']}/{$site_data[$site]['db']}");
+define('PEAR_DATABASE_DSN', "{$site_data[$site]['db_driver']}://{$site_data[$site]['db_user']}:{$site_data[$site]['db_pass']}@{$site_data[$site]['db_host']}/{$site_data[$site]['db']}");
// Last Updated..
$tmp = filectime($_SERVER['SCRIPT_FILENAME']);