* Format code and fix return value.
This commit is contained in:
@@ -600,7 +600,6 @@ class baseControl
|
||||
|
||||
if(!empty($jsExtPath))
|
||||
{
|
||||
$realModulePath = realPath($modulePath);
|
||||
foreach($jsExtPath as $jsPath)
|
||||
{
|
||||
if(empty($jsPath)) continue;
|
||||
@@ -730,7 +729,7 @@ class baseControl
|
||||
chdir(dirname($viewFile));
|
||||
|
||||
/**
|
||||
* 使用extract安定ob方法渲染$viewFile里面的代码。
|
||||
* 使用extract和ob方法渲染$viewFile里面的代码。
|
||||
* Use extract and ob functions to eval the codes in $viewFile.
|
||||
*/
|
||||
extract((array)$this->view);
|
||||
|
||||
@@ -87,7 +87,7 @@ class baseHelper
|
||||
/* 生成url链接的开始部分。Set the begin parts of the link. */
|
||||
if($config->requestType == 'PATH_INFO') $link = $config->webRoot . $appName;
|
||||
if($config->requestType != 'PATH_INFO') $link = $config->webRoot . $appName . basename($_SERVER['SCRIPT_NAME']);
|
||||
if($config->requestType == 'PATH_INFO2') $link .= '/';
|
||||
if($config->requestType == 'PATH_INFO2') $link = '/';
|
||||
|
||||
/**
|
||||
* #1: RequestType为GET。When the requestType is GET.
|
||||
@@ -178,7 +178,7 @@ class baseHelper
|
||||
* Check in only body mode or not.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public static function inOnlyBodyMode()
|
||||
{
|
||||
@@ -464,7 +464,7 @@ class baseHelper
|
||||
|
||||
$agent = $_SERVER["HTTP_USER_AGENT"];
|
||||
|
||||
/* Chrome should checked before safari.*/
|
||||
/* Chrome should check before safari.*/
|
||||
if(strpos($agent, 'Firefox') !== false) $browser['name'] = "firefox";
|
||||
if(strpos($agent, 'Opera') !== false) $browser['name'] = 'opera';
|
||||
if(strpos($agent, 'Safari') !== false) $browser['name'] = 'safari';
|
||||
@@ -853,7 +853,7 @@ function a($var)
|
||||
* Judge the server ip is local or not.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
function isLocalIP()
|
||||
{
|
||||
@@ -954,33 +954,42 @@ function htmlSpecialString($string, $flags = '', $encoding = 'UTF-8')
|
||||
return htmlspecialchars($string, $flags, $encoding);
|
||||
}
|
||||
|
||||
if (!function_exists('array_column'))
|
||||
if(!function_exists('array_column'))
|
||||
{
|
||||
function array_column(array $input, $columnKey, $indexKey = null)
|
||||
{
|
||||
$output = array();
|
||||
|
||||
foreach ($input as $row) {
|
||||
$key = $value = null;
|
||||
foreach($input as $row)
|
||||
{
|
||||
$key = $value = null;
|
||||
$keySet = $valueSet = false;
|
||||
|
||||
if (null !== $indexKey && array_key_exists($indexKey, $row)) {
|
||||
if(null !== $indexKey && array_key_exists($indexKey, $row))
|
||||
{
|
||||
$keySet = true;
|
||||
$key = (string) $row[$indexKey];
|
||||
$key = (string) $row[$indexKey];
|
||||
}
|
||||
|
||||
if (null === $columnKey) {
|
||||
if(null === $columnKey)
|
||||
{
|
||||
$valueSet = true;
|
||||
$value = $row;
|
||||
} elseif (\is_array($row) && \array_key_exists($columnKey, $row)) {
|
||||
$value = $row;
|
||||
}
|
||||
elseif(\is_array($row) && \array_key_exists($columnKey, $row))
|
||||
{
|
||||
$valueSet = true;
|
||||
$value = $row[$columnKey];
|
||||
$value = $row[$columnKey];
|
||||
}
|
||||
|
||||
if ($valueSet) {
|
||||
if ($keySet) {
|
||||
if($valueSet)
|
||||
{
|
||||
if($keySet)
|
||||
{
|
||||
$output[$key] = $value;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$output[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1719,7 +1719,7 @@ class baseRouter
|
||||
}
|
||||
|
||||
/* 1. 如果extensionLevel == 2,且扩展文件存在,返回该站点扩展文件。 If extensionLevel == 2 and site extensionFile exists, return it. */
|
||||
if($this->config->framework->extensionLevel == 2 and !empty( $moduleExtPaths['site']))
|
||||
if($this->config->framework->extensionLevel == 2 and !empty($moduleExtPaths['site']))
|
||||
{
|
||||
$this->extActionFile = $moduleExtPaths['site'] . $this->methodName . '.php';
|
||||
if(file_exists($this->extActionFile)) return true;
|
||||
@@ -1757,7 +1757,7 @@ class baseRouter
|
||||
if(empty($moduleExtPaths)) return false;
|
||||
|
||||
/* 如果extensionLevel == 2,且扩展文件存在,返回该站点扩展文件。If extensionLevel == 2 and site extensionFile exists, return it. */
|
||||
if($this->config->framework->extensionLevel == 2 and !empty( $moduleExtPaths['site']))
|
||||
if($this->config->framework->extensionLevel == 2 and !empty($moduleExtPaths['site']))
|
||||
{
|
||||
$locateFile = $moduleExtPaths['site'] . $this->methodName . '.302';
|
||||
if(file_exists($locateFile)) $this->sendAPI($locateFile);
|
||||
@@ -2497,9 +2497,8 @@ class baseRouter
|
||||
*
|
||||
* @param string $moduleName module name
|
||||
* @param string $appName app name
|
||||
* @param bool $exitIfNone exit or not
|
||||
* @access public
|
||||
* @return object|bool the config object or false.
|
||||
* @return void
|
||||
*/
|
||||
public function loadModuleConfig($moduleName, $appName = '')
|
||||
{
|
||||
@@ -2525,7 +2524,7 @@ class baseRouter
|
||||
if(!empty($extConfigPath['saas'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['saas'], '.php'));
|
||||
if(!empty($extConfigPath['custom'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['custom'], '.php'));
|
||||
}
|
||||
if($config->framework->extensionLevel == 2 and !empty($extConfigPath['site'])) $siteExtConfigFiles = helper::ls($extConfigPath['site'], '.php');
|
||||
if($config->framework->extensionLevel == 2 and !empty($extConfigPath['site'])) $siteExtConfigFiles = helper::ls($extConfigPath['site'], '.php');
|
||||
$extConfigFiles = array_merge($commonExtConfigFiles, $siteExtConfigFiles);
|
||||
|
||||
/* 将主配置文件和扩展配置文件合并在一起。Put the main config file and extension config files together. */
|
||||
@@ -2690,12 +2689,12 @@ class baseRouter
|
||||
if($this->config->framework->extensionLevel >= 1)
|
||||
{
|
||||
if(!empty($extLangPath['common'])) $commonExtLangFiles = helper::ls($extLangPath['common'] . $this->clientLang, '.php');
|
||||
if(!empty($extLangPath['xuan'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['xuan'] . $this->clientLang, '.php'));
|
||||
if(!empty($extLangPath['xuan'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['xuan'] . $this->clientLang, '.php'));
|
||||
if(!empty($extLangPath['vision'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['vision'] . $this->clientLang, '.php'));
|
||||
if(!empty($extLangPath['custom'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['custom'] . $this->clientLang, '.php'));
|
||||
if(!empty($extLangPath['saas'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['saas'] . $this->clientLang, '.php'));
|
||||
}
|
||||
if($this->config->framework->extensionLevel == 2 and !empty($extLangPath['site'])) $siteExtLangFiles = helper::ls($extLangPath['site'] . $this->clientLang, '.php');
|
||||
if($this->config->framework->extensionLevel == 2 and !empty($extLangPath['site'])) $siteExtLangFiles = helper::ls($extLangPath['site'] . $this->clientLang, '.php');
|
||||
$extLangFiles = array_merge($commonExtLangFiles, $siteExtLangFiles);
|
||||
}
|
||||
|
||||
|
||||
@@ -315,9 +315,8 @@ class router extends baseRouter
|
||||
*
|
||||
* @param string $moduleName module name
|
||||
* @param string $appName app name
|
||||
* @param bool $exitIfNone exit or not
|
||||
* @access public
|
||||
* @return object|bool the config object or false.
|
||||
* @return void
|
||||
*/
|
||||
public function loadModuleConfig($moduleName, $appName = '')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user