diff --git a/README.md b/README.md index d01bea1..8697455 100644 --- a/README.md +++ b/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'); diff --git a/conf.php-sample b/conf.php-sample index 96087a9..ddd9a8b 100644 --- a/conf.php-sample +++ b/conf.php-sample @@ -1,9 +1,5 @@ diff --git a/index.php b/index.php index 27b137a..28b83c2 100644 --- a/index.php +++ b/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;