|
10 | 10 |
|
11 | 11 | // We are a valid entry point. |
12 | 12 | const _JEXEC = 1; |
13 | | - |
14 | 13 | // Define the application's minimum supported PHP version as a constant so it can be referenced within the application. |
15 | 14 | const JOOMLA_MINIMUM_PHP = '8.1.0'; |
16 | | - |
17 | 15 | if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) { |
18 | 16 | echo 'Sorry, your PHP version is not supported.' . PHP_EOL; |
19 | 17 | echo 'Your command line php needs to be version ' . JOOMLA_MINIMUM_PHP . ' or newer to run the Joomla! CLI Tools' . PHP_EOL; |
20 | 18 | echo 'The version of PHP currently running this code, at the command line, is PHP version ' . PHP_VERSION . '.' . PHP_EOL; |
21 | 19 | echo 'Please note, the version of PHP running your commands here, may be different to the version that is used by '; |
22 | 20 | echo 'your web server to run the Joomla! Web Application' . PHP_EOL; |
23 | | - |
24 | 21 | exit; |
25 | 22 | } |
26 | 23 |
|
|
39 | 36 | echo 'It looks like you are trying to run Joomla! from our git repository.' . PHP_EOL; |
40 | 37 | echo 'To do so requires you complete a couple of extra steps first.' . PHP_EOL; |
41 | 38 | echo 'Please see https://docs.joomla.org/Special:MyLanguage/J5.x:Setting_Up_Your_Local_Environment for further details.' . PHP_EOL; |
42 | | - |
43 | 39 | exit; |
44 | 40 | } |
45 | 41 |
|
|
49 | 45 | || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) |
50 | 46 | ) { |
51 | 47 | echo 'Install Joomla to run cli commands' . PHP_EOL; |
52 | | - |
53 | 48 | exit; |
54 | 49 | } |
55 | 50 |
|
56 | 51 | // Get the framework. |
57 | 52 | require_once JPATH_BASE . '/includes/framework.php'; |
58 | | - |
59 | 53 | // Boot the DI container |
60 | 54 | $container = \Joomla\CMS\Factory::getContainer(); |
61 | | - |
62 | 55 | /* |
63 | 56 | * Alias the session service keys to the CLI session service as that is the primary session backend for this application |
64 | 57 | * |
|
71 | 64 | ->alias(\Joomla\CMS\Session\Session::class, 'session.cli') |
72 | 65 | ->alias(\Joomla\Session\Session::class, 'session.cli') |
73 | 66 | ->alias(\Joomla\Session\SessionInterface::class, 'session.cli'); |
74 | | - |
75 | 67 | $app = \Joomla\CMS\Factory::getContainer()->get(\Joomla\Console\Application::class); |
76 | 68 | \Joomla\CMS\Factory::$application = $app; |
77 | 69 | $app->execute(); |
0 commit comments