2011-10-11 13:02:57 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2015-12-05 17:43:54 +00:00
|
|
|
* Patch testing component for the Joomla! CMS
|
2013-07-13 02:26:21 +00:00
|
|
|
*
|
2016-02-20 16:35:10 +00:00
|
|
|
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2016 Open Source Matters, Inc. All rights reserved.
|
2013-07-13 02:26:21 +00:00
|
|
|
* @license GNU General Public License version 2 or later
|
2011-10-11 13:02:57 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
|
|
|
|
// Access check.
|
2012-06-12 18:42:45 +00:00
|
|
|
if (!JFactory::getUser()->authorise('core.manage', 'com_patchtester'))
|
|
|
|
{
|
2015-12-05 17:43:54 +00:00
|
|
|
return JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
|
2011-10-11 13:02:57 +00:00
|
|
|
}
|
|
|
|
|
2014-05-03 23:48:08 +00:00
|
|
|
// Application reference
|
|
|
|
$app = JFactory::getApplication();
|
2014-05-03 01:56:15 +00:00
|
|
|
|
2014-05-03 23:48:08 +00:00
|
|
|
// Register the component namespace to the autoloader
|
|
|
|
JLoader::registerNamespace('PatchTester', __DIR__);
|
|
|
|
|
|
|
|
// Build the controller class name based on task
|
|
|
|
$task = $app->input->getCmd('task', 'display');
|
|
|
|
|
|
|
|
// If $task is an empty string, apply our default since JInput might not
|
|
|
|
if ($task === '')
|
|
|
|
{
|
|
|
|
$task = 'display';
|
|
|
|
}
|
|
|
|
|
|
|
|
$class = '\\PatchTester\\Controller\\' . ucfirst(strtolower($task)) . 'Controller';
|
|
|
|
|
|
|
|
// Instantiate and execute the controller
|
|
|
|
$controller = new $class($app->input, $app);
|
|
|
|
$controller->execute();
|