Files
DomFramework/Tests/autoload.php.dist

48 lines
1.5 KiB
Plaintext

<?php
/** Autoload */
spl_autoload_register(function ($class) {
@include $class . '.php';
});
define ("PHPUNIT", "ON-GOING");
define ("CONFIGFILE", "./Tests/configuration.php");
if (! file_exists (CONFIGFILE))
die ("No Config file found in ".CONFIGFILE."\n");
echo "Configuration file : ".CONFIGFILE."\n";
if (file_exists ("/tmp/database.db"))
{
unlink ("/tmp/database.db");
}
file_put_contents ("Tests/dblayerSqliteTest.php",
str_replace ("{ENGINE}", "sqlite",
file_get_contents ("Tests/dblayerComplet.php")));
file_put_contents ("Tests/dblayerMySQLTest.php",
str_replace ("{ENGINE}", "mysql",
file_get_contents ("Tests/dblayerComplet.php")));
file_put_contents ("Tests/dblayerPostgreSQLTest.php",
str_replace ("{ENGINE}", "pgsql",
file_get_contents ("Tests/dblayerComplet.php")));
require_once ("domframework/config.php");
/** The class need to take care of configuration parameters */
class configuration extends config
{
/** All the default parameters in the configuration */
function __construct ()
{
$this->default = array (
"database"=>array ("dsn"=>null,
"username"=>null,
"password"=>null,
"driver_options"=>null,
"tableprefix"=>""),
);
if (defined("CONFIGFILE"))
$this->confFile = CONFIGFILE;
}
}
// vim: syntax=on filetype=php