Comments (6)
Thanks for reporting this. Is there a ticket in Drupal's issue tracker? I'm just trying to get some more scenario and context details. Anyway, I'll try to reproduce that behavior soonish.
That's the position that triggers the TypeError
:
https://github.com/TYPO3/phar-stream-wrapper/blob/master/src/Phar/Reader.php#L109
If possible, please provide the version of phpstan.phar
that has been used and a debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS )
in case $line === false
.
from phar-stream-wrapper.
Okay... independent from PharStreamWrapper I could reproduce fgets
resolving to false
at the end of a file offset, without(!) having feof() === true
. Basically I was reading 2-byte chunks from a total of 13 bytes. I was able to reproduce that on macOS with PHP 7.4, but not with PHP 8.0. Well...
I think it's fine to add an additional guard for this case. Still, finding out what really happens with phpstan.phar
of course would be interesting.
from phar-stream-wrapper.
@mglaman Please let me know whether PR #70 fixes the issue for Drupal. Thx
from phar-stream-wrapper.
Sorry! I linked this GitHub issue to the Drupal issue, but not here to there. Drupal issue: https://www.drupal.org/project/upgrade_status/issues/3232011
from phar-stream-wrapper.
I was able to reproduce that on macOS with PHP 7.4, but not with PHP 8.0. Well...
I had PHP 8.0, locally maybe that's why I couldn't reproduce. I'll see if I can work the user to get a reproduction and more data.
from phar-stream-wrapper.
Let's have a look, when that actually happens - thus, when PHP has problems to read from a stream, without issuing feof
.
https://github.com/php/php-src/blob/PHP-7.4.20/ext/standard/file.c#L1122-L1127
false
is returned when underlying stream invocation returns null
, let's have a look...
https://github.com/php/php-src/blob/PHP-7.4.20/main/streams/streams.c#L991-L996
null
is returned nothing could be read from a stream (zero bytes copied to memory).
tl;dr: fgets($resource)
returns false
, when not a single byte could be read from a string, as indicated by variable total_copied
.
I have not able to reproduce this behavior with DDEV and PHP 7.4.20 on macOS.
from phar-stream-wrapper.
Related Issues (20)
- Interceptors fail using Phar archives using internal aliases
- Monitor Drupal reports
- Publish new v2.1.0 & v3.1.0 releases
- Including dependencies packed with clue/phar-composer results in exception HOT 8
- Breaking included AWS Phar HOT 8
- Performance down between 0469d9f and b7a21f0 HOT 9
- Manifest / End of Stub Detection
- Enhance variety of test fixtures
- Normalize resolved Windows path to Unix-style
- Deprecate unused constant in PharInvocationResolver
- Connect up appveyor HOT 1
- Alias resolving on included Phar files fails
- Extend invocation test cases HOT 1
- Breaks typo3 8.7.25 on symlinked webroot HOT 5
- Ensure PHP 7.4 compatibility HOT 6
- Check meta-data deserialization capabilities in PHP 8 HOT 3
- PHP Notice: stream_wrapper_restore(): phar:// was never changed HOT 1
- Version 2.2.2 not backwards compatible because of strict_types=1 HOT 1
- Add possibility to retrieve low-level Phar internals
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phar-stream-wrapper.