servnest/common/init.php

24 lines
1017 B
PHP
Raw Normal View History

2022-05-19 16:59:32 +02:00
<?php
define("CONF", parse_ini_file(__DIR__ . "/../config.ini", true, INI_SCANNER_TYPED));
define("SERVICE", substr(dirname($_SERVER['PHP_SELF']), strlen(CONF['common']['prefix']) + 1));
2022-05-19 16:59:32 +02:00
define("PAGE", basename($_SERVER['PHP_SELF'], '.php'));
define("DB_PATH", CONF['common']['root_path'] . "/db/niver.db"); // Niver's SQLite database
2022-05-19 16:59:32 +02:00
2022-06-11 23:42:48 +02:00
define("PLACEHOLDER_DOMAIN", "example"); // From RFC2606: Reserved Top Level DNS Names > 2. TLDs for Testing, & Documentation Examples
define("PLACEHOLDER_IPV6", "2001:db8::3"); // From RFC3849: IPv6 Address Prefix Reserved for Documentation
define("PLACEHOLDER_IPV4", "203.0.113.42"); // From RFC5737: IPv4 Address Blocks Reserved for Documentation
2022-05-31 19:12:14 +02:00
// Page titles definition
require "pages.php";
foreach (array_diff(scandir(CONF['common']['root_path'] . "/fn"), array('..', '.')) as $file)
require CONF['common']['root_path'] . '/fn/' . $file;
2022-06-16 15:08:50 +02:00
function success($msg = '') {
if ($msg !== '')
echo "<p><strong>Succès</strong> : <em>" . $msg . "</em></p>";
closeHTML();
}