Skip to content

Commit

Permalink
MDL-31501 session: fixed missing autoloader during install
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Sep 23, 2013
1 parent d99847a commit 98d696b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions admin/cli/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@
require_once($CFG->libdir.'/componentlib.class.php');
require_once($CFG->dirroot.'/cache/lib.php');

// Register our classloader, in theory somebody might want to replace it to load other hacked core classes.
// Required because the database checks below lead to session interaction which is going to lead us to requiring autoloaded classes.
if (defined('COMPONENT_CLASSLOADER')) {
spl_autoload_register(COMPONENT_CLASSLOADER);
} else {
spl_autoload_register('core_component::classloader');
}

require($CFG->dirroot.'/version.php');
$CFG->target_release = $release;

Expand Down
8 changes: 8 additions & 0 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@
//point zend include path to moodles lib/zend so that includes and requires will search there for files before anywhere else
ini_set('include_path', $CFG->libdir.'/zend' . PATH_SEPARATOR . ini_get('include_path'));

// Register our classloader, in theory somebody might want to replace it to load other hacked core classes.
// Required because the database checks below lead to session interaction which is going to lead us to requiring autoloaded classes.
if (defined('COMPONENT_CLASSLOADER')) {
spl_autoload_register(COMPONENT_CLASSLOADER);
} else {
spl_autoload_register('core_component::classloader');
}

require('version.php');
$CFG->target_release = $release;

Expand Down

0 comments on commit 98d696b

Please sign in to comment.