summaryrefslogtreecommitdiffstats
path: root/Auth/OpenID
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2006-02-14 01:00:58 +0000
committertailor <cygnus@janrain.com>2006-02-14 01:00:58 +0000
commit480ae2abfc23162453d7d675f782858c14fa46ab (patch)
treea7a02f2c34087605536eb74f4f87de9768e237db /Auth/OpenID
parent080b9a9473492e641dbce7efac47f67e819d2ac1 (diff)
downloadphp-openid-480ae2abfc23162453d7d675f782858c14fa46ab.zip
php-openid-480ae2abfc23162453d7d675f782858c14fa46ab.tar.gz
php-openid-480ae2abfc23162453d7d675f782858c14fa46ab.tar.bz2
[project @ Moved ensureDir from Util to OpenID]
Diffstat (limited to 'Auth/OpenID')
-rw-r--r--Auth/OpenID/Store/FileStore.php11
-rw-r--r--Auth/OpenID/Util.php20
2 files changed, 6 insertions, 25 deletions
diff --git a/Auth/OpenID/Store/FileStore.php b/Auth/OpenID/Store/FileStore.php
index 232b24f..da08faf 100644
--- a/Auth/OpenID/Store/FileStore.php
+++ b/Auth/OpenID/Store/FileStore.php
@@ -18,6 +18,7 @@
/**
* Require base class for creating a new interface.
*/
+require_once 'Auth/OpenID.php';
require_once 'Auth/OpenID/Store/Interface.php';
require_once 'Auth/OpenID/HMACSHA1.php';
require_once 'Auth/OpenID/Util.php';
@@ -189,7 +190,7 @@ class Auth_OpenID_FileStore extends Auth_OpenID_OpenIDStore {
*/
function Auth_OpenID_FileStore($directory)
{
- if (!Auth_OpenID_ensureDir($directory)) {
+ if (!Auth_OpenID::ensureDir($directory)) {
trigger_error('Not a directory and failed to create: '
. $directory, E_USER_ERROR);
}
@@ -231,10 +232,10 @@ class Auth_OpenID_FileStore extends Auth_OpenID_OpenIDStore {
*/
function _setup()
{
- return (Auth_OpenID_ensureDir(dirname($this->auth_key_name)) &&
- Auth_OpenID_ensureDir($this->nonce_dir) &&
- Auth_OpenID_ensureDir($this->association_dir) &&
- Auth_OpenID_ensureDir($this->temp_dir));
+ return (Auth_OpenID::ensureDir(dirname($this->auth_key_name)) &&
+ Auth_OpenID::ensureDir($this->nonce_dir) &&
+ Auth_OpenID::ensureDir($this->association_dir) &&
+ Auth_OpenID::ensureDir($this->temp_dir));
}
/**
diff --git a/Auth/OpenID/Util.php b/Auth/OpenID/Util.php
index 8bed09b..6894ca1 100644
--- a/Auth/OpenID/Util.php
+++ b/Auth/OpenID/Util.php
@@ -21,26 +21,6 @@ $_Auth_OpenID_digits = "0123456789";
$_Auth_OpenID_punct = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
/**
- * Create dir_name as a directory if it does not exist. If it exists,
- * make sure that it is, in fact, a directory. Returns true if the
- * operation succeeded; false if not.
- *
- * @access private
- */
-function Auth_OpenID_ensureDir($dir_name)
-{
- if (is_dir($dir_name) || @mkdir($dir_name)) {
- return true;
- } else {
- if (Auth_OpenID_ensureDir(dirname($dir_name))) {
- return is_dir($dir_name) || @mkdir($dir_name);
- } else {
- return false;
- }
- }
-}
-
-/**
* Convenience function for getting array values.
*
* @access private