-
-
Save farik92/6ff9186bc2a5126c53fc69a69cfcb270 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| define('_JEXEC', 1); | |
| define('JPATH_BASE', __DIR__); | |
| require_once JPATH_BASE . '/includes/defines.php'; | |
| require_once JPATH_BASE . '/includes/framework.php'; | |
| // Boot the DI container | |
| $container = \Joomla\CMS\Factory::getContainer(); | |
| /* | |
| * Alias the session service keys to the web session service as that is the primary session backend for this application | |
| * | |
| * In addition to aliasing "common" service keys, we also create aliases for the PHP classes to ensure autowiring objects | |
| * is supported. This includes aliases for aliased class names, and the keys for aliased class names should be considered | |
| * deprecated to be removed when the class name alias is removed as well. | |
| */ | |
| $container->alias('session.web', 'session.web.site') | |
| ->alias('session', 'session.web.site') | |
| ->alias('JSession', 'session.web.site') | |
| ->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; | |
| var_dump($app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment