Hi, Thanks for the reply..
just trying to implement Oauth2.0 server by bshaffer https://github.com/bshaffer/oauth2-server-php with phalcon and rewrite the code based on its interfaces.
here's code from Pdo Storage Constructor
public function __construct($connection, $config = array())
{
if (!$connection instanceof \PDO) {
if (is_string($connection)) {
$connection = array('dsn' => $connection);
}
if (!is_array($connection)) {
throw new \InvalidArgumentException('First argument to OAuth2\Storage\Pdo must be an instance of PDO, a DSN string, or a configuration array');
}
if (!isset($connection['dsn'])) {
throw new \InvalidArgumentException('configuration array must contain "dsn"');
}
// merge optional parameters
$connection = array_merge(array(
'username' => null,
'password' => null,
), $connection);
$connection = new \PDO($connection['dsn'], $connection['username'], $connection['password']);
}
$this->db = $connection;
// ........
}