2017-01-09 11:05:33 +01:00
|
|
|
<?php
|
2017-03-03 17:31:50 +01:00
|
|
|
require_once "vars.inc.php";
|
2017-01-09 11:05:33 +01:00
|
|
|
ini_set('error_reporting', 0);
|
2017-03-03 17:31:50 +01:00
|
|
|
$has_object = 0;
|
2017-01-09 11:05:33 +01:00
|
|
|
header('Content-Type: text/plain');
|
|
|
|
$dsn = $database_type . ':host=' . $database_host . ';dbname=' . $database_name;
|
|
|
|
$opt = [
|
|
|
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
|
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
|
|
PDO::ATTR_EMULATE_PREPARES => false,
|
|
|
|
];
|
2017-03-04 00:23:38 +01:00
|
|
|
try {
|
|
|
|
$pdo = new PDO($dsn, $database_user, $database_pass, $opt);
|
|
|
|
$stmt = $pdo->query("SELECT `domain` FROM `domain`");
|
|
|
|
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
while ($row = array_shift($rows)) {
|
|
|
|
$has_object = 1;
|
|
|
|
echo strtolower(trim($row['domain'])) . PHP_EOL;
|
|
|
|
}
|
|
|
|
$stmt = $pdo->query("SELECT `alias_domain` FROM `alias_domain`");
|
|
|
|
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
while ($row = array_shift($rows)) {
|
|
|
|
$has_object = 1;
|
|
|
|
echo strtolower(trim($row['alias_domain'])) . PHP_EOL;
|
|
|
|
}
|
|
|
|
if ($has_object == 0) {
|
|
|
|
echo "dummy@domain.local";
|
|
|
|
}
|
2017-01-09 11:05:33 +01:00
|
|
|
}
|
2017-03-04 00:23:38 +01:00
|
|
|
catch (PDOException $e) {
|
2017-03-03 17:31:50 +01:00
|
|
|
echo "dummy@domain.local";
|
2017-03-04 00:23:38 +01:00
|
|
|
exit;
|
2017-03-03 17:31:50 +01:00
|
|
|
}
|
2017-01-09 11:05:33 +01:00
|
|
|
?>
|