Re: [PEPr] Call for votes on Authentication::OpenID
| From: | Lorenzo Alberton | Date: | Wed, 08 Feb 2006 20:21:31 +0000 |
| Subject: | Re: [PEPr] Call for votes on Authentication::OpenID | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41250@lists.php.net to get a copy of this message | ||
Jonathan Daugherty wrote:
I can see lots of global functions and variables... you should wrap them inside a full qualified class. I realize the dangers of global variables and it's understandable that most people see them and react violently. I can assure you that we reserved global variables for situations where they made sense.Can't you put them as class vars?
As for the functions, they're already namespaced according to the PEAR guidelines.no, they're not really: function Auth_OpenID_ensureDir() { } function Auth_OpenID_array_get() { } should be: class Auth_OpenID_Utils {
function ensureDir() { }
function array_get() { }
}
and should be called statically, if you prefer so:
$sth = Auth_OpenID_Utils::ensureDir($var);
or alternatively
$utils = new Auth_OpenID_Utils();
$sth = $utils->ensureDir($var);
HTH
Regards,
--
Lorenzo Alberton
http://pear.php.net/user/quipo