$this->input = $input ?: new Input();
$this->client = $client ?: new WebClient();
// Setup the response object.
if (!$response) {
$response = new Response();
}
$this->setResponse($response);
// Call the constructor as late as possible (it runs `initialise`).
public function __construct(Input $input = null, Registry $config = null, WebClient $client = null, ResponseInterface $response = null)
{
// Ensure we have a CMS Input object otherwise the DI for \Joomla\CMS\Session\Storage\JoomlaStorage fails
$input = $input ?: new Input();
parent::__construct($input, $config, $client, $response);
// Set the execution datetime and timestamp;
$this->set('execution.datetime', gmdate('Y-m-d H:i:s'));
$this->set('execution.timestamp', time());
public function __construct(Input $input = null, Registry $config = null, WebClient $client = null, Container $container = null)
{
$container = $container ?: new Container();
$this->setContainer($container);
parent::__construct($input, $config, $client);
// If JDEBUG is defined, load the profiler instance
if (\defined('JDEBUG') && JDEBUG) {
$this->profiler = Profiler::getInstance('Application');
}
// Register the client ID
$this->clientId = 0;
// Execute the parent constructor
parent::__construct($input, $config, $client, $container);
}
/**
* Check if the user can access the application
*
$container->alias(SiteApplication::class, 'JApplicationSite')
->share(
'JApplicationSite',
function (Container $container) {
$app = new SiteApplication(null, $container->get('config'), null, $container);
// The session service provider needs Factory::$application, set it if still null
if (Factory::$application === null) {
Factory::$application = $app;
}
if ($this->isShared())
{
if ($this->instance === null)
{
$this->instance = $callable($this->container);
}
return $this->instance;
}
}
throw new KeyNotFoundException(sprintf("Resource '%s' has not been registered with the container.", $resourceName));
}
return $this->resources[$key]->getInstance();
}
/**
* Check if specified resource exists.
*
->alias(\Joomla\CMS\Session\Session::class, 'session.web.site')
->alias(\Joomla\Session\Session::class, 'session.web.site')
->alias(\Joomla\Session\SessionInterface::class, 'session.web.site');
// Instantiate the application.
$app = $container->get(\Joomla\CMS\Application\SiteApplication::class);
// Set the application as global app
\Joomla\CMS\Factory::$application = $app;
// Execute the application.
* define() is used rather than "const" to not error for PHP 5.2 and lower
*/
define('_JEXEC', 1);
// Run the application - All executable code should be triggered through this file
require_once dirname(__FILE__) . '/includes/app.php';
ClassNotFoundError
|
---|
Symfony\Component\ErrorHandler\Error\ClassNotFoundError: Attempted to load class "Response" from namespace "Laminas\Diactoros". Did you forget a "use" statement for another namespace? at /homepages/23/d380474000/htdocs/circle2020/libraries/vendor/joomla/application/src/AbstractWebApplication.php:204 at Joomla\Application\AbstractWebApplication->__construct() (/homepages/23/d380474000/htdocs/circle2020/libraries/src/Application/WebApplication.php:106) at Joomla\CMS\Application\WebApplication->__construct() (/homepages/23/d380474000/htdocs/circle2020/libraries/src/Application/CMSApplication.php:175) at Joomla\CMS\Application\CMSApplication->__construct() (/homepages/23/d380474000/htdocs/circle2020/libraries/src/Application/SiteApplication.php:93) at Joomla\CMS\Application\SiteApplication->__construct() (/homepages/23/d380474000/htdocs/circle2020/libraries/src/Service/Provider/Application.php:100) at Joomla\CMS\Service\Provider\Application->Joomla\CMS\Service\Provider\{closure}() (/homepages/23/d380474000/htdocs/circle2020/libraries/vendor/joomla/di/src/ContainerResource.php:176) at Joomla\DI\ContainerResource->getInstance() (/homepages/23/d380474000/htdocs/circle2020/libraries/vendor/joomla/di/src/Container.php:96) at Joomla\DI\Container->get() (/homepages/23/d380474000/htdocs/circle2020/includes/app.php:55) at require_once('/homepages/23/d380474000/htdocs/circle2020/includes/app.php') (/homepages/23/d380474000/htdocs/circle2020/index.php:32) |