8 Star 13 Fork 5

XpmJS / xapp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.php 970 Bytes
一键复制 编辑 原始数据 按行查看 历史
天人合一 提交于 2017-01-08 15:24 . XApp 应用开发演示
<?php
/**
* 团队猫应用路由
*
* 所有请求将会通过本程序转发
*
* @see 团队猫应用开发手册
*/
if( !defined('DS') ) define( 'DS' , DIRECTORY_SEPARATOR );
define('APP_ROOT', __DIR__);
$headers = [];
if ( function_exists('apache_request_headers') ) {
$headers = apache_request_headers();
} else {
foreach( $_SERVER as $key => $value ) {
if ( substr($key,0,5)=="HTTP_" ) {
$key = str_replace( " " , "-" , ucwords( strtolower( str_replace( "_" , " " , substr( $key , 5 ) ))));
$headers[$key]=$value;
}
else {
$headers[$key]=$value;
}
}
}
// 服务库根目录
$seroot = $headers['Tuanduimao-Service'];
if ( empty($seroot) ) {
echo json_encode([
'result'=>false,
'content'=>'服务库目录',
'data'=>$headers ]
);
exit;
}
// 自动载入脚本
require_once( $seroot . DS . 'loader' . DS . "Autoload.php" );
\Tuanduimao\Loader\Auto::run( $headers );
PHP
1
https://gitee.com/xpmjs/xapp.git
git@gitee.com:xpmjs/xapp.git
xpmjs
xapp
xapp
master

搜索帮助