summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2006-01-18 23:09:56 +0000
committertailor <cygnus@janrain.com>2006-01-18 23:09:56 +0000
commit64cdc69b117dabc9d138d41ab8bae28f274bfe95 (patch)
treefb97cbbd375e054e325676d993abbf89d127af5a /examples
parentbd13abf337f79f8550c04aebf91e8ddfb8a1e64e (diff)
downloadphp-openid-64cdc69b117dabc9d138d41ab8bae28f274bfe95.zip
php-openid-64cdc69b117dabc9d138d41ab8bae28f274bfe95.tar.gz
php-openid-64cdc69b117dabc9d138d41ab8bae28f274bfe95.tar.bz2
[project @ Cleaned up bugs in example consumer]
Diffstat (limited to 'examples')
-rw-r--r--examples/consumer.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/consumer.php b/examples/consumer.php
index ea53098..855a344 100644
--- a/examples/consumer.php
+++ b/examples/consumer.php
@@ -25,7 +25,7 @@ require_once("Auth/OpenID/OIDUtil.php");
*/
$store_type = 'file';
-if ($store_type = 'sqlite') {
+if ($store_type == 'sqlite') {
require_once("Auth/OpenID/Store/SQLStore.php");
@@ -62,7 +62,7 @@ if ($store_type = 'sqlite') {
*/
$store->createTables();
-} else if ($store_type = 'pgsql') {
+} else if ($store_type == 'pgsql') {
require_once("Auth/OpenID/Store/SQLStore.php");
@@ -80,6 +80,12 @@ if ($store_type = 'sqlite') {
$db =& DB::connect($dsn);
+ if (PEAR::isError($db)) {
+ print "Database connection error: " .
+ $db->getMessage();
+ exit(0);
+ }
+
$store = new Auth_OpenID_PostgreSQLStore($db);
/**