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
8 changes: 0 additions & 8 deletions public/index.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<?php

// Valid PHP Version?
$minPHPVersion = '7.3';
if (version_compare(PHP_VERSION, $minPHPVersion, '<'))
{
die("Your PHP version must be {$minPHPVersion} or higher to run CodeIgniter. Current version: " . PHP_VERSION);
}
unset($minPHPVersion);

// Path to the front controller (this file)
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);

Expand Down
8 changes: 0 additions & 8 deletions spark
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
#!/usr/bin/env php
<?php

// Valid PHP Version?
$minPHPVersion = '7.3';
if (version_compare(PHP_VERSION, $minPHPVersion, '<'))
{
die("Your PHP version must be {$minPHPVersion} or higher to run CodeIgniter. Current version: " . PHP_VERSION);
}
unset($minPHPVersion);

/*
* --------------------------------------------------------------------
* CodeIgniter command-line tools
Expand Down
16 changes: 16 additions & 0 deletions system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class CodeIgniter
*/
const CI_VERSION = '4.1.1';

/**
* @var string
*/
private const MIN_PHP_VERSION = '7.3';

/**
* App startup time.
*
Expand Down Expand Up @@ -147,6 +152,17 @@ class CodeIgniter
*/
public function __construct(App $config)
{
if (version_compare(PHP_VERSION, self::MIN_PHP_VERSION, '<'))
{
die(
sprintf(
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible, if this is added to Lang?

Copy link
Copy Markdown
Member Author

@samsonasik samsonasik Mar 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@totoprayogo1916 if you mean for multi language, I am not sure since it early executed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lang() is definitely not available yet. In general I'm okay with strictly internal messages being in English. I understand there are some internationalization efforts for PHP core but I think this is still pretty common?

self::MIN_PHP_VERSION,
PHP_VERSION
)
);
}

$this->startTime = microtime(true);
$this->config = $config;
}
Expand Down