xami / oauth

Automatically exported from code.google.com/p/oauth
0 stars 0 forks source link

PHP: Please change private $dbh to protected in SimpleOAuthDataStore #160

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've had the need to test a different DBA backend than gdbm, as it wasn't
available in my PHP installation.

All I needed to do is subclass :
class MySimpleOAuthDataStore extends SimpleOAuthDataStore {/*{{{*/
  //  private $dbh;

  function __construct($path = "/tmp/oauth.qdbm") {/*{{{*/
    $this->dbh = dba_popen($path, 'n', 'qdbm');
    if(! $this->dbh) {
      throw new OAuthException("doooom!");
    }
 ...
But this required changing SimpleOAuthDataStore so that $dbh becomes a
protected attribute instead of a private one.

Could this be changed in the lib's code ?

Hope this helps.

Original issue reported on code.google.com by olber...@gmail.com on 5 May 2010 at 12:12

GoogleCodeExporter commented 8 years ago
A better fix would be to change the examples to something more sane.. (Like 
SQLite via PDO).. But otherwise this 
could work too, I guess..

Original comment by morten.f...@gmail.com on 7 May 2010 at 3:22