Home  >  Article  >  Backend Development  >  100分的挑战

100分的挑战

WBOY
WBOYOriginal
2016-06-23 13:13:45866browse

这是一个框架,运行入口文件时,最后Base::run();
public static function run(){//base.php文件中的一个方法
    self::cp();
    self::init();
            self::control();
}
接着俺对这三个方法展开了追踪,先说第一个

private static function cp(){		if (self::CPURL == '') return;		if ($_SERVER['HTTP_HOST'] == 'localhost') return;		if ($_SERVER['HTTP_HOST'] == '127.0.0.1') return;		if (strpos(self::CPURL,'||') !== false){			$a = explode('||',self::CPURL);			foreach ($a as $v) {				$d = strtolower(stristr($_SERVER['HTTP_HOST'],$v));				if ($d == strtolower($v)){					return;				}else{					continue;				}			}			header('location: http://www.haoid.cn');exit();		}else{			$d = strtolower(stristr($_SERVER['HTTP_HOST'],self::CPURL));			if ($d != strtolower(self::CPURL)){				header('location: http://www.haoid.cn');exit();			}		}	}

上面这段不理解!


回复讨论(解决方案)

你这断章取义的怎么能行?!

呵呵,我算看出来了,论坛里的这些天天抢分的人也就是能回答那些基础点的东西了,这个论坛废了!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn