[ Index ]

PHP Cross Reference of Joomla 3.3.0

title

Body

[close]

/libraries/ -> cms.php (source)

   1  <?php
   2  /**
   3   * @package    Joomla.Libraries
   4   *
   5   * @copyright  Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
   6   * @license    GNU General Public License version 2 or later; see LICENSE
   7   */
   8  
   9  defined('_JEXEC') or die;
  10  
  11  // Set the platform root path as a constant if necessary.
  12  if (!defined('JPATH_PLATFORM'))
  13  {
  14      define('JPATH_PLATFORM', __DIR__);
  15  }
  16  
  17  // Import the library loader if necessary.
  18  if (!class_exists('JLoader'))
  19  {
  20      require_once  JPATH_PLATFORM . '/loader.php';
  21  }
  22  
  23  // Make sure that the Joomla Platform has been successfully loaded.
  24  if (!class_exists('JLoader'))
  25  {
  26      throw new RuntimeException('Joomla Platform not loaded.');
  27  }
  28  
  29  // Register the library base path for CMS libraries.
  30  JLoader::registerPrefix('J', JPATH_PLATFORM . '/cms', false, true);
  31  
  32  // Register PHP namespaces
  33  JLoader::registerNamespace('Joomla', JPATH_PLATFORM . '/framework');
  34  JLoader::registerNamespace('Symfony', JPATH_PLATFORM . '/framework');
  35  
  36  // Register the class aliases for Framework classes that have replaced their Platform equivilents
  37  require_once  __DIR__ . '/classmap.php';
  38  
  39  // Register a handler for uncaught exceptions that shows a pretty error page when possible
  40  set_exception_handler(array('JErrorPage', 'render'));
  41  
  42  // Define the Joomla version if not already defined.
  43  if (!defined('JVERSION'))
  44  {
  45      $jversion = new JVersion;
  46      define('JVERSION', $jversion->getShortVersion());
  47  }
  48  
  49  // Set up the message queue logger for web requests
  50  if (array_key_exists('REQUEST_METHOD', $_SERVER))
  51  {
  52      JLog::addLogger(array('logger' => 'messagequeue'), JLog::ALL, array('jerror'));
  53  }
  54  
  55  // Register classes where the names have been changed to fit the autoloader rules
  56  // @deprecated  4.0
  57  JLoader::register('JToolBar', JPATH_PLATFORM . '/cms/toolbar/toolbar.php');
  58  JLoader::register('JButton',  JPATH_PLATFORM . '/cms/toolbar/button.php');
  59  JLoader::register('JInstallerComponent',  JPATH_PLATFORM . '/cms/installer/adapter/component.php');
  60  JLoader::register('JInstallerFile',  JPATH_PLATFORM . '/cms/installer/adapter/file.php');
  61  JLoader::register('JInstallerLanguage',  JPATH_PLATFORM . '/cms/installer/adapter/language.php');
  62  JLoader::register('JInstallerLibrary',  JPATH_PLATFORM . '/cms/installer/adapter/library.php');
  63  JLoader::register('JInstallerModule',  JPATH_PLATFORM . '/cms/installer/adapter/module.php');
  64  JLoader::register('JInstallerPackage',  JPATH_PLATFORM . '/cms/installer/adapter/package.php');
  65  JLoader::register('JInstallerPlugin',  JPATH_PLATFORM . '/cms/installer/adapter/plugin.php');
  66  JLoader::register('JInstallerTemplate',  JPATH_PLATFORM . '/cms/installer/adapter/template.php');
  67  JLoader::register('JExtension',  JPATH_PLATFORM . '/cms/installer/extension.php');
  68  JLoader::registerAlias('JAdministrator',  'JApplicationAdministrator');
  69  JLoader::registerAlias('JSite',  'JApplicationSite');
  70  
  71  // Register Observers:
  72  // Add Tags to Content, Contact, NewsFeeds, WebLinks and Categories: (this is the only link between them here!):
  73  JObserverMapper::addObserverClassToClass('JTableObserverTags', 'JTableContent', array('typeAlias' => 'com_content.article'));
  74  JObserverMapper::addObserverClassToClass('JTableObserverTags', 'ContactTableContact', array('typeAlias' => 'com_contact.contact'));
  75  JObserverMapper::addObserverClassToClass('JTableObserverTags', 'NewsfeedsTableNewsfeed', array('typeAlias' => 'com_newsfeeds.newsfeed'));
  76  JObserverMapper::addObserverClassToClass('JTableObserverTags', 'WeblinksTableWeblink', array('typeAlias' => 'com_weblinks.weblink'));
  77  JObserverMapper::addObserverClassToClass('JTableObserverTags', 'JTableCategory', array('typeAlias' => '{extension}.category'));
  78  
  79  // Register Observers for Version History
  80  JObserverMapper::addObserverClassToClass('JTableObserverContenthistory', 'ContactTableContact', array('typeAlias' => 'com_contact.contact'));
  81  JObserverMapper::addObserverClassToClass('JTableObserverContenthistory', 'JTableContent', array('typeAlias' => 'com_content.article'));
  82  JObserverMapper::addObserverClassToClass('JTableObserverContenthistory', 'JTableCategory', array('typeAlias' => '{extension}.category'));
  83  JObserverMapper::addObserverClassToClass('JTableObserverContenthistory', 'NewsfeedsTableNewsfeed', array('typeAlias' => 'com_newsfeeds.newsfeed'));
  84  JObserverMapper::addObserverClassToClass('JTableObserverContenthistory', 'WeblinksTableWeblink', array('typeAlias' => 'com_weblinks.weblink'));
  85  JObserverMapper::addObserverClassToClass('JTableObserverContenthistory', 'BannersTableBanner', array('typeAlias' => 'com_banners.banner'));
  86  JObserverMapper::addObserverClassToClass('JTableObserverContenthistory', 'BannersTableClient', array('typeAlias' => 'com_banners.client'));
  87  JObserverMapper::addObserverClassToClass('JTableObserverContenthistory', 'TagsTableTag', array('typeAlias' => 'com_tags.tag'));
  88  JObserverMapper::addObserverClassToClass('JTableObserverContenthistory', 'UsersTableNote', array('typeAlias' => 'com_users.note'));


Generated: Fri May 2 13:54:24 2014 Cross-referenced by PHPXref 0.7.1