diff options
author | tailor <cygnus@janrain.com> | 2006-02-14 18:59:36 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2006-02-14 18:59:36 +0000 |
commit | b7229617cefe6f02354bf69a4e4f1bd1b92ef253 (patch) | |
tree | 0ff28e65db170e350c26bfa25cb603f933b83214 | |
parent | 1f0b903e2df56ba3c671261ef7c13a002c46932c (diff) | |
download | php-openid-b7229617cefe6f02354bf69a4e4f1bd1b92ef253.zip php-openid-b7229617cefe6f02354bf69a4e4f1bd1b92ef253.tar.gz php-openid-b7229617cefe6f02354bf69a4e4f1bd1b92ef253.tar.bz2 |
[project @ Moved letter/digit/punct constants from Util.php to OpenID.php]
-rw-r--r-- | Auth/OpenID.php | 12 | ||||
-rw-r--r-- | Auth/OpenID/Association.php | 5 | ||||
-rw-r--r-- | Auth/OpenID/Consumer.php | 1 | ||||
-rw-r--r-- | Auth/OpenID/Store/FileStore.php | 6 | ||||
-rw-r--r-- | Auth/OpenID/Util.php | 24 | ||||
-rw-r--r-- | Tests/Auth/OpenID/Consumer.php | 1 | ||||
-rw-r--r-- | Tests/Auth/OpenID/StoreTest.php | 10 | ||||
-rw-r--r-- | Tests/Auth/OpenID/Util.php | 1 |
8 files changed, 18 insertions, 42 deletions
diff --git a/Auth/OpenID.php b/Auth/OpenID.php index 9f6a4b8..67104a3 100644 --- a/Auth/OpenID.php +++ b/Auth/OpenID.php @@ -84,6 +84,18 @@ define('Auth_OpenID_DO_AUTH', 'do_auth'); define('Auth_OpenID_DO_ABOUT', 'do_about'); /** + * Defines for regexes and format checking. + */ +define('Auth_OpenID_letters', + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); + +define('Auth_OpenID_digits', + "0123456789"); + +define('Auth_OpenID_punct', + "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"); + +/** * The OpenID utility function class. * * @package OpenID diff --git a/Auth/OpenID/Association.php b/Auth/OpenID/Association.php index b81d1ec..3676af6 100644 --- a/Auth/OpenID/Association.php +++ b/Auth/OpenID/Association.php @@ -15,13 +15,10 @@ */ /** - * Includes for utility functions. - */ -require_once 'Auth/OpenID/Util.php'; -/** * @access private */ require_once 'Auth/OpenID/CryptUtil.php'; + /** * @access private */ diff --git a/Auth/OpenID/Consumer.php b/Auth/OpenID/Consumer.php index f62ed60..b601cf4 100644 --- a/Auth/OpenID/Consumer.php +++ b/Auth/OpenID/Consumer.php @@ -191,7 +191,6 @@ require_once "Auth/OpenID/AuthenticationRequest.php"; require_once "Auth/OpenID/CryptUtil.php"; require_once "Auth/OpenID/DiffieHellman.php"; require_once "Auth/OpenID/KVForm.php"; -require_once "Auth/OpenID/Util.php"; /** * This is the status code returned when either the of the beginAuth diff --git a/Auth/OpenID/Store/FileStore.php b/Auth/OpenID/Store/FileStore.php index da08faf..07b5ba8 100644 --- a/Auth/OpenID/Store/FileStore.php +++ b/Auth/OpenID/Store/FileStore.php @@ -21,7 +21,6 @@ require_once 'Auth/OpenID.php'; require_once 'Auth/OpenID/Store/Interface.php'; require_once 'Auth/OpenID/HMACSHA1.php'; -require_once 'Auth/OpenID/Util.php'; /** * @access private @@ -111,9 +110,8 @@ function Auth_OpenID_listdir($dir) */ function Auth_OpenID_isFilenameSafe($char) { - global $_Auth_OpenID_letters, $_Auth_OpenID_digits; - $_Auth_OpenID_filename_allowed = $_Auth_OpenID_letters . - $_Auth_OpenID_digits . "."; + $_Auth_OpenID_filename_allowed = Auth_OpenID_letters . + Auth_OpenID_digits . "."; return (strpos($_Auth_OpenID_filename_allowed, $char) !== false); } diff --git a/Auth/OpenID/Util.php b/Auth/OpenID/Util.php deleted file mode 100644 index 0121c21..0000000 --- a/Auth/OpenID/Util.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * Util: URL manipulation utility functions for the OpenID library. - * - * PHP versions 4 and 5 - * - * LICENSE: See the COPYING file included in this distribution. - * - * @package OpenID - * @author JanRain, Inc. <openid@janrain.com> - * @copyright 2005 Janrain, Inc. - * @license http://www.gnu.org/copyleft/lesser.html LGPL - */ - -/** - * Some constants for string checking. - */ -$_Auth_OpenID_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; -$_Auth_OpenID_digits = "0123456789"; -$_Auth_OpenID_punct = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; - - -?>
\ No newline at end of file diff --git a/Tests/Auth/OpenID/Consumer.php b/Tests/Auth/OpenID/Consumer.php index 7ffe676..f9b2002 100644 --- a/Tests/Auth/OpenID/Consumer.php +++ b/Tests/Auth/OpenID/Consumer.php @@ -16,7 +16,6 @@ require_once 'Auth/OpenID/CryptUtil.php'; require_once 'Auth/OpenID/DiffieHellman.php'; require_once 'Auth/OpenID/Store/FileStore.php'; -require_once 'Auth/OpenID/Util.php'; require_once 'Auth/OpenID/KVForm.php'; require_once 'Auth/OpenID/Consumer.php'; require_once 'Auth/OpenID/HTTPFetcher.php'; diff --git a/Tests/Auth/OpenID/StoreTest.php b/Tests/Auth/OpenID/StoreTest.php index 48cf33e..a98f760 100644 --- a/Tests/Auth/OpenID/StoreTest.php +++ b/Tests/Auth/OpenID/StoreTest.php @@ -18,7 +18,6 @@ */ require_once 'Auth/OpenID/Association.php'; require_once 'Auth/OpenID/CryptUtil.php'; -require_once 'Auth/OpenID/Util.php'; require_once 'PHPUnit.php'; /** @@ -55,12 +54,9 @@ class Tests_Auth_OpenID_StoreTest extends PHPUnit_TestCase { */ function setUp() { - global $_Auth_OpenID_letters, $_Auth_OpenID_digits, - $_Auth_OpenID_punct; - - $this->letters = $_Auth_OpenID_letters; - $this->digits = $_Auth_OpenID_digits; - $this->punct = $_Auth_OpenID_punct; + $this->letters = Auth_OpenID_letters; + $this->digits = Auth_OpenID_digits; + $this->punct = Auth_OpenID_punct; $this->allowed_nonce = $this->letters . $this->digits; $this->allowed_handle = $this->letters . $this->digits . $this->punct; } diff --git a/Tests/Auth/OpenID/Util.php b/Tests/Auth/OpenID/Util.php index 9ad024e..838a5a6 100644 --- a/Tests/Auth/OpenID/Util.php +++ b/Tests/Auth/OpenID/Util.php @@ -14,7 +14,6 @@ */ require_once 'PHPUnit.php'; -require_once 'Auth/OpenID/Util.php'; require_once 'Auth/OpenID.php'; class Tests_Auth_OpenID_Util extends PHPUnit_TestCase { |