Re: [Fwd: Re: [PEAR-DEV] User authorisation class]

From: 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.de
-----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 XML
conguration
file 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 that
sets
the appropriate class properties "by hand" and builds the server list
as
an 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>:
Allrighty 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 and
     
XML
does add a lot of overhead. So going with an array structure (with
     
XML
as a potential source of the array structure in mind) first just
     
speeds
up development and then you can just generate the array structure
     
from
the XML in a second step if indeed other apps need to read and/or
     
write
that 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 everywhere
     
forgetting
how much overhead it adds, especially in a stateless environment
     
such as
PHP. For example another approach would be to have the server list just
     
be a
php file that defines the arrays and if other apps (especially non
     
php
apps) really need access to read and/or write you can offer a SOAP
     
or
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 sense
     
IMHO.
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.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
         
not
only
     
existing connections will be reused but also any new connection
         
created
     
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
XML to
     
define the server lists but just a simple php with an array.
         
Later
you
     
can then add the XML server list from which this php array can
         
be
generated. This will mean that the auth class does not need to constantly parse an XML file again. Also I don't know how often
         
some
other app really needs to read and/or write to the server list
         
anyways,
     
so I think you don't need to hurry with XML.
         
Actually, the XML part is already finished and works well - thanks
       
to
XML_Tree ;-) And it´s quite essential, as not only the server list is read
       
through
XML, but also general configuration data, such as: What session
       
name
to
     
use, what cookie settings etc.pp. - so that all applications that
       
use
the same ACLs can easily be set up to use the same settings by
       
tweaking
     
one central file. Regards, Markus -- 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.php
     
-- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.pear.dev (#7337) next »