public function test_option_exists() { $value = rand(1, 99999); $optionName = 'test_option_exists' . $value; $this->assertFalse(Config::option_exists($optionName), "{$optionName} shouldn't exist yet"); Config::set_option($optionName, $value); $this->assertTrue(Config::option_exists($optionName), "{$optionName} should exist now"); $returnedValue = Config::get_option($optionName); $this->assertEquals($value, $returnedValue, "{$optionName} should equal {$value}, got {$returnedValue}"); }
if (isset($siteName)) { \Scoop\Config::set_option('site_name', $siteName); } // load config $frameworkConfig = (include \Scoop\Config::get_option('config_dir') . '/framework.php'); // load user config file if one exists foreach ([__DIR__ . '/../../scoop/custom.php', __DIR__ . '/../../../../scoop/custom.php'] as $customConfigFilePath) { if (file_exists($customConfigFilePath)) { $customConfig = (include_once $customConfigFilePath); if (is_array($customConfig)) { $frameworkConfig = array_replace_recursive($frameworkConfig, $customConfig); } } } // set main options \Scoop\Config::set_options($frameworkConfig); // set the timezone if one was provided if (\Scoop\Config::option_exists('timezone')) { date_default_timezone_set(\Scoop\Config::get_option('timezone')); } // the autoloader require_once \Scoop\Config::get_option('bootstrap_dir') . '/autoloader.php'; $clientIP = array_key_exists('REMOTE_ADDR', $_SERVER) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0'; $serverIP = array_key_exists('SERVER_ADDR', $_SERVER) ? $_SERVER['SERVER_ADDR'] : '0.0.0.0'; if (\Scoop\Environment::is_internal_ip($clientIP, $serverIP)) { ini_set('display_errors', 'On'); ini_set('display_startup_errors', 'On'); } else { ini_set('display_errors', 'Off'); ini_set('display_startup_errors', 'Off'); }