Ignore:
Timestamp:
May 2, 2016, 12:09:23 PM (3 years ago)
Author:
jrpelegrina
Message:

Updated to moodle 3.0.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • moodle/trunk/fuentes/lib/classes/component.php

    r136 r1331  
    101101            $debugging = "Class '%s' has been renamed for the autoloader and is now deprecated. Please use '%s' instead.";
    102102            debugging(sprintf($debugging, $classname, $newclassname), DEBUG_DEVELOPER);
     103            if (PHP_VERSION_ID >= 70000 && preg_match('#\\\null(\\\|$)#', $classname)) {
     104                throw new \coding_exception("Cannot alias $classname to $newclassname");
     105            }
    103106            class_alias($newclassname, $classname);
    104107            return;
     
    349352            'calendar'    => $CFG->dirroot.'/calendar',
    350353            'cohort'      => $CFG->dirroot.'/cohort',
    351             'completion'  => null,
     354            'comment'     => $CFG->dirroot.'/comment',
     355            'completion'  => $CFG->dirroot.'/completion',
    352356            'countries'   => null,
    353357            'course'      => $CFG->dirroot.'/course',
     
    648652        }
    649653
     654        if (!is_readable($fulldir)) {
     655            // TODO: MDL-51711 We should generate some diagnostic debugging information in this case
     656            // because its pretty likely to lead to a missing class error further down the line.
     657            // But our early setup code can't handle errors this early at the moment.
     658            return;
     659        }
     660
    650661        $items = new \DirectoryIterator($fulldir);
    651662        foreach ($items as $item) {
     
    707718    protected static function load_psr_classes($basedir, $subdir = null) {
    708719        if ($subdir) {
    709             $fulldir = implode(DIRECTORY_SEPARATOR, array($basedir, $subdir));
    710             $classnameprefix = preg_replace('/\//', '_', $subdir);
     720            $fulldir = realpath($basedir . DIRECTORY_SEPARATOR . $subdir);
     721            $classnameprefix = preg_replace('#' . preg_quote(DIRECTORY_SEPARATOR) . '#', '_', $subdir);
    711722        } else {
    712723            $fulldir = $basedir;
    713724        }
    714         if (!is_dir($fulldir)) {
     725        if (!$fulldir || !is_dir($fulldir)) {
    715726            return;
    716727        }
     
    11021113                $plugin->version = null;
    11031114                $module = $plugin;
    1104                 @include($fullplug.'/version.php');
     1115                include($fullplug.'/version.php');
    11051116                $versions[$type.'_'.$plug] = $plugin->version;
    11061117            }
Note: See TracChangeset for help on using the changeset viewer.