You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
postfixadmin/tests/bootstrap.php

38 lines
768 B
PHTML

<?php
define('POSTFIXADMIN', 1);
define('POSTFIXADMIN_CLI', 1);
require_once(dirname(__FILE__) . '/../vendor/autoload.php');
require_once(dirname(__FILE__) . '/../common.php');
6 years ago
$CONF['default_language'] = 'en';
$CONF['language_hook'] = '';
$db_file = dirname(__FILE__) . '/postfixadmin.sqlite.test';
6 years ago
$CONF['database_type'] = 'sqlite';
$CONF['database_name'] = $db_file;
6 years ago
Config::write('database_type', 'sqlite');
Config::write('database_name', $db_file);
6 years ago
clearstatcache();
if (file_exists($db_file)) {
unlink($db_file);
}
6 years ago
touch($db_file);
list($db, $error_text) = db_connect_with_errors();
6 years ago
if ($db === false) {
6 years ago
echo "failed to connect to database\n";
echo $error_text;
exit(1);
}
6 years ago
require_once(dirname(__FILE__) . '/../public/upgrade.php');