Git Product home page Git Product logo

Comments (8)

ohader avatar ohader commented on June 23, 2024

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.

neoacevedo avatar neoacevedo commented on June 23, 2024

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.

ohader avatar ohader commented on June 23, 2024

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.

ohader avatar ohader commented on June 23, 2024

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.

neoacevedo avatar neoacevedo commented on June 23, 2024

I needed only require 'phar://aws-3.90.3.phar/aws-autoloader.php'; and it worked again.

from phar-stream-wrapper.

jurihahn avatar jurihahn commented on June 23, 2024

@ohader this solution does not work with "geoip2.phar"?

from phar-stream-wrapper.

jurihahn avatar jurihahn commented on June 23, 2024

i have workaround for "GeoIP2.phar"
require_once ( 'phar://' . __DIR__ . '/geoip2.phar/vendor/autoload.php' );

from phar-stream-wrapper.

ohader avatar ohader commented on June 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.