Files
DomFramework/Tests/autoload.php.dist

46 lines
1.6 KiB
Plaintext

<?php
/** Autoload */
spl_autoload_register(function ($class) {
$classes = array ();
foreach (scandir ("src") as $file)
{
$fileShort = basename ($file);
if ($fileShort == "." || $fileShort == "..")
continue;
$classFile = substr ($fileShort, 0, -4);
$classes["Domframework\\".$classFile] = "src/$file";
}
if (key_exists ($class, $classes))
{
@include ($classes[$class]);
}
else
{
echo "ERROR : $class : doesnt exists in src\n";
}
});
define ("PHPUNIT", "ON-GOING");
file_put_contents ("Tests/DblayerooSqliteTest.php",
str_replace ("{ENGINE}", "sqlite",
file_get_contents ("Tests/DblayerooComplet.php")));
file_put_contents ("Tests/DblayerooMySQLTest.php",
str_replace ("{ENGINE}", "mysql",
file_get_contents ("Tests/DblayerooComplet.php")));
file_put_contents ("Tests/DblayerooPostgreSQLTest.php",
str_replace ("{ENGINE}", "pgsql",
file_get_contents ("Tests/DblayerooComplet.php")));
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")));
// vim: syntax=on filetype=php