示例#1
0
文件: Exits.php 项目: o-log/php-lib
 public static function setAccessControlAllowOriginHeader()
 {
     // TODO: review!
     $allowed_hosts = \OLOG\ConfWrapper::value('access_control_allow_origin_header', '');
     if ($allowed_hosts != '') {
         header('Access-Control-Allow-Origin: ' . $allowed_hosts);
     }
 }
示例#2
0
 public function testGetOptionalSubvalue()
 {
     $this->assertEquals(self::TEST_DEFAULT_VALUE, \OLOG\ConfWrapper::getOptionalSubvalue(self::TEST_CONFIG_ARR, self::TEST_FIRST_LEVEL_ARR_KEY . '.' . self::TEST_NOT_EXISTING_KEY, self::TEST_DEFAULT_VALUE));
     $this->assertEquals(self::TEST_VALUE, \OLOG\ConfWrapper::getOptionalSubvalue(self::TEST_CONFIG_ARR, self::TEST_FIRST_LEVEL_ARR_KEY . '.' . self::TEST_SECOND_LEVEL_STRING_KEY));
 }