Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Desktop.ini
/libraries/vendor/joomla/*/.travis/
/libraries/vendor/joomla/*/docs
/libraries/vendor/joomla/*/Tests
/libraries/vendor/joomla/*/tests
/libraries/vendor/joomla/*/vendor
/libraries/vendor/joomla/*/.scrutinizer.yml
/libraries/vendor/joomla/*/.travis.yml
Expand Down
4 changes: 2 additions & 2 deletions cli/finder_indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
*
* @since 2.5
*/
class FinderCli extends JApplicationCli
class FinderCli extends \Joomla\CMS\Application\CliApplication
{
/**
* Start time for the index process
Expand Down Expand Up @@ -370,4 +370,4 @@ private function getFilters()

// Instantiate the application object, passing the class name to JCli::getInstance
// and use chaining to execute the application.
JApplicationCli::getInstance('FinderCli')->execute();
\Joomla\CMS\Application\CliApplication::getInstance('FinderCli')->execute();
27 changes: 16 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions libraries/src/CMS/Application/Autoconfigurable.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

namespace Joomla\CMS\Application;

defined('JPATH_PLATFORM') or die;

use Joomla\Registry\Registry;

/**
Expand Down
94 changes: 24 additions & 70 deletions libraries/src/CMS/Application/CMSApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
use Joomla\CMS\Menu\AbstractMenu;
use Joomla\CMS\Pathway\Pathway;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Profiler\Profiler;
use Joomla\CMS\Session\Session;
use Joomla\CMS\User\User;
use Joomla\DI\Container;
use Joomla\DI\ContainerAwareInterface;
use Joomla\DI\ContainerAwareTrait;
Expand All @@ -29,74 +32,10 @@
*
* @since 3.2
*/
abstract class CMSApplication extends WebApplication implements ContainerAwareInterface
abstract class CMSApplication extends WebApplication implements ContainerAwareInterface, CMSApplicationInterface
{
use ContainerAwareTrait, ExtensionNamespaceMapper;

/**
* Constant defining an enqueued emergency message
*
* @var string
* @since 4.0
*/
const MSG_EMERGENCY = 'emergency';

/**
* Constant defining an enqueued alert message
*
* @var string
* @since 4.0
*/
const MSG_ALERT = 'alert';

/**
* Constant defining an enqueued critical message
*
* @var string
* @since 4.0
*/
const MSG_CRITICAL = 'critical';

/**
* Constant defining an enqueued error message
*
* @var string
* @since 4.0
*/
const MSG_ERROR = 'error';

/**
* Constant defining an enqueued warning message
*
* @var string
* @since 4.0
*/
const MSG_WARNING = 'warning';

/**
* Constant defining an enqueued notice message
*
* @var string
* @since 4.0
*/
const MSG_NOTICE = 'notice';

/**
* Constant defining an enqueued info message
*
* @var string
* @since 4.0
*/
const MSG_INFO = 'info';

/**
* Constant defining an enqueued debug message
*
* @var string
* @since 4.0
*/
const MSG_DEBUG = 'debug';

/**
* Array of options for the \JDocument object
*
Expand Down Expand Up @@ -148,7 +87,7 @@ abstract class CMSApplication extends WebApplication implements ContainerAwareIn
/**
* The profiler instance
*
* @var \JProfiler
* @var Profiler
* @since 3.2
*/
protected $profiler = null;
Expand Down Expand Up @@ -187,7 +126,7 @@ public function __construct(\JInput $input = null, Registry $config = null, WebC
// If JDEBUG is defined, load the profiler instance
if (defined('JDEBUG') && JDEBUG)
{
$this->profiler = \JProfiler::getInstance('Application');
$this->profiler = Profiler::getInstance('Application');
}

// Enable sessions by default.
Expand Down Expand Up @@ -221,7 +160,7 @@ public function afterSessionStart(SessionEvent $event)
if ($session->isNew())
{
$session->set('registry', new Registry);
$session->set('user', new \JUser);
$session->set('user', new User);
}

// TODO: At some point we need to get away from having session data always in the db.
Expand Down Expand Up @@ -1222,7 +1161,7 @@ public function toString($compress = false)
*/
public function getFormToken($forceNew = false)
{
/** @var \JSession $session */
/** @var Session $session */
$session = $this->getSession();

return $session->getFormToken();
Expand All @@ -1241,9 +1180,24 @@ public function getFormToken($forceNew = false)
*/
public function checkToken($method = 'post')
{
/** @var \JSession $session */
/** @var Session $session */
$session = $this->getSession();

return $session->checkToken($method);
}

/**
* Flag if the application instance is a CLI or web based application.
*
* Helper function, you should use the native PHP functions to detect if it is a CLI application.
*
* @return boolean
*
* @since __DEPLOY_VERSION__
* @deprecated 5.0 Will be removed without replacements
*/
public function isCli()
{
return false;
}
}
Loading