CMS for the late garbage.fm
at main 80 lines 2.7 kB view raw
1<?php 2/* 3 site-wide settings, loaded after framework 4 5 should do per-environment setup like logging, tweaking php settings, etc. 6*/ 7 8define("ADMIN_ROOT_DOMAIN", "garbage.fm"); 9define("ADMIN_ROOT_PATH", "/adm1n/"); 10define("ADMIN_ROOT_URL", "https://" . ADMIN_ROOT_DOMAIN . ADMIN_ROOT_PATH); 11 12define("TWITTER_CONSUMER_KEY", $_ENV["TWITTER_CONSUMER_KEY"]); 13define("TWITTER_CONSUMER_SECRET", $_ENV["TWITTER_CONSUMER_SECRET"]); 14 15/* session settings, change according to your application requirements */ 16session_name("_garbagefm_session"); 17session_set_cookie_params($lifetime = (60 * 60 * 24 * 7), "/", 18 ADMIN_ROOT_DOMAIN, true, true); 19 20/* activate encrypted cookie storage; requires the mcrypt php extension */ 21HalfMoon\Config::set_session_store( 22 "encrypted_cookie", 23 24 /* you must define a random encryption key here of 32 characters. 25 * "openssl rand 16 -hex" will generate one for you. */ 26 array("encryption_key" => $_ENV["COOKIE_ENCRYPTION_KEY"]); 27); 28 29/* a timezone is required for DateTime functions */ 30date_default_timezone_set("US/Central"); 31 32/* environment-specific settings */ 33if (HALFMOON_ENV == "development") { 34 /* be open and verbose during development */ 35 36 /* show errors in the browser */ 37 ini_set("display_errors", 1); 38 39 /* log all activerecord queries and values */ 40 HalfMoon\Config::set_activerecord_log_level("full"); 41 42 /* log all halfmoon activity */ 43 HalfMoon\Config::set_log_level("full"); 44} 45 46elseif (HALFMOON_ENV == "production") { 47 /* be quiet in production */ 48 49 /* don't display actual php error messages to the user, just generic error 50 * pages (see skel/500.html) */ 51 ini_set("display_errors", 0); 52 53 /* do not log any activerecord queries */ 54 HalfMoon\Config::set_activerecord_log_level("none"); 55 56 /* only log halfmoon processing times with urls */ 57 HalfMoon\Config::set_log_level("full"); 58 59 /* perform file caching for controllers that request it, and store files in 60 * this directory (must be writable by web server user running halfmoon */ 61 HalfMoon\Config::set_cache_store_path(HALFMOON_ROOT . "/public/cache"); 62 63 /* uncomment to send emails of error backtraces and debugging info */ 64 HalfMoon\Config::set_exception_notification_recipient( 65 $_ENV["EXCEPTION_NOTIFICATION_RECIPIENT"]); 66 HalfMoon\Config::set_exception_notification_subject("[garbagefm]"); 67} 68 69require_once("lib/parsedown/Parsedown.php"); 70require_once("lib/PasswordHash.php"); 71 72require_once("lib/hash_equals/lib/hash_equals.php"); 73require_once("lib/base32/src/Base32.php"); 74require_once("lib/otphp/lib/Factory.php"); 75require_once("lib/otphp/lib/OTPInterface.php"); 76require_once("lib/otphp/lib/OTP.php"); 77require_once("lib/otphp/lib/TOTPInterface.php"); 78require_once("lib/otphp/lib/TOTP.php"); 79 80?>