Home >Backend Development >PHP Tutorial >谁能说明一下discuz X2.5 upload/index.php文件思路

谁能说明一下discuz X2.5 upload/index.php文件思路

WBOY
WBOYOriginal
2016-06-13 11:37:431060browse

哪位高手能说明一下discuz X2.5 upload/index.php文件思路!
discuz X2.5 upload/index.php代码如下,主说针对运行步骤(架构思路)说明一下,越详细越好,非常感谢!!!

<br><?php <br /><br>/**<br> *      [Discuz!] (C)2001-2099 Comsenz Inc.<br> *      This is NOT a freeware, use is subject to license terms<br> *<br> *      $Id: index.php 27617 2012-02-07 08:24:14Z monkey $<br> */<br><br>if(!empty($_SERVER['QUERY_STRING']) && is_numeric($_SERVER['QUERY_STRING'])) {<br>	$_ENV['curapp'] = 'home';<br>	$_GET = array('mod'=>'space', 'uid'=>$_SERVER['QUERY_STRING']);<br>} else {<br><br>	$url = '';<br>	$domain = $_ENV = array();<br>	$jump = false;<br>	@include_once './data/sysdata/cache_domain.php';<br>	$_ENV['domain'] = $domain;<br>	if(empty($_ENV['domain'])) {<br>		$_ENV['curapp'] = 'forum';<br>	} else {<br>		$_ENV['defaultapp'] = array('portal.php' => 'portal', 'forum.php' => 'forum', 'group.php' => 'group', 'home.php' => 'home');<br>		$_ENV['hostarr'] = explode('.', $_SERVER['HTTP_HOST']);<br>		$_ENV['domainroot'] = substr($_SERVER['HTTP_HOST'], strpos($_SERVER['HTTP_HOST'], '.')+1);<br>		if(!empty($_ENV['domain']['app']) && is_array($_ENV['domain']['app']) && in_array($_SERVER['HTTP_HOST'], $_ENV['domain']['app'])) {<br>			$_ENV['curapp'] = array_search($_SERVER['HTTP_HOST'], $_ENV['domain']['app']);<br>			if($_ENV['curapp'] == 'mobile') {<br>				$_ENV['curapp'] = 'forum';<br>				if(@$_GET['mobile'] != 'no') {<br>					@$_GET['mobile'] = 'yes';<br>				}<br>			}<br>			if($_ENV['curapp'] == 'default' || !isset($_ENV['defaultapp'][$_ENV['curapp'].'.php'])) {<br>				$_ENV['curapp'] = '';<br>			}<br>		} elseif(!empty($_ENV['domain']['root']) && is_array($_ENV['domain']['root']) && in_array($_ENV['domainroot'], $_ENV['domain']['root'])) {<br><br>			$_G['setting']['holddomain'] = $_ENV['domain']['holddomain'] ? $_ENV['domain']['holddomain'] : array('www');<br>			$list = $_ENV['domain']['list'];<br>			if(isset($list[$_SERVER['HTTP_HOST']])) {<br>				$domain = $list[$_SERVER['HTTP_HOST']];<br>				$id = intval($domain['id']);<br>				switch($domain['idtype']) {<br>					case 'subarea':<br>						$_ENV['curapp'] = 'forum';<br>						$_GET['gid'] = $id;<br>						break;<br>					case 'forum':<br>						$_ENV['curapp'] = 'forum';<br>						$_GET['mod'] = 'forumdisplay';<br>						$_GET['fid'] = $id;<br>						break;<br>					case 'topic':<br>						$_ENV['curapp'] = 'portal';<br>						$_GET['mod'] = 'topic';<br>						$_GET['topicid'] = $id;<br>						break;<br>					case 'channel':<br>						$_ENV['curapp'] = 'portal';<br>						$_GET['mod'] = 'list';<br>						$_GET['catid'] = $id;<br>						break;<br>				}<br>			} elseif(count($_ENV['hostarr']) > 2 && $_ENV['hostarr'][0] != 'www' && !checkholddomain($_ENV['hostarr'][0])) {<br>				$_ENV['prefixdomain'] = addslashes($_ENV['hostarr'][0]);<br>				$_ENV['domainroot'] = addslashes($_ENV['domainroot']);<br>				require_once './source/class/class_core.php';<br>				C::app()->init_setting = true;<br>				C::app()->init_user = false;<br>				C::app()->init_session = false;<br>				C::app()->init_cron = false;<br>				C::app()->init_misc = false;<br>				C::app()->init();<br>				$jump = true;<br>				$domain = C::t('common_domain')->fetch_by_domain_domainroot($_ENV['prefixdomain'], $_ENV['domainroot']);<br>				$apphost = $_ENV['domain']['app'][$domain['idtype']] ? $_ENV['domain']['app'][$domain['idtype']] : $_ENV['domain']['app']['default'];<br>				$apphost = $apphost ? 'http://'.$apphost.'/' : '';<br>				switch($domain['idtype']) {<br>					case 'home':<br>						if($_G['setting']['rewritestatus'] && in_array('home_space', $_G['setting']['rewritestatus'])) {<br>							$url = rewriteoutput('home_space', 1, $apphost, $domain['id']);<br>						} else {<br>							$url = $apphost.'home.php?mod=space&uid='.$domain['id'];<br>						}<br>						break;<br>					case 'group':<br>						if($_G['setting']['rewritestatus'] && in_array('group_group', $_G['setting']['rewritestatus'])) {<br>							$url = rewriteoutput('group_group', 1, $apphost, $domain['id']);<br>						} else {<br>							$url = $apphost.'forum.php?mod=group&fid='.$domain['id'].'&page=1';<br>						}<br>						break;<br>				}<br>			}<br>		} else {<br>			$jump = true;<br>		}<br>		if(empty($url) && empty($_ENV['curapp'])) {<br>			if(!empty($_ENV['domain']['defaultindex']) && !$jump) {<br>				if($_ENV['defaultapp'][$_ENV['domain']['defaultindex']]) {<br>					$_ENV['curapp'] = $_ENV['defaultapp'][$_ENV['domain']['defaultindex']];<br>				} else {<br>					$url = $_ENV['domain']['defaultindex'];<div class="clear">
                 
              
              
        
            </div>
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