Coder Social home page Coder Social logo

Autoload ability about oauth2-client HOT 7 CLOSED

thephpleague avatar thephpleague commented on May 18, 2024
Autoload ability

from oauth2-client.

Comments (7)

alexbilbie avatar alexbilbie commented on May 18, 2024

You're the first person to have asked for a non-Composer based autoloading mechanism so at present there isn't a solution—
Sent from my iPhone

On Mon, May 19, 2014 at 4:15 PM, Colorfully.Me [email protected]
wrote:

Hi, thanks for this great library!

How one can/should autoload this lib when cloning it as a sub-module via git? Have searched the code base but did not found any autoload function to invoke when not using composer as dependency manager for instance.

Reply to this email directly or view it on GitHub:
#96

from oauth2-client.

kkartunov avatar kkartunov commented on May 18, 2024

Hum, was about to write/add one PSR-0 autoloader myself but inspecting the classes closely now I see that there is a hard coded hidden dependency to guzzle too :(

I think this dep. should be reflected into the Requirements section of the README.md.
And adding autoload ability will help people cloning this repo work on it too.

from oauth2-client.

TomHAnderson avatar TomHAnderson commented on May 18, 2024

ColorfullyMe: I cannot find a reason why you would not use composer when you require this project or any other composable package. This requires composer.phar which provides the autoloader you are looking for. Even if you were to write your own autoloader as you suggest it would be a requirement of your autoloader to install dependencies.

Trying to use packages like stand alone libraries given today's package manager-centric development belies a lack of understanding of what a package manager is for.

Your idea for PSR-0 shows you're 3.5 years behind in your knowledge of PHP development. This package has moved forward and is PSR-4 compliant. I've heard it said on more than one occasion that skills as a developer are only good for 3 years and yours have expired.

from oauth2-client.

alexbilbie avatar alexbilbie commented on May 18, 2024

@ColorfullyMe I'm sorry but I don't have the time to write a one off autoloader that considers also autoloading Guzzle.

For the record I don't support @TomHAnderson's unnecessary rudeness regarding your skills as a developer.

from oauth2-client.

kkartunov avatar kkartunov commented on May 18, 2024

@TomHAnderson PSR is a specification for defining a coding standard for PHP. There's five versions of it: PSR-0, PSR-1, PSR-2, PSR-3 and PSR-4 each addressing a specific aspect of coding. PSR describes a specification for autoloading classes from file paths. It is fully interoperable, and can be used in addition to any other autoloading specification, including PSR-0. In other words the numbers does not matter this much...When it comes just to auto load classes from files placed in specific folder structure you can use any of those and there is no need to implement space shuttle to just go to the bar at the next street corner.
Dependency management is indeed feature that everybody should treasure and I'm not a exception.

from oauth2-client.

kkartunov avatar kkartunov commented on May 18, 2024

@alexbilbie Thank You!
I relay believe that the src/Provider/AbstractProvider.php(and maybe others) should be re-factored. This will/should elevate things further by decoupling the project from its dependency to Guzzle.

Also from testing point of view this will be much better:

public function __construct($options = array(), GuzzleClient GC)
    {
        foreach ($options as $option => $value) {
            if (isset($this->{$option})) {
                $this->{$option} = $value;
            }
        }

        $this->setHttpClient(new GC);
    }

Because it allows mocks by using constructor dependency injection.

Good work i wish You!

from oauth2-client.

philsturgeon avatar philsturgeon commented on May 18, 2024

I will not tolerate this sort of idiocy.

@ColorfullyMe thank you for asking us about how this works. It is a fair question, and many packages out there do offer support for autoloading without just assuming you have Composer installed. We sadly have not had anyone ask us before, and do ourselves happen to use Composer, so we have not built in support for this.

I am sorry that @TomHAnderson decided to come in here and shout about how his way is the one and only true way. He has done this before and its always fucking obnoxious when he does. He is a very smart developer who needs to grow up a little and accept that there are quite a few ways to skin a cat.

@TomHAnderson You've made some great contributions. Please don't ruin that by being an obnoxious jackass all over our GitHub repos.

from oauth2-client.

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.