1
0
Fork 0
template/site-settings.php
2024-04-25 21:55:08 +02:00

47 lines
1.3 KiB
PHP
Executable file

<?php session_start();
require_once 'site-config.php';
ini_set('display_errors', ($debugging == false ? 0 : 1));
ini_set('display_startup_errors', ($debugging == false ? 0 : 1));
error_reporting(E_ALL);
date_default_timezone_set($config_timezone);
$host = $_SERVER['HTTP_HOST'];
$uri = $_SERVER['REQUEST_URI'];
$is_local = (($host == 'localhost' OR strpos($host, '192.168') !== false) ? true : false);
$filename = basename($_SERVER['PHP_SELF']);
$filename_get = (!empty($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null);
$google = ['notranslate','nositelinkssearchb'];
$robots = ['nofollow','nosnippet','noarchive','noimageindex'];
$dir_files = $config_root.'/files/template';
$dir_functions = 'functions';
$dir_images = 'images';
$dir_languages = 'languages';
if(file_exists('vendor(autoload.php')) {
require_once 'vendor/autoload.php';
$Parsedown = new Parsedown();
}
require_once 'site-functions.php';
if(!empty($database_host) AND !empty($database_name) AND !empty($database_user) AND !empty($database_pass)) {
try {
$sql = new PDO('mysql:host='.$database_host.';dbname='.$database_name, $database_user, $database_pass);
$sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e) {
echo $e;
exit;
}
}
?>