Jump to content

OAuth PDO


hackalive

Recommended Posts

The developer writes

 

/**

* @file

* Sample OAuth2 Library PDO DB Implementation.

*

* Simply pass in a configured PDO class, eg:

* new OAuth2StoragePDO( new PDO('mysql:dbname=mydb;host=localhost', 'user', 'pass') );

*/

 

But where? I have been so far unable to get it to work.

 

Hopefully someone with better understanding of PDO can help me out.

 

Thanks

Link to comment
Share on other sites

You have got to be kidding. You marked that other thread as being solved. Both kicken and I posted code to use. I even pointed out some errors in the example code (you have got to ask yourself if the example code and comments in the script are so poor, how good can the code in the class be) and posted the exact changes that you needed to try.

 

If you didn't get it to work, there's absolutely no point in starting a new thread for the same problem without providing any new or actual information about what problems, errors, or symptoms you are getting and what your exact code is that you tried. We cannot help you based on you simply stating you cannot get something to work and repeatedly bumping a thread. For all we know, it's not working for you because you don't have any PDO driver installed.

 

Do you have any actual information that you can supply that would allow someone to actually help you? What have you done to debug what the code is actually doing? What symptoms or errors are you getting?

 

 

Link to comment
Share on other sites

I just re-downloaded the .zip source of that class and someone has corrected at least the incorrect include file name and the incorrect class name in the comment that is serving as the documentation on how to instigate the class and pass it an instance of a PDO class. However, they did not update any of the other information in that repository site to indicate that they even did this. Simply, sloppy.

 

i dont know where to put the DB details for the PDO!

 

You put the database details in when you make an instance of the PDO class (if you don't understand the PDO class, stop now and go read that section in the php.net documentation.) The dbname=mydb, host=localhost, user, and pass are the database name, hostname, database username, and database password values in the following line of code -

 

Assuming that your page makes an instance of a PDO class at some point - $dbConnection = new PDO('mysql:dbname=mydb;host=localhost', 'user', 'pass');

Link to comment
Share on other sites

Your previous thread had this, along with a specific line of code for the addclient.php example -

 

Change any use of new OAuth2StoragePDO() in the 'example' pages to - new OAuth2StoragePDO($dbConnection)

 

Line 15 of addclient.php would become -

  $oauth = new OAuth2StoragePDO($dbConnection);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.