File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?php
22
3+ // Valid PHP Version?
4+ $ minPHPVersion = '7.1 ' ;
5+ if (phpversion () < $ minPHPVersion )
6+ {
7+ die ("You PHP version must be {$ minPHPVersion } or higher to run CodeIgniter. Current version: " . phpversion ());
8+ }
9+ unset($ minPHPVersion );
10+
311// Path to the front controller (this file)
412define ('FCPATH ' , __DIR__ .DIRECTORY_SEPARATOR );
513
Original file line number Diff line number Diff line change 4141
4242/**
4343 * Launch the PHP development server
44- *
44+ *
4545 * Not testable, as it throws phpunit for a loop :-/
4646 * @codeCoverageIgnore
4747 */
4848class Serve extends BaseCommand
4949{
50+ protected $ minPHPVersion = '7.1 ' ;
5051
5152 protected $ group = 'CodeIgniter ' ;
5253 protected $ name = 'serve ' ;
@@ -61,6 +62,12 @@ class Serve extends BaseCommand
6162
6263 public function run (array $ params )
6364 {
65+ // Valid PHP Version?
66+ if (phpversion () < $ this ->minPHPVersion )
67+ {
68+ die ("You PHP version must be {$ this ->minPHPVersion } or higher to run CodeIgniter. Current version: " . phpversion ());
69+ }
70+
6471 // Collect any user-supplied options and apply them
6572 $ php = CLI ::getOption ('php ' ) ?? PHP_BINARY ;
6673 $ host = CLI ::getOption ('host ' ) ?? 'localhost ' ;
You can’t perform that action at this time.
0 commit comments