Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Version conflict #1340

Closed
mambax7 opened this issue Apr 23, 2023 · 1 comment
Closed

PHP Version conflict #1340

mambax7 opened this issue Apr 23, 2023 · 1 comment

Comments

@mambax7
Copy link
Collaborator

mambax7 commented Apr 23, 2023

@geekwright
We say that this version supports PHP 5.3.9

But in \htdocs\class\libraries\vendor\composer\autoload_static.php

we have in line 472:

}, null, ClassLoader::class);

However Class name constant is only allowed since PHP 5.5

Are we bumping up the minimum version to PHP 5.5, or are we refactoring it?

Similar issues in some of the libraries:
line 103 in \htdocs\class\libraries\vendor\paragonie\random_compat\lib\random_bytes_dev_urandom.php
'stream_set_chunk_size' is available starting with 5.4 PHP version

line 36 in \htdocs\class\libraries\vendor\smottt\wideimage\lib\WideImage\Mapper\WEBP.php
'imagecreatefromwebp' is available starting with 5.4 PHP version

line 41 in \htdocs\class\libraries\vendor\smottt\wideimage\lib\WideImage\Mapper\WEBP.php
'imagewebp' is available starting with 5.4 PHP version

@geekwright
Copy link
Contributor

All of these instances are version aware -- using newer functions only when available.

Looking at the context in \htdocs\class\libraries\vendor\composer\autoload_static.php at line 472 shows:

        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
        if ($useStaticLoader) {
            require __DIR__ . '/autoload_static.php';

            call_user_func(\Composer\Autoload\ComposerStaticInit6352cb8ef79af2c7649e83bf921c4678::getInitializer($loader));
        } else {
 ...

In line 103 in \htdocs\class\libraries\vendor\paragonie\random_compat\lib\random_bytes_dev_urandom.php
'stream_set_chunk_size' is available starting with 5.4 PHP version

                if (is_callable('stream_set_chunk_size')) {
                    stream_set_chunk_size($fp, RANDOM_COMPAT_READ_BUFFER);
                }

It appears that WideImage\Mapper\WEBP should indicate that webp is not a supported format when run in PHP 5.3. Not as graceful as the other two, but effective.

@mambax7 mambax7 closed this as completed May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants