commit
28204ab707
@ -0,0 +1,4 @@
|
||||
.idea
|
||||
composer.lock
|
||||
*.log
|
||||
thinkphp
|
||||
@ -0,0 +1,42 @@
|
||||
sudo: false
|
||||
|
||||
language: php
|
||||
|
||||
branches:
|
||||
only:
|
||||
- stable
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
before_install:
|
||||
- composer self-update
|
||||
|
||||
install:
|
||||
- composer install --no-dev --no-interaction --ignore-platform-reqs
|
||||
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip .
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-image:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-server:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0"
|
||||
- composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0"
|
||||
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip .
|
||||
|
||||
script:
|
||||
- php think unit
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw=
|
||||
file:
|
||||
- ThinkPHP_Core.zip
|
||||
- ThinkPHP_Full.zip
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
@ -0,0 +1 @@
|
||||
deny from all
|
||||
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 生成应用公共文件
|
||||
'__file__' => ['common.php', 'config.php', 'database.php'],
|
||||
|
||||
// push
|
||||
'push' => [
|
||||
'__file__' => ['common.php'],
|
||||
'__dir__' => ['behavior', 'controller', 'model', 'view'],
|
||||
'controller' => ['Index', 'Work'],
|
||||
'model' => [],
|
||||
'view' => ['index/index'],
|
||||
],
|
||||
|
||||
// cli
|
||||
'cli' => [
|
||||
'__file__' => ['common.php'],
|
||||
'__dir__' => ['behavior', 'controller', 'model', 'view'],
|
||||
'controller' => ['Index', 'Work'],
|
||||
'model' => [],
|
||||
'view' => ['index/index'],
|
||||
]
|
||||
];
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [];
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: 流年 <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// 应用公共文件
|
||||
|
||||
function clearTemp($path)
|
||||
{
|
||||
if (is_null($path)) {
|
||||
return;
|
||||
}
|
||||
$path = realpath($path) . DS;
|
||||
$files = scandir($path);
|
||||
if ($files) {
|
||||
foreach ($files as $file) {
|
||||
if ('.' != $file && '..' != $file && is_dir($path . $file)) {
|
||||
clearTemp($path . $file);
|
||||
} elseif ('.gitignore' != $file && is_file($path . $file)) {
|
||||
unlink($path . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Wind
|
||||
* Date: 2017/10/23
|
||||
* Time: 8:42
|
||||
*/
|
||||
|
||||
namespace app\common;
|
||||
|
||||
|
||||
use think\template\TagLib;
|
||||
|
||||
class Tree extends TagLib
|
||||
{
|
||||
/**
|
||||
* 定义标签列表
|
||||
*/
|
||||
protected $tags = [
|
||||
'close' => ['attr' => 'time,format', 'close' => 0],
|
||||
'open' => ['attr' => 'name,type', 'close' => 1],
|
||||
];
|
||||
|
||||
/**
|
||||
* 闭合标签
|
||||
* @param $tag
|
||||
* @return string
|
||||
*/
|
||||
public function tagClose($tag)
|
||||
{
|
||||
$format = empty($tag['format']) ? 'Y-m-d H:i:s' : $tag['format'];
|
||||
$time = empty($tag['time']) ? time() : $tag['time'];
|
||||
$parse = '<?php ';
|
||||
$parse .= 'echo date("' . $format . '",' . $time . ');';
|
||||
$parse .= ' ?>';
|
||||
return $parse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 非闭合标签
|
||||
* @param $tag
|
||||
* @param $content
|
||||
*/
|
||||
public function tagOpen($tag, $content)
|
||||
{
|
||||
$type = empty($tag['type']) ? 0 : 1;
|
||||
$name = $tag['name'];
|
||||
$parse = '<?php ';
|
||||
$parse .= '$test_arr=[[1,3,5,7,9],[2,4,6,8,10]];';
|
||||
$parse .= ' ?>';
|
||||
$parse .= '{volist name="__LIST__" id="' . $name . '"}';
|
||||
$parse .= $content;
|
||||
$parse .= '{/volist}';
|
||||
return $parse;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Wind
|
||||
* Date: 2017/10/20
|
||||
* Time: 16:18
|
||||
*/
|
||||
|
||||
namespace app\common\behavior;
|
||||
|
||||
|
||||
use think\Config;
|
||||
|
||||
class ModuleTest
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$arr = Config::get('template');
|
||||
$arr = array_merge($arr, [
|
||||
// 模板引擎类型 支持 php think 支持扩展
|
||||
'type' => 'Think',
|
||||
// 模板路径
|
||||
'view_path' => __DIR__ . '/../../../themes/blue/',
|
||||
// 模板后缀
|
||||
'view_suffix' => 'html',
|
||||
// 模板文件名分隔符
|
||||
'view_depr' => "_",
|
||||
// 模板引擎普通标签开始标记
|
||||
'tpl_begin' => '{',
|
||||
// 模板引擎普通标签结束标记
|
||||
'tpl_end' => '}',
|
||||
// 标签库标签开始标记
|
||||
'taglib_begin' => '{',
|
||||
// 标签库标签结束标记
|
||||
'taglib_end' => '}',
|
||||
//'taglib_pre_load' => 'app\common\Tree',
|
||||
]);
|
||||
Config::set(['template' => $arr]);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Wind
|
||||
* Date: 2017/10/20
|
||||
* Time: 16:09
|
||||
*/
|
||||
|
||||
namespace app\common\controller;
|
||||
|
||||
use think\Config;
|
||||
use think\Controller;
|
||||
|
||||
class Base extends Controller
|
||||
{
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize(); // TODO: Change the autogenerated stub
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 数据库类型
|
||||
'type' => 'mysql',
|
||||
// 服务器地址
|
||||
'hostname' => '127.0.0.1',
|
||||
// 数据库名
|
||||
'database' => '',
|
||||
// 用户名
|
||||
'username' => 'root',
|
||||
// 密码
|
||||
'password' => '',
|
||||
// 端口
|
||||
'hostport' => '',
|
||||
// 连接dsn
|
||||
'dsn' => '',
|
||||
// 数据库连接参数
|
||||
'params' => [],
|
||||
// 数据库编码默认采用utf8
|
||||
'charset' => 'utf8',
|
||||
// 数据库表前缀
|
||||
'prefix' => '',
|
||||
// 数据库调试模式
|
||||
'debug' => true,
|
||||
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
|
||||
'deploy' => 0,
|
||||
// 数据库读写是否分离 主从式有效
|
||||
'rw_separate' => false,
|
||||
// 读写分离后 主服务器数量
|
||||
'master_num' => 1,
|
||||
// 指定从服务器序号
|
||||
'slave_no' => '',
|
||||
// 是否严格检查字段是否存在
|
||||
'fields_strict' => true,
|
||||
// 数据集返回类型
|
||||
'resultset_type' => 'array',
|
||||
// 自动写入时间戳字段
|
||||
'auto_timestamp' => false,
|
||||
// 时间字段取出后的默认时间格式
|
||||
'datetime_format' => 'Y-m-d H:i:s',
|
||||
// 是否需要进行SQL性能分析
|
||||
'sql_explain' => false,
|
||||
];
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Wind
|
||||
* Date: 2017/10/21
|
||||
* Time: 10:32
|
||||
*/
|
||||
return [
|
||||
'template' => [
|
||||
// 模板引擎类型 支持 php think 支持扩展
|
||||
'type' => 'Think',
|
||||
// 模板路径
|
||||
'view_path' => __DIR__ . '/../../themes/blue/',
|
||||
// 模板后缀
|
||||
'view_suffix' => 'html',
|
||||
// 模板文件名分隔符
|
||||
'view_depr' => "_",
|
||||
// 模板引擎普通标签开始标记
|
||||
'tpl_begin' => '{',
|
||||
// 模板引擎普通标签结束标记
|
||||
'tpl_end' => '}',
|
||||
// 标签库标签开始标记
|
||||
'taglib_begin' => '{',
|
||||
// 标签库标签结束标记
|
||||
'taglib_end' => '}',
|
||||
'taglib_pre_load' => 'app\common\Tree',
|
||||
],
|
||||
];
|
||||
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace app\index\controller;
|
||||
|
||||
use app\common\controller\Base;
|
||||
|
||||
class Index extends Base
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$this->assign('__LIST__', [1, 2, 3]);
|
||||
$this->assign('demo_time', $this->request->time());
|
||||
$this->assign('demo_name', 'king');
|
||||
$this->assign('key', 'demo');
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<?php
|
||||
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
//配置文件
|
||||
return [
|
||||
|
||||
];
|
||||
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace app\push\controller;
|
||||
|
||||
class Index
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }</style><div style="padding: 24px 48px;"> <h1>:)</h1><p> ThinkPHP V5<br/><span style="font-size:30px">十年磨一剑 - 为API开发设计的高性能框架</span></p><span style="font-size:22px;">[ V5.0 版本由 <a href="http://www.qiniu.com" target="qiniu">七牛云</a> 独家赞助发布 ]</span></div><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_bd568ce7058a1091"></thinkad>';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
namespace app\push\controller;
|
||||
|
||||
use king\worker\Server;
|
||||
|
||||
class Worker extends Server
|
||||
{
|
||||
protected $socket = 'websocket://127.0.0.1:7272';
|
||||
|
||||
/**
|
||||
* 收到消息
|
||||
* @param $connection
|
||||
* @param $data
|
||||
*/
|
||||
public function onMessage($connection, $data)
|
||||
{
|
||||
$connection->send('我收到你的信息了');
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接时触发的回调函数
|
||||
* @param $connection
|
||||
*/
|
||||
public function onConnect($connection)
|
||||
{
|
||||
file_put_contents('d:/msg','error',FILE_APPEND);
|
||||
}
|
||||
|
||||
/**
|
||||
* 当客户端的连接发生错误时触发
|
||||
* @param $connection
|
||||
* @param $code
|
||||
* @param $msg
|
||||
*/
|
||||
public function onClose($connection, $code, $msg)
|
||||
{
|
||||
echo "error $code $msg\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* 每个进程启动
|
||||
* @param $worker
|
||||
*/
|
||||
public function onWorkerStart($worker)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
'__pattern__' => [
|
||||
'name' => '\w+',
|
||||
],
|
||||
'[hello]' => [
|
||||
':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
|
||||
':name' => ['index/hello', ['method' => 'post']],
|
||||
],
|
||||
|
||||
];
|
||||
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// 应用行为扩展定义文件
|
||||
return [
|
||||
// 应用初始化
|
||||
'app_init' => [
|
||||
|
||||
],
|
||||
// 应用开始
|
||||
'app_begin' => [
|
||||
|
||||
],
|
||||
// 模块初始化
|
||||
'module_init' => [
|
||||
'app\common\behavior\ModuleTest'
|
||||
],
|
||||
// 操作开始执行
|
||||
'action_begin' => [],
|
||||
// 视图内容过滤
|
||||
'view_filter' => [],
|
||||
// 日志写入
|
||||
'log_write' => [],
|
||||
// 应用结束
|
||||
'app_end' => [],
|
||||
];
|
||||
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Wind
|
||||
* Date: 2017/10/20
|
||||
* Time: 15:52
|
||||
*/
|
||||
return [
|
||||
'deny_module_list' => ['common','index'],
|
||||
];
|
||||
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// 应用行为扩展定义文件
|
||||
return [
|
||||
// 应用初始化
|
||||
'app_init' => [
|
||||
'app\common\behavior\ModuleTest'
|
||||
],
|
||||
// 应用开始
|
||||
'app_begin' => [
|
||||
|
||||
],
|
||||
// 模块初始化
|
||||
'module_init' => [
|
||||
|
||||
],
|
||||
// 操作开始执行
|
||||
'action_begin' => [],
|
||||
// 视图内容过滤
|
||||
'view_filter' => [],
|
||||
// 日志写入
|
||||
'log_write' => [],
|
||||
// 应用结束
|
||||
'app_end' => [],
|
||||
];
|
||||
@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "topthink/think",
|
||||
"description": "the new thinkphp framework",
|
||||
"type": "project",
|
||||
"keywords": [
|
||||
"framework",
|
||||
"thinkphp",
|
||||
"ORM"
|
||||
],
|
||||
"homepage": "http://thinkphp.cn/",
|
||||
"license": "Apache-2.0",
|
||||
"authors": [
|
||||
{
|
||||
"name": "liu21st",
|
||||
"email": "liu21st@gmail.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.4.0",
|
||||
"topthink/framework": "~5.0.0",
|
||||
"workerman/workerman-for-win": "^3.5"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"app\\": "application"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"think-path": "thinkphp"
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@ -0,0 +1,8 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
Options +FollowSymlinks -Multiviews
|
||||
RewriteEngine On
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
|
||||
</IfModule>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// [ 应用入口文件 ]
|
||||
|
||||
// 定义应用目录
|
||||
define('APP_PATH', __DIR__ . '/../application/');
|
||||
|
||||
// 加载框架引导文件
|
||||
require __DIR__ . '/../thinkphp/start.php';
|
||||
|
||||
clearTemp(RUNTIME_PATH);
|
||||
@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow:
|
||||
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
// $Id$
|
||||
|
||||
if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["REQUEST_URI"])) {
|
||||
return false;
|
||||
} else {
|
||||
if (!isset($_SERVER['PATH_INFO'])) {
|
||||
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
|
||||
}
|
||||
require __DIR__ . "/index.php";
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Wind
|
||||
* Date: 2017/10/20
|
||||
* Time: 9:51
|
||||
*/
|
||||
|
||||
define('APP_PATH', __DIR__ . '/../application');
|
||||
define('BIND_MODULE', 'push/Worker');
|
||||
define('CONF_PATH', __DIR__ . '/../application/xconfig/');
|
||||
require __DIR__ . '/../thinkphp/start.php';
|
||||
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>闭合标签</h1>
|
||||
{tree:close time='$demo_time'/}
|
||||
<hr>
|
||||
<h1>非闭合标签</h1>
|
||||
{tree:open name='demo_name'}
|
||||
{$key}=>{$demo_name}<br>
|
||||
{/tree:open}
|
||||
<br>
|
||||
{tree:open name='demo_name' type='1'}
|
||||
{$key}=>{$demo_name}<br>
|
||||
{/tree:open}
|
||||
<div id="msg" style="border: dotted 1px grey;width: 200px;height: 200px;color: blue">blue</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Wind
|
||||
* Date: 2017/10/21
|
||||
* Time: 10:20
|
||||
*/
|
||||
@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
|
||||
<script src="../__PUBLIC__/static/js/jquery-3.2.1.min.js"></script>
|
||||
<script src="../__PUBLIC__/static/js/jquery.validate.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
console.log(document.location.href);
|
||||
</script>
|
||||
<form id="myForm" action="" method="post">
|
||||
<input type="text" name="user_name" id="user_name" placeholder="用户名:">
|
||||
<input type="text" name="user_password" id="user_password" placeholder="密码:">
|
||||
<input type="submit" value="提交">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
||||
//自定义验证
|
||||
$.validator.addMethod("phone", function (value, element, param) {
|
||||
var rel = /^1[3458]\d{9}$/.test(value);
|
||||
return rel;
|
||||
}, "手机号不正确");
|
||||
|
||||
$().ready(function () {
|
||||
$("#myForm").validate({
|
||||
debug: true,
|
||||
onkeyup: null,
|
||||
rules: {
|
||||
user_name: "required",
|
||||
user_password: {
|
||||
required: true,
|
||||
rangelength: [3, 11],
|
||||
/* remote:{
|
||||
url:"",
|
||||
type:"post",
|
||||
dataType:"json",
|
||||
data:{
|
||||
username:function(){
|
||||
return $("#user_name").val();
|
||||
}
|
||||
}
|
||||
},*/
|
||||
phone: true
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
user_name: "请输入用户名",
|
||||
user_password: {
|
||||
required: "密码不能为空",
|
||||
rangelength: $.validator.format("密码长度为:{3}-{5}之间"),
|
||||
remote: "密码未设置"
|
||||
}
|
||||
},
|
||||
errorPlacement: function (error, element) {
|
||||
if (element.is(":text"))
|
||||
error.appendTo(element.parent().next().next());
|
||||
},
|
||||
success: function () {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="msg" style="border: dotted 1px grey;width: 200px;height: 200px;color: red">red</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// 定义项目路径
|
||||
define('APP_PATH', __DIR__ . '/application/');
|
||||
|
||||
// 加载框架引导文件
|
||||
require __DIR__.'/thinkphp/console.php';
|
||||
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
Loading…
Reference in new issue