commit ed72d8458798f34c764db60a10f9c5036ddba4bc from: mischa date: Wed Aug 24 13:13:17 2022 UTC move some stuff out of the config, DEFINE debug commit - 7c5f1fcd82cd8cca52458c6cd94141d036eb20c0 commit + ed72d8458798f34c764db60a10f9c5036ddba4bc blob - d01bea1cd42e9bc2884fcc51b34fb95981d93826 blob + 86974558e0cb8929c12837a079f2ed7b8b404117 --- README.md +++ README.md @@ -36,6 +36,7 @@ Configuration file needs to be renamed to conf.php Configuration options: + define("HASH_LENGTH", 4); define("SITE_TITLE", "NAME OF SITE"); define("BASE_URL", 'https://host.domain.tld/'); define("DB_HOST", 'localhost'); blob - 96087a94ed6f53c4e47237e5c979909d89f0dba6 blob + ddd9a8bac83218e4bc643ac17db449af13927b78 --- conf.php-sample +++ conf.php-sample @@ -1,9 +1,5 @@ blob - 27b137ac3ec635df0672bc29d5dd23b8679ea19a blob + 28b83c20600c4d8238176dbd214e595587bdc81b --- index.php +++ index.php @@ -3,13 +3,22 @@ require_once './conf.php'; define("SHORTER_NAME", "shortr"); define("SHORTER_VERSION", "v0.1"); -define("HASH_LENGTH", 8); define("CHARSET", "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); $url = ""; $link = ""; $callback = "NO"; + +if (DEBUG == 'true') { + ini_set('display_errors', 1); + ini_set('display_startup_errors', 1); + error_reporting(E_ALL); +} else { + ini_set('display_errors', 0); + ini_set('display_startup_errors', 0); +} + function db_connect() { $dbh = new PDO('mysql:host='. DB_HOST . ';dbname='. DB_NAME , DB_USER, DB_PASS); return $dbh;