<?php
class Config{
public function __write($config_path, $cfg){
$body = '<?php
/* Configuration for database class
*
* data base types:
* mysql, postgresql, mssql, oracle, sqlite
*
*/
$dbconfig["type"] = "mysql";
$dbconfig["host"] = "'.$cfg["host"].'";
$dbconfig["user"] = "'.$cfg["user"].'";
$dbconfig["pass"] = "'.$cfg["pass"].'";
$dbconfig["name"] = "'.$cfg["name"].'";
$dbconfig["port"] = "";
?>';
$e = File::__write($config_path, $body, FILE_MODE_WRITE);
if (PEAR::isError($e)) {
return 'Could not write to file : ' . $e->getMessage();
}
}
}
?>