CVS: phpweather/config make_config.php,1.5,1.6
Brought to you by:
iridium
From: Martin G. <gim...@us...> - 2002-11-10 23:15:44
|
Update of /cvsroot/phpweather/phpweather/config In directory usw-pr-cvs1:/tmp/cvs-serv23055/config Modified Files: make_config.php Log Message: A new database backend: ADOdb. This is a wrapper library written in PHP that supports no less than 28(!) databases. So now there's no excuse for not using a database with PHP Weather. Index: make_config.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/config/make_config.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- make_config.php 2 Sep 2002 18:17:52 -0000 1.5 +++ make_config.php 10 Nov 2002 23:15:41 -0000 1.6 @@ -52,6 +52,11 @@ $sql_dep = new pw_dependency_or('db_type', array('mysql', 'pgsql')); $dba_dep = new pw_dependency('db_type', 'dba'); $proxy_dep = new pw_dependency('use_proxy', 'true'); + $adodb_dep = new pw_dependency('db_type', 'adodb'); + $adodb_ext_dep = new pw_dependency('db_adodb_ext', 'true'); + + $not_empty_validator = new pw_validator_ereg("Sorry, the empty string '' cannot be " . + "used here", '^.+$'); $port_validator = new pw_validator_range("Sorry, '%s' is not a valid port-number " . "because is't outside the range 1-65536", @@ -147,7 +152,55 @@ array('null' => 'No database at all', 'mysql' => 'A MySQL database', 'pgsql' => 'A PostgreSQL database', - 'dba' => 'A DBA database')); + 'dba' => 'A DBA database', + 'adodb' => 'The ADOdb wrapper library')); + + $options['db_adodb_path'] = + new pw_option_text('db_adodb_path', + "We need to know where we can find the ADOdb library. " . + "The default is for a Debian GNU/Linux system, but " . + "you'll probably have to change it.", + array($adodb_dep), + false, // we could try to validate the path... + '/usr/share/adodb'); + + $options['db_adodb_driver'] = + new pw_option_text('db_adodb_driver', + "Please select a driver to use with the ADOdb " . + "wrapper library. You can get a list of drivers from " . + '<a href="http://php.weblogs.com/ADODB_Manual#drivers">' . + "the ADOdb Manual</a>.", + array($adodb_dep), + $not_empty_validator); + + $options['db_adodb_ext'] = + new pw_option_boolean('db_adodb_ext', + "If you need to load an extension for ADOdb to work, " . + "then set this option to 'Yes'. PHP might have been " . + "compiled with support for MySQL, but the extension " . + "isn't necessarily loaded.", + array($adodb_dep), + array('false' => 'No', 'true' => 'Yes')); + + $options['db_adodb_ext_name'] = + new pw_option_text('db_adodb_ext_name', + "If you need to load an extension go get your database " . + "to work, then specify the name here. For example, if " . + "you're using MySQL, then the extension is called " . + "'mysql', or if you're using PostgreSQL, then it's " . + "called 'pgsql'.", + array($adodb_ext_dep), + $not_empty_validator); + + $options['db_adodb_ext_file'] = + new pw_option_text('db_adodb_ext_file', + "The name of the extension isn't enough to guess the " . + "filename to load. For example, if you're using the " . + "'mysql' extension with the MySQL database, then the " . + "file to load is either 'mysql.so' on a Unix based " . + "system, or 'mysql.dll' on a Windows based system.", + array($adodb_ext_dep), + $not_empty_validator); $options['db_handler'] = new pw_option_select('db_handler', @@ -303,7 +356,9 @@ 'retrieves. This is very nice, since it takes at ' . 'least a second or two to fetch a METAR from the ' . 'National Weather Service.', - array('db_type', 'db_handler', 'db_pconnect', 'always_use_db', + array('db_type', 'db_adodb_path', 'db_adodb_driver', + 'db_adodb_ext', 'db_adodb_ext_name', 'db_adodb_ext_file', + 'db_handler', 'db_pconnect', 'always_use_db', 'cache_timeout', 'db_hostname', 'db_port', 'db_username', 'db_password', 'db_database', 'db_metars', 'db_stations', 'db_countries'), |