Guest User

Untitled

a guest
Jul 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. <?php
  2.  
  3. define('CLI_SCRIPT', 1);
  4. require('config.php');
  5.  
  6. // From core_component::$psr0namespaces
  7. $psr0 = [
  8. 'Horde' => $CFG->libdir . '/horde/framework/Horde/',
  9. 'Mustache' => $CFG->libdir . '/mustache/src/Mustache/',
  10. ];
  11.  
  12. // From core_component::$psr4namespaces
  13. $psr4 = [
  14. 'MaxMind\\' => $CFG->libdir . '/maxmind/MaxMind/',
  15. 'GeoIp2\\' => $CFG->libdir . '/maxmind/GeoIp2/',
  16. 'Sabberworm\\CSS\\' => $CFG->libdir . '/php-css-parser/',
  17. 'MoodleHQ\\RTLCSS\\' => $CFG->libdir . '/rtlcss/',
  18. 'Leafo\\ScssPhp\\' => $CFG->libdir . '/scssphp/',
  19. 'Box\\Spout\\' => $CFG->libdir . '/spout/src/Spout/',
  20. 'MatthiasMullie\\Minify\\' => $CFG->libdir . '/minify/matthiasmullie-minify/src//',
  21. 'MatthiasMullie\\PathConverter\\' => $CFG->libdir . '/minify/matthiasmullie-pathconverter/src/',
  22. 'IMSGlobal\LTI\\' => $CFG->libdir . '/ltiprovider/src/',
  23. 'Phpml\\' => $CFG->libdir . '/mlbackend/php/phpml/src/Phpml/',
  24. 'PHPMailer\\PHPMailer\\' => $CFG->libdir . '/phpmailer/src/',
  25. 'RedeyeVentures\\GeoPattern\\' => $CFG->libdir . '/geopattern-php/GeoPattern/',
  26. ];
  27.  
  28. foreach(core_component::get_core_subsystems() as $subsystem => $dir) {
  29. if (file_exists($dir . '/classes')) {
  30. $psr4['core_' . $subsystem . '\\'] = $dir . '/classes/';
  31. }
  32. }
  33.  
  34. foreach(core_component::get_plugin_types() as $plugintype => $dummy) {
  35. foreach(core_component::get_plugin_list($plugintype) as $pluginname => $dir) {
  36. if (file_exists($dir . '/classes')) {
  37. $psr4[$plugintype . '_' . $pluginname . '\\'] = $dir . '/classes/';
  38. }
  39. }
  40. }
  41.  
  42. // Required for things like core_date, core\session\manager etc.
  43. $psr4['core\\'] = $CFG->libdir . '/classes';
  44.  
  45. $config = [
  46. 'autoload' => [
  47. 'psr-0' => $psr0,
  48. 'psr-4' => $psr4
  49. ]
  50. ];
  51. file_put_contents('composer.local.json', json_encode($config, JSON_PRETTY_PRINT));
Add Comment
Please, Sign In to add comment