-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
117 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
header("Content-type:text/html;charset=utf-8"); | ||
|
||
/** | ||
* ===================================================================================================================== | ||
* 传递数据以易于阅读的样式格式化后输出 | ||
* @param $data | ||
* ===================================================================================================================== | ||
*/ | ||
function homePrint($data) | ||
{ | ||
// 定义样式 | ||
$str = '<pre style="display: block;padding: 9.5px;margin: 44px 0 0 0;font-size: 13px;line-height: 1.42857;color: #333;word-break: break-all;word-wrap: break-word;background-color: #F5F5F5;border: 1px solid #CCC;border-radius: 4px;">'; | ||
// 如果是boolean或者null直接显示文字;否则print | ||
if (is_bool($data)) { | ||
$show_data = $data ? 'true' : 'false'; | ||
} elseif (is_null($data)) { | ||
$show_data = 'null'; | ||
} else { | ||
$show_data = print_r($data, true); | ||
} | ||
$str .= $show_data; | ||
$str .= '</pre>'; | ||
echo $str; | ||
} | ||
|
||
/** | ||
* php cli模式执行php文件 | ||
* 测试 | ||
*/ | ||
function cli_test() | ||
{ | ||
$count = 0; | ||
while(true){ | ||
$count++; | ||
echo $count."\r\n"; | ||
if($count > 10){ | ||
break; | ||
} | ||
sleep(3); | ||
} | ||
echo 'done'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
|
||
|
||
<?php | ||
// +---------------------------------------------------------------------- | ||
// | ThinkPHP [ WE CAN DO IT JUST THINK ] | ||
// +---------------------------------------------------------------------- | ||
// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved. | ||
// +---------------------------------------------------------------------- | ||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) | ||
// +---------------------------------------------------------------------- | ||
// | Author: liu21st <[email protected]> | ||
// +---------------------------------------------------------------------- | ||
|
||
// 应用入口文件 | ||
|
||
// 检测PHP环境 | ||
if(version_compare(PHP_VERSION,'5.3.0','<')) die('require PHP > 5.3.0 !'); | ||
|
||
// 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false | ||
define('APP_DEBUG',True); | ||
|
||
/** | ||
* 绑定Home模块到当前入口文件(3.2.1以上版本写法) | ||
* old:http://serverName/index.php/Home/Index/index | ||
* new:http://serverName/home.php/Index/index | ||
*/ | ||
//define('BIND_MODULE','Home'); | ||
|
||
|
||
/** | ||
* 绑定Index控制器到当前入口文件(3.2.1以上版本写法) | ||
* old:http://serverName/index.php/Home/Index/index | ||
* new:http://serverName/home.php/index | ||
*/ | ||
//define('BIND_CONTROLLER','Index'); | ||
|
||
// 定义应用目录 | ||
define('APP_PATH','./Backend/'); | ||
|
||
// 引入ThinkPHP入口文件 | ||
require './ThinkPHP/ThinkPHP.php'; | ||
|
||
|
||
|
||
// 亲^_^ 后面不需要任何代码了 就是如此简单 | ||
|