init.php 1017 B

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