Cotonti / Cotonti

Fast, reliable and flexible PHP CMF/CMS
https://www.cotonti.com
BSD 3-Clause "New" or "Revised" License
92 stars 51 forks source link

Cotonti 0.9.24 || PHP requirement 7.1 #1768

Closed pinalgirkar closed 4 months ago

pinalgirkar commented 4 months ago

Hi,

I have a question regarding Cotonti 0.9.24 and its PHP version compatibility. I initially installed it with PHP 5.6, as specified in the requirements.

However, when I visit http://domain_name/cotonti0924/install.php, I encounter the following error:

Parse error: syntax error, unexpected '=' in [directory_path]/cotonti0924/system/functions.php on line 1985

This error is due to the use of array destructing syntax, introduced in PHP 7.1:

[$birth_y, $birth_m, $birth_d] = explode('-', cot_date('Y-m-d', $birthdate));

Upon upgrading the PHP version to 7.1, the installation wizard loads successfully, and I can install Cotonti 0.9.24.

If the PHP version is the only issue, could you please update the requirements details in the documentation and the zip package to reflect that PHP 7.1 or later is necessary for compatibility?

Alex300 commented 4 months ago

Hi, thanks for info.

It looks like my IDE has replaced the old syntax with the new one for some reason. And I didn't see it.

I fixed PHP 5.6 compatibility by replacing it with old PHP syntax

list($birth_y, $birth_m, $birth_d) = explode(...

and updated release. You can download it from release page: https://github.com/Cotonti/Cotonti/releases/tag/0.9.24