AW: AW: AW: [Phpmyadmin-devel] Re: Apache 2.0.* and PHP 4.2.?
Robin Johnson
robbat2 at fermi.orbis-terrarum.net
Thu May 23 02:46:04 CEST 2002
On Thu, 23 May 2002, Beck, Mike wrote:
> ACK, now at least i see what you are doing... but i still think it is more
> complicated than it needs to be. of course you can put the serialized data
> in the db, but why not just put it in the db like
> table db
> id host con_type dbuser dbpass....
> 1 localhost tcp ....
> 2 212.114.248.20 tcp ...
>
> $local_query = 'SELECT * FROM db';
> $rs = mysql_query($local_query, $dbh);
> $count =count($cfg['Servers']); // assuming we allready read the
> configfile
> while ($row = mysql_fetch_array($rs)) {
> $cfg['Servers'][$count]['host'] = $row['host'];
> $count ++;
> }
This method fails dismally. It would be very non-portable between versions
of PMA, and additionally, how do you handle multi-dimensonal data without
adding more rows?
A configuration file might have two or three servers, each with a number
of IP Allow/Deny rules.
Effectively, we have array nesting 3 levels deep already with this, so
giving each variable a field in the table is not practical.
Additionally, my method using XML + XPath allows the administrator of each
copy of PMA to completely customize what the user is allowed to change,
with only a single line in the configuration file. (This is one of those
security preferences that is not available in the DB-Config level).
> of course it might need a little extra time going through this data and
> putting it in the configvariable, but surely not enough that there is such a
> pressing need to use another way that we'd rather make it work only with >=
> 4.2 ??
Let me finish coding it up the way I have in mind, with the
customizability and view towards the future, and then tell me if you can
port all of those features to PHP3 without XPath. That XPath class is the
single thing standing in the way of the code working on PHP3, and it is
something I am using from outside, just like the FPDF library.
For my XPath axes, I basically need to be able to match the following
example axes:
/PmaAbsoluteUri
/Servers/*/controlpass
/Servers/*/AllowDeny/order
/OBGzip | /GZipDump
I don't really need any of the XPath functions [count() etc.], although
they would come in handy.
If you want, I will provide a sample of the XML configuration file as
well.
--
Robin Hugh Johnson
E-Mail : robbat2 at orbis-terrarum.net
Home Page : http://www.orbis-terrarum.net/?l=people.robbat2
ICQ# : 30269588 or 41961639
More information about the Developers
mailing list