Пример #1
0
// Register a handler for uncaught exceptions that shows a pretty error page when possible
set_exception_handler(array('JErrorPage', 'render'));
// Define the Joomla version if not already defined.
if (!defined('JVERSION')) {
    $jversion = new JVersion();
    define('JVERSION', $jversion->getShortVersion());
}
// Set up the message queue logger for web requests
if (array_key_exists('REQUEST_METHOD', $_SERVER)) {
    JLog::addLogger(array('logger' => 'messagequeue'), JLog::ALL, array('jerror'));
}
// Register JArrayHelper due to JRegistry moved to composer's vendor folder
JLoader::register('JArrayHelper', JPATH_PLATFORM . '/joomla/utilities/arrayhelper.php');
// Register the Crypto lib
JLoader::register('Crypto', JPATH_PLATFORM . '/php-encryption/Crypto.php');
// Register classes where the names have been changed to fit the autoloader rules
// @deprecated  4.0
JLoader::register('JToolBar', JPATH_PLATFORM . '/cms/toolbar/toolbar.php');
JLoader::register('JButton', JPATH_PLATFORM . '/cms/toolbar/button.php');
JLoader::register('JInstallerComponent', JPATH_PLATFORM . '/cms/installer/adapter/component.php');
JLoader::register('JInstallerFile', JPATH_PLATFORM . '/cms/installer/adapter/file.php');
JLoader::register('JInstallerLanguage', JPATH_PLATFORM . '/cms/installer/adapter/language.php');
JLoader::register('JInstallerLibrary', JPATH_PLATFORM . '/cms/installer/adapter/library.php');
JLoader::register('JInstallerModule', JPATH_PLATFORM . '/cms/installer/adapter/module.php');
JLoader::register('JInstallerPackage', JPATH_PLATFORM . '/cms/installer/adapter/package.php');
JLoader::register('JInstallerPlugin', JPATH_PLATFORM . '/cms/installer/adapter/plugin.php');
JLoader::register('JInstallerTemplate', JPATH_PLATFORM . '/cms/installer/adapter/template.php');
JLoader::register('JExtension', JPATH_PLATFORM . '/cms/installer/extension.php');
JLoader::registerAlias('JAdministrator', 'JApplicationAdministrator');
JLoader::registerAlias('JSite', 'JApplicationSite');
 /**
  * Tests the JLoader::registerAlias method.
  *
  * @return  void
  *
  * @since   3.2
  */
 public function testRegisterAlias()
 {
     // Clear the prefixes array for this test
     TestReflection::setValue('JLoader', 'classAliases', array());
     TestReflection::setValue('JLoader', 'classAliasesInverse', array());
     JLoader::registerAlias('foo', 'bar');
     // Get the current prefixes array
     $aliases = TestReflection::getValue('JLoader', 'classAliases');
     $aliasesInverse = TestReflection::getValue('JLoader', 'classAliasesInverse');
     $this->assertEquals($aliases['foo'], 'bar', 'Assert the alias is set in the classAlias array.');
     $this->assertArrayHasKey('bar', $aliasesInverse, 'Assert the real class is set in the classAliasInverse array.');
     $this->assertEquals(array('foo'), $aliasesInverse['bar'], 'Assert the alias is set in the classAliasInverse array for the real class.');
     JLoader::registerAlias('baz', 'bar');
     $aliasesInverse = TestReflection::getValue('JLoader', 'classAliasesInverse');
     $this->assertEquals(array('foo', 'baz'), $aliasesInverse['bar'], 'Assert you can assign multiple aliases for each real class.');
     $this->assertEquals(JLoader::registerAlias('foo', 'bar'), false, 'Assert adding an existing alias will return false.');
 }
Пример #3
0
<?php

/**
 * @package    Joomla.Libraries
 *
 * @copyright  Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */
JLoader::registerAlias('JRegistry', '\\Joomla\\Registry\\Registry');
JLoader::registerAlias('JRegistryFormat', '\\Joomla\\Registry\\AbstractRegistryFormat');
JLoader::registerAlias('JRegistryFormatIni', '\\Joomla\\Registry\\Format\\Ini');
JLoader::registerAlias('JRegistryFormatJson', '\\Joomla\\Registry\\Format\\Json');
JLoader::registerAlias('JRegistryFormatPhp', '\\Joomla\\Registry\\Format\\Php');
JLoader::registerAlias('JRegistryFormatXml', '\\Joomla\\Registry\\Format\\Xml');
JLoader::registerAlias('JStringInflector', '\\Joomla\\String\\Inflector');
JLoader::registerAlias('JStringNormalise', '\\Joomla\\String\\Normalise');
Пример #4
0
<?php

/**
 * @package    Joomla.Libraries
 *
 * @copyright  Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */
JLoader::registerAlias('JRegistry', '\\Joomla\\Registry\\Registry');
JLoader::registerAlias('JRegistryFormat', '\\Joomla\\Registry\\AbstractRegistryFormat');
JLoader::registerAlias('JRegistryFormatINI', '\\Joomla\\Registry\\Format\\Ini');
JLoader::registerAlias('JRegistryFormatJSON', '\\Joomla\\Registry\\Format\\Json');
JLoader::registerAlias('JRegistryFormatPHP', '\\Joomla\\Registry\\Format\\Php');
JLoader::registerAlias('JRegistryFormatXML', '\\Joomla\\Registry\\Format\\Xml');
Пример #5
0
 /**
  * Tests the JLoader::registerAlias method.
  *
  * @return  void
  *
  * @since   3.2
  */
 public function testRegisterAlias()
 {
     // Clear the prefixes array for this test
     TestReflection::setValue('JLoader', 'classAliases', array());
     JLoader::registerAlias('foo', 'bar');
     // Get the current prefixes array
     $aliases = TestReflection::getValue('JLoader', 'classAliases');
     $this->assertEquals($aliases['foo'], 'bar', 'Assert the alias is set in the classAlias array.');
     $this->assertEquals(JLoader::registerAlias('foo', 'bar'), false, 'Assert adding an existing alias will return false.');
 }
<?php

/**
 * @package    Joomla.Libraries
 *
 * @copyright  Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */
JLoader::registerAlias('JRegistry', '\\Joomla\\Registry\\Registry');
JLoader::registerAlias('JRegistryFormat', '\\Joomla\\Registry\\AbstractRegistryFormat');
JLoader::registerAlias('JRegistryFormatINI', '\\Joomla\\Registry\\Format\\Ini');
JLoader::registerAlias('JRegistryFormatJSON', '\\Joomla\\Registry\\Format\\Json');
JLoader::registerAlias('JRegistryFormatPHP', '\\Joomla\\Registry\\Format\\Php');
JLoader::registerAlias('JRegistryFormatXML', '\\Joomla\\Registry\\Format\\Xml');
JLoader::registerAlias('JString', '\\Joomla\\String\\StringHelper');
JLoader::registerAlias('JStringNormalise', '\\Joomla\\String\\Normalise');
JLoader::registerAlias('JStringInflector', '\\Joomla\\String\\Inflector');
Пример #7
0
    define("CROWDFUNDING_PATH_COMPONENT_ADMINISTRATOR", JPATH_ADMINISTRATOR . "/components/com_crowdfunding");
}
if (!defined("CROWDFUNDING_PATH_COMPONENT_SITE")) {
    define("CROWDFUNDING_PATH_COMPONENT_SITE", JPATH_SITE . "/components/com_crowdfunding");
}
if (!defined("CROWDFUNDING_PATH_LIBRARY")) {
    define("CROWDFUNDING_PATH_LIBRARY", JPATH_LIBRARIES . "/Crowdfunding");
}
JLoader::registerNamespace('Crowdfunding', JPATH_LIBRARIES);
// Register some helpers
JLoader::register("CrowdfundingHelper", CROWDFUNDING_PATH_COMPONENT_ADMINISTRATOR . "/helpers/crowdfunding.php");
JLoader::register("CrowdfundingHelperRoute", CROWDFUNDING_PATH_COMPONENT_SITE . "/helpers/route.php");
// Register some Joomla! classes
JLoader::register('JHtmlString', JPATH_LIBRARIES . "/joomla/html/html/string.php");
JLoader::register("JHtmlCategory", JPATH_LIBRARIES . "/joomla/html/html/category.php");
// Include HTML helpers path
JHtml::addIncludePath(CROWDFUNDING_PATH_COMPONENT_SITE . '/helpers/html');
// Register Observers
JLoader::register("CrowdfundingObserverReward", CROWDFUNDING_PATH_COMPONENT_ADMINISTRATOR . "/tables/observers/reward.php");
JObserverMapper::addObserverClassToClass('CrowdfundingObserverReward', 'CrowdfundingTableReward', array('typeAlias' => 'com_crowdfunding.reward'));
// Prepare logger
$registry = Joomla\Registry\Registry::getInstance("com_crowdfunding");
/** @var  $registry Joomla\Registry\Registry */
$registry->set("logger.table", "#__crowdf_logs");
$registry->set("logger.file", "com_crowdfunding.php");
// Load library language
$lang = JFactory::getLanguage();
$lang->load('lib_crowdfunding', CROWDFUNDING_PATH_LIBRARY);
// Register class aliases.
JLoader::registerAlias('CrowdfundingCategories', '\\Crowdfunding\\Categories');
Пример #8
0
<?php

/**
 * @package    Joomla.Libraries
 *
 * @copyright  Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */
JLoader::registerAlias('JRegistry', '\\Joomla\\Registry\\Registry');
JLoader::registerAlias('JRegistryFormat', '\\Joomla\\Registry\\AbstractRegistryFormat');
JLoader::registerAlias('JRegistryFormatIni', '\\Joomla\\Registry\\Format\\Ini');
JLoader::registerAlias('JRegistryFormatJson', '\\Joomla\\Registry\\Format\\Json');
JLoader::registerAlias('JRegistryFormatPhp', '\\Joomla\\Registry\\Format\\Php');
JLoader::registerAlias('JRegistryFormatXml', '\\Joomla\\Registry\\Format\\Xml');
JLoader::registerAlias('JStringInflector', '\\Joomla\\String\\Inflector');
JLoader::registerAlias('JStringNormalise', '\\Joomla\\String\\Normalise');
JLoader::registerAlias('JApplicationWebClient', '\\Joomla\\Application\\Web\\WebClient');
<?php

/**
 * Joomlatools Platform - http://developer.joomlatools.org/platform
 *
 * @copyright	Copyright (C) 2015 Johan Janssens and Timble CVBA. (http://www.timble.net)
 * @license		GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link		https://github.com/joomlatools/joomlatools-platform for the canonical source repository
 */
JLoader::register('MediaHelperMedia', JPATH_ADMINISTRATOR . '/components/com_media/helper/media.php');
JLoader::registerAlias('JHelperMedia', 'MediaHelperMedia');
JLoader::register('JFormFieldMedia', JPATH_ADMINISTRATOR . '/components/com_media/models/fields/media.php');
//Provide a specialised version of JHelperTags found in /lib/libraries/cms/helper/tags.php
JLoader::register('JHelperTags', JPATH_ADMINISTRATOR . '/components/com_tags/helpers/tags.php');
JLoader::registerAlias('TagsHelperTags', 'JHelperTags');
JLoader::register('TagsTableObserverTags', JPATH_ADMINISTRATOR . '/components/com_tags/tables/observer/history.php');
JLoader::registerAlias('JTableObserverTags', 'TagsTableObserverTags');
JLoader::register('ContenthistoryHelperHistory', JPATH_ADMINISTRATOR . '/components/com_contenthistory/helpers/history.php');
JLoader::register('ContenthistoryTableObserverHistory', JPATH_ADMINISTRATOR . '/components/com_contenthistory/tables/observer/history.php');
JLoader::registerAlias('JHelperContenthistory', 'ContenthistoryHelperHistory');
JLoader::registerAlias('JTableObserverContenthistory', 'ContenthistoryTableObserverHistory');
JLoader::register('JFormFieldTag', JPATH_ADMINISTRATOR . '/components/com_tags/models/fields/tag.php');
JLoader::register('JFormFieldContenthistory', JPATH_ADMINISTRATOR . '/components/com_contenthistory/models/fields/history.php');
JLoader::register('JFormFieldContenttype', JPATH_ADMINISTRATOR . '/components/com_content/models/fields/contenttype.php');
JLoader::register('JFormFieldOrdering', JPATH_ADMINISTRATOR . '/components/com_content/models/fields/ordering.php');
JLoader::register('JFormFieldModal_Article', JPATH_ADMINISTRATOR . '/components/com_content/models/fields/modal/article.php');
JLoader::register('ContentTableContent', JPATH_ADMINISTRATOR . '/components/com_content/tables/content.php');
JLoader::register('ContentTableCore', JPATH_ADMINISTRATOR . '/components/com_content/tables/core.php');
JLoader::register('ContentTableTypes', JPATH_ADMINISTRATOR . '/components/com_content/tables/types.php');
JLoader::registerAlias('JTableContent', 'ContentTableContent');
JLoader::registerAlias('JTableCorecontent', 'ContentTableCore');
JLoader::registerAlias('JTableContenttype', 'ContentTableTypes');
JLoader::register('ContentTableUcmBase', JPATH_ADMINISTRATOR . '/components/com_content/tables/ucm/base.php');
JLoader::register('ContentTableUcmContent', JPATH_ADMINISTRATOR . '/components/com_content/tables/ucm/content.php');
JLoader::register('ContentTableUcmType', JPATH_ADMINISTRATOR . '/components/com_content/tables/ucm/type.php');
JLoader::register('ContentTableUcm', JPATH_ADMINISTRATOR . '/components/com_content/tables/ucm/ucm.php');
JLoader::registerAlias('JUcmBase', 'ContentTableUcmBase');
JLoader::registerAlias('JUcmContent', 'ContentTableUcmContent');
JLoader::registerAlias('JUcmType', 'ContentTableUcmType');
JLoader::registerAlias('JUcm', 'ContentTableUcm');
JHtml::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_content/helpers/html');
JHtml::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_contenthistory/helpers/html');
JHtml::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/helpers/html');
<?php

/**
 * Joomlatools Platform - http://developer.joomlatools.org/platform
 *
 * @copyright	Copyright (C) 2015 Johan Janssens and Timble CVBA. (http://www.timble.net)
 * @license		GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link		https://github.com/joomlatools/joomlatools-platform for the canonical source repository
 */
JLoader::register('JCategories', JPATH_ADMINISTRATOR . '/components/com_categories/libraries/categories.php');
JLoader::register('CategoriesTableCategories', JPATH_ADMINISTRATOR . '/components/com_categories/tables/categories.php');
if (JPATH_BASE == JPATH_SITE) {
    JLoader::register('CategoriesViewCategory', JPATH_SITE . '/components/com_categories/views/category/view.html.php');
    JLoader::register('CategoriesViewCategories', JPATH_SITE . '/components/com_categories/views/categories/view.html.php');
    JLoader::register('CategoriesViewCategoryfeed', JPATH_SITE . '/components/com_categories/views/category/view.feed.php');
}
JLoader::register('JFormFieldCategoryEdit', JPATH_ADMINISTRATOR . '/components/com_categories/models/fields/categoryedit.php');
JLoader::register('JFormFieldCategoryParent', JPATH_ADMINISTRATOR . '/components/com_categories/models/fields/categoryparent.php');
JLoader::register('JFormFieldCategory', JPATH_ADMINISTRATOR . '/components/com_categories/models/fields/category.php');
JLoader::registerAlias('JTableCategory', 'CategoriesTableCategories');
JLoader::registerAlias('JViewCategories', 'CategoriesViewCategories');
JLoader::registerAlias('JViewCategoryfeed', 'CategoriesViewCategoryfeed');
JHtml::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/helpers/html');
Пример #12
0
<?php

/**
 * @package    Joomla.Libraries
 *
 * @copyright  Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */
JLoader::registerAlias('JRegistry', '\\Joomla\\Registry\\Registry', '4.0');
JLoader::registerAlias('JRegistryFormat', '\\Joomla\\Registry\\AbstractRegistryFormat', '4.0');
JLoader::registerAlias('JRegistryFormatIni', '\\Joomla\\Registry\\Format\\Ini', '4.0');
JLoader::registerAlias('JRegistryFormatJson', '\\Joomla\\Registry\\Format\\Json', '4.0');
JLoader::registerAlias('JRegistryFormatPhp', '\\Joomla\\Registry\\Format\\Php', '4.0');
JLoader::registerAlias('JRegistryFormatXml', '\\Joomla\\Registry\\Format\\Xml', '4.0');
JLoader::registerAlias('JStringInflector', '\\Joomla\\String\\Inflector', '4.0');
JLoader::registerAlias('JStringNormalise', '\\Joomla\\String\\Normalise', '4.0');
JLoader::registerAlias('JApplicationWebClient', '\\Joomla\\Application\\Web\\WebClient', '4.0');
JLoader::registerAlias('JData', '\\Joomla\\Data\\DataObject', '4.0');
JLoader::registerAlias('JDataSet', '\\Joomla\\Data\\DataSet', '4.0');
JLoader::registerAlias('JDataDumpable', '\\Joomla\\Data\\DumpableInterface', '4.0');