1 Star 1 Fork 0

Colin / borrow

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.php 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
Colin 提交于 2019-07-12 17:15 . init
<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
defined('YII_ENV_DEV') or define('YII_ENV_DEV', true);
require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/common/config/bootstrap.php');
if (is_mobile()) {
require(__DIR__ . '/mobile/config/bootstrap.php');
} else {
require(__DIR__ . '/frontend/config/bootstrap.php');
}
if (is_mobile()) {
$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/common/config/main.php'),
require(__DIR__ . '/mobile/config/main.php')
);
} else {
$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/common/config/main.php'),
require(__DIR__ . '/frontend/config/main.php')
);
}
$application = new yii\web\Application($config);
$application->run();
// 判断是否为手机
function is_mobile()
{
return true;
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
$is_pc = (strpos($agent, 'windows nt')) ? true : false;
$is_mac = (strpos($agent, 'mac os')) ? true : false;
$is_iphone = (strpos($agent, 'iphone')) ? true : false;
$is_android = (strpos($agent, 'android')) ? true : false;
$is_ipad = (strpos($agent, 'ipad')) ? true : false;
if ($is_pc) {
return false;
}
if ($is_mac) {
return true;
}
if ($is_iphone) {
return true;
}
if ($is_android) {
return true;
}
if ($is_ipad) {
return true;
}
}
PHP
1
https://gitee.com/hicolin/borrow.git
git@gitee.com:hicolin/borrow.git
hicolin
borrow
borrow
master

搜索帮助