From 1abf2f6acc8d6ebf6ead5167576f9a5167f65db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Tue, 18 Jun 2013 10:31:26 +0200 Subject: [PATCH] MDL-39854 fix installer regression caused by new core_component --- admin/cli/install.php | 3 +++ install.php | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/admin/cli/install.php b/admin/cli/install.php index 5578213dc21..684acb5d168 100644 --- a/admin/cli/install.php +++ b/admin/cli/install.php @@ -131,6 +131,8 @@ define('MOODLE_INTERNAL', true); // Disables all caching. define('CACHE_DISABLE_ALL', true); +define('PHPUNIT_TEST', false); + // Check that PHP is of a sufficient version if (version_compare(phpversion(), "5.3.3") < 0) { $phpversion = phpversion(); @@ -160,6 +162,7 @@ $CFG->admin = array_pop($parts); //the problem is that we need specific version of quickforms and hacked excel files :-( ini_set('include_path', $CFG->libdir.'/pear' . PATH_SEPARATOR . ini_get('include_path')); +require_once($CFG->libdir.'/classes/component.php'); require_once($CFG->libdir.'/installlib.php'); require_once($CFG->libdir.'/clilib.php'); require_once($CFG->libdir.'/setuplib.php'); diff --git a/install.php b/install.php index d71e7a58463..ebca5227390 100644 --- a/install.php +++ b/install.php @@ -46,6 +46,7 @@ if (file_exists($configfile)) { define('CLI_SCRIPT', false); // prevents some warnings later define('AJAX_SCRIPT', false); // prevents some warnings later define('CACHE_DISABLE_ALL', true); // Disables caching.. just in case. +define('PHPUNIT_TEST', false); // Servers should define a default timezone in php.ini, but if they don't then make sure something is defined. // This is a quick hack. Ideally we should ask the admin for a value. See MDL-22625 for more on this. @@ -88,7 +89,8 @@ if (PHP_INT_SIZE > 4) { /** Used by library scripts to check they are being called by Moodle */ define('MOODLE_INTERNAL', true); -require dirname(__FILE__).'/lib/installlib.php'; +require_once(__DIR__.'/lib/classes/component.php'); +require_once(__DIR__.'/lib/installlib.php'); // TODO: add lang detection here if empty $_REQUEST['lang']