Re: [Fwd: Re: [PEAR-DEV] User authorisation class]
| From: | Alan Knowles | Date: | Tue, 25 Jun 2002 00:21:49 +0000 |
| Subject: | Re: [Fwd: Re: [PEAR-DEV] User authorisation class] | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7337@lists.php.net to get a copy of this message | ||
From what I've done on the DB_DataObject for configuration - it is reasonably neutral to whatever format the user wishes to use...
Easiest method of setting options
$config = parse_ini_file('myconfig.ini',TRUE);
foreach($config as $class=>$o) {
$options = &PEAR::getStaticPropery($class,'options');
$options = $o;
}
of course the parse_ini_file can be replaced with the config class, or any other method you like...
I also store the current database results object, connection array and cached results in
PEAR::getStaticPropery('DB_DataObject','connections');
PEAR::getStaticPropery('DB_DataObject','cache');
PEAR::getStaticPropery('DB_DataObject','results');
Its a great method for organizing static data relating to a single object, which would otherwise end up as a global..
Anyway - this thought this may help....
regards
alan
Lukas Smith wrote:
Yeah ... having both is optimal ... My mail was more a general rant against XML overuse :-) And a reminder that XML is just a storage facility and as such not all that much a critical design decision, because most of the time in the end the XML data will end up in a language specific array anyways :-) Looking forward to your work. Best regards, Lukas Smith smith@dybnet.de _______________________________ DybNet Internet Solutions GbR Reuchlinstr. 10-11 Gebäude 4 1.OG Raum 6 (4.1.6) 10553 Berlin Germany Tel. : +49 30 83 22 50 00 Fax : +49 30 83 22 50 07 www.dybnet.de info@dybnet.denot-----Original Message----- From: Markus Wolff [mailto:wolff@21st.de] Sent: Tuesday, June 25, 2002 12:10 AM To: smith@dybnet.de Cc: rocha@i-node.com.br; pear-dev@lists.php.net Subject: Re: [Fwd: Re: [PEAR-DEV] User authorisation class] Hi Lukas, alright, I see your point. I´ll do it this way: Using an XMLcongurationfile is optional and if you use one, you can set another option to enable caching (using PEAR::Cache) - but I´ll add the caching feature later on, as it´s a nice-to-have thing, IMO. If you don´t want to use XML, you can simply make a PHP script thatsetsthe appropriate class properties "by hand" and builds the server listasan array. As the class does exactly this with the XML values already, this is not a big change. Regards, Markus Am Mon, 24 Jun 2002 23:59:54 +0200 schrieb "Lukas Smith" <smith@dybnet.de>:XMLAllrighty then ... In your case I would have really gone with a non XML version first. You will need to parse the XML into an array structure anyways andXMLdoes add a lot of overhead. So going with an array structure (withspeedsas a potential source of the array structure in mind) first justfromup development and then you can just generate the array structurewritethe XML in a second step if indeed other apps need to read and/orforgettingthat data. And the good thing is that then you can also easily add a caching mechanism. I just think that often people think XML is cool everywheresuch ashow much overhead it adds, especially in a stateless environmentbe aPHP. For example another approach would be to have the server list justphpphp file that defines the arrays and if other apps (especially nonorapps) really need access to read and/or write you can offer a SOAPIMHO.XMLRPC services that does that (and enjoy all the fun of XML). That might even be better, because that would ensure that only one method exists to modify this central list which for security makes senseBest regards, Lukas Smith smith@dybnet.de _______________________________ DybNet Internet Solutions GbR Reuchlinstr. 10-11 Gebäude 4 1.OG Raum 6 (4.1.6) 10553 Berlin Germany Tel. : +49 30 83 22 50 00 Fax : +49 30 83 22 50 07 www.dybnet.de info@dybnet.de-----Original Message----- From: Markus Wolff [mailto:wolff@21st.de] Sent: Monday, June 24, 2002 11:02 PM To: smith@dybnet.de Cc: rocha@i-node.com.br; pear-dev@lists.php.net Subject: Re: [Fwd: Re: [PEAR-DEV] User authorisation class] Am Mon, 24 Jun 2002 09:23:48 +0200 schrieb "Lukas Smith" <smith@dybnet.de>:2 more things. 1) The array I mentioned should be passed by reference and any new connections should be also referenced in this array. This way
createdonlyexisting connections will be reused but also any new connection
by the auth class can be then used by the app.
Hi Lukas, that shouldn´t be a problem.
2) If you want to get this thing going ASAP maybe you should not
use
LaterXML todefine the server lists but just a simple php with an array.
beyoucan then add the XML server list from which this php array can
somegenerated. This will mean that the auth class does not need to constantly parse an XML file again. Also I don't know how often
toActually, the XML part is already finished and works well - thanksanyways,other app really needs to read and/or write to the server listso I think you don't need to hurry with XML.
throughXML_Tree ;-) And it´s quite essential, as not only the server list is read
nameXML, but also general configuration data, such as: What session
usetouse, what cookie settings etc.pp. - so that all applications that
-- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpthe same ACLs can easily be set up to use the same settings bytweakingone central file. Regards, Markus -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php