├── thinkphp ├── .htaccess ├── tests │ ├── conf │ │ ├── redis.ini │ │ ├── timezone.ini │ │ ├── memcached.ini │ │ ├── apcu.ini │ │ └── apcu_bc.ini │ ├── thinkphp │ │ ├── library │ │ │ ├── think │ │ │ │ ├── display.html │ │ │ │ ├── include2.html │ │ │ │ ├── model │ │ │ │ │ └── .gitignore │ │ │ │ ├── session │ │ │ │ │ └── .gitignore │ │ │ │ ├── controller │ │ │ │ │ └── .gitignore │ │ │ │ ├── db │ │ │ │ │ └── driver │ │ │ │ │ │ └── .gitignore │ │ │ │ ├── layout.html │ │ │ │ ├── view │ │ │ │ │ ├── driver │ │ │ │ │ │ └── .gitignore │ │ │ │ │ └── theme │ │ │ │ │ │ └── index │ │ │ │ │ │ └── template.html │ │ │ │ ├── config │ │ │ │ │ └── driver │ │ │ │ │ │ ├── fixtures │ │ │ │ │ │ ├── config.ini │ │ │ │ │ │ ├── config.json │ │ │ │ │ │ └── config.xml │ │ │ │ │ │ ├── iniTest.php │ │ │ │ │ │ ├── jsonTest.php │ │ │ │ │ │ └── xmlTest.php │ │ │ │ ├── layout2.html │ │ │ │ ├── template │ │ │ │ │ └── driver │ │ │ │ │ │ └── .gitignore │ │ │ │ ├── lang │ │ │ │ │ └── lang.php │ │ │ │ ├── extend.html │ │ │ │ ├── include.html │ │ │ │ ├── loader │ │ │ │ │ └── test │ │ │ │ │ │ └── Hello.php │ │ │ │ ├── behavior │ │ │ │ │ ├── Two.php │ │ │ │ │ ├── Three.php │ │ │ │ │ └── One.php │ │ │ │ ├── extend2.html │ │ │ │ ├── log │ │ │ │ │ └── driver │ │ │ │ │ │ └── fileTest.php │ │ │ │ ├── logTest.php │ │ │ │ ├── cache │ │ │ │ │ └── driver │ │ │ │ │ │ ├── fileTest.php │ │ │ │ │ │ ├── memcacheTest.php │ │ │ │ │ │ ├── liteTest.php │ │ │ │ │ │ ├── memcachedTest.php │ │ │ │ │ │ └── redisTest.php │ │ │ │ ├── exceptionTest.php │ │ │ │ ├── paginateTest.php │ │ │ │ └── loaderTest.php │ │ │ └── traits │ │ │ │ ├── model │ │ │ │ └── .gitignore │ │ │ │ └── controller │ │ │ │ └── .gitignore │ │ └── baseTest.php │ ├── .gitignore │ ├── extensions │ │ ├── 5.4 │ │ │ └── apcu.so │ │ ├── 5.5 │ │ │ └── apcu.so │ │ ├── 5.6 │ │ │ └── apcu.so │ │ └── 7.0 │ │ │ ├── apc.so │ │ │ ├── apcu.so │ │ │ ├── redis.so │ │ │ └── memcached.so │ ├── script │ │ └── install.sh │ ├── mock.php │ └── application │ │ ├── route.php │ │ ├── index │ │ └── controller │ │ │ └── Index.php │ │ ├── config.php │ │ └── database.php ├── .gitignore ├── logo.png ├── library │ ├── think │ │ ├── console │ │ │ ├── bin │ │ │ │ ├── hiddeninput.exe │ │ │ │ └── README.md │ │ │ ├── command │ │ │ │ ├── make │ │ │ │ │ ├── stubs │ │ │ │ │ │ ├── model.stub │ │ │ │ │ │ ├── controller.plain.stub │ │ │ │ │ │ └── controller.stub │ │ │ │ │ ├── Model.php │ │ │ │ │ └── Controller.php │ │ │ │ ├── Clear.php │ │ │ │ ├── Build.php │ │ │ │ ├── Help.php │ │ │ │ └── Lists.php │ │ │ ├── LICENSE │ │ │ └── output │ │ │ │ ├── driver │ │ │ │ ├── Nothing.php │ │ │ │ └── Buffer.php │ │ │ │ └── question │ │ │ │ └── Confirmation.php │ │ ├── exception │ │ │ ├── RouteNotFoundException.php │ │ │ ├── HttpResponseException.php │ │ │ ├── ClassNotFoundException.php │ │ │ ├── TemplateNotFoundException.php │ │ │ ├── ValidateException.php │ │ │ ├── HttpException.php │ │ │ ├── DbException.php │ │ │ ├── PDOException.php │ │ │ ├── ThrowableError.php │ │ │ └── ErrorException.php │ │ ├── config │ │ │ └── driver │ │ │ │ ├── Ini.php │ │ │ │ ├── Json.php │ │ │ │ └── Xml.php │ │ ├── log │ │ │ └── driver │ │ │ │ └── Test.php │ │ ├── db │ │ │ ├── exception │ │ │ │ ├── BindParamException.php │ │ │ │ ├── ModelNotFoundException.php │ │ │ │ └── DataNotFoundException.php │ │ │ └── builder │ │ │ │ ├── Sqlite.php │ │ │ │ ├── Mysql.php │ │ │ │ └── Pgsql.php │ │ ├── Env.php │ │ ├── model │ │ │ └── Pivot.php │ │ ├── controller │ │ │ └── Yar.php │ │ ├── Exception.php │ │ ├── process │ │ │ ├── exception │ │ │ │ ├── Failed.php │ │ │ │ └── Timeout.php │ │ │ ├── Utils.php │ │ │ └── pipes │ │ │ │ └── Pipes.php │ │ ├── response │ │ │ ├── Json.php │ │ │ ├── Jsonp.php │ │ │ └── View.php │ │ └── template │ │ │ └── driver │ │ │ └── File.php │ └── traits │ │ └── think │ │ └── Instance.php ├── codecov.yml ├── start.php ├── console.php ├── composer.json ├── tpl │ ├── default_index.tpl │ └── dispatch_jump.tpl ├── .travis.yml ├── phpunit.xml └── LICENSE.txt ├── application ├── .htaccess ├── system │ ├── model │ │ ├── Admin.php │ │ └── User.php │ ├── controller │ │ ├── Base.php │ │ ├── Index.php │ │ ├── User.php │ │ └── Login.php │ └── view │ │ ├── public │ │ ├── footer.html │ │ ├── header.html │ │ └── side.html │ │ ├── index │ │ └── index.html │ │ └── user │ │ └── index.html ├── common │ └── validate │ │ └── Login.php ├── index │ └── controller │ │ └── Index.php ├── common.php ├── command.php ├── route.php ├── tags.php ├── user │ └── controller │ │ └── Index.php └── database.php ├── extend └── .gitignore ├── runtime └── .gitignore ├── vendor ├── .gitignore ├── topthink │ ├── think-captcha │ │ ├── .gitignore │ │ ├── assets │ │ │ ├── bgs │ │ │ │ ├── 1.jpg │ │ │ │ ├── 2.jpg │ │ │ │ ├── 3.jpg │ │ │ │ ├── 4.jpg │ │ │ │ ├── 5.jpg │ │ │ │ ├── 6.jpg │ │ │ │ ├── 7.jpg │ │ │ │ └── 8.jpg │ │ │ ├── ttfs │ │ │ │ ├── 1.ttf │ │ │ │ ├── 2.ttf │ │ │ │ ├── 3.ttf │ │ │ │ ├── 4.ttf │ │ │ │ ├── 5.ttf │ │ │ │ └── 6.ttf │ │ │ └── zhttfs │ │ │ │ └── 1.ttf │ │ ├── composer.json │ │ ├── README.md │ │ ├── src │ │ │ ├── CaptchaController.php │ │ │ └── helper.php │ │ └── LICENSE │ └── think-installer │ │ ├── .gitignore │ │ ├── composer.json │ │ └── src │ │ ├── Plugin.php │ │ ├── ThinkFramework.php │ │ └── ThinkTesting.php ├── autoload.php └── composer │ ├── autoload_classmap.php │ ├── autoload_namespaces.php │ ├── autoload_files.php │ ├── autoload_psr4.php │ ├── LICENSE │ ├── autoload_static.php │ └── autoload_real.php ├── public ├── static │ ├── .gitignore │ ├── layui │ │ ├── src │ │ │ ├── font │ │ │ │ ├── iconfont.eot │ │ │ │ ├── iconfont.ttf │ │ │ │ └── iconfont.woff │ │ │ ├── images │ │ │ │ └── face │ │ │ │ │ ├── 0.gif │ │ │ │ │ ├── 1.gif │ │ │ │ │ ├── 10.gif │ │ │ │ │ ├── 11.gif │ │ │ │ │ ├── 12.gif │ │ │ │ │ ├── 13.gif │ │ │ │ │ ├── 14.gif │ │ │ │ │ ├── 15.gif │ │ │ │ │ ├── 16.gif │ │ │ │ │ ├── 17.gif │ │ │ │ │ ├── 18.gif │ │ │ │ │ ├── 19.gif │ │ │ │ │ ├── 2.gif │ │ │ │ │ ├── 20.gif │ │ │ │ │ ├── 21.gif │ │ │ │ │ ├── 22.gif │ │ │ │ │ ├── 23.gif │ │ │ │ │ ├── 24.gif │ │ │ │ │ ├── 25.gif │ │ │ │ │ ├── 26.gif │ │ │ │ │ ├── 27.gif │ │ │ │ │ ├── 28.gif │ │ │ │ │ ├── 29.gif │ │ │ │ │ ├── 3.gif │ │ │ │ │ ├── 30.gif │ │ │ │ │ ├── 31.gif │ │ │ │ │ ├── 32.gif │ │ │ │ │ ├── 33.gif │ │ │ │ │ ├── 34.gif │ │ │ │ │ ├── 35.gif │ │ │ │ │ ├── 36.gif │ │ │ │ │ ├── 37.gif │ │ │ │ │ ├── 38.gif │ │ │ │ │ ├── 39.gif │ │ │ │ │ ├── 4.gif │ │ │ │ │ ├── 40.gif │ │ │ │ │ ├── 41.gif │ │ │ │ │ ├── 42.gif │ │ │ │ │ ├── 43.gif │ │ │ │ │ ├── 44.gif │ │ │ │ │ ├── 45.gif │ │ │ │ │ ├── 46.gif │ │ │ │ │ ├── 47.gif │ │ │ │ │ ├── 48.gif │ │ │ │ │ ├── 49.gif │ │ │ │ │ ├── 5.gif │ │ │ │ │ ├── 50.gif │ │ │ │ │ ├── 51.gif │ │ │ │ │ ├── 52.gif │ │ │ │ │ ├── 53.gif │ │ │ │ │ ├── 54.gif │ │ │ │ │ ├── 55.gif │ │ │ │ │ ├── 56.gif │ │ │ │ │ ├── 57.gif │ │ │ │ │ ├── 58.gif │ │ │ │ │ ├── 59.gif │ │ │ │ │ ├── 6.gif │ │ │ │ │ ├── 60.gif │ │ │ │ │ ├── 61.gif │ │ │ │ │ ├── 62.gif │ │ │ │ │ ├── 63.gif │ │ │ │ │ ├── 64.gif │ │ │ │ │ ├── 65.gif │ │ │ │ │ ├── 66.gif │ │ │ │ │ ├── 67.gif │ │ │ │ │ ├── 68.gif │ │ │ │ │ ├── 69.gif │ │ │ │ │ ├── 7.gif │ │ │ │ │ ├── 70.gif │ │ │ │ │ ├── 71.gif │ │ │ │ │ ├── 8.gif │ │ │ │ │ └── 9.gif │ │ │ ├── css │ │ │ │ └── modules │ │ │ │ │ ├── laydate │ │ │ │ │ └── icon.png │ │ │ │ │ ├── layer │ │ │ │ │ └── default │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ ├── icon-ext.png │ │ │ │ │ │ ├── loading-0.gif │ │ │ │ │ │ ├── loading-1.gif │ │ │ │ │ │ └── loading-2.gif │ │ │ │ │ └── code.css │ │ │ └── lay │ │ │ │ ├── all-mobile.js │ │ │ │ ├── modules │ │ │ │ ├── mobile │ │ │ │ │ └── layim-mobile-open.js │ │ │ │ ├── mobile.js │ │ │ │ ├── code.js │ │ │ │ └── util.js │ │ │ │ └── all.js │ │ └── global.js │ ├── bootstrap │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ │ ├── bootstrap-datepicker.zh-CN.min.js │ │ │ ├── npm.js │ │ │ └── bootstrap-datetimepicker.zh-CN.js │ ├── js │ │ └── ajax.min.js │ └── css │ │ └── default.css-- ├── robots.txt ├── favicon.ico ├── .htaccess ├── index.php └── router.php ├── .gitignore ├── composer.json ├── think ├── LICENSE.txt └── .travis.yml /thinkphp/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /application/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /extend/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /runtime/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /vendor/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /public/static/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | composer.lock 3 | *.log 4 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /thinkphp/tests/conf/redis.ini: -------------------------------------------------------------------------------- 1 | extension=redis.so 2 | -------------------------------------------------------------------------------- /thinkphp/tests/conf/timezone.ini: -------------------------------------------------------------------------------- 1 | date.timezone = UTC -------------------------------------------------------------------------------- /thinkphp/tests/conf/memcached.ini: -------------------------------------------------------------------------------- 1 | extension=memcached.so 2 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/display.html: -------------------------------------------------------------------------------- 1 | {$name??'default'} -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/include2.html: -------------------------------------------------------------------------------- 1 | {$info.value}: -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/model/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/session/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/traits/model/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /thinkphp/.gitignore: -------------------------------------------------------------------------------- 1 | /composer.lock 2 | /vendor 3 | .idea 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /thinkphp/tests/conf/apcu.ini: -------------------------------------------------------------------------------- 1 | extension=apcu.so 2 | 3 | apc.enable_cli=1 4 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/controller/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/db/driver/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/layout.html: -------------------------------------------------------------------------------- 1 |
{__CONTENT__} 2 |
-------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/view/driver/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/traits/controller/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /vendor/topthink/think-captcha/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | /composer.lock 3 | .idea -------------------------------------------------------------------------------- /vendor/topthink/think-installer/.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | composer.lock 3 | /vendor -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/config/driver/fixtures/config.ini: -------------------------------------------------------------------------------- 1 | inifile=1 -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/layout2.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/template/driver/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/config/driver/fixtures/config.json: -------------------------------------------------------------------------------- 1 | {"jsonstring":1} -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehack/vue2-thinkphp5/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /thinkphp/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehack/vue2-thinkphp5/HEAD/thinkphp/logo.png -------------------------------------------------------------------------------- /thinkphp/tests/conf/apcu_bc.ini: -------------------------------------------------------------------------------- 1 | extension=apcu.so 2 | extension=apc.so 3 | 4 | apc.enable_cli=1 5 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/lang/lang.php: -------------------------------------------------------------------------------- 1 | '加载', 4 | ]; 5 | -------------------------------------------------------------------------------- /thinkphp/tests/.gitignore: -------------------------------------------------------------------------------- 1 | /runtime/ 2 | /application/common.php 3 | /application/demo/ 4 | /application/runtime/ -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/extend.html: -------------------------------------------------------------------------------- 1 | {extend name="extend2" /} 2 | {block name="head"}header{/block} -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/include.html: -------------------------------------------------------------------------------- 1 | 2 | {include file="include2" /} -------------------------------------------------------------------------------- /thinkphp/tests/extensions/5.4/apcu.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehack/vue2-thinkphp5/HEAD/thinkphp/tests/extensions/5.4/apcu.so -------------------------------------------------------------------------------- /thinkphp/tests/extensions/5.5/apcu.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehack/vue2-thinkphp5/HEAD/thinkphp/tests/extensions/5.5/apcu.so -------------------------------------------------------------------------------- /thinkphp/tests/extensions/5.6/apcu.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehack/vue2-thinkphp5/HEAD/thinkphp/tests/extensions/5.6/apcu.so -------------------------------------------------------------------------------- /thinkphp/tests/extensions/7.0/apc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehack/vue2-thinkphp5/HEAD/thinkphp/tests/extensions/7.0/apc.so -------------------------------------------------------------------------------- /thinkphp/tests/extensions/7.0/apcu.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehack/vue2-thinkphp5/HEAD/thinkphp/tests/extensions/7.0/apcu.so -------------------------------------------------------------------------------- /thinkphp/tests/extensions/7.0/redis.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehack/vue2-thinkphp5/HEAD/thinkphp/tests/extensions/7.0/redis.so -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/loader/test/Hello.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | 6 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/command/make/stubs/model.stub: -------------------------------------------------------------------------------- 1 | 2 | Options +FollowSymlinks -Multiviews 3 | RewriteEngine On 4 | 5 | RewriteCond %{REQUEST_FILENAME} !-d 6 | RewriteCond %{REQUEST_FILENAME} !-f 7 | RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] 8 | 9 | -------------------------------------------------------------------------------- /thinkphp/codecov.yml: -------------------------------------------------------------------------------- 1 | comment: 2 | layout: header, changes, diff 3 | coverage: 4 | ignore: 5 | - base.php 6 | - helper.php 7 | - convention.php 8 | - lang/zh-cn.php 9 | - start.php 10 | - console.php 11 | status: 12 | patch: false 13 | -------------------------------------------------------------------------------- /vendor/composer/autoload_files.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/topthink/think-captcha/src/helper.php', 10 | ); 11 | -------------------------------------------------------------------------------- /public/static/layui/global.js: -------------------------------------------------------------------------------- 1 | /** 2 | 项目JS主入口 3 | 以依赖Layui的layer和form模块为例 4 | **/ 5 | layui.define(['layer', 'form'], function(exports){ 6 | var layer = layui.layer 7 | ,form = layui.form(); 8 | 9 | // layer.msg('Hello World'); 10 | 11 | exports('global', {}); //注意,这里是模块输出的核心,模块名必须和use时的模块名一致 12 | }); 13 | -------------------------------------------------------------------------------- /application/system/controller/Base.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |

2017 ©

4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/view/theme/index/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Document 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/extend2.html: -------------------------------------------------------------------------------- 1 | {layout name="layout2" replace="[__REPLACE__]" /} 2 | {block name="head"}{/block} 3 |
4 | {include file="include" name="info" value="$info.value" /} 5 | {block name="main"} 6 | {block name="side"} 7 | side 8 | {/block} 9 | {block name="mainbody"} 10 | 11 | {/block} 12 | {/block} 13 | {literal} 14 | {$name} 15 | {/literal} 16 | 17 |
-------------------------------------------------------------------------------- /vendor/composer/autoload_psr4.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/topthink/think-installer/src'), 10 | 'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'), 11 | 'think\\' => array($baseDir . '/thinkphp/library/think'), 12 | ); 13 | -------------------------------------------------------------------------------- /public/static/bootstrap/js/bootstrap-datepicker.zh-CN.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],daysShort:["周日","周一","周二","周三","周四","周五","周六"],daysMin:["日","一","二","三","四","五","六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",clear:"清除",format:"yyyy年mm月dd日",titleFormat:"yyyy年mm月",weekStart:1}}(jQuery); -------------------------------------------------------------------------------- /application/common/validate/Login.php: -------------------------------------------------------------------------------- 1 | 'require', 8 | 'password' => 'require', 9 | 'code' => 'require' 10 | 11 | ]; 12 | 13 | protected $message = [ 14 | 'username.require' => '请填写用户名!', 15 | 'password.require' => '请填写登录密码!', 16 | 'code.require' => '请输入验证码!' 17 | ]; 18 | 19 | 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /application/index/controller/Index.php: -------------------------------------------------------------------------------- 1 | '.date('Y-m-d H:i:s',time()).'
'.'version '.THINK_VERSION; 9 | } 10 | 11 | public function hello($name = 'ThinkPHP5') 12 | { 13 | return 'hello,' . $name; 14 | } 15 | 16 | public function test(){ 17 | $data =db('user')->where('id',1)->select(); 18 | dump($data); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/topthink/think-captcha/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "topthink/think-captcha", 3 | "description": "captcha package for thinkphp5", 4 | "authors": [ 5 | { 6 | "name": "yunwuxin", 7 | "email": "448901948@qq.com" 8 | } 9 | ], 10 | "license": "Apache-2.0", 11 | "require": {}, 12 | "autoload": { 13 | "psr-4": { 14 | "think\\captcha\\": "src/" 15 | }, 16 | "files": [ 17 | "src/helper.php" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /application/system/model/User.php: -------------------------------------------------------------------------------- 1 | 'timestamp:Y-m-d', 10 | 'etime' => 'timestamp:Y-m-d', 11 | ]; 12 | 13 | // 获取器 14 | public function getBcycleAttr($value){ 15 | $bcycle=[ 16 | 'y'=>'年付', 17 | 'm'=>'月付', 18 | 'd'=>'日付' 19 | ]; 20 | return $bcycle[$value]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /public/static/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /vendor/topthink/think-captcha/README.md: -------------------------------------------------------------------------------- 1 | # think-captcha 2 | thinkphp5 验证码类库 3 | 4 | ## 安装 5 | > composer require topthink/think-captcha 6 | 7 | 8 | ##使用 9 | 10 | ###模板里输出验证码 11 | 12 | ~~~ 13 |
{:captcha_img()}
14 | ~~~ 15 | 或者 16 | ~~~ 17 |
captcha
18 | ~~~ 19 | > 上面两种的最终效果是一样的 20 | 21 | ### 控制器里验证 22 | 使用TP5的内置验证功能即可 23 | ~~~ 24 | $this->validate($data,[ 25 | 'captcha|验证码'=>'required|captcha' 26 | ]); 27 | ~~~ 28 | 或者手动验证 29 | ~~~ 30 | if(!captcha_check($captcha)){ 31 | //验证失败 32 | }; 33 | ~~~ -------------------------------------------------------------------------------- /thinkphp/tests/script/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $(phpenv version-name) != "hhvm" ]; then 4 | cp tests/extensions/$(phpenv version-name)/*.so $(php-config --extension-dir) 5 | 6 | if [ $(phpenv version-name) = "7.0" ]; then 7 | phpenv config-add tests/conf/apcu_bc.ini 8 | else 9 | phpenv config-add tests/conf/apcu.ini 10 | fi 11 | 12 | phpenv config-add tests/conf/memcached.ini 13 | phpenv config-add tests/conf/redis.ini 14 | 15 | phpenv config-add tests/conf/timezone.ini 16 | fi 17 | 18 | composer install --no-interaction --ignore-platform-reqs 19 | -------------------------------------------------------------------------------- /application/system/view/public/header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 6 | 17 |
18 |
-------------------------------------------------------------------------------- /application/common.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | // 应用公共文件 13 | -------------------------------------------------------------------------------- /vendor/topthink/think-installer/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "topthink/think-installer", 3 | "type": "composer-plugin", 4 | "require": { 5 | "composer-plugin-api": "^1.0" 6 | }, 7 | "require-dev": { 8 | "composer/composer": "1.0.*@dev" 9 | }, 10 | "license": "Apache-2.0", 11 | "authors": [ 12 | { 13 | "name": "yunwuxin", 14 | "email": "448901948@qq.com" 15 | } 16 | ], 17 | "autoload": { 18 | "psr-4": { 19 | "think\\composer\\": "src" 20 | } 21 | }, 22 | "extra": { 23 | "class": "think\\composer\\Plugin" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /application/command.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | return []; 13 | -------------------------------------------------------------------------------- /public/static/layui/src/lay/modules/mobile.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | @Name:layui 移动模块入口 | 构建后则为移动模块集合 4 | @Author:贤心 5 | @License:MIT 6 | 7 | */ 8 | 9 | 10 | if(!layui['layui.mobile']){ 11 | layui.config({ 12 | base: layui.cache.dir + 'lay/modules/mobile/' 13 | }).extend({ 14 | 'layer-mobile': 'layer-mobile' 15 | ,'zepto': 'zepto' 16 | ,'upload-mobile': 'upload-mobile' 17 | ,'layim-mobile': 'layim-mobile' 18 | }); 19 | } 20 | 21 | layui.define([ 22 | 'layer-mobile' 23 | ,'zepto' 24 | ,'layim-mobile' 25 | ], function(exports){ 26 | exports('mobile', { 27 | layer: layui['layer-mobile'] //弹层 28 | ,layim: layui['layim-mobile'] //WebIM 29 | }); 30 | }); -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "topthink/think", 3 | "description": "the new thinkphp framework", 4 | "type": "project", 5 | "keywords": [ 6 | "framework", 7 | "thinkphp", 8 | "ORM" 9 | ], 10 | "homepage": "http://thinkphp.cn/", 11 | "license": "Apache-2.0", 12 | "authors": [ 13 | { 14 | "name": "liu21st", 15 | "email": "liu21st@gmail.com" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.4.0", 20 | "topthink/framework": "^5.0" 21 | }, 22 | "extra": { 23 | "think-path": "thinkphp" 24 | }, 25 | "config": { 26 | "preferred-install": "dist" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /public/static/bootstrap/js/bootstrap-datetimepicker.zh-CN.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Simplified Chinese translation for bootstrap-datetimepicker 3 | * Yuan Cheung 4 | */ 5 | ;(function($){ 6 | $.fn.datetimepicker.dates['zh-CN'] = { 7 | days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"], 8 | daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"], 9 | daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], 10 | months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 11 | monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 12 | today: "今天", 13 | suffix: [], 14 | meridiem: ["上午", "下午"] 15 | }; 16 | }(jQuery)); 17 | -------------------------------------------------------------------------------- /vendor/topthink/think-installer/src/Plugin.php: -------------------------------------------------------------------------------- 1 | getInstallationManager(); 15 | 16 | //框架核心 17 | $manager->addInstaller(new ThinkFramework($io, $composer)); 18 | 19 | //单元测试 20 | $manager->addInstaller(new ThinkTesting($io, $composer)); 21 | 22 | //扩展 23 | $manager->addInstaller(new ThinkExtend($io, $composer)); 24 | 25 | } 26 | } -------------------------------------------------------------------------------- /thinkphp/start.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think; 13 | 14 | // ThinkPHP 引导文件 15 | // 加载基础文件 16 | require __DIR__ . '/base.php'; 17 | // 执行应用 18 | App::run()->send(); 19 | -------------------------------------------------------------------------------- /think: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | 11 | // +---------------------------------------------------------------------- 12 | 13 | // 定义项目路径 14 | define('APP_PATH', __DIR__ . '/application/'); 15 | 16 | // 加载框架引导文件 17 | require __DIR__.'/thinkphp/console.php'; 18 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | // [ 应用入口文件 ] 13 | 14 | // 定义应用目录 15 | define('APP_PATH', __DIR__ . '/../application/'); 16 | // 加载框架引导文件 17 | require __DIR__ . '/../thinkphp/start.php'; 18 | -------------------------------------------------------------------------------- /public/router.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | // $Id$ 12 | 13 | if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["REQUEST_URI"])) { 14 | return false; 15 | } else { 16 | require __DIR__ . "/index.php"; 17 | } 18 | -------------------------------------------------------------------------------- /thinkphp/console.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think; 13 | 14 | // ThinkPHP 引导文件 15 | // 加载基础文件 16 | require __DIR__ . '/base.php'; 17 | 18 | // 执行应用 19 | App::initCommon(); 20 | Console::init(); 21 | -------------------------------------------------------------------------------- /application/system/controller/Index.php: -------------------------------------------------------------------------------- 1 | getmenu(); 13 | // return $json; 14 | // dump($json); 15 | $admin=db('admin')->field('prem')->getByUsername(Session::get('user_name')); 16 | $arr=explode(',',$admin['prem']); 17 | // dump($arr);// [1,10,16] 18 | foreach ($json as $key => $value) { 19 | if(in_array($value['id'], $arr)){ 20 | $menuArr[]=$value; 21 | } 22 | } 23 | $this->assign('json',$menuArr);*/ 24 | // return $this->fetch('public/left2'); 25 | // return $this->fetch('index'); 26 | return $this->fetch(); 27 | } 28 | 29 | 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /thinkphp/library/think/exception/RouteNotFoundException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\exception; 13 | 14 | class RouteNotFoundException extends HttpException 15 | { 16 | 17 | public function __construct() 18 | { 19 | parent::__construct(404); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /application/route.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | return [ 13 | '__pattern__' => [ 14 | 'name' => '\w+', 15 | ], 16 | '[hello]' => [ 17 | ':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']], 18 | ':name' => ['index/hello', ['method' => 'post']], 19 | ], 20 | 21 | ]; 22 | -------------------------------------------------------------------------------- /thinkphp/tests/mock.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | // 测试入口文件 13 | $_SERVER['REQUEST_METHOD'] = 'GET'; 14 | // 定义项目测试基础路径 15 | define('TEST_PATH', __DIR__ . '/'); 16 | // 定义项目路径 17 | define('APP_PATH', __DIR__ . '/application/'); 18 | // 加载框架基础文件 19 | require __DIR__ . '/../base.php'; 20 | \think\Loader::addNamespace('tests', TEST_PATH); 21 | -------------------------------------------------------------------------------- /thinkphp/tests/application/route.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | // $Id$ 12 | 13 | return [ 14 | '__pattern__' => [ 15 | 'name' => '\w+', 16 | ], 17 | '[hello]' => [ 18 | ':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']], 19 | ':name' => ['index/hello', ['method' => 'post']], 20 | ], 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /vendor/topthink/think-captcha/src/CaptchaController.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\captcha; 13 | 14 | use think\Config; 15 | 16 | class CaptchaController 17 | { 18 | public function index($id = "") 19 | { 20 | $captcha = new Captcha((array)Config::get('captcha')); 21 | return $captcha->entry($id); 22 | } 23 | } -------------------------------------------------------------------------------- /thinkphp/library/think/config/driver/Ini.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\config\driver; 13 | 14 | class Ini 15 | { 16 | public function parse($config) 17 | { 18 | if (is_file($config)) { 19 | return parse_ini_file($config, true); 20 | } else { 21 | return parse_ini_string($config, true); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /thinkphp/library/think/config/driver/Json.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\config\driver; 13 | 14 | class Json 15 | { 16 | public function parse($config) 17 | { 18 | if (is_file($config)) { 19 | $config = file_get_contents($config); 20 | } 21 | $result = json_decode($config, true); 22 | return $result; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /thinkphp/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "topthink/framework", 3 | "description": "the new thinkphp framework", 4 | "type": "think-framework", 5 | "keywords": [ 6 | "framework", 7 | "thinkphp", 8 | "ORM" 9 | ], 10 | "homepage": "http://thinkphp.cn/", 11 | "license": "Apache-2.0", 12 | "authors": [ 13 | { 14 | "name": "liu21st", 15 | "email": "liu21st@gmail.com" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.4.0", 20 | "topthink/think-installer": "~1.0" 21 | }, 22 | "require-dev": { 23 | "phpunit/phpunit": "4.8.*", 24 | "johnkary/phpunit-speedtrap": "^1.0", 25 | "mikey179/vfsStream": "~1.6", 26 | "phploc/phploc": "2.*", 27 | "sebastian/phpcpd": "2.*", 28 | "phpdocumentor/reflection-docblock": "^2.0" 29 | }, 30 | "autoload": { 31 | "psr-4": { 32 | "think\\": "library/think" 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /thinkphp/library/think/log/driver/Test.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\log\driver; 13 | 14 | /** 15 | * 模拟测试输出 16 | */ 17 | class Test 18 | { 19 | /** 20 | * 日志写入接口 21 | * @access public 22 | * @param array $log 日志信息 23 | * @return bool 24 | */ 25 | public function save(array $log = []) 26 | { 27 | return true; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /application/system/view/index/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ss管理系统 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | {include file="public/header" /} 16 | {include file="public/side" /} 17 | 18 |
19 | 首页 20 |
21 | {include file="public/footer" /} 22 | 23 |
24 | 25 |
26 |
27 | 28 | 29 |
30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /application/tags.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | // 应用行为扩展定义文件 13 | return [ 14 | // 应用初始化 15 | 'app_init' => [], 16 | // 应用开始 17 | 'app_begin' => [], 18 | // 模块初始化 19 | 'module_init' => [], 20 | // 操作开始执行 21 | 'action_begin' => [], 22 | // 视图内容过滤 23 | 'view_filter' => [], 24 | // 日志写入 25 | 'log_write' => [], 26 | // 应用结束 27 | 'app_end' => [], 28 | ]; 29 | -------------------------------------------------------------------------------- /thinkphp/tpl/default_index.tpl: -------------------------------------------------------------------------------- 1 | *{ 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 }

:)

ThinkPHP V5
十年磨一剑 - 为API开发设计的高性能框架

[ V5.0 版本由 七牛云 独家赞助发布 ]
'; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /thinkphp/tests/application/index/controller/Index.php: -------------------------------------------------------------------------------- 1 | *{ 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 }

:)

ThinkPHP V5
十年磨一剑 - 为API开发设计的高性能框架

[ V5.0 版本由 七牛云 独家赞助发布 ]
'; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /application/system/view/public/side.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 22 |
23 |
-------------------------------------------------------------------------------- /thinkphp/library/think/exception/HttpResponseException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\exception; 13 | 14 | use think\Response; 15 | 16 | class HttpResponseException extends \RuntimeException 17 | { 18 | /** 19 | * @var Response 20 | */ 21 | protected $response; 22 | 23 | public function __construct(Response $response) 24 | { 25 | $this->response = $response; 26 | } 27 | 28 | public function getResponse() 29 | { 30 | return $this->response; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2016 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /thinkphp/library/think/console/output/driver/Nothing.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\output\driver; 13 | 14 | use think\console\Output; 15 | 16 | class Nothing 17 | { 18 | 19 | public function __construct(Output $output) 20 | { 21 | // do nothing 22 | } 23 | 24 | public function write($messages, $newline = false, $options = Output::OUTPUT_NORMAL) 25 | { 26 | // do nothing 27 | } 28 | 29 | public function renderException(\Exception $e) 30 | { 31 | // do nothing 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /thinkphp/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: php 4 | 5 | services: 6 | - memcached 7 | - mongodb 8 | - mysql 9 | - postgresql 10 | - redis-server 11 | 12 | matrix: 13 | fast_finish: true 14 | include: 15 | - php: 5.4 16 | - php: 5.5 17 | - php: 5.6 18 | - php: 7.0 19 | - php: hhvm 20 | allow_failures: 21 | - php: hhvm 22 | 23 | cache: 24 | directories: 25 | - $HOME/.composer/cache 26 | 27 | before_install: 28 | - composer self-update 29 | - mysql -e "create database IF NOT EXISTS test;" -uroot 30 | - psql -c 'DROP DATABASE IF EXISTS test;' -U postgres 31 | - psql -c 'create database test;' -U postgres 32 | 33 | install: 34 | - ./tests/script/install.sh 35 | 36 | script: 37 | ## LINT 38 | - find . -path ./vendor -prune -o -type f -name \*.php -exec php -l {} \; 39 | ## PHP Copy/Paste Detector 40 | - vendor/bin/phpcpd --verbose --exclude vendor ./ || true 41 | ## PHPLOC 42 | - vendor/bin/phploc --exclude vendor ./ 43 | ## PHPUNIT 44 | - vendor/bin/phpunit --coverage-clover=coverage.xml --configuration=phpunit.xml 45 | 46 | after_success: 47 | - bash <(curl -s https://codecov.io/bash) 48 | -------------------------------------------------------------------------------- /vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /thinkphp/library/think/exception/ClassNotFoundException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\exception; 13 | 14 | class ClassNotFoundException extends \RuntimeException 15 | { 16 | protected $class; 17 | public function __construct($message, $class = '') 18 | { 19 | $this->message = $message; 20 | $this->class = $class; 21 | } 22 | 23 | /** 24 | * 获取类名 25 | * @access public 26 | * @return string 27 | */ 28 | public function getClass() 29 | { 30 | return $this->class; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /thinkphp/library/think/exception/TemplateNotFoundException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\exception; 13 | 14 | class TemplateNotFoundException extends \RuntimeException 15 | { 16 | protected $template; 17 | 18 | public function __construct($message, $template = '') 19 | { 20 | $this->message = $message; 21 | $this->template = $template; 22 | } 23 | 24 | /** 25 | * 获取模板文件 26 | * @access public 27 | * @return string 28 | */ 29 | public function getTemplate() 30 | { 31 | return $this->template; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /thinkphp/library/think/exception/ValidateException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\exception; 13 | 14 | class ValidateException extends \RuntimeException 15 | { 16 | protected $error; 17 | 18 | public function __construct($error) 19 | { 20 | $this->error = $error; 21 | $this->message = is_array($error) ? implode("\n\r", $error) : $error; 22 | } 23 | 24 | /** 25 | * 获取验证错误信息 26 | * @access public 27 | * @return array|string 28 | */ 29 | public function getError() 30 | { 31 | return $this->error; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/log/driver/fileTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * Test File Log 14 | */ 15 | namespace tests\thinkphp\library\think\log\driver; 16 | 17 | use think\Log; 18 | 19 | class fileTest extends \PHPUnit_Framework_TestCase 20 | { 21 | protected function setUp() 22 | { 23 | Log::init(['type' => 'file']); 24 | } 25 | 26 | public function testRecord() 27 | { 28 | $record_msg = 'record'; 29 | Log::record($record_msg, 'notice'); 30 | $logs = Log::getLog(); 31 | 32 | $this->assertEquals([], $logs); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /thinkphp/library/think/config/driver/Xml.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\config\driver; 13 | 14 | class Xml 15 | { 16 | public function parse($config) 17 | { 18 | if (is_file($config)) { 19 | $content = simplexml_load_file($config); 20 | } else { 21 | $content = simplexml_load_string($config); 22 | } 23 | $result = (array) $content; 24 | foreach ($result as $key => $val) { 25 | if (is_object($val)) { 26 | $result[$key] = (array) $val; 27 | } 28 | } 29 | return $result; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /thinkphp/tests/application/config.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | // $Id$ 12 | 13 | return [ 14 | 'url_route_on' => true, 15 | 'log' => [ 16 | 'type' => 'file', // 支持 socket trace file 17 | ], 18 | 'view' => [ 19 | // 模板引擎 20 | 'engine_type' => 'think', 21 | // 模板引擎配置 22 | 'engine_config' => [ 23 | // 模板路径 24 | 'view_path' => '', 25 | // 模板后缀 26 | 'view_suffix' => '.html', 27 | // 模板文件名分隔符 28 | 'view_depr' => DS, 29 | ], 30 | // 输出字符串替换 31 | 'parse_str' => [], 32 | ], 33 | ]; 34 | -------------------------------------------------------------------------------- /public/static/layui/src/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | @Name: layui.code 4 | @Author: 贤心 5 | @Site: http://www.layui.com 6 | 7 | */ 8 | 9 | /* 加载就绪标志 */ 10 | html #layuicss-skincodecss{display:none; position: absolute; width:1989px;} 11 | 12 | /* 默认风格 */ 13 | .layui-code-view{display: block; position: relative; margin: 10px 0; padding: 0; border: 1px solid #ddd; border-left-width: 6px; background-color: #F2F2F2; color: #333; font-family: Courier New; font-size: 12px;} 14 | .layui-code-h3{position: relative; padding: 0 10px; height: 30px; line-height: 30px; border-bottom: 1px solid #ddd; font-size: 12px;} 15 | .layui-code-h3 a{position: absolute; right: 10px; top: 0; color: #999;} 16 | .layui-code-view .layui-code-ol{position: relative; overflow: auto;} 17 | .layui-code-view .layui-code-ol li{position: relative; margin-left: 45px; line-height: 20px; padding: 0 5px; border-left: 1px solid #ddd; list-style-type: decimal-leading-zero; *list-style-type: decimal; background-color: #fff;} 18 | .layui-code-view pre{margin: 0;} 19 | 20 | /* notepadd++风格 */ 21 | .layui-code-notepad{border: 1px solid #0C0C0C; border-left-color: #3F3F3F; background-color: #0C0C0C; color: #C2BE9E} 22 | .layui-code-notepad .layui-code-h3{border-bottom: none;} 23 | .layui-code-notepad .layui-code-ol li{background-color: #3F3F3F; border-left: none;} -------------------------------------------------------------------------------- /thinkphp/library/think/console/command/make/Model.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\command\make; 13 | 14 | use think\console\command\Make; 15 | 16 | class Model extends Make 17 | { 18 | protected $type = "Model"; 19 | 20 | protected function configure() 21 | { 22 | parent::configure(); 23 | $this->setName('make:model') 24 | ->setDescription('Create a new model class'); 25 | } 26 | 27 | protected function getStub() 28 | { 29 | return __DIR__ . '/stubs/model.stub'; 30 | } 31 | 32 | protected function getNamespace($appNamespace, $module) 33 | { 34 | return parent::getNamespace($appNamespace, $module) . '\model'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /thinkphp/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./tests/thinkphp/ 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ./ 23 | 24 | tests 25 | vendor 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/config/driver/iniTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * Ini配置测试 14 | * @author 7IN0SAN9 15 | */ 16 | 17 | namespace tests\thinkphp\library\think\config\driver; 18 | 19 | use think\config; 20 | 21 | class iniTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function testParse() 24 | { 25 | Config::parse('inistring=1', 'ini'); 26 | $this->assertEquals(1, Config::get('inistring')); 27 | Config::reset(); 28 | Config::parse(__DIR__ . '/fixtures/config.ini'); 29 | $this->assertTrue(Config::has('inifile')); 30 | $this->assertEquals(1, Config::get('inifile')); 31 | Config::reset(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /thinkphp/library/think/db/exception/BindParamException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\db\exception; 13 | 14 | use think\exception\DbException; 15 | 16 | /** 17 | * PDO参数绑定异常 18 | */ 19 | class BindParamException extends DbException 20 | { 21 | 22 | /** 23 | * BindParamException constructor. 24 | * @param string $message 25 | * @param array $config 26 | * @param string $sql 27 | * @param array $bind 28 | * @param int $code 29 | */ 30 | public function __construct($message, $config, $sql, $bind, $code = 10502) 31 | { 32 | $this->setData('Bind Param', $bind); 33 | parent::__construct($message, $config, $sql, $code); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /thinkphp/library/think/exception/HttpException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\exception; 13 | 14 | class HttpException extends \RuntimeException 15 | { 16 | private $statusCode; 17 | private $headers; 18 | 19 | public function __construct($statusCode, $message = null, \Exception $previous = null, array $headers = [], $code = 0) 20 | { 21 | $this->statusCode = $statusCode; 22 | $this->headers = $headers; 23 | 24 | parent::__construct($message, $code, $previous); 25 | } 26 | 27 | public function getStatusCode() 28 | { 29 | return $this->statusCode; 30 | } 31 | 32 | public function getHeaders() 33 | { 34 | return $this->headers; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/config/driver/jsonTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * Xml配置测试 14 | * @author 7IN0SAN9 15 | */ 16 | 17 | namespace tests\thinkphp\library\think\config\driver; 18 | 19 | use think\config; 20 | 21 | class jsonTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function testParse() 24 | { 25 | Config::parse('{"jsonstring":1}', 'json'); 26 | $this->assertEquals(1, Config::get('jsonstring')); 27 | Config::reset(); 28 | Config::parse(__DIR__ . '/fixtures/config.json'); 29 | $this->assertTrue(Config::has('jsonstring')); 30 | $this->assertEquals(1, Config::get('jsonstring')); 31 | Config::reset(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /thinkphp/library/think/Env.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think; 13 | 14 | class Env 15 | { 16 | /** 17 | * 获取环境变量值 18 | * @param string $name 环境变量名(支持二级 .号分割) 19 | * @param string $default 默认值 20 | * @return mixed 21 | */ 22 | public static function get($name, $default = null) 23 | { 24 | $result = getenv(ENV_PREFIX . strtoupper(str_replace('.', '_', $name))); 25 | if (false !== $result) { 26 | if ('false' === $result) { 27 | $result = false; 28 | } elseif ('true' === $result) { 29 | $result = true; 30 | } 31 | return $result; 32 | } else { 33 | return $default; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/config/driver/xmlTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * Xml配置测试 14 | * @author 7IN0SAN9 15 | */ 16 | 17 | namespace tests\thinkphp\library\think\config\driver; 18 | 19 | use think\config; 20 | 21 | class xmlTest extends \PHPUnit_Framework_TestCase 22 | { 23 | public function testParse() 24 | { 25 | Config::parse('1', 'xml'); 26 | $this->assertEquals(1, Config::get('xmlstring')); 27 | Config::reset(); 28 | Config::parse(__DIR__ . '/fixtures/config.xml'); 29 | $this->assertTrue(Config::has('xmlfile.istrue')); 30 | $this->assertEquals(1, Config::get('xmlfile.istrue')); 31 | Config::reset(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/logTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * Log测试 14 | * @author liu21st 15 | */ 16 | namespace tests\thinkphp\library\think; 17 | 18 | use think\Log; 19 | 20 | class logTest extends \PHPUnit_Framework_TestCase 21 | { 22 | 23 | public function testSave() 24 | { 25 | Log::init(['type' => 'test']); 26 | Log::clear(); 27 | Log::record('test'); 28 | Log::record([1, 2, 3]); 29 | $this->assertTrue(Log::save()); 30 | } 31 | 32 | public function testWrite() 33 | { 34 | Log::init(['type' => 'test']); 35 | Log::clear(); 36 | $this->assertTrue(Log::write('hello', 'info')); 37 | $this->assertTrue(Log::write([1, 2, 3], 'log')); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 3 | 版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn) 4 | All rights reserved。 5 | ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 6 | 7 | Apache Licence是著名的非盈利开源组织Apache采用的协议。 8 | 该协议和BSD类似,鼓励代码共享和尊重原作者的著作权, 9 | 允许代码修改,再作为开源或商业软件发布。需要满足 10 | 的条件: 11 | 1. 需要给代码的用户一份Apache Licence ; 12 | 2. 如果你修改了代码,需要在被修改的文件中说明; 13 | 3. 在延伸的代码中(修改和有源代码衍生的代码中)需要 14 | 带有原来代码中的协议,商标,专利声明和其他原来作者规 15 | 定需要包含的说明; 16 | 4. 如果再发布的产品中包含一个Notice文件,则在Notice文 17 | 件中需要带有本协议内容。你可以在Notice中增加自己的 18 | 许可,但不可以表现为对Apache Licence构成更改。 19 | 具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /thinkphp/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 3 | 版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn) 4 | All rights reserved。 5 | ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 6 | 7 | Apache Licence是著名的非盈利开源组织Apache采用的协议。 8 | 该协议和BSD类似,鼓励代码共享和尊重原作者的著作权, 9 | 允许代码修改,再作为开源或商业软件发布。需要满足 10 | 的条件: 11 | 1. 需要给代码的用户一份Apache Licence ; 12 | 2. 如果你修改了代码,需要在被修改的文件中说明; 13 | 3. 在延伸的代码中(修改和有源代码衍生的代码中)需要 14 | 带有原来代码中的协议,商标,专利声明和其他原来作者规 15 | 定需要包含的说明; 16 | 4. 如果再发布的产品中包含一个Notice文件,则在Notice文 17 | 件中需要带有本协议内容。你可以在Notice中增加自己的 18 | 许可,但不可以表现为对Apache Licence构成更改。 19 | 具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /thinkphp/library/think/model/Pivot.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\model; 13 | 14 | use think\Model; 15 | 16 | class Pivot extends Model 17 | { 18 | 19 | /** @var Model */ 20 | public $parent; 21 | 22 | protected $autoWriteTimestamp = false; 23 | 24 | /** 25 | * 架构函数 26 | * @access public 27 | * @param Model $parent 上级模型 28 | * @param array|object $data 数据 29 | * @param string $table 中间数据表名 30 | */ 31 | public function __construct(Model $parent, $data = [], $table = '') 32 | { 33 | $this->parent = $parent; 34 | 35 | if (is_null($this->name)) { 36 | $this->name = $table; 37 | } 38 | 39 | parent::__construct($data); 40 | 41 | $this->class = $this->name; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /vendor/topthink/think-captcha/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 3 | 版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn) 4 | All rights reserved。 5 | ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 6 | 7 | Apache Licence是著名的非盈利开源组织Apache采用的协议。 8 | 该协议和BSD类似,鼓励代码共享和尊重原作者的著作权, 9 | 允许代码修改,再作为开源或商业软件发布。需要满足 10 | 的条件: 11 | 1. 需要给代码的用户一份Apache Licence ; 12 | 2. 如果你修改了代码,需要在被修改的文件中说明; 13 | 3. 在延伸的代码中(修改和有源代码衍生的代码中)需要 14 | 带有原来代码中的协议,商标,专利声明和其他原来作者规 15 | 定需要包含的说明; 16 | 4. 如果再发布的产品中包含一个Notice文件,则在Notice文 17 | 件中需要带有本协议内容。你可以在Notice中增加自己的 18 | 许可,但不可以表现为对Apache Licence构成更改。 19 | 具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /thinkphp/library/think/db/exception/ModelNotFoundException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\db\exception; 13 | 14 | use think\exception\DbException; 15 | 16 | class ModelNotFoundException extends DbException 17 | { 18 | protected $model; 19 | 20 | /** 21 | * 构造方法 22 | * @param string $message 23 | * @param string $model 24 | */ 25 | public function __construct($message, $model = '', array $config = []) 26 | { 27 | $this->message = $message; 28 | $this->model = $model; 29 | 30 | $this->setData('Database Config', $config); 31 | } 32 | 33 | /** 34 | * 获取模型类名 35 | * @access public 36 | * @return string 37 | */ 38 | public function getModel() 39 | { 40 | return $this->model; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /thinkphp/library/think/db/exception/DataNotFoundException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\db\exception; 13 | 14 | use think\exception\DbException; 15 | 16 | class DataNotFoundException extends DbException 17 | { 18 | protected $table; 19 | 20 | /** 21 | * DbException constructor. 22 | * @param string $message 23 | * @param string $table 24 | * @param array $config 25 | */ 26 | public function __construct($message, $table = '', array $config = []) 27 | { 28 | $this->message = $message; 29 | $this->table = $table; 30 | 31 | $this->setData('Database Config', $config); 32 | } 33 | 34 | /** 35 | * 获取数据表名 36 | * @access public 37 | * @return string 38 | */ 39 | public function getTable() 40 | { 41 | return $this->table; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /thinkphp/tests/application/database.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | // $Id$ 12 | 13 | return [ 14 | // 数据库类型 15 | 'type' => 'mysql', 16 | // 数据库连接DSN配置 17 | 'dsn' => '', 18 | // 服务器地址 19 | 'hostname' => '127.0.0.1', 20 | // 数据库名 21 | 'database' => '', 22 | // 数据库用户名 23 | 'username' => 'root', 24 | // 数据库密码 25 | 'password' => '', 26 | // 数据库连接端口 27 | 'hostport' => '', 28 | // 数据库连接参数 29 | 'params' => [], 30 | // 数据库编码默认采用utf8 31 | 'charset' => 'utf8', 32 | // 数据库表前缀 33 | 'prefix' => '', 34 | // 数据库调试模式 35 | 'debug' => true, 36 | // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) 37 | 'deploy' => 0, 38 | // 数据库读写是否分离 主从式有效 39 | 'rw_separate' => false, 40 | // 读写分离后 主服务器数量 41 | 'master_num' => 1, 42 | // 指定从服务器序号 43 | 'slave_no' => '', 44 | ]; 45 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/cache/driver/fileTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * File缓存驱动测试 14 | * @author 刘志淳 15 | */ 16 | 17 | namespace tests\thinkphp\library\think\cache\driver; 18 | 19 | class fileTest extends cacheTestCase 20 | { 21 | private $_cacheInstance = null; 22 | 23 | /** 24 | * 基境缓存类型 25 | */ 26 | protected function setUp() 27 | { 28 | \think\Cache::connect(['type' => 'File', 'path' => CACHE_PATH]); 29 | } 30 | 31 | /** 32 | * @return FileCache 33 | */ 34 | protected function getCacheInstance() 35 | { 36 | if (null === $this->_cacheInstance) { 37 | $this->_cacheInstance = new \think\cache\driver\File(); 38 | } 39 | return $this->_cacheInstance; 40 | } 41 | 42 | // skip testExpire 43 | public function testExpire() 44 | { 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php', 11 | ); 12 | 13 | public static $prefixLengthsPsr4 = array ( 14 | 't' => 15 | array ( 16 | 'think\\composer\\' => 15, 17 | 'think\\captcha\\' => 14, 18 | 'think\\' => 6, 19 | ), 20 | ); 21 | 22 | public static $prefixDirsPsr4 = array ( 23 | 'think\\composer\\' => 24 | array ( 25 | 0 => __DIR__ . '/..' . '/topthink/think-installer/src', 26 | ), 27 | 'think\\captcha\\' => 28 | array ( 29 | 0 => __DIR__ . '/..' . '/topthink/think-captcha/src', 30 | ), 31 | 'think\\' => 32 | array ( 33 | 0 => __DIR__ . '/../..' . '/thinkphp/library/think', 34 | ), 35 | ); 36 | 37 | public static function getInitializer(ClassLoader $loader) 38 | { 39 | return \Closure::bind(function () use ($loader) { 40 | $loader->prefixLengthsPsr4 = ComposerStaticInitcd8a0c083ea6387fe21cdb9bb6ee4e2c::$prefixLengthsPsr4; 41 | $loader->prefixDirsPsr4 = ComposerStaticInitcd8a0c083ea6387fe21cdb9bb6ee4e2c::$prefixDirsPsr4; 42 | 43 | }, null, ClassLoader::class); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /thinkphp/library/think/exception/DbException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\exception; 13 | 14 | use think\Exception; 15 | 16 | /** 17 | * Database相关异常处理类 18 | */ 19 | class DbException extends Exception 20 | { 21 | /** 22 | * DbException constructor. 23 | * @param string $message 24 | * @param array $config 25 | * @param string $sql 26 | * @param int $code 27 | */ 28 | public function __construct($message, array $config, $sql, $code = 10500) 29 | { 30 | $this->message = $message; 31 | $this->code = $code; 32 | 33 | $this->setData('Database Status', [ 34 | 'Error Code' => $code, 35 | 'Error Message' => $message, 36 | 'Error SQL' => $sql, 37 | ]); 38 | 39 | unset($config['username'], $config['password']); 40 | $this->setData('Database Config', $config); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /thinkphp/library/think/controller/Yar.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\controller; 13 | 14 | /** 15 | * ThinkPHP Yar控制器类 16 | */ 17 | abstract class Yar 18 | { 19 | 20 | /** 21 | * 构造函数 22 | * @access public 23 | */ 24 | public function __construct() 25 | { 26 | //控制器初始化 27 | if (method_exists($this, '_initialize')) { 28 | $this->_initialize(); 29 | } 30 | 31 | //判断扩展是否存在 32 | if (!extension_loaded('yar')) { 33 | throw new \Exception('not support yar'); 34 | } 35 | 36 | //实例化Yar_Server 37 | $server = new \Yar_Server($this); 38 | // 启动server 39 | $server->handle(); 40 | } 41 | 42 | /** 43 | * 魔术方法 有不存在的操作的时候执行 44 | * @access public 45 | * @param string $method 方法名 46 | * @param array $args 参数 47 | * @return mixed 48 | */ 49 | public function __call($method, $args) 50 | {} 51 | } 52 | -------------------------------------------------------------------------------- /thinkphp/library/think/exception/PDOException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\exception; 13 | 14 | /** 15 | * PDO异常处理类 16 | * 重新封装了系统的\PDOException类 17 | */ 18 | class PDOException extends DbException 19 | { 20 | /** 21 | * PDOException constructor. 22 | * @param \PDOException $exception 23 | * @param array $config 24 | * @param string $sql 25 | * @param int $code 26 | */ 27 | public function __construct(\PDOException $exception, array $config, $sql, $code = 10501) 28 | { 29 | $error = $exception->errorInfo; 30 | 31 | $this->setData('PDO Error Info', [ 32 | 'SQLSTATE' => $error[0], 33 | 'Driver Error Code' => isset($error[1]) ? $error[1] : 0, 34 | 'Driver Error Message' => isset($error[2]) ? $error[2] : '', 35 | ]); 36 | 37 | parent::__construct($exception->getMessage(), $config, $sql, $code); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/output/driver/Buffer.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\output\driver; 13 | 14 | use think\console\Output; 15 | 16 | class Buffer 17 | { 18 | /** 19 | * @var string 20 | */ 21 | private $buffer = ''; 22 | 23 | public function __construct(Output $output) 24 | { 25 | // do nothing 26 | } 27 | 28 | public function fetch() 29 | { 30 | $content = $this->buffer; 31 | $this->buffer = ''; 32 | return $content; 33 | } 34 | 35 | public function write($messages, $newline = false, $options = Output::OUTPUT_NORMAL) 36 | { 37 | $messages = (array) $messages; 38 | 39 | foreach ($messages as $message) { 40 | $this->buffer .= $message; 41 | } 42 | if ($newline) { 43 | $this->buffer .= "\n"; 44 | } 45 | } 46 | 47 | public function renderException(\Exception $e) 48 | { 49 | // do nothing 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/command/make/stubs/controller.stub: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace traits\think; 13 | 14 | use think\Exception; 15 | 16 | trait Instance 17 | { 18 | protected static $instance = null; 19 | 20 | /** 21 | * @param array $options 22 | * @return static 23 | */ 24 | public static function instance($options = []) 25 | { 26 | if (is_null(self::$instance)) { 27 | self::$instance = new self($options); 28 | } 29 | return self::$instance; 30 | } 31 | 32 | // 静态调用 33 | public static function __callStatic($method, $params) 34 | { 35 | if (is_null(self::$instance)) { 36 | self::$instance = new self(); 37 | } 38 | $call = substr($method, 1); 39 | if (0 === strpos($method, '_') && is_callable([self::$instance, $call])) { 40 | return call_user_func_array([self::$instance, $call], $params); 41 | } else { 42 | throw new Exception("method not exists:" . $method); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/cache/driver/memcacheTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * Memcache缓存驱动测试 14 | * @author 刘志淳 15 | */ 16 | 17 | namespace tests\thinkphp\library\think\cache\driver; 18 | 19 | class memcacheTest extends cacheTestCase 20 | { 21 | private $_cacheInstance = null; 22 | 23 | /** 24 | * 基境缓存类型 25 | */ 26 | protected function setUp() 27 | { 28 | if (!extension_loaded('memcache')) { 29 | $this->markTestSkipped("Memcache没有安装,已跳过测试!"); 30 | } 31 | \think\Cache::connect(['type' => 'memcache', 'expire' => 2]); 32 | } 33 | 34 | /** 35 | * @return ApcCache 36 | */ 37 | protected function getCacheInstance() 38 | { 39 | if (null === $this->_cacheInstance) { 40 | $this->_cacheInstance = new \think\cache\driver\Memcache(['length' => 3]); 41 | } 42 | return $this->_cacheInstance; 43 | } 44 | 45 | // skip testExpire 46 | public function testExpire() 47 | { 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /thinkphp/library/think/Exception.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think; 13 | 14 | class Exception extends \Exception 15 | { 16 | 17 | /** 18 | * 保存异常页面显示的额外Debug数据 19 | * @var array 20 | */ 21 | protected $data = []; 22 | 23 | /** 24 | * 设置异常额外的Debug数据 25 | * 数据将会显示为下面的格式 26 | * 27 | * Exception Data 28 | * -------------------------------------------------- 29 | * Label 1 30 | * key1 value1 31 | * key2 value2 32 | * Label 2 33 | * key1 value1 34 | * key2 value2 35 | * 36 | * @param string $label 数据分类,用于异常页面显示 37 | * @param array $data 需要显示的数据,必须为关联数组 38 | */ 39 | final protected function setData($label, array $data) 40 | { 41 | $this->data[$label] = $data; 42 | } 43 | 44 | /** 45 | * 获取异常额外Debug数据 46 | * 主要用于输出到异常页面便于调试 47 | * @return array 由setData设置的Debug数据 48 | */ 49 | final public function getData() 50 | { 51 | return $this->data; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /thinkphp/library/think/process/exception/Failed.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\process\exception; 13 | 14 | use think\Process; 15 | 16 | class Failed extends \RuntimeException 17 | { 18 | 19 | private $process; 20 | 21 | public function __construct(Process $process) 22 | { 23 | if ($process->isSuccessful()) { 24 | throw new \InvalidArgumentException('Expected a failed process, but the given process was successful.'); 25 | } 26 | 27 | $error = sprintf('The command "%s" failed.' . "\nExit Code: %s(%s)", $process->getCommandLine(), $process->getExitCode(), $process->getExitCodeText()); 28 | 29 | if (!$process->isOutputDisabled()) { 30 | $error .= sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", $process->getOutput(), $process->getErrorOutput()); 31 | } 32 | 33 | parent::__construct($error); 34 | 35 | $this->process = $process; 36 | } 37 | 38 | public function getProcess() 39 | { 40 | return $this->process; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /application/user/controller/Index.php: -------------------------------------------------------------------------------- 1 | fetch(); 14 | } 15 | 16 | public function search(){ 17 | $keyword=input('keyword'); 18 | // $userdata=Db::name('user') 19 | $userdata=usermodel::where('qqnum|wechat',"{$keyword}") 20 | ->field('qqnum,wechat,money,btime,long,bcycle,etime,sip,ssport') 21 | ->select(); 22 | return json($userdata); 23 | } 24 | 25 | // 文件下载方法 26 | /*public function downloads($file=null){ 27 | // 未传入参数 28 | if(!$file){ 29 | return $this->fetch('download'); 30 | exit; 31 | } 32 | // dump($file); 33 | $file_dir = ROOT_PATH.'public/dl/'.$file; 34 | // dump($file_dir); 35 | $filename=pathinfo($file); 36 | // dump($filename); 37 | 38 | if (!file_exists($file_dir)){ 39 | header("Content-type: text/html; charset=utf-8"); 40 | echo "File not found!"; 41 | exit; 42 | } else { 43 | $file = fopen($file_dir,"r"); 44 | header("Content-type: application/octet-stream"); 45 | header("Accept-Ranges: bytes"); 46 | header("Accept-Length: ".filesize($file_dir)); 47 | header("Content-Disposition: attachment; filename=".$filename['basename']); 48 | echo fread($file, filesize($file_dir)); 49 | fclose($file); 50 | } 51 | }*/ 52 | 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /thinkphp/library/think/response/Json.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\response; 13 | 14 | use think\Response; 15 | 16 | class Json extends Response 17 | { 18 | // 输出参数 19 | protected $options = [ 20 | 'json_encode_param' => JSON_UNESCAPED_UNICODE, 21 | ]; 22 | 23 | protected $contentType = 'application/json'; 24 | 25 | /** 26 | * 处理数据 27 | * @access protected 28 | * @param mixed $data 要处理的数据 29 | * @return mixed 30 | * @throws \Exception 31 | */ 32 | protected function output($data) 33 | { 34 | try { 35 | // 返回JSON数据格式到客户端 包含状态信息 36 | $data = json_encode($data, $this->options['json_encode_param']); 37 | 38 | if ($data === false) { 39 | throw new \InvalidArgumentException(json_last_error_msg()); 40 | } 41 | 42 | return $data; 43 | } catch (\Exception $e) { 44 | if ($e->getPrevious()) { 45 | throw $e->getPrevious(); 46 | } 47 | throw $e; 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/baseTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * 保证运行环境正常 14 | */ 15 | class baseTest extends \PHPUnit_Framework_TestCase 16 | { 17 | public function testConstants() 18 | { 19 | $this->assertNotEmpty(THINK_START_TIME); 20 | $this->assertNotEmpty(THINK_START_MEM); 21 | $this->assertNotEmpty(THINK_VERSION); 22 | $this->assertNotEmpty(DS); 23 | $this->assertNotEmpty(THINK_PATH); 24 | $this->assertNotEmpty(LIB_PATH); 25 | $this->assertNotEmpty(EXTEND_PATH); 26 | $this->assertNotEmpty(CORE_PATH); 27 | $this->assertNotEmpty(TRAIT_PATH); 28 | $this->assertNotEmpty(APP_PATH); 29 | $this->assertNotEmpty(RUNTIME_PATH); 30 | $this->assertNotEmpty(LOG_PATH); 31 | $this->assertNotEmpty(CACHE_PATH); 32 | $this->assertNotEmpty(TEMP_PATH); 33 | $this->assertNotEmpty(VENDOR_PATH); 34 | $this->assertNotEmpty(EXT); 35 | $this->assertNotEmpty(ENV_PREFIX); 36 | $this->assertTrue(!is_null(IS_WIN)); 37 | $this->assertTrue(!is_null(IS_CLI)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /application/system/controller/User.php: -------------------------------------------------------------------------------- 1 | assign('data',$data); 11 | return $this->fetch('index'); 12 | } 13 | 14 | // ss账号添加 15 | public function useradd(){ 16 | return $this->fetch('add'); 17 | } 18 | 19 | public function useraddfn(){ 20 | if(Request()->isPost()){ 21 | $postdata=input('post.'); 22 | 23 | $btime=strtotime($postdata['btime']); 24 | $bcycle=input('post.bcycle'); 25 | $long=input('post.long'); 26 | $str=''; 27 | 28 | switch ($bcycle) { 29 | case 'y': 30 | $str="+{$long} year"; 31 | break; 32 | case 'm': 33 | $str="+{$long} month"; 34 | break; 35 | case 'd': 36 | $str="+{$long} day"; 37 | break; 38 | default: 39 | # code... 40 | break; 41 | } 42 | $etime=strtotime($str,$btime); 43 | // dump($etime) ; 44 | // dump($str);die(); 45 | // $postdata['btime']=strtotime($postdata['btime']); 46 | $postdata['etime']=$etime; 47 | // dump($postdata);die; 48 | $user=new usermodel; 49 | $res=$user->save($postdata); 50 | // echo usermodel::getLastSql(); 51 | 52 | 53 | return $res?'成功':'失败'; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /thinkphp/library/think/exception/ThrowableError.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\exception; 13 | 14 | class ThrowableError extends \ErrorException 15 | { 16 | public function __construct(\Throwable $e) 17 | { 18 | 19 | if ($e instanceof \ParseError) { 20 | $message = 'Parse error: ' . $e->getMessage(); 21 | $severity = E_PARSE; 22 | } elseif ($e instanceof \TypeError) { 23 | $message = 'Type error: ' . $e->getMessage(); 24 | $severity = E_RECOVERABLE_ERROR; 25 | } else { 26 | $message = 'Fatal error: ' . $e->getMessage(); 27 | $severity = E_ERROR; 28 | } 29 | 30 | parent::__construct( 31 | $message, 32 | $e->getCode(), 33 | $severity, 34 | $e->getFile(), 35 | $e->getLine() 36 | ); 37 | 38 | $this->setTrace($e->getTrace()); 39 | } 40 | 41 | protected function setTrace($trace) 42 | { 43 | $traceReflector = new \ReflectionProperty('Exception', 'trace'); 44 | $traceReflector->setAccessible(true); 45 | $traceReflector->setValue($this, $trace); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /application/database.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | return [ 13 | // 数据库类型 14 | 'type' => 'mysql', 15 | // 服务器地址 16 | 'hostname' => '127.0.0.1', 17 | // 数据库名 18 | 'database' => 'vue_tp', 19 | // 用户名 20 | 'username' => 'root', 21 | // 密码 22 | 'password' => 'root', 23 | // 端口 24 | 'hostport' => '', 25 | // 连接dsn 26 | 'dsn' => '', 27 | // 数据库连接参数 28 | 'params' => [], 29 | // 数据库编码默认采用utf8 30 | 'charset' => 'utf8', 31 | // 数据库表前缀 32 | 'prefix' => 'vue_', 33 | // 数据库调试模式 34 | 'debug' => true, 35 | // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) 36 | 'deploy' => 0, 37 | // 数据库读写是否分离 主从式有效 38 | 'rw_separate' => false, 39 | // 读写分离后 主服务器数量 40 | 'master_num' => 1, 41 | // 指定从服务器序号 42 | 'slave_no' => '', 43 | // 是否严格检查字段是否存在 44 | 'fields_strict' => true, 45 | // 数据集返回类型 46 | 'resultset_type' => 'array', 47 | // 自动写入时间戳字段 48 | 'auto_timestamp' => false, 49 | // 时间字段取出后的默认时间格式 50 | 'datetime_format' => 'Y-m-d H:i:s', 51 | // 是否需要进行SQL性能分析 52 | 'sql_explain' => false, 53 | ]; 54 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/exceptionTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * exception类测试 14 | * @author Haotong Lin 15 | */ 16 | 17 | namespace tests\thinkphp\library\think; 18 | 19 | use ReflectionMethod; 20 | use think\Exception as ThinkException; 21 | use think\exception\HttpException; 22 | 23 | class MyException extends ThinkException 24 | { 25 | 26 | } 27 | 28 | class exceptionTest extends \PHPUnit_Framework_TestCase 29 | { 30 | public function testGetHttpStatus() 31 | { 32 | try { 33 | throw new HttpException(404, "Error Processing Request"); 34 | } catch (HttpException $e) { 35 | $this->assertEquals(404, $e->getStatusCode()); 36 | } 37 | } 38 | 39 | public function testDebugData() 40 | { 41 | $data = ['a' => 'b', 'c' => 'd']; 42 | try { 43 | $e = new MyException("Error Processing Request", 1); 44 | $method = new ReflectionMethod($e, 'setData'); 45 | $method->setAccessible(true); 46 | $method->invokeArgs($e, ['test', $data]); 47 | throw $e; 48 | } catch (MyException $e) { 49 | $this->assertEquals(['test' => $data], $e->getData()); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/command/make/Controller.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\command\make; 13 | 14 | use think\Config; 15 | use think\console\command\Make; 16 | use think\console\input\Option; 17 | 18 | class Controller extends Make 19 | { 20 | 21 | protected $type = "Controller"; 22 | 23 | protected function configure() 24 | { 25 | parent::configure(); 26 | $this->setName('make:controller') 27 | ->addOption('plain', null, Option::VALUE_NONE, 'Generate an empty controller class.') 28 | ->setDescription('Create a new resource controller class'); 29 | } 30 | 31 | protected function getStub() 32 | { 33 | if ($this->input->getOption('plain')) { 34 | return __DIR__ . '/stubs/controller.plain.stub'; 35 | } 36 | 37 | return __DIR__ . '/stubs/controller.stub'; 38 | } 39 | 40 | protected function getClassName($name) 41 | { 42 | return parent::getClassName($name) . (Config::get('controller_suffix') ? ucfirst(Config::get('url_controller_layer')) : ''); 43 | } 44 | 45 | protected function getNamespace($appNamespace, $module) 46 | { 47 | return parent::getNamespace($appNamespace, $module) . '\controller'; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /application/system/controller/Login.php: -------------------------------------------------------------------------------- 1 | fetch(); 12 | } 13 | 14 | /** 15 | * [check ajax登录校验] 16 | * @return [type] [description] 17 | */ 18 | public function check(){ 19 | if(request()->isPost()){ 20 | $username=input('username'); 21 | $pwd=input('password'); 22 | $code=input('code'); 23 | $data['username']=$username; 24 | $data['password']=$pwd; 25 | $data['code']=$code; 26 | 27 | $where['username']=$username; 28 | $where['password']=md5(md5($pwd)); 29 | 30 | // 验证码检测 31 | if (!captcha_check($code)) { 32 | return '验证码错误!'; 33 | exit; 34 | } 35 | // 验证器 36 | $validate = validate('Login'); 37 | if($validate->check($data)){ 38 | // 用户名和密码匹配检测 39 | $check=adminModel::where($where)->find(); 40 | // dump($check);die; 41 | if($check){ 42 | unset($check["password"]); 43 | Session::set('user_name',$username); 44 | return '登录成功'; 45 | }else{ 46 | return '用户名或密码不正确!'; 47 | exit; 48 | } 49 | } 50 | 51 | } 52 | } 53 | 54 | 55 | // 退出登录 56 | public function logout(){ 57 | session(null); 58 | return $this->success('退出成功!','index'); 59 | } 60 | 61 | 62 | 63 | /** 64 | * 清空缓存 65 | */ 66 | public function clear(){ 67 | Cache::clear(); 68 | return '缓存清除成功!'; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /vendor/topthink/think-captcha/src/helper.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | \think\Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index"); 13 | 14 | \think\Validate::extend('captcha', function ($value, $id = "") { 15 | return captcha_check($value, $id, (array)\think\Config::get('captcha')); 16 | }); 17 | 18 | \think\Validate::setTypeMsg('captcha', '验证码错误!'); 19 | 20 | 21 | /** 22 | * @param string $id 23 | * @param array $config 24 | * @return \think\Response 25 | */ 26 | function captcha($id = "", $config = []) 27 | { 28 | $captcha = new \think\captcha\Captcha($config); 29 | return $captcha->entry($id); 30 | } 31 | 32 | 33 | /** 34 | * @param $id 35 | * @return string 36 | */ 37 | function captcha_src($id = "") 38 | { 39 | return \think\Url::build('/captcha' . ($id ? "/{$id}" : '')); 40 | } 41 | 42 | 43 | /** 44 | * @param $id 45 | * @return mixed 46 | */ 47 | function captcha_img($id = "") 48 | { 49 | return 'captcha'; 50 | } 51 | 52 | 53 | /** 54 | * @param $value 55 | * @param string $id 56 | * @param array $config 57 | * @return bool 58 | */ 59 | function captcha_check($value, $id = "", $config = []) 60 | { 61 | $captcha = new \think\captcha\Captcha($config); 62 | return $captcha->check($value, $id); 63 | } 64 | 65 | -------------------------------------------------------------------------------- /thinkphp/library/think/exception/ErrorException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\exception; 13 | 14 | use think\Exception; 15 | 16 | /** 17 | * ThinkPHP错误异常 18 | * 主要用于封装 set_error_handler 和 register_shutdown_function 得到的错误 19 | * 除开从 think\Exception 继承的功能 20 | * 其他和PHP系统\ErrorException功能基本一样 21 | */ 22 | class ErrorException extends Exception 23 | { 24 | /** 25 | * 用于保存错误级别 26 | * @var integer 27 | */ 28 | protected $severity; 29 | 30 | /** 31 | * 错误异常构造函数 32 | * @param integer $severity 错误级别 33 | * @param string $message 错误详细信息 34 | * @param string $file 出错文件路径 35 | * @param integer $line 出错行号 36 | * @param array $context 错误上下文,会包含错误触发处作用域内所有变量的数组 37 | */ 38 | public function __construct($severity, $message, $file, $line, array $context = []) 39 | { 40 | $this->severity = $severity; 41 | $this->message = $message; 42 | $this->file = $file; 43 | $this->line = $line; 44 | $this->code = 0; 45 | 46 | empty($context) || $this->setData('Error Context', $context); 47 | } 48 | 49 | /** 50 | * 获取错误级别 51 | * @return integer 错误级别 52 | */ 53 | final public function getSeverity() 54 | { 55 | return $this->severity; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/cache/driver/liteTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * Lite缓存驱动测试 14 | * @author 刘志淳 15 | */ 16 | 17 | namespace tests\thinkphp\library\think\cache\driver; 18 | 19 | use think\Cache; 20 | 21 | class liteTest extends \PHPUnit_Framework_TestCase 22 | { 23 | protected function getCacheInstance() 24 | { 25 | return Cache::connect(['type' => 'Lite', 'path' => CACHE_PATH]); 26 | } 27 | 28 | /** 29 | * 测试缓存读取 30 | * @return mixed 31 | * @access public 32 | */ 33 | public function testGet() 34 | { 35 | $cache = $this->getCacheInstance(); 36 | $this->assertFalse($cache->get('test')); 37 | } 38 | 39 | /** 40 | * 测试缓存设置 41 | * @return mixed 42 | * @access public 43 | */ 44 | public function testSet() 45 | { 46 | $cache = $this->getCacheInstance(); 47 | $this->assertNotEmpty($cache->set('test', 'test')); 48 | } 49 | 50 | /** 51 | * 删除缓存测试 52 | * @return mixed 53 | * @access public 54 | */ 55 | public function testRm() 56 | { 57 | $cache = $this->getCacheInstance(); 58 | $this->assertTrue($cache->rm('test')); 59 | } 60 | 61 | /** 62 | * 清空缓存测试 63 | * @return mixed 64 | * @access public 65 | */ 66 | public function testClear() 67 | { 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/paginateTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace tests\thinkphp\library\think; 13 | 14 | use think\paginator\driver\Bootstrap; 15 | 16 | class paginateTest extends \PHPUnit_Framework_TestCase 17 | { 18 | public function testPaginatorInfo() 19 | { 20 | $p = Bootstrap::make($array = ['item3', 'item4'], 2, 2, 4); 21 | 22 | $this->assertEquals(4, $p->total()); 23 | 24 | $this->assertEquals(2, $p->listRows()); 25 | 26 | $this->assertEquals(2, $p->currentPage()); 27 | 28 | $p2 = Bootstrap::make($array2 = ['item3', 'item4'], 2, 2, 2); 29 | $this->assertEquals(1, $p2->currentPage()); 30 | } 31 | 32 | public function testPaginatorRender() 33 | { 34 | $p = Bootstrap::make($array = ['item3', 'item4'], 2, 2, 100); 35 | $render = ''; 36 | 37 | $this->assertEquals($render, $p->render()); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/output/question/Confirmation.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\output\question; 13 | 14 | use think\console\output\Question; 15 | 16 | class Confirmation extends Question 17 | { 18 | 19 | private $trueAnswerRegex; 20 | 21 | /** 22 | * 构造方法 23 | * @param string $question 问题 24 | * @param bool $default 默认答案 25 | * @param string $trueAnswerRegex 验证正则 26 | */ 27 | public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i') 28 | { 29 | parent::__construct($question, (bool) $default); 30 | 31 | $this->trueAnswerRegex = $trueAnswerRegex; 32 | $this->setNormalizer($this->getDefaultNormalizer()); 33 | } 34 | 35 | /** 36 | * 获取默认的答案回调 37 | * @return callable 38 | */ 39 | private function getDefaultNormalizer() 40 | { 41 | $default = $this->getDefault(); 42 | $regex = $this->trueAnswerRegex; 43 | 44 | return function ($answer) use ($default, $regex) { 45 | if (is_bool($answer)) { 46 | return $answer; 47 | } 48 | 49 | $answerIsTrue = (bool) preg_match($regex, $answer); 50 | if (false === $default) { 51 | return $answer && $answerIsTrue; 52 | } 53 | 54 | return !$answer || $answerIsTrue; 55 | }; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/command/Clear.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace think\console\command; 12 | 13 | use think\console\Command; 14 | use think\console\Input; 15 | use think\console\input\Option; 16 | use think\console\Output; 17 | 18 | class Clear extends Command 19 | { 20 | protected function configure() 21 | { 22 | // 指令配置 23 | $this 24 | ->setName('clear') 25 | ->addOption('path', 'd', Option::VALUE_OPTIONAL, 'path to clear', null) 26 | ->setDescription('Clear runtime file'); 27 | } 28 | 29 | protected function execute(Input $input, Output $output) 30 | { 31 | $path = $input->getOption('path') ?: RUNTIME_PATH; 32 | 33 | if (is_dir($path)) { 34 | $this->clearPath($path); 35 | } 36 | 37 | $output->writeln("Clear Successed"); 38 | } 39 | 40 | protected function clearPath($path) 41 | { 42 | $path = realpath($path) . DS; 43 | $files = scandir($path); 44 | if ($files) { 45 | foreach ($files as $file) { 46 | if ('.' != $file && '..' != $file && is_dir($path . $file)) { 47 | $this->clearPath($path . $file); 48 | } elseif ('.gitignore' != $file && is_file($path . $file)) { 49 | unlink($path . $file); 50 | } 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/command/Build.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\command; 13 | 14 | use think\console\Command; 15 | use think\console\Input; 16 | use think\console\input\Option; 17 | use think\console\Output; 18 | 19 | class Build extends Command 20 | { 21 | 22 | /** 23 | * {@inheritdoc} 24 | */ 25 | protected function configure() 26 | { 27 | $this->setName('build') 28 | ->setDefinition([ 29 | new Option('config', null, Option::VALUE_OPTIONAL, "build.php path"), 30 | new Option('module', null, Option::VALUE_OPTIONAL, "module name"), 31 | ]) 32 | ->setDescription('Build Application Dirs'); 33 | } 34 | 35 | protected function execute(Input $input, Output $output) 36 | { 37 | if ($input->hasOption('module')) { 38 | \think\Build::module($input->getOption('module')); 39 | $output->writeln("Successed"); 40 | return; 41 | } 42 | 43 | if ($input->hasOption('config')) { 44 | $build = include $input->getOption('config'); 45 | } else { 46 | $build = include APP_PATH . 'build.php'; 47 | } 48 | if (empty($build)) { 49 | $output->writeln("Build Config Is Empty"); 50 | return; 51 | } 52 | \think\Build::run($build); 53 | $output->writeln("Successed"); 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vendor/topthink/think-installer/src/ThinkFramework.php: -------------------------------------------------------------------------------- 1 | getPrettyName()) { 17 | throw new \InvalidArgumentException('Unable to install this library!'); 18 | } 19 | 20 | if ($this->composer->getPackage()->getType() !== 'project') { 21 | return parent::getInstallPath($package); 22 | } 23 | 24 | if ($this->composer->getPackage()) { 25 | $extra = $this->composer->getPackage()->getExtra(); 26 | if (!empty($extra['think-path'])) { 27 | return $extra['think-path']; 28 | } 29 | } 30 | 31 | return 'thinkphp'; 32 | } 33 | 34 | public function install(InstalledRepositoryInterface $repo, PackageInterface $package) 35 | { 36 | parent::install($repo, $package); 37 | if ($this->composer->getPackage()->getType() == 'project') { 38 | //remove tests dir 39 | $this->filesystem->removeDirectory($this->getInstallPath($package) . DIRECTORY_SEPARATOR . 'tests'); 40 | } 41 | } 42 | 43 | public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) 44 | { 45 | parent::update($repo, $initial, $target); 46 | if ($this->composer->getPackage()->getType() == 'project') { 47 | //remove tests dir 48 | $this->filesystem->removeDirectory($this->getInstallPath($target) . DIRECTORY_SEPARATOR . 'tests'); 49 | } 50 | } 51 | 52 | /** 53 | * {@inheritDoc} 54 | */ 55 | public function supports($packageType) 56 | { 57 | return 'think-framework' === $packageType; 58 | } 59 | } -------------------------------------------------------------------------------- /public/static/js/ajax.min.js: -------------------------------------------------------------------------------- 1 | !function(a,b){function c(c){function d(){function a(c,d){function e(c,d,e){var f=[];return c=e===b?c:e+"["+c+"]","object"==typeof d&&null!==d?f=f.concat(a(d,c)):(c=encodeURIComponent(c),d=encodeURIComponent(d),f.push(c+"="+d)),f}var g,f=[];if("[object Array]"==Object.prototype.toString.call(c))for(var h=0,i=c.length;i>h;h++)g=c[h],f=f.concat(e("object"==typeof g?h:"",g,d));else if("[object Object]"==Object.prototype.toString.call(c))for(var j in c)g=c[j],f=f.concat(e(j,g,d));return f}function c(a){for(var b=a.split("&"),c=0,d=b.length;d>c;c++)name=encodeURIComponent(b[c].split("=")[0]),value=encodeURIComponent(b[c].split("=")[1]),b[c]=name+"="+value;return b}j&&("string"==typeof j?j=c(j):"object"==typeof j&&(j=a(j)),j=j.join("&").replace("/%20/g","+"),("get"===i||"jsonp"===l)&&(h+=h.indexOf("?")>-1?h.indexOf("=")>-1?"&"+j:j:"?"+j))}function e(){var b=document.createElement("script"),c=(new Date).getTime()+Math.round(1e3*Math.random()),d="JSONP_"+c;a[d]=function(a){clearTimeout(s),document.body.removeChild(b),q(a)},b.src=h+(h.indexOf("?")>-1?"&":"?")+"callback="+d,b.type="text/javascript",document.body.appendChild(b),f(d,b)}function f(c,d){n!==b&&(s=setTimeout(function(){"jsonp"===l?(delete a[c],document.body.removeChild(d)):(r=!0,t&&t.abort()),console.log("timeout")},n))}function g(){function c(){if(a.XMLHttpRequest)return new XMLHttpRequest;for(var b=["Microsoft","msxm3","msxml2","msxml1"],c=0;c=200&&t.status<300||304==t.status?q(t.responseText):p(t.status,t.statusText)}},t.send("get"===i?null:j),f()}var h=c.url||"",i=(c.type||"get").toLowerCase(),j=c.data||null,k=c.contentType||"",l=c.dataType||"",m=c.async===b?!0:c.async,n=c.timeOut,o=c.before||function(){},p=c.error||function(){},q=c.success||function(){},r=!1,s=null,t=null;d(),o(),"jsonp"===l?e():g()}a.ajax=c}(window); -------------------------------------------------------------------------------- /thinkphp/library/think/process/exception/Timeout.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\process\exception; 13 | 14 | use think\Process; 15 | 16 | class Timeout extends \RuntimeException 17 | { 18 | 19 | const TYPE_GENERAL = 1; 20 | const TYPE_IDLE = 2; 21 | 22 | private $process; 23 | private $timeoutType; 24 | 25 | public function __construct(Process $process, $timeoutType) 26 | { 27 | $this->process = $process; 28 | $this->timeoutType = $timeoutType; 29 | 30 | parent::__construct(sprintf('The process "%s" exceeded the timeout of %s seconds.', $process->getCommandLine(), $this->getExceededTimeout())); 31 | } 32 | 33 | public function getProcess() 34 | { 35 | return $this->process; 36 | } 37 | 38 | public function isGeneralTimeout() 39 | { 40 | return $this->timeoutType === self::TYPE_GENERAL; 41 | } 42 | 43 | public function isIdleTimeout() 44 | { 45 | return $this->timeoutType === self::TYPE_IDLE; 46 | } 47 | 48 | public function getExceededTimeout() 49 | { 50 | switch ($this->timeoutType) { 51 | case self::TYPE_GENERAL: 52 | return $this->process->getTimeout(); 53 | 54 | case self::TYPE_IDLE: 55 | return $this->process->getIdleTimeout(); 56 | 57 | default: 58 | throw new \LogicException(sprintf('Unknown timeout type "%d".', $this->timeoutType)); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /public/static/layui/src/lay/modules/code.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | @Name:layui.code 代码修饰器 4 | @Author:贤心 5 | @License:MIT 6 | 7 | */ 8 | 9 | layui.define('jquery', function(exports){ 10 | "use strict"; 11 | 12 | var $ = layui.jquery; 13 | var about = 'http://www.layui.com/doc/modules/code.html'; //关于信息 14 | 15 | exports('code', function(options){ 16 | var elems = []; 17 | options = options || {}; 18 | options.elem = $(options.elem||'.layui-code'); 19 | options.about = 'about' in options ? options.about : true; 20 | 21 | options.elem.each(function(){ 22 | elems.push(this); 23 | }); 24 | 25 | layui.each(elems.reverse(), function(index, item){ 26 | var othis = $(item), html = othis.html(); 27 | 28 | //转义HTML标签 29 | if(othis.attr('lay-encode') || options.encode){ 30 | html = html.replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&') 31 | .replace(//g, '>').replace(/'/g, ''').replace(/"/g, '"') 32 | } 33 | 34 | othis.html('
  1. ' + html.replace(/[\r\t\n]+/g, '
  2. ') + '
') 35 | 36 | if(!othis.find('>.layui-code-h3')[0]){ 37 | othis.prepend('

'+ (othis.attr('lay-title')||options.title||'code') + (options.about ? 'layui.code' : '') + '

'); 38 | } 39 | 40 | var ol = othis.find('>.layui-code-ol'); 41 | othis.addClass('layui-box layui-code-view'); 42 | 43 | //识别皮肤 44 | if(othis.attr('lay-skin') || options.skin){ 45 | othis.addClass('layui-code-' +(othis.attr('lay-skin') || options.skin)); 46 | } 47 | 48 | //按行数适配左边距 49 | if((ol.find('li').length/100|0) > 0){ 50 | ol.css('margin-left', (ol.find('li').length/100|0) + 'px'); 51 | } 52 | 53 | //设置最大高度 54 | if(othis.attr('lay-height') || options.height){ 55 | ol.css('max-height', othis.attr('lay-height') || options.height); 56 | } 57 | 58 | }); 59 | 60 | }); 61 | }).addcss('modules/code.css', 'skincodecss'); -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/cache/driver/memcachedTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * Memcached缓存驱动测试 14 | * @author 7IN0SAN9 15 | */ 16 | 17 | namespace tests\thinkphp\library\think\cache\driver; 18 | 19 | class memcachedTest extends cacheTestCase 20 | { 21 | private $_cacheInstance = null; 22 | /** 23 | * 基境缓存类型 24 | */ 25 | protected function setUp() 26 | { 27 | if (!extension_loaded("memcached") && !extension_loaded('memcache')) { 28 | $this->markTestSkipped("Memcached或Memcache没有安装,已跳过测试!"); 29 | } 30 | \think\Cache::connect(array('type' => 'memcached', 'expire' => 2)); 31 | } 32 | /** 33 | * @return ApcCache 34 | */ 35 | protected function getCacheInstance() 36 | { 37 | if (null === $this->_cacheInstance) { 38 | $this->_cacheInstance = new \think\cache\driver\Memcached(['length' => 3]); 39 | } 40 | return $this->_cacheInstance; 41 | } 42 | /** 43 | * 缓存过期测试《提出来测试,因为目前看通不过缓存过期测试,所以还需研究》 44 | * @return mixed 45 | * @access public 46 | */ 47 | public function testExpire() 48 | { 49 | } 50 | 51 | public function testStaticCall() 52 | { 53 | } 54 | 55 | /** 56 | * 测试缓存自增 57 | * @return mixed 58 | * @access public 59 | */ 60 | public function testInc() 61 | { 62 | } 63 | 64 | /** 65 | * 测试缓存自减 66 | * @return mixed 67 | * @access public 68 | */ 69 | public function testDec() 70 | { 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: php 4 | 5 | branches: 6 | only: 7 | - stable 8 | 9 | cache: 10 | directories: 11 | - $HOME/.composer/cache 12 | 13 | before_install: 14 | - composer self-update 15 | 16 | install: 17 | - composer install --no-dev --no-interaction --ignore-platform-reqs 18 | - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip . 19 | - composer require --update-no-dev --no-interaction "topthink/think-image:^1.0" 20 | - composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0" 21 | - composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0" 22 | - composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0" 23 | - composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0" 24 | - composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0" 25 | - composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0" 26 | - composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0" 27 | - composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0" 28 | - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip . 29 | 30 | script: 31 | - php think unit 32 | 33 | deploy: 34 | provider: releases 35 | api_key: 36 | secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw= 37 | file: 38 | - ThinkPHP_Core.zip 39 | - ThinkPHP_Full.zip 40 | skip_cleanup: true 41 | on: 42 | tags: true 43 | -------------------------------------------------------------------------------- /thinkphp/library/think/response/Jsonp.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\response; 13 | 14 | use think\Request; 15 | use think\Response; 16 | 17 | class Jsonp extends Response 18 | { 19 | // 输出参数 20 | protected $options = [ 21 | 'var_jsonp_handler' => 'callback', 22 | 'default_jsonp_handler' => 'jsonpReturn', 23 | 'json_encode_param' => JSON_UNESCAPED_UNICODE, 24 | ]; 25 | 26 | protected $contentType = 'application/javascript'; 27 | 28 | /** 29 | * 处理数据 30 | * @access protected 31 | * @param mixed $data 要处理的数据 32 | * @return mixed 33 | * @throws \Exception 34 | */ 35 | protected function output($data) 36 | { 37 | try { 38 | // 返回JSON数据格式到客户端 包含状态信息 [当url_common_param为false时是无法获取到$_GET的数据的,故使用Request来获取] 39 | $var_jsonp_handler = Request::instance()->param($this->options['var_jsonp_handler'], ""); 40 | $handler = !empty($var_jsonp_handler) ? $var_jsonp_handler : $this->options['default_jsonp_handler']; 41 | 42 | $data = json_encode($data, $this->options['json_encode_param']); 43 | 44 | if ($data === false) { 45 | throw new \InvalidArgumentException(json_last_error_msg()); 46 | } 47 | 48 | $data = $handler . '(' . $data . ');'; 49 | return $data; 50 | } catch (\Exception $e) { 51 | if ($e->getPrevious()) { 52 | throw $e->getPrevious(); 53 | } 54 | throw $e; 55 | } 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /thinkphp/tpl/dispatch_jump.tpl: -------------------------------------------------------------------------------- 1 | {__NOLAYOUT__} 2 | 3 | 4 | 5 | 跳转提示 6 | 16 | 17 | 18 |
19 | 20 | 21 |

:)

22 |

23 | 24 | 25 |

:(

26 |

27 | 28 | 29 |

30 |

31 | 页面自动 跳转 等待时间: 32 |

33 |
34 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /public/static/layui/src/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | @Name:layui.util 工具集 4 | @Author:贤心 5 | @License:MIT 6 | 7 | */ 8 | 9 | layui.define('jquery', function(exports){ 10 | "use strict"; 11 | 12 | var $ = layui.jquery 13 | 14 | ,util = { 15 | //固定块 16 | fixbar: function(options){ 17 | options = options || {}; 18 | options.bgcolor = options.bgcolor ? ('background-color:' + options.bgcolor) : ''; 19 | 20 | var TOP_BAR = 'layui-fixbar-top', timer, is, icon = [ 21 | options.bar1 === true ? '' : options.bar1 //bar1 - 信息图标 22 | ,options.bar2 === true ? '' : options.bar2 //bar2 - 问号图标 23 | ,'' //置顶 24 | ] 25 | 26 | ,dom = $(['
    ' 27 | ,options.bar1 ? '
  • '+ icon[0] +'
  • ' : '' 28 | ,options.bar2 ? '
  • '+ icon[1] +'
  • ' : '' 29 | ,'
  • '+ icon[2] +'
  • ' 30 | ,'
'].join('')) 31 | 32 | ,topbar = dom.find('.'+TOP_BAR) 33 | 34 | ,scroll = function(){ 35 | var stop = $(document).scrollTop(); 36 | if(stop >= (options.showHeight || 200)){ 37 | is || (topbar.show(), is = 1); 38 | } else { 39 | is && (topbar.hide(), is = 0); 40 | } 41 | }; 42 | 43 | if($('.layui-fixbar')[0]) return; 44 | typeof options.css === 'object' && (dom.css(options.css)); 45 | $('body').append(dom), scroll(); 46 | 47 | //bar点击事件 48 | dom.find('li').on('click', function(){ 49 | var othis = $(this), type = othis.attr('lay-type'); 50 | if(type === 'top'){ 51 | $('html,body').animate({ 52 | scrollTop : 0 53 | }, 200);; 54 | } 55 | options.click && options.click.call(this, type); 56 | }); 57 | 58 | //Top显示控制 59 | $(document).on('scroll', function(){ 60 | if(timer) clearTimeout(timer); 61 | timer = setTimeout(function(){ 62 | scroll(); 63 | }, 100); 64 | }); 65 | } 66 | }; 67 | 68 | exports('util', util); 69 | }); -------------------------------------------------------------------------------- /thinkphp/library/think/db/builder/Sqlite.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\db\builder; 13 | 14 | use think\db\Builder; 15 | 16 | /** 17 | * Sqlite数据库驱动 18 | */ 19 | class Sqlite extends Builder 20 | { 21 | 22 | /** 23 | * limit 24 | * @access public 25 | * @return string 26 | */ 27 | public function parseLimit($limit) 28 | { 29 | $limitStr = ''; 30 | if (!empty($limit)) { 31 | $limit = explode(',', $limit); 32 | if (count($limit) > 1) { 33 | $limitStr .= ' LIMIT ' . $limit[1] . ' OFFSET ' . $limit[0] . ' '; 34 | } else { 35 | $limitStr .= ' LIMIT ' . $limit[0] . ' '; 36 | } 37 | } 38 | return $limitStr; 39 | } 40 | 41 | /** 42 | * 随机排序 43 | * @access protected 44 | * @return string 45 | */ 46 | protected function parseRand() 47 | { 48 | return 'RANDOM()'; 49 | } 50 | 51 | /** 52 | * 字段和表名处理 53 | * @access protected 54 | * @param string $key 55 | * @param array $options 56 | * @return string 57 | */ 58 | protected function parseKey($key, $options = []) 59 | { 60 | $key = trim($key); 61 | if (strpos($key, '.')) { 62 | list($table, $key) = explode('.', $key, 2); 63 | if ('__TABLE__' == $table) { 64 | $table = $this->query->getTable(); 65 | } 66 | if (isset($options['alias'][$table])) { 67 | $table = $options['alias'][$table]; 68 | } 69 | } 70 | if (isset($table)) { 71 | $key = $table . '.' . $key; 72 | } 73 | return $key; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /thinkphp/library/think/template/driver/File.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\template\driver; 13 | 14 | use think\Exception; 15 | 16 | class File 17 | { 18 | /** 19 | * 写入编译缓存 20 | * @param string $cacheFile 缓存的文件名 21 | * @param string $content 缓存的内容 22 | * @return void|array 23 | */ 24 | public function write($cacheFile, $content) 25 | { 26 | // 检测模板目录 27 | $dir = dirname($cacheFile); 28 | if (!is_dir($dir)) { 29 | mkdir($dir, 0755, true); 30 | } 31 | // 生成模板缓存文件 32 | if (false === file_put_contents($cacheFile, $content)) { 33 | throw new Exception('cache write error:' . $cacheFile, 11602); 34 | } 35 | } 36 | 37 | /** 38 | * 读取编译编译 39 | * @param string $cacheFile 缓存的文件名 40 | * @param array $vars 变量数组 41 | * @return void 42 | */ 43 | public function read($cacheFile, $vars = []) 44 | { 45 | if (!empty($vars) && is_array($vars)) { 46 | // 模板阵列变量分解成为独立变量 47 | extract($vars, EXTR_OVERWRITE); 48 | } 49 | //载入模版缓存文件 50 | include $cacheFile; 51 | } 52 | 53 | /** 54 | * 检查编译缓存是否有效 55 | * @param string $cacheFile 缓存的文件名 56 | * @param int $cacheTime 缓存时间 57 | * @return boolean 58 | */ 59 | public function check($cacheFile, $cacheTime) 60 | { 61 | // 缓存文件不存在, 直接返回false 62 | if (!file_exists($cacheFile)) { 63 | return false; 64 | } 65 | if (0 != $cacheTime && $_SERVER['REQUEST_TIME'] > filemtime($cacheFile) + $cacheTime) { 66 | // 缓存是否在有效期 67 | return false; 68 | } 69 | return true; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /application/system/view/user/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 账号列表 7 | 8 | 9 | 10 | 11 | 12 |
13 | {include file="public/header" /} 14 | {include file="public/side" /} 15 | 16 |
17 |
18 |
19 | 账号列表 20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | {volist name='data' id='vo'} 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | {/volist} 54 | 55 |
编号QQ号微信号交易金额账单时间购买时长账单周期下次付款日期服务器ipss账号端口ss账号密码
{$i}{$vo.qqnum}{$vo.wechat}{$vo.money}{$vo.btime}{$vo.long}{$vo.bcycle}{$vo.etime}{$vo.sip}{$vo.ssport}{$vo.sspwd}
56 | 57 |
{$data->render()}
58 |
59 | {include file="public/footer" /} 60 |
61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /thinkphp/library/think/db/builder/Mysql.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\db\builder; 13 | 14 | use think\db\Builder; 15 | 16 | /** 17 | * mysql数据库驱动 18 | */ 19 | class Mysql extends Builder 20 | { 21 | protected $updateSql = 'UPDATE %TABLE% %JOIN% SET %SET% %WHERE% %ORDER%%LIMIT% %LOCK%%COMMENT%'; 22 | 23 | /** 24 | * 字段和表名处理 25 | * @access protected 26 | * @param string $key 27 | * @param array $options 28 | * @return string 29 | */ 30 | protected function parseKey($key, $options = []) 31 | { 32 | $key = trim($key); 33 | if (strpos($key, '$.') && false === strpos($key, '(')) { 34 | // JSON字段支持 35 | list($field, $name) = explode('$.', $key); 36 | $key = 'json_extract(' . $field . ', \'$.' . $name . '\')'; 37 | } elseif (strpos($key, '.') && !preg_match('/[,\'\"\(\)`\s]/', $key)) { 38 | list($table, $key) = explode('.', $key, 2); 39 | if ('__TABLE__' == $table) { 40 | $table = $this->query->getTable(); 41 | } 42 | if (isset($options['alias'][$table])) { 43 | $table = $options['alias'][$table]; 44 | } 45 | } 46 | if (!preg_match('/[,\'\"\*\(\)`.\s]/', $key)) { 47 | $key = '`' . $key . '`'; 48 | } 49 | if (isset($table)) { 50 | if (strpos($table, '.')) { 51 | $table = str_replace('.', '`.`', $table); 52 | } 53 | $key = '`' . $table . '`.' . $key; 54 | } 55 | return $key; 56 | } 57 | 58 | /** 59 | * 随机排序 60 | * @access protected 61 | * @return string 62 | */ 63 | protected function parseRand() 64 | { 65 | return 'rand()'; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /vendor/topthink/think-installer/src/ThinkTesting.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\composer; 13 | 14 | 15 | use Composer\Installer\LibraryInstaller; 16 | use Composer\Package\PackageInterface; 17 | use Composer\Repository\InstalledRepositoryInterface; 18 | 19 | class ThinkTesting extends LibraryInstaller 20 | { 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | public function getInstallPath(PackageInterface $package) 25 | { 26 | if ('topthink/think-testing' !== $package->getPrettyName()) { 27 | throw new \InvalidArgumentException('Unable to install this library!'); 28 | } 29 | 30 | return parent::getInstallPath($package); 31 | } 32 | 33 | public function install(InstalledRepositoryInterface $repo, PackageInterface $package) 34 | { 35 | parent::install($repo, $package); 36 | 37 | $this->copyTestDir($package); 38 | 39 | 40 | } 41 | 42 | public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) 43 | { 44 | parent::update($repo, $initial, $target); 45 | 46 | $this->copyTestDir($target); 47 | 48 | } 49 | 50 | private function copyTestDir(PackageInterface $package) 51 | { 52 | $appDir = dirname($this->vendorDir); 53 | $source = $this->getInstallPath($package) . DIRECTORY_SEPARATOR . 'example'; 54 | if (!is_file($appDir . DIRECTORY_SEPARATOR . 'phpunit.xml')) { 55 | $this->filesystem->copyThenRemove($source, $appDir); 56 | } else { 57 | $this->filesystem->removeDirectoryPhp($source); 58 | } 59 | } 60 | 61 | /** 62 | * {@inheritDoc} 63 | */ 64 | public function supports($packageType) 65 | { 66 | return 'think-testing' === $packageType; 67 | } 68 | } -------------------------------------------------------------------------------- /thinkphp/library/think/console/command/Help.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\command; 13 | 14 | use think\console\Command; 15 | use think\console\Input; 16 | use think\console\input\Argument as InputArgument; 17 | use think\console\input\Option as InputOption; 18 | use think\console\Output; 19 | 20 | class Help extends Command 21 | { 22 | 23 | private $command; 24 | 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | protected function configure() 29 | { 30 | $this->ignoreValidationErrors(); 31 | 32 | $this->setName('help')->setDefinition([ 33 | new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), 34 | new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), 35 | ])->setDescription('Displays help for a command')->setHelp(<<%command.name% command displays help for a given command: 37 | 38 | php %command.full_name% list 39 | 40 | To display the list of available commands, please use the list command. 41 | EOF 42 | ); 43 | } 44 | 45 | /** 46 | * Sets the command. 47 | * @param Command $command The command to set 48 | */ 49 | public function setCommand(Command $command) 50 | { 51 | $this->command = $command; 52 | } 53 | 54 | /** 55 | * {@inheritdoc} 56 | */ 57 | protected function execute(Input $input, Output $output) 58 | { 59 | if (null === $this->command) { 60 | $this->command = $this->getConsole()->find($input->getArgument('command_name')); 61 | } 62 | 63 | $output->describe($this->command, [ 64 | 'raw_text' => $input->getOption('raw'), 65 | ]); 66 | 67 | $this->command = null; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/cache/driver/redisTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * Redis缓存驱动测试 14 | * @author 7IN0SAN9 15 | */ 16 | 17 | namespace tests\thinkphp\library\think\cache\driver; 18 | 19 | class redisTest extends cacheTestCase 20 | { 21 | private $_cacheInstance = null; 22 | 23 | protected function setUp() 24 | { 25 | if (!extension_loaded("redis")) { 26 | $this->markTestSkipped("Redis没有安装,已跳过测试!"); 27 | } 28 | \think\Cache::connect(array('type' => 'redis', 'expire' => 2)); 29 | } 30 | 31 | protected function getCacheInstance() 32 | { 33 | if (null === $this->_cacheInstance) { 34 | $this->_cacheInstance = new \think\cache\driver\Redis(['length' => 3]); 35 | } 36 | return $this->_cacheInstance; 37 | } 38 | 39 | public function testGet() 40 | { 41 | $cache = $this->prepare(); 42 | $this->assertEquals('string_test', $cache->get('string_test')); 43 | $this->assertEquals(11, $cache->get('number_test')); 44 | $result = $cache->get('array_test'); 45 | $this->assertEquals('array_test', $result['array_test']); 46 | } 47 | 48 | public function testStoreSpecialValues() 49 | { 50 | $redis = new \think\cache\driver\Redis(['length' => 3]); 51 | $redis->set('key', 'value'); 52 | $redis->get('key'); 53 | 54 | $redis->handler()->setnx('key', 'value'); 55 | $value = $redis->handler()->get('key'); 56 | $this->assertEquals('value', $value); 57 | 58 | $redis->handler()->hset('hash', 'key', 'value'); 59 | $value = $redis->handler()->hget('hash', 'key'); 60 | $this->assertEquals('value', $value); 61 | } 62 | 63 | public function testExpire() 64 | { 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/command/Lists.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\command; 13 | 14 | use think\console\Command; 15 | use think\console\Input; 16 | use think\console\Output; 17 | use think\console\input\Argument as InputArgument; 18 | use think\console\input\Option as InputOption; 19 | use think\console\input\Definition as InputDefinition; 20 | 21 | class Lists extends Command 22 | { 23 | 24 | /** 25 | * {@inheritdoc} 26 | */ 27 | protected function configure() 28 | { 29 | $this->setName('list')->setDefinition($this->createDefinition())->setDescription('Lists commands')->setHelp(<<%command.name% command lists all commands: 31 | 32 | php %command.full_name% 33 | 34 | You can also display the commands for a specific namespace: 35 | 36 | php %command.full_name% test 37 | 38 | It's also possible to get raw list of commands (useful for embedding command runner): 39 | 40 | php %command.full_name% --raw 41 | EOF 42 | ); 43 | } 44 | 45 | /** 46 | * {@inheritdoc} 47 | */ 48 | public function getNativeDefinition() 49 | { 50 | return $this->createDefinition(); 51 | } 52 | 53 | /** 54 | * {@inheritdoc} 55 | */ 56 | protected function execute(Input $input, Output $output) 57 | { 58 | $output->describe($this->getConsole(), [ 59 | 'raw_text' => $input->getOption('raw'), 60 | 'namespace' => $input->getArgument('namespace'), 61 | ]); 62 | } 63 | 64 | /** 65 | * {@inheritdoc} 66 | */ 67 | private function createDefinition() 68 | { 69 | return new InputDefinition([ 70 | new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), 71 | new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list') 72 | ]); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /public/static/css/default.css--: -------------------------------------------------------------------------------- 1 | *{font-size:12px; font-family:Tahoma,Verdana,微软雅黑,新宋体} 2 | body{background:#D2E0F2; } 3 | a{ color:Black; text-decoration:none;} 4 | a:hover{ color:Red; text-decoration:underline;} 5 | .textbox03 {border: #878787 1px solid;padding: 4px 3px;font:Verdana, Geneva, sans-serif,宋体;line-height: 14px; background-color: #fff; height: auto; font-size: 14px; font-weight: bold; width: 190px; } 6 | 7 | .txt01{font:Verdana, Geneva, sans-serif,宋体;padding:3px 2px 2px 2px; border-width:1px; border-color:#ddd; color:#000;} 8 | .txt {border: #878787 1px solid;padding: 4px 3px;font:Verdana, Geneva, sans-serif,宋体;line-height: 14px; background-color: #fff; height: auto; font-size: 14px;} 9 | .footer{text-align:center;color:#15428B; margin:0px; padding:0px;line-height:23px; font-weight:bold;} 10 | 11 | .head a{color:White;text-decoration:underline;} 12 | 13 | .easyui-accordion ul{list-style-type:none;margin:0px; padding:10px;} 14 | .easyui-accordion ul li{ padding:0px;} 15 | .easyui-accordion ul li a{line-height:24px;} 16 | .easyui-accordion ul li div{margin:2px 0px;padding-left:10px;padding-top:2px;} 17 | .easyui-accordion ul li div.hover{background:#E0ECFF;cursor:pointer;} 18 | .easyui-accordion ul li div.hover a{color:#416AA3;} 19 | .easyui-accordion ul li div.selected{border:1px solid #99BBE8; background:#E0ECFF;cursor:default;} 20 | .easyui-accordion ul li div.selected a{color:#416AA3; font-weight:bold;} 21 | 22 | 23 | 24 | .icon{ background:url(../images/tabicons.png) no-repeat;width:18px; line-height:18px; display:inline-block;} 25 | .icon-sys{ background-position:0px -200px;} 26 | .icon-set{ background-position:-380px -200px;} 27 | .icon-add{background-position: -20px 0px;} 28 | .icon-add1{background:url('icon/edit_add.png') no-repeat;} 29 | .icon-nav{background-position: -100px -20px; } 30 | .icon-users{background-position: -100px -480px;} 31 | .icon-role{background-position: -360px -200px;} 32 | .icon-set{background-position: -380px -200px;} 33 | .icon-log{background-position: -380px -80px;} 34 | .icon-delete16{background:url('icon/delete.gif') no-repeat;width:18px; line-height:18px; display:inline-block;} 35 | .icon-delete{ background-position:-140px -120px;} 36 | .icon-edit{ background-position:-380px -320px;} 37 | .icon-magic{ background-position:0px -500px;} 38 | .icon-database{ background-position:-20px -140px;} 39 | .icon-expand{ background:url('/images/coll2.gif') no-repeat;} 40 | .icon-collapse{ background:url('/images/coll3.gif') no-repeat;} 41 | .icon-class{background-position:-200px -40px;)} 42 | .icon-page{background-position:0 -60px;)} -------------------------------------------------------------------------------- /thinkphp/library/think/db/builder/Pgsql.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\db\builder; 13 | 14 | use think\db\Builder; 15 | 16 | /** 17 | * Pgsql数据库驱动 18 | */ 19 | class Pgsql extends Builder 20 | { 21 | 22 | /** 23 | * limit分析 24 | * @access protected 25 | * @param mixed $limit 26 | * @return string 27 | */ 28 | public function parseLimit($limit) 29 | { 30 | $limitStr = ''; 31 | if (!empty($limit)) { 32 | $limit = explode(',', $limit); 33 | if (count($limit) > 1) { 34 | $limitStr .= ' LIMIT ' . $limit[1] . ' OFFSET ' . $limit[0] . ' '; 35 | } else { 36 | $limitStr .= ' LIMIT ' . $limit[0] . ' '; 37 | } 38 | } 39 | return $limitStr; 40 | } 41 | 42 | /** 43 | * 字段和表名处理 44 | * @access protected 45 | * @param string $key 46 | * @param array $options 47 | * @return string 48 | */ 49 | protected function parseKey($key, $options = []) 50 | { 51 | $key = trim($key); 52 | if (strpos($key, '$.') && false === strpos($key, '(')) { 53 | // JSON字段支持 54 | list($field, $name) = explode('$.', $key); 55 | $key = $field . '->>\'' . $name . '\''; 56 | } elseif (strpos($key, '.')) { 57 | list($table, $key) = explode('.', $key, 2); 58 | if ('__TABLE__' == $table) { 59 | $table = $this->query->getTable(); 60 | } 61 | if (isset($options['alias'][$table])) { 62 | $table = $options['alias'][$table]; 63 | } 64 | } 65 | if (isset($table)) { 66 | $key = $table . '.' . $key; 67 | } 68 | return $key; 69 | } 70 | 71 | /** 72 | * 随机排序 73 | * @access protected 74 | * @return string 75 | */ 76 | protected function parseRand() 77 | { 78 | return 'RANDOM()'; 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /thinkphp/library/think/process/Utils.php: -------------------------------------------------------------------------------- 1 | 8 | // +---------------------------------------------------------------------- 9 | 10 | namespace think\process; 11 | 12 | class Utils 13 | { 14 | 15 | /** 16 | * 转义字符串 17 | * @param string $argument 18 | * @return string 19 | */ 20 | public static function escapeArgument($argument) 21 | { 22 | 23 | if ('' === $argument) { 24 | return escapeshellarg($argument); 25 | } 26 | $escapedArgument = ''; 27 | $quote = false; 28 | foreach (preg_split('/(")/i', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { 29 | if ('"' === $part) { 30 | $escapedArgument .= '\\"'; 31 | } elseif (self::isSurroundedBy($part, '%')) { 32 | // Avoid environment variable expansion 33 | $escapedArgument .= '^%"' . substr($part, 1, -1) . '"^%'; 34 | } else { 35 | // escape trailing backslash 36 | if ('\\' === substr($part, -1)) { 37 | $part .= '\\'; 38 | } 39 | $quote = true; 40 | $escapedArgument .= $part; 41 | } 42 | } 43 | if ($quote) { 44 | $escapedArgument = '"' . $escapedArgument . '"'; 45 | } 46 | return $escapedArgument; 47 | } 48 | 49 | /** 50 | * 验证并进行规范化Process输入。 51 | * @param string $caller 52 | * @param mixed $input 53 | * @return string 54 | * @throws \InvalidArgumentException 55 | */ 56 | public static function validateInput($caller, $input) 57 | { 58 | if (null !== $input) { 59 | if (is_resource($input)) { 60 | return $input; 61 | } 62 | if (is_scalar($input)) { 63 | return (string) $input; 64 | } 65 | throw new \InvalidArgumentException(sprintf('%s only accepts strings or stream resources.', $caller)); 66 | } 67 | return $input; 68 | } 69 | 70 | private static function isSurroundedBy($arg, $char) 71 | { 72 | return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /thinkphp/library/think/process/pipes/Pipes.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\process\pipes; 13 | 14 | abstract class Pipes 15 | { 16 | 17 | /** @var array */ 18 | public $pipes = []; 19 | 20 | /** @var string */ 21 | protected $inputBuffer = ''; 22 | /** @var resource|null */ 23 | protected $input; 24 | 25 | /** @var bool */ 26 | private $blocked = true; 27 | 28 | const CHUNK_SIZE = 16384; 29 | 30 | /** 31 | * 返回用于 proc_open 描述符的数组 32 | * @return array 33 | */ 34 | abstract public function getDescriptors(); 35 | 36 | /** 37 | * 返回一个数组的索引由其相关的流,以防这些管道使用的临时文件的文件名。 38 | * @return string[] 39 | */ 40 | abstract public function getFiles(); 41 | 42 | /** 43 | * 文件句柄和管道中读取数据。 44 | * @param bool $blocking 是否使用阻塞调用 45 | * @param bool $close 是否要关闭管道,如果他们已经到达 EOF。 46 | * @return string[] 47 | */ 48 | abstract public function readAndWrite($blocking, $close = false); 49 | 50 | /** 51 | * 返回当前状态如果有打开的文件句柄或管道。 52 | * @return bool 53 | */ 54 | abstract public function areOpen(); 55 | 56 | /** 57 | * {@inheritdoc} 58 | */ 59 | public function close() 60 | { 61 | foreach ($this->pipes as $pipe) { 62 | fclose($pipe); 63 | } 64 | $this->pipes = []; 65 | } 66 | 67 | /** 68 | * 检查系统调用已被中断 69 | * @return bool 70 | */ 71 | protected function hasSystemCallBeenInterrupted() 72 | { 73 | $lastError = error_get_last(); 74 | 75 | return isset($lastError['message']) && false !== stripos($lastError['message'], 'interrupted system call'); 76 | } 77 | 78 | protected function unblock() 79 | { 80 | if (!$this->blocked) { 81 | return; 82 | } 83 | 84 | foreach ($this->pipes as $pipe) { 85 | stream_set_blocking($pipe, 0); 86 | } 87 | if (null !== $this->input) { 88 | stream_set_blocking($this->input, 0); 89 | } 90 | 91 | $this->blocked = false; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 27 | if ($useStaticLoader) { 28 | require_once __DIR__ . '/autoload_static.php'; 29 | 30 | call_user_func(\Composer\Autoload\ComposerStaticInitcd8a0c083ea6387fe21cdb9bb6ee4e2c::getInitializer($loader)); 31 | } else { 32 | $map = require __DIR__ . '/autoload_namespaces.php'; 33 | foreach ($map as $namespace => $path) { 34 | $loader->set($namespace, $path); 35 | } 36 | 37 | $map = require __DIR__ . '/autoload_psr4.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->setPsr4($namespace, $path); 40 | } 41 | 42 | $classMap = require __DIR__ . '/autoload_classmap.php'; 43 | if ($classMap) { 44 | $loader->addClassMap($classMap); 45 | } 46 | } 47 | 48 | $loader->register(true); 49 | 50 | if ($useStaticLoader) { 51 | $includeFiles = Composer\Autoload\ComposerStaticInitcd8a0c083ea6387fe21cdb9bb6ee4e2c::$files; 52 | } else { 53 | $includeFiles = require __DIR__ . '/autoload_files.php'; 54 | } 55 | foreach ($includeFiles as $fileIdentifier => $file) { 56 | composerRequirecd8a0c083ea6387fe21cdb9bb6ee4e2c($fileIdentifier, $file); 57 | } 58 | 59 | return $loader; 60 | } 61 | } 62 | 63 | function composerRequirecd8a0c083ea6387fe21cdb9bb6ee4e2c($fileIdentifier, $file) 64 | { 65 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 66 | require $file; 67 | 68 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /thinkphp/tests/thinkphp/library/think/loaderTest.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | /** 13 | * Loader测试 14 | * @author liu21st 15 | */ 16 | 17 | namespace tests\thinkphp\library\think; 18 | 19 | use think\Loader; 20 | 21 | class loaderTest extends \PHPUnit_Framework_TestCase 22 | { 23 | 24 | public function testAutoload() 25 | { 26 | $this->assertEquals(false, Loader::autoload('\think\Url')); 27 | $this->assertEquals(false, Loader::autoload('think\Test')); 28 | $this->assertEquals(false, Loader::autoload('my\HelloTest')); 29 | } 30 | 31 | public function testAddClassMap() 32 | { 33 | Loader::addClassMap('my\hello\Test', __DIR__ . DS . 'loader' . DS . 'Test.php'); 34 | } 35 | 36 | public function testAddNamespace() 37 | { 38 | Loader::addNamespace('top', __DIR__ . DS . 'loader' . DS); 39 | $this->assertEquals(true, Loader::autoload('top\test\Hello')); 40 | } 41 | 42 | public function testAddNamespaceAlias() 43 | { 44 | Loader::addNamespaceAlias('top', 'top\test'); 45 | Loader::addNamespaceAlias(['top' => 'top\test', 'app' => 'app\index']); 46 | //$this->assertEquals(true, Loader::autoload('top\Hello')); 47 | } 48 | 49 | public function testTable() 50 | { 51 | Loader::db('mysql://root@127.0.0.1/test#utf8'); 52 | } 53 | 54 | public function testImport() 55 | { 56 | $this->assertEquals(false, Loader::import('think.log.driver.MyTest')); 57 | } 58 | 59 | public function testParseName() 60 | { 61 | $this->assertEquals('HelloTest', Loader::parseName('hello_test', 1)); 62 | $this->assertEquals('hello_test', Loader::parseName('HelloTest', 0)); 63 | } 64 | 65 | public function testParseClass() 66 | { 67 | $this->assertEquals('app\index\controller\User', Loader::parseClass('index', 'controller', 'user')); 68 | $this->assertEquals('app\index\controller\user\Type', Loader::parseClass('index', 'controller', 'user.type')); 69 | $this->assertEquals('app\admin\model\UserType', Loader::parseClass('admin', 'model', 'user_type')); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /thinkphp/library/think/response/View.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\response; 13 | 14 | use think\Config; 15 | use think\Response; 16 | use think\View as ViewTemplate; 17 | 18 | class View extends Response 19 | { 20 | // 输出参数 21 | protected $options = []; 22 | protected $vars = []; 23 | protected $replace = []; 24 | protected $contentType = 'text/html'; 25 | 26 | /** 27 | * 处理数据 28 | * @access protected 29 | * @param mixed $data 要处理的数据 30 | * @return mixed 31 | */ 32 | protected function output($data) 33 | { 34 | // 渲染模板输出 35 | return ViewTemplate::instance(Config::get('template'), Config::get('view_replace_str')) 36 | ->fetch($data, $this->vars, $this->replace); 37 | } 38 | 39 | /** 40 | * 获取视图变量 41 | * @access public 42 | * @param string $name 模板变量 43 | * @return mixed 44 | */ 45 | public function getVars($name = null) 46 | { 47 | if (is_null($name)) { 48 | return $this->vars; 49 | } else { 50 | return isset($this->vars[$name]) ? $this->vars[$name] : null; 51 | } 52 | } 53 | 54 | /** 55 | * 模板变量赋值 56 | * @access public 57 | * @param mixed $name 变量名 58 | * @param mixed $value 变量值 59 | * @return $this 60 | */ 61 | public function assign($name, $value = '') 62 | { 63 | if (is_array($name)) { 64 | $this->vars = array_merge($this->vars, $name); 65 | return $this; 66 | } else { 67 | $this->vars[$name] = $value; 68 | } 69 | return $this; 70 | } 71 | 72 | /** 73 | * 视图内容替换 74 | * @access public 75 | * @param string|array $content 被替换内容(支持批量替换) 76 | * @param string $replace 替换内容 77 | * @return $this 78 | */ 79 | public function replace($content, $replace = '') 80 | { 81 | if (is_array($content)) { 82 | $this->replace = array_merge($this->replace, $content); 83 | } else { 84 | $this->replace[$content] = $replace; 85 | } 86 | return $this; 87 | } 88 | 89 | } 90 | --------------------------------------------------------------------------------