├── thinkphp
├── .htaccess
├── logo.png
├── library
│ ├── think
│ │ ├── console
│ │ │ ├── bin
│ │ │ │ ├── hiddeninput.exe
│ │ │ │ └── README.md
│ │ │ ├── command
│ │ │ │ ├── make
│ │ │ │ │ ├── stubs
│ │ │ │ │ │ ├── model.stub
│ │ │ │ │ │ ├── controller.plain.stub
│ │ │ │ │ │ └── controller.stub
│ │ │ │ │ ├── Model.php
│ │ │ │ │ └── Controller.php
│ │ │ │ ├── Build.php
│ │ │ │ ├── Clear.php
│ │ │ │ └── Help.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
│ │ │ └── Expression.php
│ │ ├── Env.php
│ │ ├── model
│ │ │ └── Pivot.php
│ │ ├── controller
│ │ │ └── Yar.php
│ │ ├── process
│ │ │ └── exception
│ │ │ │ ├── Failed.php
│ │ │ │ └── Timeout.php
│ │ ├── response
│ │ │ ├── Json.php
│ │ │ └── Jsonp.php
│ │ ├── Exception.php
│ │ └── template
│ │ │ └── driver
│ │ │ └── File.php
│ └── traits
│ │ └── think
│ │ └── Instance.php
├── codecov.yml
├── start.php
├── console.php
├── tpl
│ ├── default_index.tpl
│ └── dispatch_jump.tpl
├── composer.json
├── .travis.yml
├── phpunit.xml
└── LICENSE.txt
├── application
├── .htaccess
├── command.php
├── common.php
├── index
│ └── controller
│ │ └── Index.php
├── tags.php
├── admin
│ ├── controller
│ │ ├── Base.php
│ │ ├── Index.php
│ │ └── Login.php
│ └── view
│ │ └── admin
│ │ └── message.html
├── extra
│ └── queue.php
├── database.php
└── route.php
├── public
├── robots.txt
├── favicon.ico
├── static
│ ├── img
│ │ ├── biaoqian.jpg
│ │ └── zhineng.jpg
│ ├── login
│ │ ├── img
│ │ │ ├── 1.jpg
│ │ │ ├── 2.jpg
│ │ │ ├── 3.jpg
│ │ │ ├── twitter.png
│ │ │ └── facebook.png
│ │ ├── js
│ │ │ ├── supersized-init.js
│ │ │ ├── scripts.js
│ │ │ └── html5.js
│ │ └── css
│ │ │ ├── reset.css
│ │ │ └── supersized.css
│ ├── index
│ │ ├── images
│ │ │ ├── item-1.jpg
│ │ │ ├── item-2.jpg
│ │ │ ├── item-3.jpg
│ │ │ ├── item-4.jpg
│ │ │ ├── item-5.jpg
│ │ │ ├── item-6.jpg
│ │ │ ├── item-7.jpg
│ │ │ ├── item-8.jpg
│ │ │ └── item-9.jpg
│ │ ├── sortable.min.css
│ │ └── demo.css
│ └── admin
│ │ ├── fonts
│ │ ├── flaticon
│ │ │ ├── Flaticon.eot
│ │ │ ├── Flaticon.ttf
│ │ │ └── Flaticon.woff
│ │ ├── summernote
│ │ │ ├── summernote.eot
│ │ │ ├── summernote.ttf
│ │ │ └── summernote.woff
│ │ ├── fontawesome
│ │ │ ├── fa-brands-400.eot
│ │ │ ├── fa-brands-400.ttf
│ │ │ ├── fa-solid-900.eot
│ │ │ ├── fa-solid-900.ttf
│ │ │ ├── fa-solid-900.woff
│ │ │ ├── fa-brands-400.woff
│ │ │ ├── fa-brands-400.woff2
│ │ │ ├── fa-regular-400.eot
│ │ │ ├── fa-regular-400.ttf
│ │ │ ├── fa-regular-400.woff
│ │ │ ├── fa-solid-900.woff2
│ │ │ └── fa-regular-400.woff2
│ │ └── simple-line-icons
│ │ │ ├── Simple-Line-Icons.eot
│ │ │ ├── Simple-Line-Icons.ttf
│ │ │ ├── Simple-Line-Icons.woff
│ │ │ └── Simple-Line-Icons.woff2
│ │ └── js
│ │ └── plugin
│ │ └── jquery-ui-touch-punch
│ │ └── jquery.ui.touch-punch.min.js
├── admin.php
├── index.php
├── .htaccess
├── 404.html
└── router.php
├── vendor
├── topthink
│ ├── think-image
│ │ ├── tests
│ │ │ ├── images
│ │ │ │ ├── test.bmp
│ │ │ │ ├── test.gif
│ │ │ │ ├── test.jpg
│ │ │ │ ├── test.png
│ │ │ │ └── test.ttf
│ │ │ ├── tmp
│ │ │ │ └── .gitignore
│ │ │ ├── autoload.php
│ │ │ ├── TestCase.php
│ │ │ ├── RotateTest.php
│ │ │ ├── FlipTest.php
│ │ │ ├── WaterTest.php
│ │ │ ├── TextTest.php
│ │ │ ├── CropTest.php
│ │ │ └── InfoTest.php
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── composer.json
│ │ ├── src
│ │ │ └── image
│ │ │ │ └── Exception.php
│ │ ├── phpunit.xml
│ │ └── README.md
│ ├── think-mongo
│ │ ├── .gitignore
│ │ ├── composer.json
│ │ └── README.md
│ ├── think-helper
│ │ ├── .gitignore
│ │ ├── composer.json
│ │ ├── src
│ │ │ ├── Arr.php
│ │ │ ├── hash
│ │ │ │ ├── Md5.php
│ │ │ │ └── Bcrypt.php
│ │ │ └── Hash.php
│ │ └── README.md
│ ├── 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
│ ├── think-migration
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── src
│ │ │ ├── command
│ │ │ │ └── stubs
│ │ │ │ │ ├── seed.stub
│ │ │ │ │ └── migrate.stub
│ │ │ ├── Seeder.php
│ │ │ ├── config.php
│ │ │ └── Migrator.php
│ │ ├── phinx
│ │ │ ├── src
│ │ │ │ └── Phinx
│ │ │ │ │ ├── Seed
│ │ │ │ │ └── Seed.template.php.dist
│ │ │ │ │ ├── Migration
│ │ │ │ │ ├── Migration.template.php.dist
│ │ │ │ │ └── IrreversibleMigrationException.php
│ │ │ │ │ └── Db
│ │ │ │ │ └── Adapter
│ │ │ │ │ └── WrapperInterface.php
│ │ │ └── LICENSE
│ │ ├── composer.json
│ │ └── LICENSE
│ ├── think-queue
│ │ ├── .gitignore
│ │ ├── src
│ │ │ ├── config.php
│ │ │ ├── queue
│ │ │ │ ├── ShouldQueue.php
│ │ │ │ ├── CallQueuedHandler.php
│ │ │ │ ├── command
│ │ │ │ │ ├── Restart.php
│ │ │ │ │ └── Subscribe.php
│ │ │ │ ├── Queueable.php
│ │ │ │ ├── job
│ │ │ │ │ ├── Sync.php
│ │ │ │ │ ├── Topthink.php
│ │ │ │ │ └── Database.php
│ │ │ │ └── connector
│ │ │ │ │ └── Sync.php
│ │ │ ├── common.php
│ │ │ └── Queue.php
│ │ └── composer.json
│ ├── think-oracle
│ │ ├── README.md
│ │ └── composer.json
│ └── think-worker
│ │ ├── composer.json
│ │ ├── README.md
│ │ └── src
│ │ └── Server.php
├── autoload.php
├── composer
│ ├── autoload_classmap.php
│ ├── autoload_namespaces.php
│ ├── autoload_files.php
│ ├── autoload_psr4.php
│ └── LICENSE
└── workerman
│ └── workerman
│ ├── Events
│ ├── React
│ │ ├── ExtEventLoop.php
│ │ ├── StreamSelectLoop.php
│ │ └── ExtLibEventLoop.php
│ └── EventInterface.php
│ ├── composer.json
│ ├── Lib
│ └── Constants.php
│ ├── MIT-LICENSE.txt
│ ├── Protocols
│ ├── Frame.php
│ ├── ProtocolInterface.php
│ └── Text.php
│ └── Autoloader.php
├── 必看安装教程.txt
├── .htaccess
├── 404.html
├── think
├── composer.json
├── README.md
└── .travis.yml
/thinkphp/.htaccess:
--------------------------------------------------------------------------------
1 | deny from all
--------------------------------------------------------------------------------
/application/.htaccess:
--------------------------------------------------------------------------------
1 | deny from all
--------------------------------------------------------------------------------
/application/command.php:
--------------------------------------------------------------------------------
1 | 7.0
4 | 3.设置数据库 application/database.php
5 | 4.导入sql到数据库
6 |
7 |
8 | 如果遇到问题请联系qq32579135
9 |
--------------------------------------------------------------------------------
/public/static/admin/fonts/flaticon/Flaticon.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/flaticon/Flaticon.woff
--------------------------------------------------------------------------------
/thinkphp/library/think/console/bin/hiddeninput.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/thinkphp/library/think/console/bin/hiddeninput.exe
--------------------------------------------------------------------------------
/vendor/topthink/think-captcha/assets/zhttfs/1.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/vendor/topthink/think-captcha/assets/zhttfs/1.ttf
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/images/test.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/vendor/topthink/think-image/tests/images/test.gif
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/images/test.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/vendor/topthink/think-image/tests/images/test.jpg
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/images/test.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/vendor/topthink/think-image/tests/images/test.png
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/images/test.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/vendor/topthink/think-image/tests/images/test.ttf
--------------------------------------------------------------------------------
/public/static/admin/fonts/summernote/summernote.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/summernote/summernote.eot
--------------------------------------------------------------------------------
/public/static/admin/fonts/summernote/summernote.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/summernote/summernote.ttf
--------------------------------------------------------------------------------
/public/static/admin/fonts/summernote/summernote.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/summernote/summernote.woff
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-brands-400.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-brands-400.eot
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-brands-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-brands-400.ttf
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-solid-900.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-solid-900.eot
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-solid-900.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-solid-900.ttf
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-solid-900.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-solid-900.woff
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-brands-400.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-brands-400.woff
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-brands-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-brands-400.woff2
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-regular-400.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-regular-400.eot
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-regular-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-regular-400.ttf
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-regular-400.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-regular-400.woff
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-solid-900.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-solid-900.woff2
--------------------------------------------------------------------------------
/public/static/admin/fonts/fontawesome/fa-regular-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pmhw/telegram-bot/HEAD/public/static/admin/fonts/fontawesome/fa-regular-400.woff2
--------------------------------------------------------------------------------
/public/admin.php:
--------------------------------------------------------------------------------
1 |
2 | Options +FollowSymlinks
3 | RewriteEngine On
4 | RewriteCond %{REQUEST_FILENAME} !-d
5 | RewriteCond %{REQUEST_FILENAME} !-f
6 | RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
7 |
8 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-oracle/README.md:
--------------------------------------------------------------------------------
1 | ThinkPHP 5.0 Oracle驱动
2 | ===============
3 |
4 | 首先在`php.ini`开启 `php_pdo_oci` 扩展
5 |
6 | 然后,配置应用的数据库配置文件`database.php`的`type`参数为:
7 |
8 | ~~~
9 | 'type' => '\think\oracle\Connection',
10 | ~~~
11 |
12 |
13 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/public/static/index/sortable.min.css:
--------------------------------------------------------------------------------
1 | .sjs-default{position:relative;padding:0;margin:0;opacity:0;transition:height .2s ease-out,opacity .2s ease-out .2s}[data-sjsel]{opacity:0;position:absolute;top:0;left:0;transition:-webkit-transform .2s ease-out;transition:transform .2s ease-out;transition:transform .2s ease-out,-webkit-transform .2s ease-out}
--------------------------------------------------------------------------------
/application/index/controller/Index.php:
--------------------------------------------------------------------------------
1 | redirect('/404.html');
14 |
15 | }
16 | }
--------------------------------------------------------------------------------
/application/tags.php:
--------------------------------------------------------------------------------
1 | [],
6 | // 应用开始
7 | 'app_begin' => [],
8 | // 模块初始化
9 | 'module_init' => [],
10 | // 操作开始执行
11 | 'action_begin' => [],
12 | // 视图内容过滤
13 | 'view_filter' => [],
14 | // 日志写入
15 | 'log_write' => [],
16 | // 应用结束
17 | 'app_end' => [],
18 | ];
19 |
--------------------------------------------------------------------------------
/vendor/topthink/think-migration/src/command/stubs/seed.stub:
--------------------------------------------------------------------------------
1 | '\think\mongo\Connection',
12 | ~~~
13 |
14 | 即可正常使用MongoDb,例如:
15 | ~~~
16 | Db::name('demo')
17 | ->find();
18 | Db::name('demo')
19 | ->field('id,name')
20 | ->limit(10)
21 | ->order('id','desc')
22 | ->select();
23 | ~~~
24 |
25 | 1.*版本支持ThinkPHP 5.0
26 | 2.*版本支持ThinkPHP 5.1
27 |
--------------------------------------------------------------------------------
/vendor/topthink/think-oracle/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "topthink/think-oracle",
3 | "description": "Oracle driver for thinkphp5",
4 | "license": "Apache-2.0",
5 | "authors": [
6 | {
7 | "name": "liu21st",
8 | "email": "liu21st@gmail.com"
9 | }
10 | ],
11 | "require": {
12 | "topthink/framework": "~5.0.17"
13 | },
14 | "autoload": {
15 | "psr-4": {
16 | "think\\oracle\\": "src"
17 | },
18 | "files": [
19 | ]
20 | }
21 | }
--------------------------------------------------------------------------------
/vendor/topthink/think-worker/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "topthink/think-worker",
3 | "description": "workerman extend for thinkphp5",
4 | "license": "Apache-2.0",
5 | "authors": [
6 | {
7 | "name": "liu21st",
8 | "email": "liu21st@gmail.com"
9 | }
10 | ],
11 | "require": {
12 | "workerman/workerman":"^3.3.0"
13 | },
14 | "autoload": {
15 | "psr-4": {
16 | "think\\worker\\": "src"
17 | },
18 | "files": [
19 | ]
20 | }
21 | }
--------------------------------------------------------------------------------
/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 |
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 | ~~~
--------------------------------------------------------------------------------
/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 404
8 |
21 |
22 |
23 |
24 | 404,您请求的文件不存在!
25 |
26 |
27 |
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 404
8 |
21 |
22 |
23 |
24 | 404,您请求的文件不存在!
25 |
26 |
--------------------------------------------------------------------------------
/vendor/composer/autoload_files.php:
--------------------------------------------------------------------------------
1 | $vendorDir . '/topthink/think-helper/src/helper.php',
10 | '1cfd2761b63b0a29ed23657ea394cb2d' => $vendorDir . '/topthink/think-captcha/src/helper.php',
11 | 'ddc3cd2a04224f9638c5d0de6a69c7e3' => $vendorDir . '/topthink/think-migration/src/config.php',
12 | 'cc56288302d9df745d97c934d6a6e5f0' => $vendorDir . '/topthink/think-queue/src/common.php',
13 | );
14 |
--------------------------------------------------------------------------------
/application/admin/controller/Base.php:
--------------------------------------------------------------------------------
1 | _admin = session('admin');
14 | // 未登录的用户不允许访问
15 | if(!$this->_admin){
16 | header('Location: /login');
17 | exit;
18 | }
19 |
20 | $admin=Db::table('admin')->where(array('name'=>$this->_admin['name']))->find();
21 | $this->assign('admin',$admin);
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-image/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "topthink/think-image",
3 | "description": "The ThinkPHP5 Image Package",
4 | "license": "Apache-2.0",
5 | "authors": [
6 | {
7 | "name": "yunwuxin",
8 | "email": "448901948@qq.com"
9 | }
10 | ],
11 | "require": {
12 | "ext-gd": "*"
13 | },
14 | "require-dev": {
15 | "topthink/framework": "^5.0",
16 | "phpunit/phpunit": "4.8.*"
17 | },
18 | "config": {
19 | "preferred-install": "dist"
20 | },
21 | "autoload": {
22 | "psr-4": {
23 | "think\\": "src"
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/application/extra/queue.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | return [
13 | 'connector' => 'Sync'
14 | ];
15 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/public/static/index/demo.css:
--------------------------------------------------------------------------------
1 | body, html { font-size: 100%; padding: 0; margin: 0;}
2 |
3 | /* Reset */
4 | *,
5 | *:after,
6 | *:before {
7 | -webkit-box-sizing: border-box;
8 | -moz-box-sizing: border-box;
9 | box-sizing: border-box;
10 | }
11 |
12 | /* Clearfix hack by Nicolas Gallagher: http://nicolasgallagher.com/micro-clearfix-hack/ */
13 | .clearfix:before,
14 | .clearfix:after {
15 | content: " ";
16 | display: table;
17 | }
18 |
19 | .clearfix:after {
20 | clear: both;
21 | }
22 |
23 | body{
24 | background: #494A5F;
25 | color: #D5D6E2;
26 | font-weight: 500;
27 | font-size: 1.05em;
28 | font-family: "Microsoft YaHei","Segoe UI", "Lucida Grande", Helvetica, Arial,sans-serif;
29 | }
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/config.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | return [
13 | 'connector' => 'Sync'
14 | ];
15 |
--------------------------------------------------------------------------------
/application/admin/controller/Index.php:
--------------------------------------------------------------------------------
1 | where(array('gid'=>$gid))->select();
15 |
16 | $data['shangpin_gid']=Db::table('shangpin_gid')->where(array('gid'=>$gid))->find();
17 |
18 | //获取Telegram用户名
19 | $data['admin']=Db::table('admin')->where(array('id'=>1))->find();
20 |
21 |
22 | $this->assign('data',$data);
23 | return $this->fetch();
24 | }
25 | }
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/queue/ShouldQueue.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\queue;
13 |
14 | interface ShouldQueue
15 | {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "topthink/think-queue",
3 | "description": "The ThinkPHP5 Queue Package",
4 | "type": "think-extend",
5 | "authors": [
6 | {
7 | "name": "yunwuxin",
8 | "email": "448901948@qq.com"
9 | }
10 | ],
11 | "license": "Apache-2.0",
12 | "autoload": {
13 | "psr-4": {
14 | "think\\": "src"
15 | },
16 | "files": [
17 | "src/common.php"
18 | ]
19 | },
20 | "require": {
21 | "topthink/think-helper": ">=1.0.4",
22 | "topthink/think-installer": ">=1.0.10"
23 | },
24 | "extra": {
25 | "think-config": {
26 | "queue": "src/config.php"
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/topthink/think-image/src/image/Exception.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\image;
13 |
14 |
15 | class Exception extends \RuntimeException
16 | {
17 |
18 | }
--------------------------------------------------------------------------------
/vendor/topthink/think-image/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 | ./tests/
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/vendor/topthink/think-migration/src/Seeder.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | namespace think\migration;
12 |
13 | use Phinx\Seed\AbstractSeed;
14 |
15 | class Seeder extends AbstractSeed
16 | {
17 |
18 | }
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 |
--------------------------------------------------------------------------------
/thinkphp/start.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think;
13 |
14 | // ThinkPHP 引导文件
15 | // 1. 加载基础文件
16 | require __DIR__ . '/base.php';
17 |
18 | // 2. 执行应用
19 | App::run()->send();
20 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | "autoload": {
23 | "psr-4": {
24 | "app\\": "application"
25 | }
26 | },
27 | "extra": {
28 | "think-path": "thinkphp"
29 | },
30 | "config": {
31 | "preferred-install": "dist"
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/workerman/workerman/Events/React/ExtEventLoop.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright walkor
11 | * @link http://www.workerman.net/
12 | * @license http://www.opensource.org/licenses/mit-license.php MIT License
13 | */
14 | namespace Workerman\Events\React;
15 |
16 | /**
17 | * Class ExtEventLoop
18 | * @package Workerman\Events\React
19 | */
20 | class ExtEventLoop extends Base
21 | {
22 |
23 | public function __construct()
24 | {
25 | $this->_eventLoop = new \React\EventLoop\ExtEventLoop();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/workerman/workerman/Events/React/StreamSelectLoop.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright walkor
11 | * @link http://www.workerman.net/
12 | * @license http://www.opensource.org/licenses/mit-license.php MIT License
13 | */
14 | namespace Workerman\Events\React;
15 |
16 | /**
17 | * Class StreamSelectLoop
18 | * @package Workerman\Events\React
19 | */
20 | class StreamSelectLoop extends Base
21 | {
22 | public function __construct()
23 | {
24 | $this->_eventLoop = new \React\EventLoop\StreamSelectLoop();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/autoload.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | define('TEST_PATH', __DIR__ . '/');
12 | // 加载框架基础文件
13 | require __DIR__ . '/../thinkphp/base.php';
14 | \think\Loader::addNamespace('tests', TEST_PATH);
15 | \think\Loader::addNamespace('think', __DIR__ . '/../src/');
--------------------------------------------------------------------------------
/vendor/workerman/workerman/Events/React/ExtLibEventLoop.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright walkor
11 | * @link http://www.workerman.net/
12 | * @license http://www.opensource.org/licenses/mit-license.php MIT License
13 | */
14 | namespace Workerman\Events\React;
15 | use Workerman\Events\EventInterface;
16 |
17 | /**
18 | * Class ExtLibEventLoop
19 | * @package Workerman\Events\React
20 | */
21 | class ExtLibEventLoop extends Base
22 | {
23 | public function __construct()
24 | {
25 | $this->_eventLoop = new \React\EventLoop\ExtLibeventLoop();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/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 }';
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/public/router.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | // $Id$
12 |
13 | if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
14 | return false;
15 | } else {
16 | if (!isset($_SERVER['PATH_INFO'])) {
17 | $_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
18 | }
19 | require __DIR__ . "/index.php";
20 | }
21 |
--------------------------------------------------------------------------------
/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, 'Route Not Found');
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 | }
--------------------------------------------------------------------------------
/vendor/topthink/think-migration/src/config.php:
--------------------------------------------------------------------------------
1 |
8 | // +----------------------------------------------------------------------
9 |
10 | \think\Console::addDefaultCommands([
11 | "think\\migration\\command\\migrate\\Create",
12 | "think\\migration\\command\\migrate\\Run",
13 | "think\\migration\\command\\migrate\\Rollback",
14 | "think\\migration\\command\\migrate\\Breakpoint",
15 | "think\\migration\\command\\migrate\\Status",
16 | "think\\migration\\command\\seed\\Create",
17 | "think\\migration\\command\\seed\\Run",
18 | ]);
19 |
--------------------------------------------------------------------------------
/vendor/topthink/think-migration/phinx/src/Phinx/Migration/Migration.template.php.dist:
--------------------------------------------------------------------------------
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/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-worker/README.md:
--------------------------------------------------------------------------------
1 | ThinkPHP 5.0 Workerman 扩展
2 | ===============
3 |
4 | ## 安装
5 | composer require topthink/think-worker
6 |
7 | ## 使用方法
8 | 首先创建控制器类并继承 think\worker\Server,然后设置属性和添加回调方法
9 |
10 | ~~~
11 | namespace app\index\controller;
12 |
13 | use think\worker\Server;
14 |
15 | class Worker extends Server
16 | {
17 | protected $socket = 'http://0.0.0.0:2346';
18 |
19 | public function onMessage($connection,$data)
20 | {
21 | $connection->send(json_encode($data));
22 | }
23 | }
24 | ~~~
25 | 支持workerman所有的回调方法定义(回调方法必须是public类型)
26 |
27 |
28 | 在应用根目录增加入口文件 server.php
29 |
30 | ~~~
31 | #!/usr/bin/env php
32 |
10 | // +----------------------------------------------------------------------
11 | namespace think\migration;
12 |
13 | use Phinx\Migration\AbstractMigration;
14 | use think\migration\db\Table;
15 |
16 | class Migrator extends AbstractMigration
17 | {
18 | /**
19 | * @param string $tableName
20 | * @param array $options
21 | * @return Table
22 | */
23 | public function table($tableName, $options = [])
24 | {
25 | return new Table($tableName, $options, $this->getAdapter());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/composer/autoload_psr4.php:
--------------------------------------------------------------------------------
1 | array($vendorDir . '/topthink/think-worker/src'),
10 | 'think\\oracle\\' => array($vendorDir . '/topthink/think-oracle/src'),
11 | 'think\\mongo\\' => array($vendorDir . '/topthink/think-mongo/src'),
12 | 'think\\migration\\' => array($vendorDir . '/topthink/think-migration/src'),
13 | 'think\\helper\\' => array($vendorDir . '/topthink/think-helper/src'),
14 | 'think\\composer\\' => array($vendorDir . '/topthink/think-installer/src'),
15 | 'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'),
16 | 'think\\' => array($baseDir . '/thinkphp/library/think', $vendorDir . '/topthink/think-image/src', $vendorDir . '/topthink/think-queue/src'),
17 | 'app\\' => array($baseDir . '/application'),
18 | 'Workerman\\' => array($vendorDir . '/workerman/workerman'),
19 | 'Phinx\\' => array($vendorDir . '/topthink/think-migration/phinx/src/Phinx'),
20 | );
21 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/TestCase.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace tests;
13 |
14 | use think\File;
15 |
16 | abstract class TestCase extends \PHPUnit_Framework_TestCase
17 | {
18 |
19 | protected function getJpeg()
20 | {
21 | return new File(TEST_PATH . 'images/test.jpg');
22 | }
23 |
24 | protected function getPng()
25 | {
26 | return new File(TEST_PATH . 'images/test.png');
27 | }
28 |
29 | protected function getGif()
30 | {
31 | return new File(TEST_PATH . 'images/test.gif');
32 | }
33 | }
--------------------------------------------------------------------------------
/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/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/.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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/workerman/workerman/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "workerman/workerman",
3 | "type": "library",
4 | "keywords": [
5 | "event-loop",
6 | "asynchronous"
7 | ],
8 | "homepage": "http://www.workerman.net",
9 | "license": "MIT",
10 | "description": "An asynchronous event driven PHP framework for easily building fast, scalable network applications.",
11 | "authors": [
12 | {
13 | "name": "walkor",
14 | "email": "walkor@workerman.net",
15 | "homepage": "http://www.workerman.net",
16 | "role": "Developer"
17 | }
18 | ],
19 | "support": {
20 | "email": "walkor@workerman.net",
21 | "issues": "https://github.com/walkor/workerman/issues",
22 | "forum": "http://wenda.workerman.net/",
23 | "wiki": "http://doc3.workerman.net/index.html",
24 | "source": "https://github.com/walkor/workerman"
25 | },
26 | "require": {
27 | "php": ">=5.3"
28 | },
29 | "suggest": {
30 | "ext-event": "For better performance. "
31 | },
32 | "autoload": {
33 | "psr-4": {
34 | "Workerman\\": "./"
35 | }
36 | },
37 | "minimum-stability": "dev"
38 | }
39 |
--------------------------------------------------------------------------------
/application/admin/view/admin/message.html:
--------------------------------------------------------------------------------
1 |
2 | {include file="public/header"}
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
15 |
19 |
20 | {volist name="data.tg_message" id="vo" }
21 |
22 | -
23 |
24 | {$vo.text} @{$vo.name}
25 |
26 | {/volist}
27 |
28 | {$data.tg_message->render()}
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | {include file="public/footer"}
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/workerman/workerman/Lib/Constants.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright walkor
11 | * @link http://www.workerman.net/
12 | * @license http://www.opensource.org/licenses/mit-license.php MIT License
13 | */
14 |
15 | // Date.timezone
16 | if (!ini_get('date.timezone')) {
17 | date_default_timezone_set('Asia/Shanghai');
18 | }
19 | // Display errors.
20 | ini_set('display_errors', 'on');
21 | // Reporting all.
22 | error_reporting(E_ALL);
23 |
24 | // Reset opcache.
25 | if (function_exists('opcache_reset')) {
26 | opcache_reset();
27 | }
28 |
29 | // For onError callback.
30 | define('WORKERMAN_CONNECT_FAIL', 1);
31 | // For onError callback.
32 | define('WORKERMAN_SEND_FAIL', 2);
33 |
34 | // Define OS Type
35 | define('OS_TYPE_LINUX', 'linux');
36 | define('OS_TYPE_WINDOWS', 'windows');
37 |
38 | // Compatible with php7
39 | if(!class_exists('Error'))
40 | {
41 | class Error extends Exception
42 | {
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/public/static/login/js/scripts.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 作者:qq32579135
3 | * 开发时间:2020年10月份
4 | * 开发周期:一个月
5 | * **/
6 |
7 | jQuery(document).ready(function() {
8 |
9 | $('.page-container form').submit(function(){
10 | var username = $(this).find('.username').val();
11 | var password = $(this).find('.password').val();
12 | if(username == '') {
13 | $(this).find('.error').fadeOut('fast', function(){
14 | $(this).css('top', '27px');
15 | });
16 | $(this).find('.error').fadeIn('fast', function(){
17 | $(this).parent().find('.username').focus();
18 | });
19 | return false;
20 | }
21 |
22 | if(password == '') {
23 | $(this).find('.error').fadeOut('fast', function(){
24 | $(this).css('top', '96px');
25 | });
26 | $(this).find('.error').fadeIn('fast', function(){
27 | $(this).parent().find('.password').focus();
28 | });
29 | return false;
30 | }
31 | });
32 |
33 | $('.page-container form .username, .page-container form .password').keyup(function(){
34 | $(this).parent().find('.error').fadeOut('fast');
35 | });
36 |
37 | });
38 |
--------------------------------------------------------------------------------
/vendor/workerman/workerman/MIT-LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2009-2015 walkor and contributors (see https://github.com/walkor/workerman/contributors)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/application/database.php:
--------------------------------------------------------------------------------
1 | 'mysql',
5 | // 服务器地址
6 | 'hostname' => '127.0.0.1',
7 | // 数据库名
8 | 'database' => '',
9 | // 用户名
10 | 'username' => '',
11 | // 密码
12 | 'password' => '',
13 | // 端口
14 | 'hostport' => '',
15 | // 连接dsn
16 | 'dsn' => '',
17 | // 数据库连接参数
18 | 'params' => [],
19 | // 数据库编码默认采用utf8
20 | 'charset' => 'utf8',
21 | // 数据库表前缀
22 | 'prefix' => '',
23 | // 数据库调试模式
24 | 'debug' => true,
25 | // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
26 | 'deploy' => 0,
27 | // 数据库读写是否分离 主从式有效
28 | 'rw_separate' => false,
29 | // 读写分离后 主服务器数量
30 | 'master_num' => 1,
31 | // 指定从服务器序号
32 | 'slave_no' => '',
33 | // 自动读取主库数据
34 | 'read_master' => false,
35 | // 是否严格检查字段是否存在
36 | 'fields_strict' => true,
37 | // 数据集返回类型
38 | 'resultset_type' => 'array',
39 | // 自动写入时间戳字段
40 | 'auto_timestamp' => false,
41 | // 时间字段取出后的默认时间格式
42 | 'datetime_format' => 'Y-m-d H:i:s',
43 | // 是否需要进行SQL性能分析
44 | 'sql_explain' => false,
45 | ];
46 |
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/queue/CallQueuedHandler.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\queue;
13 |
14 | class CallQueuedHandler
15 | {
16 |
17 | public function call(Job $job, array $data)
18 | {
19 | $command = unserialize($data['command']);
20 |
21 | call_user_func([$command, 'handle']);
22 |
23 | if (!$job->isDeletedOrReleased()) {
24 | $job->delete();
25 | }
26 | }
27 |
28 | public function failed(array $data)
29 | {
30 | $command = unserialize($data['command']);
31 |
32 | if (method_exists($command, 'failed')) {
33 | $command->failed();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/queue/command/Restart.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\queue\command;
13 |
14 | use think\Cache;
15 | use think\console\Command;
16 | use think\console\Input;
17 | use think\console\Output;
18 |
19 | class Restart extends Command
20 | {
21 | public function configure()
22 | {
23 | $this->setName('queue:restart')->setDescription('Restart queue worker daemons after their current job');
24 | }
25 |
26 | public function execute(Input $input, Output $output)
27 | {
28 | Cache::set('think:queue:restart', time());
29 | $output->writeln("Broadcasting queue restart signal.");
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/queue/Queueable.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\queue;
13 |
14 | trait Queueable
15 | {
16 |
17 | /** @var string 队列名称 */
18 | public $queue;
19 |
20 | /** @var integer 延迟时间 */
21 | public $delay;
22 |
23 | /**
24 | * 设置队列名
25 | * @param $queue
26 | * @return $this
27 | */
28 | public function queue($queue)
29 | {
30 | $this->queue = $queue;
31 |
32 | return $this;
33 | }
34 |
35 | /**
36 | * 设置延迟时间
37 | * @param $delay
38 | * @return $this
39 | */
40 | public function delay($delay)
41 | {
42 | $this->delay = $delay;
43 |
44 | return $this;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/topthink/think-helper/src/Arr.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\helper;
13 |
14 |
15 | class Arr
16 | {
17 |
18 | public static function isAssoc(array $array)
19 | {
20 | $keys = array_keys($array);
21 |
22 | return array_keys($keys) !== $keys;
23 | }
24 |
25 | public static function sortRecursive($array)
26 | {
27 | foreach ($array as &$value) {
28 | if (is_array($value)) {
29 | $value = static::sortRecursive($value);
30 | }
31 | }
32 |
33 | if (static::isAssoc($array)) {
34 | ksort($array);
35 | } else {
36 | sort($array);
37 | }
38 |
39 | return $array;
40 | }
41 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/public/static/login/css/reset.css:
--------------------------------------------------------------------------------
1 | /**
2 | * 作者:qq32579135
3 | * 开发时间:2020年10月份
4 | * 开发周期:一个月
5 | * **/
6 | html, body, div, span, applet, object, iframe,
7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, a,
8 | abbr, acronym, address, big, cite, code, del,
9 | dfn, em, img, ins, kbd, q, s, samp, small,
10 | strike, strong, sub, sup, tt, var, u, i, center,
11 | dl, dt, dd, ol, ul, li, fieldset, form, label,
12 | legend, table, caption, tbody, tfoot, thead, tr,
13 | th, td, article, aside, canvas, details, embed,
14 | figure, figcaption, footer, header, hgroup, menu,
15 | nav, output, ruby, section, summary, time, mark, audio, video {
16 | margin: 0;
17 | padding: 0;
18 | border: 0;
19 | font-size: 100%;
20 | font: inherit;
21 | vertical-align: baseline;
22 | }
23 |
24 | /* ------- HTML5 display-role reset for older browsers ------- */
25 |
26 | article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
27 | display: block;
28 | }
29 | body {
30 | line-height: 1;
31 | }
32 | ol, ul {
33 | list-style: none;
34 | }
35 | blockquote, q {
36 | quotes: none;
37 | }
38 | blockquote:before, blockquote:after, q:before, q:after {
39 | content: '';
40 | content: none;
41 | }
42 | table {
43 | border-collapse: collapse;
44 | border-spacing: 0;
45 | }
46 |
47 | /**
48 | * 作者:qq32579135
49 | * 开发时间:2020年10月份
50 | * 开发周期:一个月
51 | * **/
--------------------------------------------------------------------------------
/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/library/think/db/Expression.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\db;
13 |
14 | class Expression
15 | {
16 | /**
17 | * 查询表达式
18 | *
19 | * @var string
20 | */
21 | protected $value;
22 |
23 | /**
24 | * 创建一个查询表达式
25 | *
26 | * @param string $value
27 | * @return void
28 | */
29 | public function __construct($value)
30 | {
31 | $this->value = $value;
32 | }
33 |
34 | /**
35 | * 获取表达式
36 | *
37 | * @return string
38 | */
39 | public function getValue()
40 | {
41 | return $this->value;
42 | }
43 |
44 | public function __toString()
45 | {
46 | return (string) $this->value;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/common.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | \think\Console::addDefaultCommands([
13 | "think\\queue\\command\\Work",
14 | "think\\queue\\command\\Restart",
15 | "think\\queue\\command\\Listen",
16 | "think\\queue\\command\\Subscribe"
17 | ]);
18 |
19 | if (!function_exists('queue')) {
20 |
21 | /**
22 | * 添加到队列
23 | * @param $job
24 | * @param string $data
25 | * @param int $delay
26 | * @param null $queue
27 | */
28 | function queue($job, $data = '', $delay = 0, $queue = null)
29 | {
30 | if ($delay > 0) {
31 | \think\Queue::later($delay, $job, $data, $queue);
32 | } else {
33 | \think\Queue::push($job, $data, $queue);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/topthink/think-image/README.md:
--------------------------------------------------------------------------------
1 | # The ThinkPHP5 Image Package
2 |
3 | [](https://travis-ci.org/top-think/think-image)
4 | [](https://codecov.io/github/top-think/think-image)
5 | [](https://github.com/top-think/think-image/releases)
6 | [](https://github.com/top-think/think-image/releases/latest)
7 | [](https://github.com/top-think/think-image/releases/latest)
8 | [](https://packagist.org/packages/topthink/think-image)
9 | [](https://packagist.org/packages/topthink/think-image)
10 |
11 | ## 安装
12 |
13 | > composer require topthink/think-image
14 |
15 | ## 使用
16 |
17 | ~~~
18 | $image = \think\Image::open('./image.jpg');
19 | 或者
20 | $image = \think\Image::open(request()->file('image'));
21 |
22 |
23 | $image->crop(...)
24 | ->thumb(...)
25 | ->water(...)
26 | ->text(....)
27 | ->save(..);
28 |
29 | ~~~
--------------------------------------------------------------------------------
/public/static/admin/js/plugin/jquery-ui-touch-punch/jquery.ui.touch-punch.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * jQuery UI Touch Punch 0.2.3
3 | *
4 | * Copyright 2011–2014, Dave Furfero
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | *
7 | * Depends:
8 | * jquery.ui.widget.js
9 | * jquery.ui.mouse.js
10 | */
11 | "use strict";!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
--------------------------------------------------------------------------------
/thinkphp/library/think/Env.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think;
13 |
14 | class Env
15 | {
16 | /**
17 | * 获取环境变量值
18 | * @access public
19 | * @param string $name 环境变量名(支持二级 . 号分割)
20 | * @param string $default 默认值
21 | * @return mixed
22 | */
23 | public static function get($name, $default = null)
24 | {
25 | $result = getenv(ENV_PREFIX . strtoupper(str_replace('.', '_', $name)));
26 |
27 | if (false !== $result) {
28 | if ('false' === $result) {
29 | $result = false;
30 | } elseif ('true' === $result) {
31 | $result = true;
32 | }
33 |
34 | return $result;
35 | }
36 |
37 | return $default;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/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 array|object $data 数据
28 | * @param Model $parent 上级模型
29 | * @param string $table 中间数据表名
30 | */
31 | public function __construct($data = [], Model $parent = null, $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 |
42 | }
43 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-migration/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.
--------------------------------------------------------------------------------
/thinkphp/LICENSE.txt:
--------------------------------------------------------------------------------
1 |
2 | ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
3 | 版权所有Copyright © 2006-2017 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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-helper/src/hash/Md5.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | namespace think\helper\hash;
12 |
13 | class Md5
14 | {
15 |
16 | protected $salt = 'think';
17 |
18 | public function make($value, array $options = [])
19 | {
20 | $salt = isset($options['salt']) ? $options['salt'] : $this->salt;
21 |
22 | return md5(md5($value) . $salt);
23 | }
24 |
25 | public function check($value, $hashedValue, array $options = [])
26 | {
27 | if (strlen($hashedValue) === 0) {
28 | return false;
29 | }
30 |
31 | $salt = isset($options['salt']) ? $options['salt'] : $this->salt;
32 |
33 | return md5(md5($value) . $salt) == $hashedValue;
34 | }
35 |
36 | public function setSalt($salt)
37 | {
38 | $this->salt = (string)$salt;
39 |
40 | return $this;
41 | }
42 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/application/route.php:
--------------------------------------------------------------------------------
1 | [
4 | 'name' => '\w+',
5 | ],
6 | '[hello]' => [
7 | ':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
8 | ':name' => ['index/hello', ['method' => 'post']],
9 | ],
10 |
11 | //Index
12 | 'index'=>'index/Index/index',//
13 |
14 | 'admin'=>'admin/Admin/admin',
15 | 'message'=>'admin/Admin/message',
16 | 'setting_bot'=>'admin/Admin/setting_bot',//机器人api配置
17 | 'huifu'=>'admin/Admin/huifu',
18 | 'huifu_zn'=>'admin/Admin/huifu_zn',
19 | 'huifu_bq'=>'admin/Admin/huifu_bq',
20 | 'login'=>'admin/login/login',
21 | 'api'=>'admin/Api/index',//telegram回调接口
22 | 'api1'=>'admin/Api/ceshi',//api测试
23 | 'shangpin'=>'admin/admin/shangpin',
24 | 'shangpin_gid'=>'admin/Admin/shangpin_gid',
25 |
26 | 'add_token'=>'admin/Admin/add_token',//保存密钥
27 | 'add_api'=>'admin/Admin/add_api',//保存api
28 | 'delete_api'=>'admin/Admin/delete_api',//删除api
29 | 'dulogin'=>'admin/Login/dulogin',
30 | 'add_shangpingid'=>'admin/Admin/add_shangpingid',//保存商品分类
31 | 'delete_shangpingid'=>'admin/Admin/delete_shangpingid',//删除商品分类
32 | 'add_shangpin'=>'admin/Admin/add_shangpin',//保存商品信息
33 | 'update_img'=>'admin/Admin/update_img',//图片封面
34 | 'update_shangpinimg'=>'admin/Admin/update_shangpinimg',//商品图片存
35 |
36 |
37 | 'index'=>'admin/Index/index',
38 |
39 | ];
40 |
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/RotateTest.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | namespace tests;
12 |
13 | use think\Image;
14 |
15 | class RotateTest extends TestCase
16 | {
17 | public function testJpeg()
18 | {
19 | $pathname = TEST_PATH . 'tmp/rotate.jpg';
20 | $image = Image::open($this->getJpeg());
21 | $image->rotate(90)->save($pathname);
22 |
23 | $file = new \SplFileInfo($pathname);
24 |
25 | $this->assertTrue($file->isFile());
26 |
27 | @unlink($pathname);
28 | }
29 |
30 | public function testGif()
31 | {
32 | $pathname = TEST_PATH . 'tmp/rotate.gif';
33 | $image = Image::open($this->getGif());
34 | $image->rotate(90)->save($pathname);
35 |
36 | $file = new \SplFileInfo($pathname);
37 |
38 | $this->assertTrue($file->isFile());
39 |
40 | @unlink($pathname);
41 | }
42 | }
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/FlipTest.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | namespace tests;
12 |
13 | use think\Image;
14 |
15 | class FlipTest extends TestCase
16 | {
17 | public function testJpeg()
18 | {
19 | $pathname = TEST_PATH . 'tmp/flip.jpg';
20 | $image = Image::open($this->getJpeg());
21 | $image->flip()->save($pathname);
22 |
23 | $file = new \SplFileInfo($pathname);
24 |
25 | $this->assertTrue($file->isFile());
26 |
27 | @unlink($pathname);
28 | }
29 |
30 |
31 | public function testGif()
32 | {
33 | $pathname = TEST_PATH . 'tmp/flip.gif';
34 | $image = Image::open($this->getGif());
35 | $image->flip(Image::FLIP_Y)->save($pathname);
36 |
37 | $file = new \SplFileInfo($pathname);
38 |
39 | $this->assertTrue($file->isFile());
40 |
41 | @unlink($pathname);
42 | }
43 | }
--------------------------------------------------------------------------------
/vendor/topthink/think-helper/README.md:
--------------------------------------------------------------------------------
1 | # thinkphp5 常用的一些扩展类库
2 |
3 | > 更新完善中
4 |
5 | > 以下类库都在`\\think\\helper`命名空间下
6 |
7 | ## Str
8 | > 字符串操作
9 |
10 | ```
11 | // 检查字符串中是否包含某些字符串
12 | Str::contains($haystack, $needles)
13 |
14 | // 检查字符串是否以某些字符串结尾
15 | Str::endsWith($haystack, $needles)
16 |
17 | // 获取指定长度的随机字母数字组合的字符串
18 | Str::random($length = 16)
19 |
20 | // 字符串转小写
21 | Str::lower($value)
22 |
23 | // 字符串转大写
24 | Str::upper($value)
25 |
26 | // 获取字符串的长度
27 | Str::length($value)
28 |
29 | // 截取字符串
30 | Str::substr($string, $start, $length = null)
31 |
32 | ```
33 |
34 | ## Hash
35 | > 创建密码的哈希
36 |
37 | ```
38 | // 创建
39 | Hash::make($value, $type = null, array $options = [])
40 |
41 | // 检查
42 | Hash::check($value, $hashedValue, $type = null, array $options = [])
43 |
44 | ```
45 |
46 | ## Time
47 | > 时间戳操作
48 |
49 | ```
50 | // 今日开始和结束的时间戳
51 | Time::today();
52 |
53 | // 昨日开始和结束的时间戳
54 | Time::yesterday();
55 |
56 | // 本周开始和结束的时间戳
57 | Time::week();
58 |
59 | // 上周开始和结束的时间戳
60 | Time::lastWeek();
61 |
62 | // 本月开始和结束的时间戳
63 | Time::month();
64 |
65 | // 上月开始和结束的时间戳
66 | Time::lastMonth();
67 |
68 | // 今年开始和结束的时间戳
69 | Time::year();
70 |
71 | // 去年开始和结束的时间戳
72 | Time::lastYear();
73 |
74 | // 获取7天前零点到现在的时间戳
75 | Time::dayToNow(7)
76 |
77 | // 获取7天前零点到昨日结束的时间戳
78 | Time::dayToNow(7, true)
79 |
80 | // 获取7天前的时间戳
81 | Time::daysAgo(7)
82 |
83 | // 获取7天后的时间戳
84 | Time::daysAfter(7)
85 |
86 | // 天数转换成秒数
87 | Time::daysToSecond(5)
88 |
89 | // 周数转换成秒数
90 | Time::weekToSecond(5)
91 |
92 | ```
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Telegram-bot 机器人
2 |
3 | TG机器人接定制,web端、pc端(授权验机码)等等 联系qq:2430502300 备注需求 否则不通过
4 | TG机器人接定制,web端、pc端(授权验机码)等等 联系qq:2430502300 备注需求 否则不通过
5 | TG机器人接定制,web端、pc端(授权验机码)等等 联系qq:2430502300 备注需求 否则不通过
6 |
7 | 扫码备注 程序定制
8 |
9 |
10 |
11 |
12 | 图片展示
13 | 
14 | 
15 | 
16 |
17 |
18 |
19 |
20 | #### 介绍
21 | Tg机器人,自动回复自定义消息回复,私聊回复以及群聊回复,可以进行二次开发,希望你做出更优质的东西,记得@我
22 | 独家制作没什么技术含量,大佬勿喷,后台附带得有配置教程,适合萌新,以及官方API接口,如果不懂可以联系我 qq 2430502300
23 |
24 | 最新版 支持自动加群,自动群发广告、群采集等等
25 |
26 | #### 软件架构
27 | Thinkphp5.0
28 |
29 |
30 | #### 安装教程
31 |
32 | 1. 上传Bot到服务器
33 | 2. 设置伪静态(具体可以参考Thinkphp框架安装方法)
34 |
35 | ```
36 | location / {
37 | if (!-e $request_filename){
38 | rewrite ^(.*)$ /index.php?s=$1 last; break;
39 | }
40 | }
41 | ```
42 | 3. 选择网站运行目录为Public
43 |
44 | 4. 配置数据库(在application/database.php)
45 |
46 | 5. 导入sql到数据库
47 |
48 | 6. 后台地址: 您的域名/admin
49 |
50 | 账号:admin 密码:123456
51 |
52 | #### 使用说明
53 |
54 | 关于后台首页admin报错问题,懒得修复,需要你先配置好机器人,机器人正常工作有效后即可正常访问后台首页admin
55 |
56 | #### 参与贡献
57 |
58 | TG机器人接定制,web端、pc端(授权验机码)等等 联系qq:2430502300 备注需求 否则不通过
59 |
60 |
--------------------------------------------------------------------------------
/public/static/login/css/supersized.css:
--------------------------------------------------------------------------------
1 | /**
2 | * 作者:qq32579135
3 | * 开发时间:2020年10月份
4 | * 开发周期:一个月
5 | * **/
6 |
7 | * { margin:0; padding:0; }
8 | body { background:#111; height:100%; }
9 | img { border:none; }
10 |
11 | #supersized-loader { position:absolute; top:50%; left:50%; z-index:0; width:60px; height:60px; margin:-30px 0 0 -30px; text-indent:-999em; no-repeat center center;}
12 |
13 | #supersized { display:block; position:fixed; left:0; top:0; overflow:hidden; z-index:-999; height:100%; width:100%; }
14 | #supersized img { width:auto; height:auto; position:relative; display:none; outline:none; border:none; }
15 | #supersized.speed img { -ms-interpolation-mode:nearest-neighbor; image-rendering: -moz-crisp-edges; } /*Speed*/
16 | #supersized.quality img { -ms-interpolation-mode:bicubic; image-rendering: optimizeQuality; } /*Quality*/
17 |
18 | #supersized li { display:block; list-style:none; z-index:-30; position:fixed; overflow:hidden; top:0; left:0; width:100%; height:100%; background:#111; }
19 | #supersized a { width:100%; height:100%; display:block; }
20 | #supersized li.prevslide { z-index:-20; }
21 | #supersized li.activeslide { z-index:-10; }
22 | #supersized li.image-loading { background:#111 no-repeat center center; width:100%; height:100%; }
23 | #supersized li.image-loading img{ visibility:hidden; }
24 | #supersized li.prevslide img, #supersized li.activeslide img{ display:inline; }
25 |
26 |
27 | #supersized img { max-width: none !important }
28 |
29 | /**
30 | * 作者:qq32579135
31 | * 开发时间:2020年10月份
32 | * 开发周期:一个月
33 | * **/
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/queue/job/Sync.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\queue\job;
13 |
14 | use think\queue\Job;
15 |
16 | class Sync extends Job
17 | {
18 | /**
19 | * The queue message data.
20 | *
21 | * @var string
22 | */
23 | protected $payload;
24 |
25 | public function __construct($payload)
26 | {
27 | $this->payload = $payload;
28 | }
29 |
30 | /**
31 | * Fire the job.
32 | * @return void
33 | */
34 | public function fire()
35 | {
36 | $this->resolveAndFire(json_decode($this->payload, true));
37 | }
38 |
39 | /**
40 | * Get the number of times the job has been attempted.
41 | * @return int
42 | */
43 | public function attempts()
44 | {
45 | return 1;
46 | }
47 |
48 | /**
49 | * Get the raw body string for the job.
50 | * @return string
51 | */
52 | public function getRawBody()
53 | {
54 | return $this->payload;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-migration/phinx/src/Phinx/Migration/IrreversibleMigrationException.php:
--------------------------------------------------------------------------------
1 |
36 | */
37 | class IrreversibleMigrationException extends \Exception
38 | {
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/topthink/think-helper/src/hash/Bcrypt.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | namespace think\helper\hash;
12 |
13 | class Bcrypt
14 | {
15 |
16 | /**
17 | * Default crypt cost factor.
18 | *
19 | * @var int
20 | */
21 | protected $rounds = 10;
22 |
23 | public function make($value, array $options = [])
24 | {
25 | $cost = isset($options['rounds']) ? $options['rounds'] : $this->rounds;
26 |
27 | $hash = password_hash($value, PASSWORD_BCRYPT, ['cost' => $cost]);
28 |
29 | if ($hash === false) {
30 | throw new \RuntimeException('Bcrypt hashing not supported.');
31 | }
32 |
33 | return $hash;
34 | }
35 |
36 | public function check($value, $hashedValue, array $options = [])
37 | {
38 | if (strlen($hashedValue) === 0) {
39 | return false;
40 | }
41 |
42 | return password_verify($value, $hashedValue);
43 | }
44 |
45 | public function setRounds($rounds)
46 | {
47 | $this->rounds = (int)$rounds;
48 |
49 | return $this;
50 | }
51 | }
--------------------------------------------------------------------------------
/vendor/workerman/workerman/Protocols/Frame.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright walkor
11 | * @link http://www.workerman.net/
12 | * @license http://www.opensource.org/licenses/mit-license.php MIT License
13 | */
14 | namespace Workerman\Protocols;
15 |
16 | use Workerman\Connection\TcpConnection;
17 |
18 | /**
19 | * Frame Protocol.
20 | */
21 | class Frame
22 | {
23 | /**
24 | * Check the integrity of the package.
25 | *
26 | * @param string $buffer
27 | * @param TcpConnection $connection
28 | * @return int
29 | */
30 | public static function input($buffer, TcpConnection $connection)
31 | {
32 | if (strlen($buffer) < 4) {
33 | return 0;
34 | }
35 | $unpack_data = unpack('Ntotal_length', $buffer);
36 | return $unpack_data['total_length'];
37 | }
38 |
39 | /**
40 | * Decode.
41 | *
42 | * @param string $buffer
43 | * @return string
44 | */
45 | public static function decode($buffer)
46 | {
47 | return substr($buffer, 4);
48 | }
49 |
50 | /**
51 | * Encode.
52 | *
53 | * @param string $buffer
54 | * @return string
55 | */
56 | public static function encode($buffer)
57 | {
58 | $total_length = 4 + strlen($buffer);
59 | return pack('N', $total_length) . $buffer;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/thinkphp/library/think/console/command/make/stubs/controller.stub:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/queue/connector/Sync.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\queue\connector;
13 |
14 | use Exception;
15 | use think\queue\Connector;
16 | use think\queue\job\Sync as SyncJob;
17 | use Throwable;
18 |
19 | class Sync extends Connector
20 | {
21 |
22 | public function push($job, $data = '', $queue = null)
23 | {
24 | $queueJob = $this->resolveJob($this->createPayload($job, $data, $queue));
25 |
26 | try {
27 | set_time_limit(0);
28 | $queueJob->fire();
29 | } catch (Exception $e) {
30 | $queueJob->failed();
31 |
32 | throw $e;
33 | } catch (Throwable $e) {
34 | $queueJob->failed();
35 |
36 | throw $e;
37 | }
38 |
39 | return 0;
40 | }
41 |
42 | public function later($delay, $job, $data = '', $queue = null)
43 | {
44 | return $this->push($job, $data, $queue);
45 | }
46 |
47 | public function pop($queue = null)
48 | {
49 |
50 | }
51 |
52 | protected function resolveJob($payload)
53 | {
54 | return new SyncJob($payload);
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/thinkphp/library/think/Exception.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think;
13 |
14 | class Exception extends \Exception
15 | {
16 | /**
17 | * @var array 保存异常页面显示的额外 Debug 数据
18 | */
19 | protected $data = [];
20 |
21 | /**
22 | * 设置异常额外的 Debug 数据
23 | * 数据将会显示为下面的格式
24 | *
25 | * Exception Data
26 | * --------------------------------------------------
27 | * Label 1
28 | * key1 value1
29 | * key2 value2
30 | * Label 2
31 | * key1 value1
32 | * key2 value2
33 | *
34 | * @access protected
35 | * @param string $label 数据分类,用于异常页面显示
36 | * @param array $data 需要显示的数据,必须为关联数组
37 | * @return void
38 | */
39 | final protected function setData($label, array $data)
40 | {
41 | $this->data[$label] = $data;
42 | }
43 |
44 | /**
45 | * 获取异常额外 Debug 数据
46 | * 主要用于输出到异常页面便于调试
47 | * @access public
48 | * @return array
49 | */
50 | final public function getData()
51 | {
52 | return $this->data;
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/vendor/topthink/think-helper/src/Hash.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\helper;
13 |
14 |
15 | class Hash
16 | {
17 | protected static $handle = [];
18 |
19 | public static function make($value, $type = null, array $options = [])
20 | {
21 | return self::handle($type)->make($value, $options);
22 | }
23 |
24 | public static function check($value, $hashedValue, $type = null, array $options = [])
25 | {
26 | return self::handle($type)->check($value, $hashedValue, $options);
27 | }
28 |
29 | public static function handle($type)
30 | {
31 | if (is_null($type)) {
32 | if (PHP_VERSION_ID >= 50500) {
33 | $type = 'bcrypt';
34 | } else {
35 | $type = 'md5';
36 | }
37 | }
38 | if (empty(self::$handle[$type])) {
39 | $class = "\\think\\helper\\hash\\" . ucfirst($type);
40 | if (!class_exists($class)) {
41 | throw new \ErrorException("Not found {$type} hash type!");
42 | }
43 | self::$handle[$type] = new $class();
44 | }
45 | return self::$handle[$type];
46 | }
47 |
48 | }
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/Queue.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think;
13 |
14 | use think\helper\Str;
15 | use think\queue\Connector;
16 |
17 | /**
18 | * Class Queue
19 | * @package think\queue
20 | *
21 | * @method static push($job, $data = '', $queue = null)
22 | * @method static later($delay, $job, $data = '', $queue = null)
23 | * @method static pop($queue = null)
24 | * @method static marshal()
25 | */
26 | class Queue
27 | {
28 | /** @var Connector */
29 | protected static $connector;
30 |
31 | private static function buildConnector()
32 | {
33 | $options = Config::get('queue');
34 | $type = !empty($options['connector']) ? $options['connector'] : 'Sync';
35 |
36 | if (!isset(self::$connector)) {
37 |
38 | $class = false !== strpos($type, '\\') ? $type : '\\think\\queue\\connector\\' . Str::studly($type);
39 |
40 | self::$connector = new $class($options);
41 | }
42 | return self::$connector;
43 | }
44 |
45 | public static function __callStatic($name, $arguments)
46 | {
47 | return call_user_func_array([self::buildConnector(), $name], $arguments);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/application/admin/controller/Login.php:
--------------------------------------------------------------------------------
1 | fetch();
17 | }
18 |
19 |
20 | //请求
21 |
22 | public function dulogin(){
23 | if(session('admin')){
24 | header('Location: /setting_bot');
25 | exit;
26 | }
27 |
28 |
29 | $name=trim(input('post.name'));
30 | $password=trim(input('post.password'));
31 | $vfe=trim(input('post.vfe'));
32 |
33 | if(!$name){
34 | exit(json_encode(array('code'=>1,'msg'=>'用户名为空')));
35 | }
36 | if(!$password){
37 | exit(json_encode(array('code'=>1,'msg'=>'密码为空')));
38 | }
39 | //判断验证码是否正确
40 | if(!captcha_check($vfe)){
41 | exit(json_encode(array('code'=>1,'msg'=>'验证码错误')));
42 | }
43 |
44 | $admin=Db::table('admin')->where(array('name'=>$name))->find();
45 |
46 | if(!$admin){
47 | exit(json_encode(array('code'=>1,'msg'=>'用户名或密码错误')));
48 | }
49 |
50 | if($admin['password'] != md5($password)){
51 | exit(json_encode(array('code'=>1,'msg'=>'用户名或密码错误')));
52 | }
53 |
54 | session('admin',$admin);
55 | exit(json_encode(array('code'=>0,'msg'=>'登录成功')));
56 |
57 |
58 | }
59 |
60 | //退出登录
61 | public function outlogin(){
62 | session('admin', null);
63 | return'退出成功';
64 | }
65 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/thinkphp/library/traits/think/Instance.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace traits\think;
13 |
14 | use think\Exception;
15 |
16 | trait Instance
17 | {
18 | /**
19 | * @var null|static 实例对象
20 | */
21 | protected static $instance = null;
22 |
23 | /**
24 | * 获取示例
25 | * @param array $options 实例配置
26 | * @return static
27 | */
28 | public static function instance($options = [])
29 | {
30 | if (is_null(self::$instance)) self::$instance = new self($options);
31 |
32 | return self::$instance;
33 | }
34 |
35 | /**
36 | * 静态调用
37 | * @param string $method 调用方法
38 | * @param array $params 调用参数
39 | * @return mixed
40 | * @throws Exception
41 | */
42 | public static function __callStatic($method, array $params)
43 | {
44 | if (is_null(self::$instance)) self::$instance = new self();
45 |
46 | $call = substr($method, 1);
47 |
48 | if (0 !== strpos($method, '_') || !is_callable([self::$instance, $call])) {
49 | throw new Exception("method not exists:" . $method);
50 | }
51 |
52 | return call_user_func_array([self::$instance, $call], $params);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/topthink/think-worker/src/Server.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\worker;
13 |
14 | use Workerman\Worker;
15 |
16 | /**
17 | * Worker控制器扩展类
18 | */
19 | abstract class Server
20 | {
21 | protected $worker;
22 | protected $socket = '';
23 | protected $protocol = 'http';
24 | protected $host = '0.0.0.0';
25 | protected $port = '2346';
26 | protected $processes = 4;
27 |
28 | /**
29 | * 架构函数
30 | * @access public
31 | */
32 | public function __construct()
33 | {
34 | // 实例化 Websocket 服务
35 | $this->worker = new Worker($this->socket ?: $this->protocol . '://' . $this->host . ':' . $this->port);
36 | // 设置进程数
37 | $this->worker->count = $this->processes;
38 | // 初始化
39 | $this->init();
40 |
41 | // 设置回调
42 | foreach (['onWorkerStart', 'onConnect', 'onMessage', 'onClose', 'onError', 'onBufferFull', 'onBufferDrain', 'onWorkerStop', 'onWorkerReload'] as $event) {
43 | if (method_exists($this, $event)) {
44 | $this->worker->$event = [$this, $event];
45 | }
46 | }
47 | // Run worker
48 | Worker::runAll();
49 | }
50 |
51 | protected function init()
52 | {
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/vendor/workerman/workerman/Protocols/ProtocolInterface.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright walkor
11 | * @link http://www.workerman.net/
12 | * @license http://www.opensource.org/licenses/mit-license.php MIT License
13 | */
14 | namespace Workerman\Protocols;
15 |
16 | use Workerman\Connection\ConnectionInterface;
17 |
18 | /**
19 | * Protocol interface
20 | */
21 | interface ProtocolInterface
22 | {
23 | /**
24 | * Check the integrity of the package.
25 | * Please return the length of package.
26 | * If length is unknow please return 0 that mean wating more data.
27 | * If the package has something wrong please return false the connection will be closed.
28 | *
29 | * @param ConnectionInterface $connection
30 | * @param string $recv_buffer
31 | * @return int|false
32 | */
33 | public static function input($recv_buffer, ConnectionInterface $connection);
34 |
35 | /**
36 | * Decode package and emit onMessage($message) callback, $message is the result that decode returned.
37 | *
38 | * @param ConnectionInterface $connection
39 | * @param string $recv_buffer
40 | * @return mixed
41 | */
42 | public static function decode($recv_buffer, ConnectionInterface $connection);
43 |
44 | /**
45 | * Encode package brefore sending to client.
46 | *
47 | * @param ConnectionInterface $connection
48 | * @param mixed $data
49 | * @return string
50 | */
51 | public static function encode($data, ConnectionInterface $connection);
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 |
--------------------------------------------------------------------------------
/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 '
';
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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/WaterTest.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | namespace tests;
12 |
13 | use think\Image;
14 |
15 | class WaterTest extends TestCase
16 | {
17 | public function testJpeg()
18 | {
19 | $pathname = TEST_PATH . 'tmp/water.jpg';
20 | $image = Image::open($this->getJpeg());
21 |
22 | $image->water(TEST_PATH . 'images/test.gif')->save($pathname);
23 |
24 | $file = new \SplFileInfo($pathname);
25 |
26 | $this->assertTrue($file->isFile());
27 |
28 | @unlink($pathname);
29 | }
30 |
31 | public function testPng()
32 | {
33 | $pathname = TEST_PATH . 'tmp/water.png';
34 | $image = Image::open($this->getPng());
35 |
36 | $image->water(TEST_PATH . 'images/test.gif')->save($pathname);
37 |
38 | $file = new \SplFileInfo($pathname);
39 |
40 | $this->assertTrue($file->isFile());
41 |
42 | @unlink($pathname);
43 | }
44 |
45 | public function testGif()
46 | {
47 | $pathname = TEST_PATH . 'tmp/water.gif';
48 | $image = Image::open($this->getGif());
49 |
50 | $image->water(TEST_PATH . 'images/test.jpg')->save($pathname);
51 |
52 | $file = new \SplFileInfo($pathname);
53 |
54 | $this->assertTrue($file->isFile());
55 |
56 | @unlink($pathname);
57 | }
58 | }
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/TextTest.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | namespace tests;
12 |
13 | use think\Image;
14 |
15 | class TextTest extends TestCase
16 | {
17 | public function testJpeg()
18 | {
19 | $pathname = TEST_PATH . 'tmp/text.jpg';
20 | $image = Image::open($this->getJpeg());
21 |
22 | $image->text('test', TEST_PATH . 'images/test.ttf', 12)->save($pathname);
23 |
24 | $file = new \SplFileInfo($pathname);
25 |
26 | $this->assertTrue($file->isFile());
27 |
28 | @unlink($pathname);
29 | }
30 |
31 | public function testPng()
32 | {
33 | $pathname = TEST_PATH . 'tmp/text.png';
34 | $image = Image::open($this->getPng());
35 |
36 | $image->text('test', TEST_PATH . 'images/test.ttf', 12)->save($pathname);
37 |
38 | $file = new \SplFileInfo($pathname);
39 |
40 | $this->assertTrue($file->isFile());
41 |
42 | @unlink($pathname);
43 | }
44 |
45 | public function testGif()
46 | {
47 | $pathname = TEST_PATH . 'tmp/text.gif';
48 | $image = Image::open($this->getGif());
49 |
50 | $image->text('test', TEST_PATH . 'images/test.ttf', 12)->save($pathname);
51 |
52 | $file = new \SplFileInfo($pathname);
53 |
54 | $this->assertTrue($file->isFile());
55 |
56 | @unlink($pathname);
57 | }
58 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/queue/command/Subscribe.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\queue\command;
13 |
14 | use think\console\Command;
15 | use think\console\Input;
16 | use think\console\input\Argument;
17 | use think\console\input\Option;
18 | use think\console\Output;
19 | use think\Queue;
20 | use think\Url;
21 |
22 | class Subscribe extends Command
23 | {
24 | public function configure()
25 | {
26 | $this->setName('queue:subscribe')
27 | ->setDescription('Subscribe a URL to an push queue')
28 | ->addArgument('name', Argument::REQUIRED, 'name')
29 | ->addArgument('url', Argument::REQUIRED, 'The URL to be subscribed.')
30 | ->addArgument('queue', Argument::OPTIONAL, 'The URL to be subscribed.')
31 | ->addOption('option', null, Option::VALUE_IS_ARRAY | Option::VALUE_OPTIONAL, 'the options');
32 | }
33 |
34 | public function execute(Input $input, Output $output)
35 | {
36 |
37 | $url = $input->getArgument('url');
38 | if (!preg_match('/^https?:\/\//', $url)) {
39 | $url = Url::build($url);
40 | }
41 |
42 | Queue::subscribe($input->getArgument('name'), $url, $input->getArgument('queue'), $input->getOption('option'));
43 |
44 | $output->write('Queue subscriber added: ' . $input->getArgument('url') . '');
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/workerman/workerman/Protocols/Text.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright walkor
11 | * @link http://www.workerman.net/
12 | * @license http://www.opensource.org/licenses/mit-license.php MIT License
13 | */
14 | namespace Workerman\Protocols;
15 |
16 | use Workerman\Connection\TcpConnection;
17 |
18 | /**
19 | * Text Protocol.
20 | */
21 | class Text
22 | {
23 | /**
24 | * Check the integrity of the package.
25 | *
26 | * @param string $buffer
27 | * @param TcpConnection $connection
28 | * @return int
29 | */
30 | public static function input($buffer, TcpConnection $connection)
31 | {
32 | // Judge whether the package length exceeds the limit.
33 | if (strlen($buffer) >= $connection::$maxPackageSize) {
34 | $connection->close();
35 | return 0;
36 | }
37 | // Find the position of "\n".
38 | $pos = strpos($buffer, "\n");
39 | // No "\n", packet length is unknown, continue to wait for the data so return 0.
40 | if ($pos === false) {
41 | return 0;
42 | }
43 | // Return the current package length.
44 | return $pos + 1;
45 | }
46 |
47 | /**
48 | * Encode.
49 | *
50 | * @param string $buffer
51 | * @return string
52 | */
53 | public static function encode($buffer)
54 | {
55 | // Add "\n"
56 | return $buffer . "\n";
57 | }
58 |
59 | /**
60 | * Decode.
61 | *
62 | * @param string $buffer
63 | * @return string
64 | */
65 | public static function decode($buffer)
66 | {
67 | // Remove "\n"
68 | return trim($buffer);
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/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/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/workerman/workerman/Autoloader.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright walkor
11 | * @link http://www.workerman.net/
12 | * @license http://www.opensource.org/licenses/mit-license.php MIT License
13 | */
14 | namespace Workerman;
15 |
16 | /**
17 | * Autoload.
18 | */
19 | class Autoloader
20 | {
21 | /**
22 | * Autoload root path.
23 | *
24 | * @var string
25 | */
26 | protected static $_autoloadRootPath = '';
27 |
28 | /**
29 | * Set autoload root path.
30 | *
31 | * @param string $root_path
32 | * @return void
33 | */
34 | public static function setRootPath($root_path)
35 | {
36 | self::$_autoloadRootPath = $root_path;
37 | }
38 |
39 | /**
40 | * Load files by namespace.
41 | *
42 | * @param string $name
43 | * @return boolean
44 | */
45 | public static function loadByNamespace($name)
46 | {
47 | $class_path = str_replace('\\', DIRECTORY_SEPARATOR, $name);
48 | if (strpos($name, 'Workerman\\') === 0) {
49 | $class_file = __DIR__ . substr($class_path, strlen('Workerman')) . '.php';
50 | } else {
51 | if (self::$_autoloadRootPath) {
52 | $class_file = self::$_autoloadRootPath . DIRECTORY_SEPARATOR . $class_path . '.php';
53 | }
54 | if (empty($class_file) || !is_file($class_file)) {
55 | $class_file = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . "$class_path.php";
56 | }
57 | }
58 |
59 | if (is_file($class_file)) {
60 | require_once($class_file);
61 | if (class_exists($name, false)) {
62 | return true;
63 | }
64 | }
65 | return false;
66 | }
67 | }
68 |
69 | spl_autoload_register('\Workerman\Autoloader::loadByNamespace');
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-installer/src/ThinkFramework.php:
--------------------------------------------------------------------------------
1 | composer->getPackage()->getType() == 'project' && $package->getInstallationSource() != 'source') {
15 | //remove tests dir
16 | $this->filesystem->removeDirectory($this->getInstallPath($package) . DIRECTORY_SEPARATOR . 'tests');
17 | }
18 | }
19 |
20 | /**
21 | * {@inheritDoc}
22 | */
23 | public function getInstallPath(PackageInterface $package)
24 | {
25 | if ('topthink/framework' !== $package->getPrettyName()) {
26 | throw new \InvalidArgumentException('Unable to install this library!');
27 | }
28 |
29 | if ($this->composer->getPackage()->getType() !== 'project') {
30 | return parent::getInstallPath($package);
31 | }
32 |
33 | if ($this->composer->getPackage()) {
34 | $extra = $this->composer->getPackage()->getExtra();
35 | if (!empty($extra['think-path'])) {
36 | return $extra['think-path'];
37 | }
38 | }
39 |
40 | return 'thinkphp';
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' && $target->getInstallationSource() != 'source') {
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 | }
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-migration/phinx/src/Phinx/Db/Adapter/WrapperInterface.php:
--------------------------------------------------------------------------------
1 |
35 | */
36 | interface WrapperInterface
37 | {
38 | /**
39 | * Class constructor, must always wrap another adapter.
40 | *
41 | * @param AdapterInterface $adapter
42 | */
43 | public function __construct(AdapterInterface $adapter);
44 |
45 | /**
46 | * Sets the database adapter to proxy commands to.
47 | *
48 | * @param AdapterInterface $adapter
49 | * @return AdapterInterface
50 | */
51 | public function setAdapter(AdapterInterface $adapter);
52 |
53 | /**
54 | * Gets the database adapter.
55 | *
56 | * @throws \RuntimeException if the adapter has not been set
57 | * @return AdapterInterface
58 | */
59 | public function getAdapter();
60 | }
61 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/CropTest.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | namespace tests;
12 |
13 | use think\Image;
14 |
15 | class CropTest extends TestCase
16 | {
17 | public function testJpeg()
18 | {
19 | $pathname = TEST_PATH . 'tmp/crop.jpg';
20 | $image = Image::open($this->getJpeg());
21 |
22 | $image->crop(200, 200, 100, 100, 300, 300)->save($pathname);
23 |
24 | $this->assertEquals(300, $image->width());
25 | $this->assertEquals(300, $image->height());
26 |
27 | $file = new \SplFileInfo($pathname);
28 |
29 | $this->assertTrue($file->isFile());
30 |
31 | @unlink($pathname);
32 | }
33 |
34 | public function testPng()
35 | {
36 | $pathname = TEST_PATH . 'tmp/crop.png';
37 | $image = Image::open($this->getPng());
38 |
39 | $image->crop(200, 200, 100, 100, 300, 300)->save($pathname);
40 |
41 | $this->assertEquals(300, $image->width());
42 | $this->assertEquals(300, $image->height());
43 |
44 | $file = new \SplFileInfo($pathname);
45 |
46 | $this->assertTrue($file->isFile());
47 |
48 | @unlink($pathname);
49 | }
50 |
51 | public function testGif()
52 | {
53 | $pathname = TEST_PATH . 'tmp/crop.gif';
54 | $image = Image::open($this->getGif());
55 |
56 | $image->crop(200, 200, 100, 100, 300, 300)->save($pathname);
57 |
58 | $this->assertEquals(300, $image->width());
59 | $this->assertEquals(300, $image->height());
60 |
61 | $file = new \SplFileInfo($pathname);
62 |
63 | $this->assertTrue($file->isFile());
64 |
65 | @unlink($pathname);
66 | }
67 | }
--------------------------------------------------------------------------------
/vendor/topthink/think-image/tests/InfoTest.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | namespace tests;
12 |
13 | use think\Image;
14 |
15 | class InfoTest extends TestCase
16 | {
17 |
18 | public function testOpen()
19 | {
20 | $this->setExpectedException("\\think\\image\\Exception");
21 | Image::open('');
22 | }
23 |
24 | public function testIllegal()
25 | {
26 | $this->setExpectedException("\\think\\image\\Exception", 'Illegal image file');
27 | Image::open(TEST_PATH . 'images/test.bmp');
28 | }
29 |
30 | public function testJpeg()
31 | {
32 | $image = Image::open($this->getJpeg());
33 | $this->assertEquals(800, $image->width());
34 | $this->assertEquals(600, $image->height());
35 | $this->assertEquals('jpeg', $image->type());
36 | $this->assertEquals('image/jpeg', $image->mime());
37 | $this->assertEquals([800, 600], $image->size());
38 | }
39 |
40 |
41 | public function testPng()
42 | {
43 | $image = Image::open($this->getPng());
44 | $this->assertEquals(800, $image->width());
45 | $this->assertEquals(600, $image->height());
46 | $this->assertEquals('png', $image->type());
47 | $this->assertEquals('image/png', $image->mime());
48 | $this->assertEquals([800, 600], $image->size());
49 | }
50 |
51 | public function testGif()
52 | {
53 | $image = Image::open($this->getGif());
54 | $this->assertEquals(380, $image->width());
55 | $this->assertEquals(216, $image->height());
56 | $this->assertEquals('gif', $image->type());
57 | $this->assertEquals('image/gif', $image->mime());
58 | $this->assertEquals([380, 216], $image->size());
59 | }
60 | }
--------------------------------------------------------------------------------
/thinkphp/tpl/dispatch_jump.tpl:
--------------------------------------------------------------------------------
1 | {__NOLAYOUT__}
2 |
3 |
4 |
5 |
6 | 跳转提示
7 |
17 |
18 |
19 |
20 |
21 |
22 |
:)
23 |
24 |
25 |
26 |
:(
27 |
28 |
29 |
30 |
31 |
32 | 页面自动 跳转 等待时间:
33 |
34 |
35 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/thinkphp/library/think/console/command/Clear.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | namespace think\console\command;
12 |
13 | use think\Cache;
14 | use think\console\Command;
15 | use think\console\Input;
16 | use think\console\input\Argument;
17 | use think\console\input\Option;
18 | use think\console\Output;
19 |
20 | class Clear extends Command
21 | {
22 | protected function configure()
23 | {
24 | // 指令配置
25 | $this
26 | ->setName('clear')
27 | ->addArgument('type', Argument::OPTIONAL, 'type to clear', null)
28 | ->addOption('path', 'd', Option::VALUE_OPTIONAL, 'path to clear', null)
29 | ->setDescription('Clear runtime file');
30 | }
31 |
32 | protected function execute(Input $input, Output $output)
33 | {
34 | $path = $input->getOption('path') ?: RUNTIME_PATH;
35 |
36 | $type = $input->getArgument('type');
37 |
38 | if ($type == 'route') {
39 | Cache::clear('route_check');
40 | } else {
41 | if (is_dir($path)) {
42 | $this->clearPath($path);
43 | }
44 | }
45 |
46 | $output->writeln("Clear Successed");
47 | }
48 |
49 | protected function clearPath($path)
50 | {
51 | $path = realpath($path) . DS;
52 | $files = scandir($path);
53 | if ($files) {
54 | foreach ($files as $file) {
55 | if ('.' != $file && '..' != $file && is_dir($path . $file)) {
56 | $this->clearPath($path . $file);
57 | } elseif ('.gitignore' != $file && is_file($path . $file)) {
58 | unlink($path . $file);
59 | }
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/public/static/login/js/html5.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 作者:qq32579135
3 | * 开发时间:2020年10月份
4 | * 开发周期:一个月
5 | * **/
6 | (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
7 | a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x";
8 | c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
9 | "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
10 | if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d
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 | }
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/queue/job/Topthink.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 |
12 | namespace think\queue\job;
13 |
14 | use think\queue\Job;
15 | use think\queue\connector\Topthink as TopthinkQueue;
16 |
17 | class Topthink extends Job
18 | {
19 |
20 | /**
21 | * The Iron queue instance.
22 | *
23 | * @var TopthinkQueue
24 | */
25 | protected $topthink;
26 |
27 | /**
28 | * The IronMQ message instance.
29 | *
30 | * @var object
31 | */
32 | protected $job;
33 |
34 | public function __construct(TopthinkQueue $topthink, $job, $queue)
35 | {
36 | $this->topthink = $topthink;
37 | $this->job = $job;
38 | $this->queue = $queue;
39 | $this->job->attempts = $this->job->attempts + 1;
40 | }
41 |
42 | /**
43 | * Fire the job.
44 | * @return void
45 | */
46 | public function fire()
47 | {
48 | $this->resolveAndFire(json_decode($this->job->payload, true));
49 | }
50 |
51 | /**
52 | * Get the number of times the job has been attempted.
53 | * @return int
54 | */
55 | public function attempts()
56 | {
57 | return (int) $this->job->attempts;
58 | }
59 |
60 | public function delete()
61 | {
62 | parent::delete();
63 |
64 | $this->topthink->deleteMessage($this->queue, $this->job->id);
65 | }
66 |
67 | public function release($delay = 0)
68 | {
69 | parent::release($delay);
70 |
71 | $this->delete();
72 |
73 | $this->topthink->release($this->queue, $this->job, $delay);
74 | }
75 |
76 | /**
77 | * Get the raw body string for the job.
78 | * @return string
79 | */
80 | public function getRawBody()
81 | {
82 | return $this->job->payload;
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/vendor/workerman/workerman/Events/EventInterface.php:
--------------------------------------------------------------------------------
1 |
10 | * @copyright walkor
11 | * @link http://www.workerman.net/
12 | * @license http://www.opensource.org/licenses/mit-license.php MIT License
13 | */
14 | namespace Workerman\Events;
15 |
16 | interface EventInterface
17 | {
18 | /**
19 | * Read event.
20 | *
21 | * @var int
22 | */
23 | const EV_READ = 1;
24 |
25 | /**
26 | * Write event.
27 | *
28 | * @var int
29 | */
30 | const EV_WRITE = 2;
31 |
32 | /**
33 | * Except event
34 | *
35 | * @var int
36 | */
37 | const EV_EXCEPT = 3;
38 |
39 | /**
40 | * Signal event.
41 | *
42 | * @var int
43 | */
44 | const EV_SIGNAL = 4;
45 |
46 | /**
47 | * Timer event.
48 | *
49 | * @var int
50 | */
51 | const EV_TIMER = 8;
52 |
53 | /**
54 | * Timer once event.
55 | *
56 | * @var int
57 | */
58 | const EV_TIMER_ONCE = 16;
59 |
60 | /**
61 | * Add event listener to event loop.
62 | *
63 | * @param mixed $fd
64 | * @param int $flag
65 | * @param callable $func
66 | * @param mixed $args
67 | * @return bool
68 | */
69 | public function add($fd, $flag, $func, $args = null);
70 |
71 | /**
72 | * Remove event listener from event loop.
73 | *
74 | * @param mixed $fd
75 | * @param int $flag
76 | * @return bool
77 | */
78 | public function del($fd, $flag);
79 |
80 | /**
81 | * Remove all timers.
82 | *
83 | * @return void
84 | */
85 | public function clearAllTimer();
86 |
87 | /**
88 | * Main loop.
89 | *
90 | * @return void
91 | */
92 | public function loop();
93 |
94 | /**
95 | * Destroy loop.
96 | *
97 | * @return mixed
98 | */
99 | public function destroy();
100 |
101 | /**
102 | * Get Timer count.
103 | *
104 | * @return mixed
105 | */
106 | public function getTimerCount();
107 | }
108 |
--------------------------------------------------------------------------------
/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 | protected $cacheFile;
19 |
20 | /**
21 | * 写入编译缓存
22 | * @param string $cacheFile 缓存的文件名
23 | * @param string $content 缓存的内容
24 | * @return void|array
25 | */
26 | public function write($cacheFile, $content)
27 | {
28 | // 检测模板目录
29 | $dir = dirname($cacheFile);
30 | if (!is_dir($dir)) {
31 | mkdir($dir, 0755, true);
32 | }
33 | // 生成模板缓存文件
34 | if (false === file_put_contents($cacheFile, $content)) {
35 | throw new Exception('cache write error:' . $cacheFile, 11602);
36 | }
37 | }
38 |
39 | /**
40 | * 读取编译编译
41 | * @param string $cacheFile 缓存的文件名
42 | * @param array $vars 变量数组
43 | * @return void
44 | */
45 | public function read($cacheFile, $vars = [])
46 | {
47 | $this->cacheFile = $cacheFile;
48 | if (!empty($vars) && is_array($vars)) {
49 | // 模板阵列变量分解成为独立变量
50 | extract($vars, EXTR_OVERWRITE);
51 | }
52 | //载入模版缓存文件
53 | include $this->cacheFile;
54 | }
55 |
56 | /**
57 | * 检查编译缓存是否有效
58 | * @param string $cacheFile 缓存的文件名
59 | * @param int $cacheTime 缓存时间
60 | * @return boolean
61 | */
62 | public function check($cacheFile, $cacheTime)
63 | {
64 | // 缓存文件不存在, 直接返回false
65 | if (!file_exists($cacheFile)) {
66 | return false;
67 | }
68 | if (0 != $cacheTime && $_SERVER['REQUEST_TIME'] > filemtime($cacheFile) + $cacheTime) {
69 | // 缓存是否在有效期
70 | return false;
71 | }
72 | return true;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/vendor/topthink/think-queue/src/queue/job/Database.php:
--------------------------------------------------------------------------------
1 |
10 | // +----------------------------------------------------------------------
11 | namespace think\queue\job;
12 |
13 | use think\queue\Job;
14 | use think\queue\connector\Database as DatabaseQueue;
15 |
16 | class Database extends Job
17 | {
18 | /**
19 | * The database queue instance.
20 | * @var DatabaseQueue
21 | */
22 | protected $database;
23 |
24 | /**
25 | * The database job payload.
26 | * @var Object
27 | */
28 | protected $job;
29 |
30 | public function __construct(DatabaseQueue $database, $job, $queue)
31 | {
32 | $this->job = $job;
33 | $this->queue = $queue;
34 | $this->database = $database;
35 | $this->job->attempts = $this->job->attempts + 1;
36 | }
37 |
38 | /**
39 | * 执行任务
40 | * @return void
41 | */
42 | public function fire()
43 | {
44 | $this->resolveAndFire(json_decode($this->job->payload, true));
45 | }
46 |
47 | /**
48 | * 删除任务
49 | * @return void
50 | */
51 | public function delete()
52 | {
53 | parent::delete();
54 | $this->database->deleteReserved($this->job->id);
55 | }
56 |
57 | /**
58 | * 重新发布任务
59 | * @param int $delay
60 | * @return void
61 | */
62 | public function release($delay = 0)
63 | {
64 | parent::release($delay);
65 |
66 | $this->delete();
67 |
68 | $this->database->release($this->queue, $this->job, $delay);
69 | }
70 |
71 | /**
72 | * 获取当前任务尝试次数
73 | * @return int
74 | */
75 | public function attempts()
76 | {
77 | return (int) $this->job->attempts;
78 | }
79 |
80 | /**
81 | * Get the raw body string for the job.
82 | * @return string
83 | */
84 | public function getRawBody()
85 | {
86 | return $this->job->payload;
87 | }
88 | }
89 |
--------------------------------------------------------------------------------