Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('CLI_SCRIPT', 1);
- require('config.php');
- // From core_component::$psr0namespaces
- $psr0 = [
- 'Horde' => $CFG->libdir . '/horde/framework/Horde/',
- 'Mustache' => $CFG->libdir . '/mustache/src/Mustache/',
- ];
- // From core_component::$psr4namespaces
- $psr4 = [
- 'MaxMind\\' => $CFG->libdir . '/maxmind/MaxMind/',
- 'GeoIp2\\' => $CFG->libdir . '/maxmind/GeoIp2/',
- 'Sabberworm\\CSS\\' => $CFG->libdir . '/php-css-parser/',
- 'MoodleHQ\\RTLCSS\\' => $CFG->libdir . '/rtlcss/',
- 'Leafo\\ScssPhp\\' => $CFG->libdir . '/scssphp/',
- 'Box\\Spout\\' => $CFG->libdir . '/spout/src/Spout/',
- 'MatthiasMullie\\Minify\\' => $CFG->libdir . '/minify/matthiasmullie-minify/src//',
- 'MatthiasMullie\\PathConverter\\' => $CFG->libdir . '/minify/matthiasmullie-pathconverter/src/',
- 'IMSGlobal\LTI\\' => $CFG->libdir . '/ltiprovider/src/',
- 'Phpml\\' => $CFG->libdir . '/mlbackend/php/phpml/src/Phpml/',
- 'PHPMailer\\PHPMailer\\' => $CFG->libdir . '/phpmailer/src/',
- 'RedeyeVentures\\GeoPattern\\' => $CFG->libdir . '/geopattern-php/GeoPattern/',
- ];
- foreach(core_component::get_core_subsystems() as $subsystem => $dir) {
- if (file_exists($dir . '/classes')) {
- $psr4['core_' . $subsystem . '\\'] = $dir . '/classes/';
- }
- }
- foreach(core_component::get_plugin_types() as $plugintype => $dummy) {
- foreach(core_component::get_plugin_list($plugintype) as $pluginname => $dir) {
- if (file_exists($dir . '/classes')) {
- $psr4[$plugintype . '_' . $pluginname . '\\'] = $dir . '/classes/';
- }
- }
- }
- // Required for things like core_date, core\session\manager etc.
- $psr4['core\\'] = $CFG->libdir . '/classes';
- $config = [
- 'autoload' => [
- 'psr-0' => $psr0,
- 'psr-4' => $psr4
- ]
- ];
- file_put_contents('composer.local.json', json_encode($config, JSON_PRETTY_PRINT));
Add Comment
Please, Sign In to add comment