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

on php8.2 $context on StreamWrapper is missing #703

Open
pscheit opened this issue Jun 27, 2023 · 4 comments
Open

on php8.2 $context on StreamWrapper is missing #703

pscheit opened this issue Jun 27, 2023 · 4 comments
Assignees

Comments

@pscheit
Copy link

pscheit commented Jun 27, 2023

Hi there,

i upgraded to php 8.2 and now got the error if doing file_get_contents on a gaufrette-streamwrapper url:

Creation of dynamic property Gaufrette\StreamWrapper::$context is deprecated

@pscheit
Copy link
Author

pscheit commented Jun 27, 2023

seems to be enough to just declare the property:
phpspec/phpspec#1435

@KevinArtus
Copy link
Contributor

Hi.
We're working on it to update this project to php ^8.0
#692

@ZZromanZZ
Copy link

For those who won't or can't wait to release version with PHP 8.2 support. I did dirty workaround to solve this issue by patching the probematic file via composer scripts.

In composer.json:

"scripts": {
    "fix-php-8-2-compatibility": [
        "sed -i 's/private static $filesystemMap;$/private static $filesystemMap;public $context;/g' vendor/knplabs/gaufrette/src/Gaufrette/StreamWrapper.php"
    ],
    "post-install-cmd": [
        "@fix-php-8-2-compatibility"
    ],
    "post-update-cmd": [
        "@fix-php-8-2-compatibility"
    ]
}

(CLI command sed is required to be installed`)

Luckily for me it was the only issue.

@ihor-drevetskyi
Copy link

For those who won't or can't wait to release version with PHP 8.2 support. I did dirty workaround to solve this issue by patching the probematic file via composer scripts.

In composer.json:

"scripts": {
    "fix-php-8-2-compatibility": [
        "sed -i 's/private static $filesystemMap;$/private static $filesystemMap;public $context;/g' vendor/knplabs/gaufrette/src/Gaufrette/StreamWrapper.php"
    ],
    "post-install-cmd": [
        "@fix-php-8-2-compatibility"
    ],
    "post-update-cmd": [
        "@fix-php-8-2-compatibility"
    ]
}

(CLI command sed is required to be installed`)

Luckily for me it was the only issue.

Thank you

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

5 participants