87 lines
2.7 KiB
PHP
87 lines
2.7 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
|
// +----------------------------------------------------------------------
|
|
// | Author: liu21st <liu21st@gmail.com>
|
|
// +----------------------------------------------------------------------
|
|
|
|
// [ 应用入口文件 ]
|
|
namespace think;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function langt($str = '',$lang = 'en'){
|
|
// $lang 要自动获取当前语言,并不需要靠赋值来区分语言
|
|
if($lang == 'cn') return $str;
|
|
$langarr = array(
|
|
'en' => array(
|
|
'Name of the merchant'=>'商户名称',
|
|
'Detailed address'=>'详细地址',
|
|
'Distribution area'=>'经销区域',
|
|
'Latitude and longitude orientation'=>'经纬度定位',
|
|
'Latitude and longitude orientation'=>'经纬度定位',
|
|
),
|
|
'tc' => array(
|
|
'Name of the merchant'=>'商戶名稱',
|
|
'Detailed address'=>'詳細地址',
|
|
'Distribution area'=>'經銷區域',
|
|
'Latitude and longitude orientation'=>'經緯度定位6',
|
|
)
|
|
);
|
|
|
|
$langkey = (string) array_search($str,$langarr['en']);
|
|
if($lang == 'en') return $langkey?:$str;
|
|
return isset($langarr[$lang][$langkey])?$langarr[$lang][$langkey]:$str;
|
|
}
|
|
/**
|
|
* 输出字符串或数组
|
|
* @param string/array $vars 输出字符串或数组
|
|
* @param string $label 提示标题
|
|
* @param string $return 是否有返回值
|
|
*/
|
|
function dump($vars, $return = false, $label = ''){
|
|
if (ini_get('html_errors')){
|
|
$content = "<pre>\n";
|
|
if ($label != '') {
|
|
$content .= "<strong>{$label} :</strong>\n";
|
|
}
|
|
$content .= htmlspecialchars(print_r($vars, true), ENT_COMPAT, 'ISO-8859-1');
|
|
$content .= "\n</pre>\n";
|
|
} else {
|
|
$content = $label . " :\n" . print_r($vars, true);
|
|
}
|
|
echo $content;
|
|
if ($return) exit;
|
|
return null;
|
|
|
|
for ($i=0;$i<100;$i++){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 加载基础文件
|
|
require __DIR__ . '/../thinkphp/base.php';
|
|
|
|
// 支持事先使用静态方法设置Request对象和Config对象
|
|
|
|
// Container::get('app') 返回thinkphp/libray/think/app的实例
|
|
// run() thinkphp/libray/think/app 对应用进行各种配置和初始化
|
|
// send() think\Response 内
|
|
// 执行应用并响应
|
|
|
|
Container::get('app')->run()->send();
|
|
|
|
//Loader::dinfo();
|