0

I'm new with Composer. I have added the Lusitanian/PHPOAuthLib with Composer and then I created psr-4 autoload directory and I made a class in that named OAuth.

I gave namespace which I want but I'm unable to use the PHPOAuthLib with my class, anyone idea what is the basic steps? Below is my code which I have written for Composer and OAuth class.

Composer code:

{ 
    "require": {
        "php": ">=5.3.0"
    },
    "require-dev": {
    "lusitanian/oauth": "~0.3"
    },
    "autoload": {
        "psr-4": {
            "MyOAuth\\NS\\": "app/base"
        }
    }
}

OAuth class code:

namespace MyOAuth\NS;

class MyOAuthNS
{

    public $client_id;
    public $client_secret;
    public $code;
    public $access_token;
    public $redirect_uri;
}
halfer
  • 19,824
  • 17
  • 99
  • 186
  • I know this question is five weeks old or so, but I can't see a clear statement of a problem. Are you looking for implementation examples? There is an `examples` folder in the root of the project, have you looked there? – halfer Dec 18 '14 at 21:43
  • Hi Thanks for your reply, basically i figure this out, but i don't know how to make a composer project, can you explain me if i'm using this library in my project so i want to include this library in my project and i want my project in compose dependency, can you explain me how to do it. – Muhammad Adil Dec 22 '14 at 09:04
  • There is an [example in the docs](https://github.com/Lusitanian/PHPoAuthLib) of how to add this to a Composer project. (You probably want `require` rather than `require-dev`, unless it is a dev-only dependency). Other than that, in what way are you stuck? Does what you have not work? – halfer Dec 22 '14 at 09:28

0 Answers0