Anant Narayanan [2006-01-22 17:06 UTC] Hello All!
This is my first proposal to PEAR, hope you like it. Based on response I plan to add additional features to the package:
Schema for the phpindefs.xml file (This may be adopted officially for describing the configuration options of php.ini?)
Auto detection of various php.ini files present on a system.
Easier editing of options in the GUI (This part is dependent on the development of PHP-Gtk2 itself)
Parsing of existing INI files is slow, but I couldn't figure out any better way to do it.
Comments, Suggestions, Criticisms are most welcome!
Cheers!
Christian Weiske [2006-01-22 17:10 UTC] I couldn't test it yet, but some notes:
- The package file isn't valid. I get the following:
cweiske:~> pear5 install /data/download/Gtk2_PHPConfig-0.4.tgz
Invalid tag order in <package>, found <> expected one of "usesrole, usestask, providesextension, srcpackage, srcuri, phprelease, extsrcrelease, extbinrelease, bundle"
- Since it's a GUI tool, it should provide some method to load a file via GUI and not only via command line
- The quit method should provide a way to cancel the closing process via "Yes/No/Cancel" instead of yes/no only.
- It would be nice if the ini structure could be kept, including all of the comments. I personally hate it if I edit my config files with a graphical tool, but loose all the comments I made by hand.
- Don't hard-code the "NEW" file name but use a constant. Better use NULL, as a file may be named "NEW"
- I don't know where DomDocument looks for files, but it seems to me as if it's only the current working directory. Use dirname(__FILE__) to determine the file directory.
Christian Weiske [2006-01-22 17:12 UTC] I forgot to add that you can use the Config package to load an existing ini file.
Anant Narayanan [2006-01-23 13:11 UTC] Fixed requests from Christian. Any more suggestions?
Scott Mattocks [2006-01-23 14:30 UTC] Hi Anant,
This is a nice application, but I have a few suggestions:
- There are some notices thrown during use of the application. These should be cleaned up.
Notice: Undefined index: Comments in /usr/share/pear/Gtk2/PHPConfig.php on line 310
Notice: Undefined variable: i in /usr/share/pear/Gtk2/PHPConfig.php on line 336
- There is no way to add a new extension. I can only overwrite the value of the current extension directive.
- Add #!/usr/bin/php to run.phpw and give it a role="script".
- I think it would be a good idea to break this class up into a base class (that uses Config) that parses and saves the ini file and also gets and sets the values. You could call it Config_PHPini. Then take all the GUI stuff and put in in a class called Config_PHPini_GUI_Gtk2. That way other people can come along and create different GUIs for the base package. Such as Config_PHPini_GUI_Web or Config_PHPini_GUI_CLI.
Scott Mattocks
Scott Mattocks [2006-01-23 14:31 UTC] Sorry. I forgot to add that your run.phpw script should use this require_once statement instead of the one you have:
require_once 'Gtk2/PHPConfig.php';
Scott Mattocks
Anant Narayanan [2006-01-25 07:03 UTC] Warnings and run.phpw fixed as mentioned by Scott.
phpinidefs.xml is intended to be an exhaustive list of all available configurations options. That file was made with the intention of extendability. So, if in the future, some PHP directives are added/modified, only the XML file needs be modified manually.
If anyone wants to add/modify an extension or a directive, doing so in the XML file would suffice.
|