From 32199f925c5f59f14a4c51db19e602a8a35f3e04 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Thu, 16 Jan 2014 15:55:28 +0800 Subject: [PATCH 1/1] MDL-43724 - hacking to get to installler --- lib/classes/collator.php | 2 +- lib/classes/session/manager.php | 2 +- lib/dml/pgsql_native_moodle_database.php | 10 +++------- lib/setuplib.php | 4 ++++ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/classes/collator.php b/lib/classes/collator.php index 7f5f216..ac08340 100644 --- a/lib/classes/collator.php +++ b/lib/classes/collator.php @@ -82,7 +82,7 @@ class core_collator { // Check for an error code, 0 means no error occurred if ($errorcode !== 0) { // Get the actual locale being used, e.g. en, he, zh - $localeinuse = $collator->getLocale(Locale::ACTUAL_LOCALE); + $localeinuse = $collator->getLocale('en'); // Check for the common fallback warning error codes. If any of the two // following errors occurred, there is normally little to worry about: // * U_USING_FALLBACK_WARNING (-128) indicates that a fall back locale was diff --git a/lib/classes/session/manager.php b/lib/classes/session/manager.php index 314f9ed..22b2a7d 100644 --- a/lib/classes/session/manager.php +++ b/lib/classes/session/manager.php @@ -134,7 +134,7 @@ class manager { } else { $class = '\core\session\file'; } - self::$handler = new $class(); + self::$handler = new \core\session\file; } /** diff --git a/lib/dml/pgsql_native_moodle_database.php b/lib/dml/pgsql_native_moodle_database.php index 5c369a7..b23a913 100644 --- a/lib/dml/pgsql_native_moodle_database.php +++ b/lib/dml/pgsql_native_moodle_database.php @@ -165,10 +165,6 @@ class pgsql_native_moodle_database extends moodle_database { throw new dml_connection_exception($dberr); } - $this->query_start("--pg_set_client_encoding()", null, SQL_QUERY_AUX); - pg_set_client_encoding($this->pgsql, 'utf8'); - $this->query_end(true); - $sql = ''; // Only for 9.0 and upwards, set bytea encoding to old format. if ($this->is_min_version('9.0')) { @@ -413,8 +409,8 @@ class pgsql_native_moodle_database extends moodle_database { if (!$result) { return array(); } - while ($rawcolumn = pg_fetch_object($result)) { - + while ($x = pg_fetch_assoc($result)) { + $rawcolumn = (object) $x; $info = new stdClass(); $info->name = $rawcolumn->field; $matches = null; @@ -616,7 +612,7 @@ class pgsql_native_moodle_database extends moodle_database { if (!$result) { return false; } - $rawcolumn = pg_fetch_object($result); + $rawcolumn = (object) pg_fetch_assoc($result); $encoding = $rawcolumn->server_encoding; pg_free_result($result); diff --git a/lib/setuplib.php b/lib/setuplib.php index 8c61eeb..e6e93f2 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -922,6 +922,10 @@ function setup_get_remote_url() { // built-in PHP Development Server $rurl['fullpath'] = $_SERVER['REQUEST_URI']; + } else if (strpos($_SERVER['SERVER_SOFTWARE'], 'HPHP') === 0) { + // built-in PHP Development Server + $rurl['fullpath'] = $_SERVER['REQUEST_URI']; + } else { throw new moodle_exception('unsupportedwebserver', 'error', '', $_SERVER['SERVER_SOFTWARE']); } -- 1.8.5.3