diff options
author | tailor <cygnus@janrain.com> | 2006-01-25 23:38:54 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2006-01-25 23:38:54 +0000 |
commit | 2ad2158dfba634d9d9e7c3b345682a19f5b7972a (patch) | |
tree | d35b48b055e92b6cf1ae43af0f7f48e76c9cafca | |
parent | 4b1b8d265ebc57c5cd85bf97ccd2b90e35e29c3a (diff) | |
download | php-openid-2ad2158dfba634d9d9e7c3b345682a19f5b7972a.zip php-openid-2ad2158dfba634d9d9e7c3b345682a19f5b7972a.tar.gz php-openid-2ad2158dfba634d9d9e7c3b345682a19f5b7972a.tar.bz2 |
[project @ Added common.php file for example consumer implementation.]
-rw-r--r-- | examples/consumer/common.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/examples/consumer/common.php b/examples/consumer/common.php new file mode 100644 index 0000000..81ec864 --- /dev/null +++ b/examples/consumer/common.php @@ -0,0 +1,36 @@ +<?php + +/** + * Require the OpenID consumer code. + */ +require_once "Auth/OpenID/Consumer/Consumer.php"; + +/** + * Require the "file store" module, which we'll need to store OpenID + * information. + */ +require_once "Auth/OpenID/Store/FileStore.php"; + +/** + * This is where the example will store its OpenID information. You + * should change this path if you want the example store to be created + * elsewhere. After you're done playing with the example script, + * you'll have to remove this directory manually. + */ +$store_path = "/tmp/_php_consumer_test"; + +if (!file_exists($store_path) && + !mkdir($store_path)) { + print "Could not create the FileStore directory '$store_path'. ". + " Please check the effective permissions."; + exit(0); +} + +$store = new Auth_OpenID_FileStore($store_path); + +/** + * Create a consumer object using the store object created earlier. + */ +$consumer = new Auth_OpenID_Consumer($store); + +?>
\ No newline at end of file |