Comments (8)
Can you please point to the specific version of the aws.phar file, how it is used/included and mention the exact PHP version (and OS distribution) you're using? Thx
from phar-stream-wrapper.
Hi.
It happens in any Linux version with PHP >= 7.1
I'm using the latest AWS phar file (3.90.3) and requiring it according with the AWS documentation: require '/path/to/aws.phar';
from phar-stream-wrapper.
Current workaround
instead of
require('/path/to/aws.phar');
please use (for the time being)
require('phar:///path/to/aws.phar/aws-autoloader.php');
This is what the stub of aws.phar
is doing anyway internally.
Explanation
The stub of libraries like geoip2
(build with php-box
) looks like the following. When invoking the phar://
stream, the full path is still given internally by using __FILE__
. That way, the file path can be mapped to its internal alias name.
Phar::mapPhar('geoip2.phar');
require 'phar://' . __FILE__ . '/phar-stub.php';
The stub of the aws
library looks like the following and does not contain any internal reference to it's original file. That's the reason why the internal alias aws-3.90.3.phar
cannot be checked and results in an empty base-name. The work-around above uses the phar://
stream and thus triggers alias resolving.
Phar::mapPhar('aws-3.90.3.phar');
require 'phar://aws-3.90.3.phar/aws-autoloader.php';
from phar-stream-wrapper.
In PR #22 I've added test cases first in order to reproduce the behavior. Next step would be a fix...
from phar-stream-wrapper.
I needed only require 'phar://aws-3.90.3.phar/aws-autoloader.php';
and it worked again.
from phar-stream-wrapper.
@ohader this solution does not work with "geoip2.phar"?
from phar-stream-wrapper.
i have workaround for "GeoIP2.phar"
require_once ( 'phar://' . __DIR__ . '/geoip2.phar/vendor/autoload.php' );
from phar-stream-wrapper.
Please test the references pull-requests #31 (PHP7) or #32 (PHP5) and check whether the originally reported bug of this ticket is solved. Thanks!
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
- 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
- Does not handle fgets returning an error gracefully HOT 6
- 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.