Git Product home page Git Product logo

Comments (4)

matthewslyman avatar matthewslyman commented on June 2, 2024

I'm currently using the raw PHP files with the require statements manually added back in. For total idiots like me who never bothered learning how to use Composer yet, this would be a boon.

from maxmind-db-reader-php.

oschwald avatar oschwald commented on June 2, 2024

I don't think we will be replacing Composer as the recommended installation method. Most popular packages use Composer these days. This library will also work with the autoloaders present in various frameworks, as long as they comply with PSR-4.

That said, it might be worth including an example of how to load the classes manually, if for some reason, you cannot use an autoloader.

from maxmind-db-reader-php.

orlitzky avatar orlitzky commented on June 2, 2024

Composer will work fine even with the require statements present, or with your own autoload.php in the source tree (but unused if installed by composer). For an example of that, there's an autoloader that I helped add to php-redmine-api a while back,

https://github.com/kbsali/php-redmine-api/blob/master/lib/autoload.php

If present, that file will use the composer autoloader; otherwise, it will use the custom one. That makes the instructions simple because you don't need to change them depending on whether or not you used composer to install the package -- either way, you just require('lib/autoload.php'). The main benefit however is that it works even without composer, which means that we can take the release tarball and run the tests, or check its SHA hash, without having to have a network connection or patch in our own autoloader.

I wouldn't want to make the experience for composer users worse, but rather make it better for everyone else. (So long as there's like, four files, in the library though -- a custom autoload.php would be more code than adding back the require statements.)

from maxmind-db-reader-php.

oschwald avatar oschwald commented on June 2, 2024

I'd prefer not to add the require statements to the classes, but as I mentioned above, I'd be ok with PHP file that could be used by users not using an autoloader. Preferably, this script would live outside of src/ and would be tested to ensure that it works going forward, both with the extension loaded and without.

from maxmind-db-reader-php.

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.