├── extend └── .gitignore ├── 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 │ │ │ │ ├── Clear.php │ │ │ │ ├── Build.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 │ │ │ └── builder │ │ │ │ └── Sqlite.php │ │ ├── model │ │ │ └── Pivot.php │ │ ├── Env.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 ├── composer.json ├── tpl │ ├── default_index.tpl │ └── dispatch_jump.tpl ├── .travis.yml ├── phpunit.xml └── LICENSE.txt ├── application ├── .htaccess ├── convert │ ├── extra │ │ └── convert.lock │ ├── controller │ │ ├── Index.php │ │ └── Base.php │ ├── view │ │ ├── template │ │ │ ├── footer.html │ │ │ └── header.html │ │ ├── index │ │ │ └── index.html │ │ └── wordpress │ │ │ ├── step_2.html │ │ │ ├── step_1.html │ │ │ └── index.html │ ├── validate │ │ └── WordPress.php │ └── model │ │ ├── KurBlog.php │ │ └── WordPress.php ├── admin │ ├── view │ │ ├── setting │ │ │ ├── index.html │ │ │ └── theme.html │ │ ├── template │ │ │ └── footer.html │ │ ├── comment │ │ │ └── edit.html │ │ ├── login │ │ │ └── index.html │ │ ├── page │ │ │ └── index.html │ │ └── article │ │ │ └── index.html │ ├── validate │ │ ├── Setting.php │ │ ├── Login.php │ │ ├── Category.php │ │ ├── Member.php │ │ ├── Link.php │ │ ├── Menu.php │ │ ├── Page.php │ │ └── Article.php │ └── controller │ │ ├── Login.php │ │ └── Base.php ├── extra │ ├── kurblog.php │ └── queue.php ├── common │ └── model │ │ ├── Link.php │ │ ├── Page.php │ │ ├── Member.php │ │ ├── Category.php │ │ ├── Setting.php │ │ ├── Login.php │ │ ├── Article.php │ │ ├── Menu.php │ │ └── RssItem.php ├── install │ ├── view │ │ ├── template │ │ │ ├── footer.html │ │ │ └── header.html │ │ └── index │ │ │ ├── index.html │ │ │ ├── step_4.html │ │ │ └── step_2.html │ ├── validate │ │ ├── Database.php │ │ └── Setting.php │ ├── model │ │ └── Database.php │ └── extra │ │ └── db.config.php ├── index │ ├── validate │ │ └── Comment.php │ └── controller │ │ ├── Index.php │ │ ├── Rss.php │ │ ├── Category.php │ │ └── Page.php ├── common.php ├── command.php ├── tags.php ├── route.php └── database.php ├── public ├── robots.txt ├── static │ ├── upload │ │ └── .gitignore │ ├── admin │ │ ├── css │ │ │ ├── article.css │ │ │ ├── page.css │ │ │ ├── common.css │ │ │ ├── link.css │ │ │ ├── category.css │ │ │ ├── home.css │ │ │ ├── comment.css │ │ │ ├── menu.css │ │ │ ├── write.css │ │ │ ├── setting.css │ │ │ └── theme.css │ │ ├── img │ │ │ ├── loading.gif │ │ │ ├── login_logo.png │ │ │ └── upload_loader.gif │ │ └── js │ │ │ ├── page.js │ │ │ ├── article.js │ │ │ ├── setting.js │ │ │ ├── index.html │ │ │ ├── link.js │ │ │ ├── menu.js │ │ │ └── comment.js │ └── common │ │ └── css │ │ ├── sticky-footer.css │ │ ├── highlight.css │ │ └── dashboard.css ├── .htaccess_PHPStudy ├── theme │ ├── Oreo │ │ ├── images │ │ │ ├── bg.jpg │ │ │ ├── face.jpg │ │ │ ├── face.png │ │ │ └── favicon.png │ │ ├── screenshot.png │ │ ├── css │ │ │ ├── fontico │ │ │ │ ├── iconfont.eot │ │ │ │ ├── iconfont.ttf │ │ │ │ └── iconfont.woff │ │ │ └── main.css │ │ ├── config.php │ │ ├── article-dairy.php │ │ ├── article-twitter.php │ │ ├── index.php │ │ ├── article-images.php │ │ ├── article.php │ │ ├── page │ │ │ └── Index.php │ │ ├── footer.php │ │ ├── comment.php │ │ └── header.php │ └── default │ │ ├── screenshot.png │ │ ├── static │ │ ├── font.woff │ │ ├── script.js │ │ └── comment.js │ │ ├── config.php │ │ ├── footer.php │ │ ├── page │ │ ├── Index.php │ │ └── Link.php │ │ ├── index.php │ │ ├── article.php │ │ ├── comment.php │ │ └── header.php ├── nginx.conf ├── .htaccess ├── router.php ├── web.config └── index.php ├── .gitignore ├── vendor ├── autoload.php ├── composer │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── LICENSE │ └── autoload_real.php ├── nette │ ├── utils │ │ ├── src │ │ │ ├── Utils │ │ │ │ ├── IHtmlString.php │ │ │ │ ├── ITranslator.php │ │ │ │ ├── StaticClass.php │ │ │ │ ├── ArrayHash.php │ │ │ │ └── Random.php │ │ │ └── Iterators │ │ │ │ ├── Mapper.php │ │ │ │ ├── Filter.php │ │ │ │ └── RecursiveFilter.php │ │ ├── composer.json │ │ └── contributing.md │ └── mail │ │ ├── src │ │ ├── Mail │ │ │ ├── IMailer.php │ │ │ ├── exceptions.php │ │ │ ├── SendmailMailer.php │ │ │ └── FallbackMailer.php │ │ └── Bridges │ │ │ └── MailDI │ │ │ └── MailExtension.php │ │ ├── composer.json │ │ └── contributing.md ├── topthink │ └── think-installer │ │ ├── composer.json │ │ └── src │ │ ├── Plugin.php │ │ ├── ThinkFramework.php │ │ └── ThinkTesting.php └── erusev │ └── parsedown │ ├── composer.json │ └── LICENSE.txt ├── README.md ├── think ├── composer.json ├── LICENSE.txt └── .travis.yml /extend/.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore -------------------------------------------------------------------------------- /thinkphp/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /application/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /application/convert/extra/convert.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/admin/view/setting/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / -------------------------------------------------------------------------------- /public/static/upload/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | composer.lock 3 | *.log 4 | runtime -------------------------------------------------------------------------------- /public/static/admin/css/article.css: -------------------------------------------------------------------------------- 1 | .table-responsive{ 2 | overflow: inherit; 3 | } -------------------------------------------------------------------------------- /public/static/admin/css/page.css: -------------------------------------------------------------------------------- 1 | .table-responsive{ 2 | overflow: inherit; 3 | } 4 | -------------------------------------------------------------------------------- /thinkphp/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sinkey100/KurBlog/HEAD/thinkphp/logo.png -------------------------------------------------------------------------------- /application/extra/kurblog.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/nginx.conf: -------------------------------------------------------------------------------- 1 | location / { 2 | if (!-e $request_filename) { 3 | rewrite ^(.*)$ /index.php?s=/$1 last; 4 | break; 5 | } 6 | } -------------------------------------------------------------------------------- /public/static/admin/css/link.css: -------------------------------------------------------------------------------- 1 | .cancel{ 2 | display:none; 3 | } 4 | .table-responsive{ 5 | overflow: inherit; 6 | } 7 | table .weight{ 8 | width:50px; 9 | } -------------------------------------------------------------------------------- /application/common/model/Link.php: -------------------------------------------------------------------------------- 1 | 'Oreo', 4 | 'author' => '大雄', 5 | 'author_url' => 'https://199508.com', 6 | 'version' => '1.0', 7 | 'description' => 'Kur默认主题', 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 | -------------------------------------------------------------------------------- /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/theme/default/config.php: -------------------------------------------------------------------------------- 1 | '默认主题', 4 | 'author' => '关关', 5 | 'author_url' => 'https://www.sinkey.cc', 6 | 'version' => '1.0', 7 | 'description' => '这是KurBlog的默认主题' 8 | ]; -------------------------------------------------------------------------------- /application/admin/validate/Login.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/erusev/parsedown'), 10 | ); 11 | -------------------------------------------------------------------------------- /public/theme/Oreo/css/main.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | /* 3 | Copyright (c) 2017 199508.com-nobita. 4 | Theme URL:http://199508.com 5 | Author:nobita 6 | Version:1.0.0 7 | */ 8 | @import url("format.css?ver=2.2"); 9 | /*@import url("oreo-style.css");*/ 10 | @import url("animate.css"); -------------------------------------------------------------------------------- /application/admin/validate/Category.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /public/static/admin/css/comment.css: -------------------------------------------------------------------------------- 1 | .table-responsive{ 2 | overflow: inherit; 3 | } 4 | .avatar{ 5 | width:55px; 6 | border-radius: 50%; 7 | margin-right:8px; 8 | } 9 | .avatar:hover{ 10 | border-radius: 5px; 11 | } 12 | .col_1{ 13 | width:80px; 14 | } 15 | .col_1 span{ 16 | color:red; 17 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | KurBlog 1.1 2 | =============== 3 | 4 | 采用ThinkPHP5内核,环境要求PHP 5.4+ 5 | 6 | 文档将逐步更新,请关注 www.kurblog.com 7 | 8 | ## 安装说明 9 | 10 | 网站运行目录为 ```/public``` 目录,如果条件允许,我们推荐您将网站运行目录设置到```public```目录,这将更安全一些。 11 | 12 | 如果您的空间不允许设置网站运行目录,请拷贝```/public```目录的所有文件,移动到根目录即可。 13 | 14 | ## 开发文档 15 | http://www.kurblog.com/docs/ -------------------------------------------------------------------------------- /public/static/admin/css/menu.css: -------------------------------------------------------------------------------- 1 | .menu-type p{ 2 | font-weight:700; 3 | } 4 | .cancel{ 5 | display:none; 6 | } 7 | .table-responsive{ 8 | overflow: inherit; 9 | } 10 | .parent-menu .title::before{ 11 | content:"---"; 12 | color:#999; 13 | padding-right: 5px; 14 | } 15 | table .weight{ 16 | width:50px; 17 | } -------------------------------------------------------------------------------- /application/convert/view/template/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /application/install/view/template/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /application/convert/validate/WordPress.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/topthink/think-installer/src'), 10 | 'think\\' => array($baseDir . '/thinkphp/library/think'), 11 | ); 12 | -------------------------------------------------------------------------------- /vendor/nette/utils/src/Utils/IHtmlString.php: -------------------------------------------------------------------------------- 1 | '草稿', 13 | 1 => '已发布', 14 | 2 => '加密' 15 | ]; 16 | return $list[$data['status']]; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /application/install/validate/Database.php: -------------------------------------------------------------------------------- 1 | '链接', 13 | 'category' => '文章分类', 14 | 'article' => '文章', 15 | 'page' => '页面' 16 | ]; 17 | return $type[$data['type']]; 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /application/install/validate/Setting.php: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 |

7 |
8 |
9 | 10 |
11 |

12 | EOF 13 |

14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /public/theme/Oreo/article-dairy.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |

4 |
5 |

6 |
7 |
8 |

9 | 10 | 查看全文 11 |

12 |
-------------------------------------------------------------------------------- /application/install/view/index/index.html: -------------------------------------------------------------------------------- 1 | {include file="template/header" /} 2 | 3 | 6 | 7 |
8 |

感谢您选择KurBlog!

9 | 10 | 14 | 15 |
16 | 现在就开始? 17 |
18 | 19 | 20 | {include file="template/footer" /} 21 | -------------------------------------------------------------------------------- /application/convert/controller/Base.php: -------------------------------------------------------------------------------- 1 | lock = APP_PATH.'convert/extra/convert.lock'; 14 | if(file_exists($this->lock)){ 15 | $this->error('如需运行转换程序,请先删除 appliction/convert/extra/convert.lock 文件',NULL,'',60); 16 | return; 17 | } 18 | 19 | } 20 | } -------------------------------------------------------------------------------- /vendor/nette/utils/src/Utils/ITranslator.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 转换到KurBlog 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | -------------------------------------------------------------------------------- /application/install/view/template/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 安装 KurBlog 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | -------------------------------------------------------------------------------- /public/theme/Oreo/article-twitter.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |

7 |
8 |
9 |
10 |
11 |

12 | 13 | 查看全文 14 |

15 |
-------------------------------------------------------------------------------- /application/convert/view/index/index.html: -------------------------------------------------------------------------------- 1 | {include file="template/header" /} 2 | 3 | 6 | 7 |
8 | 现在您的博客可以从WordPress转换到KurBlog了! 9 |

10 | 但是有一些注意事项: 11 |
    12 |
  • 转换程序将会清空您现在的KurBlog的数据,建议您先备份KurBlog的数据库,但不会影响WordPress的数据。
  • 13 |
  • 为了安全起见,转换完成后,请在FTP中及时删除 application\convert目录。
  • 14 |
  • 本工具只会转换文章、页面、分类、链接、评论。
  • 15 |
16 | 17 |
18 | 现在就开始? 19 |
20 | 21 | 22 | {include file="template/footer" /} 23 | -------------------------------------------------------------------------------- /application/install/view/index/step_4.html: -------------------------------------------------------------------------------- 1 | {include file="template/header" /} 2 | 3 | 6 | 7 |
8 |

KurBlog 现在已经安装成功了,请尽情使用吧!

9 | 10 |
    11 |
  • 如果遇到任何使用问题,欢迎您前往 KurBlog 的官网向我们反馈。
  • 12 |
  • 为了安全起见,安装完成后,请在FTP中及时删除 application\install目录。
  • 13 |
14 | 15 |
16 | 访问前台 17 | 前往后台 18 |
19 | 20 | 21 | {include file="template/footer" /} 22 | -------------------------------------------------------------------------------- /application/common.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | // 应用公共文件 13 | -------------------------------------------------------------------------------- /vendor/topthink/think-installer/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "topthink/think-installer", 3 | "type": "composer-plugin", 4 | "require": { 5 | "composer-plugin-api": "^1.0" 6 | }, 7 | "require-dev": { 8 | "composer/composer": "1.0.*@dev" 9 | }, 10 | "license": "Apache-2.0", 11 | "authors": [ 12 | { 13 | "name": "yunwuxin", 14 | "email": "448901948@qq.com" 15 | } 16 | ], 17 | "autoload": { 18 | "psr-4": { 19 | "think\\composer\\": "src" 20 | } 21 | }, 22 | "extra": { 23 | "class": "think\\composer\\Plugin" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /public/theme/default/page/Link.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /application/command.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | return []; 13 | -------------------------------------------------------------------------------- /vendor/erusev/parsedown/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "erusev/parsedown", 3 | "description": "Parser for Markdown.", 4 | "keywords": ["markdown", "parser"], 5 | "homepage": "http://parsedown.org", 6 | "type": "library", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Emanuil Rusev", 11 | "email": "hello@erusev.com", 12 | "homepage": "http://erusev.com" 13 | } 14 | ], 15 | "require": { 16 | "php": ">=5.3.0" 17 | }, 18 | "require-dev": { 19 | "phpunit/phpunit": "^4.8.35" 20 | }, 21 | "autoload": { 22 | "psr-0": {"Parsedown": ""} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/nette/mail/src/Mail/exceptions.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | return [ 13 | 'connector' => 'Sync' 14 | ]; -------------------------------------------------------------------------------- /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/admin/css/write.css: -------------------------------------------------------------------------------- 1 | .col-md-8{ 2 | padding-left:0; 3 | padding-right:30px; 4 | } 5 | .CodeMirror-fullscreen{ 6 | z-index: 1000; 7 | } 8 | .editor-toolbar.fullscreen{ 9 | z-index:1500; 10 | } 11 | .editor-toolbar{ 12 | margin-top:15px; 13 | } 14 | .fullscreen{ 15 | margin-top:0; 16 | } 17 | .description{ 18 | resize: vertical; 19 | } 20 | .draft{ 21 | margin-left:10px; 22 | } 23 | label{ 24 | font-weight: 400; 25 | } 26 | #category .panel-body{ 27 | padding-top:3px; 28 | padding-bottom:3px 29 | } 30 | .more{ 31 | margin-bottom:5px; 32 | margin-top:-5px; 33 | } 34 | #more{ 35 | display:none; 36 | } 37 | .thumb-img{ 38 | max-width:100%; 39 | margin-bottom:15px; 40 | } -------------------------------------------------------------------------------- /public/theme/Oreo/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 | 7 | 19 | 20 |
21 | 24 | 25 | -------------------------------------------------------------------------------- /public/static/common/css/sticky-footer.css: -------------------------------------------------------------------------------- 1 | /* Sticky footer styles 2 | -------------------------------------------------- */ 3 | html { 4 | position: relative; 5 | min-height: 100%; 6 | } 7 | body { 8 | /* Margin bottom by footer height */ 9 | margin-bottom: 60px; 10 | } 11 | .footer { 12 | position: absolute; 13 | bottom: 0; 14 | width: 100%; 15 | /* Set the fixed height of the footer here */ 16 | height: 60px; 17 | background-color: #f5f5f5; 18 | } 19 | 20 | 21 | /* Custom page CSS 22 | -------------------------------------------------- */ 23 | /* Not required for template or sticky footer method. */ 24 | 25 | .container { 26 | width: auto; 27 | max-width: 680px; 28 | padding: 0 15px; 29 | } 30 | .container .text-muted { 31 | margin: 20px 0; 32 | } 33 | -------------------------------------------------------------------------------- /vendor/nette/utils/src/Iterators/Mapper.php: -------------------------------------------------------------------------------- 1 | callback = $callback; 26 | } 27 | 28 | 29 | public function current() 30 | { 31 | return call_user_func($this->callback, parent::current(), parent::key()); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /public/theme/Oreo/article-images.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |

4 |
5 |
6 |
7 |
8 |
9 |

10 |
11 |
12 |
13 |
14 |

15 | 16 | 查看全文 17 |

18 |
-------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/nette/utils/src/Utils/StaticClass.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /public/router.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | // $Id$ 12 | 13 | if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["REQUEST_URI"])) { 14 | return false; 15 | } else { 16 | require __DIR__ . "/index.php"; 17 | } 18 | -------------------------------------------------------------------------------- /public/static/admin/js/page.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by sinkey on 2017/6/20. 3 | */ 4 | $(document).ready(function(){ 5 | $(".delete").click(function(){ 6 | var id = $(this).data("id"); 7 | var title = $("#li_"+id+" .title").html(); 8 | if(confirm("您确定要删除 "+title+" 吗?")){ 9 | $.post("/admin/page/api", { 10 | 'action':'delete', 11 | 'id':id 12 | }, function(data){ 13 | var data = $.parseJSON(data); 14 | if(data.err == 0){ 15 | $("#li_"+id).remove(); 16 | alert('删除成功'); 17 | }else{ 18 | alert('删除失败'); 19 | } 20 | }); 21 | }else{ 22 | return false; 23 | } 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /public/static/admin/js/article.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by sinke on 2017/6/19. 3 | */ 4 | $(document).ready(function(){ 5 | $(".delete").click(function(){ 6 | var id = $(this).data("id"); 7 | var title = $("#li_"+id+" .title").html(); 8 | if(confirm("您确定要删除 "+title+" 吗?")){ 9 | $.post("/admin/article/api", { 10 | 'action':'delete', 11 | 'id':id 12 | }, function(data){ 13 | var data = $.parseJSON(data); 14 | if(data.err == 0){ 15 | $("#li_"+id).remove(); 16 | alert('删除成功'); 17 | }else{ 18 | alert('删除失败'); 19 | } 20 | }); 21 | }else{ 22 | return false; 23 | } 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /application/index/controller/Index.php: -------------------------------------------------------------------------------- 1 | _K['setting']['home']); 15 | if ($home->type == 'category') { 16 | //首页显示一个分类 17 | $class = new Category; 18 | return $class->index($home->value); 19 | } else if ($home->type == 'page') { 20 | //首页展示一个页面 21 | $class = new Page; 22 | return $class->index($home->value); 23 | } else { 24 | //首页显示最新文章 25 | $class = new Category; 26 | return $class->index(NULL,$page); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /application/convert/view/wordpress/step_2.html: -------------------------------------------------------------------------------- 1 | {include file="template/header" /} 2 | 3 | 6 | 7 |
8 |

恭喜,转换完成!

9 |
    10 | {volist name="count" id="vo"} 11 |
  • 已转换 {$vo.name}: {$vo.count}
  • 12 | {/volist} 13 |
14 | 15 |
请注意转换后的一些问题: 16 |
    17 |
  • KurBlog程序没有多级分类,且每篇文章仅支持选择一个分类,转换程序只会将文章对应到一个分类,请在转换完成后自行检查。
  • 18 |
  • KurBlog采用MarkDown写作,转换后的文章内容依然是html格式,无法自动转换为Markdown,但在前台仍然可以正常显示。
  • 19 |
  • 您需要将附件、图片移动到KurBlog,通常是将 /wp-content/uploads/目录(目录结构仍需包含 /wp-content/uploads/)移动到 /public/根目录。
  • 20 |
  • 系统设置和用户,不会被转换,需要您自行在后台编辑。
  • 21 |
22 | 23 |
24 | 25 | 26 | 27 | 28 | {include file="template/footer" /} 29 | -------------------------------------------------------------------------------- /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/nette/utils/src/Iterators/Filter.php: -------------------------------------------------------------------------------- 1 | callback = Nette\Utils\Callback::check($callback); 28 | } 29 | 30 | 31 | public function accept() 32 | { 33 | return call_user_func($this->callback, $this->current(), $this->key(), $this); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /thinkphp/library/think/config/driver/Ini.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\config\driver; 13 | 14 | class Ini 15 | { 16 | public function parse($config) 17 | { 18 | if (is_file($config)) { 19 | return parse_ini_file($config, true); 20 | } else { 21 | return parse_ini_string($config, true); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /thinkphp/library/think/config/driver/Json.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\config\driver; 13 | 14 | class Json 15 | { 16 | public function parse($config) 17 | { 18 | if (is_file($config)) { 19 | $config = file_get_contents($config); 20 | } 21 | $result = json_decode($config, true); 22 | return $result; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/nette/utils/src/Iterators/RecursiveFilter.php: -------------------------------------------------------------------------------- 1 | getInnerIterator()->hasChildren(); 28 | } 29 | 30 | 31 | public function getChildren() 32 | { 33 | return new static($this->getInnerIterator()->getChildren(), $this->callback); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /vendor/nette/mail/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nette/mail", 3 | "description": "Nette Mail: Sending E-mails", 4 | "homepage": "https://nette.org", 5 | "license": ["BSD-3-Clause", "GPL-2.0", "GPL-3.0"], 6 | "authors": [ 7 | { 8 | "name": "David Grudl", 9 | "homepage": "https://davidgrudl.com" 10 | }, 11 | { 12 | "name": "Nette Community", 13 | "homepage": "https://nette.org/contributors" 14 | } 15 | ], 16 | "require": { 17 | "php": ">=5.6.0", 18 | "ext-iconv": "*", 19 | "nette/utils": "^2.4 || ~3.0.0" 20 | }, 21 | "require-dev": { 22 | "nette/di": "^2.4 || ~3.0.0", 23 | "nette/tester": "^2.0", 24 | "tracy/tracy": "^2.4" 25 | }, 26 | "conflict": { 27 | "nette/nette": "<2.2" 28 | }, 29 | "suggest": { 30 | "ext-fileinfo": "to detect type of attached files" 31 | }, 32 | "autoload": { 33 | "classmap": ["src/"] 34 | }, 35 | "minimum-stability": "dev", 36 | "extra": { 37 | "branch-alias": { 38 | "dev-master": "2.4-dev" 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /thinkphp/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "topthink/framework", 3 | "description": "the new thinkphp framework", 4 | "type": "think-framework", 5 | "keywords": [ 6 | "framework", 7 | "thinkphp", 8 | "ORM" 9 | ], 10 | "homepage": "http://thinkphp.cn/", 11 | "license": "Apache-2.0", 12 | "authors": [ 13 | { 14 | "name": "liu21st", 15 | "email": "liu21st@gmail.com" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.4.0", 20 | "topthink/think-installer": "~1.0" 21 | }, 22 | "require-dev": { 23 | "phpunit/phpunit": "4.8.*", 24 | "johnkary/phpunit-speedtrap": "^1.0", 25 | "mikey179/vfsStream": "~1.6", 26 | "phploc/phploc": "2.*", 27 | "sebastian/phpcpd": "2.*", 28 | "phpdocumentor/reflection-docblock": "^2.0" 29 | }, 30 | "autoload": { 31 | "psr-4": { 32 | "think\\": "library/think" 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /thinkphp/library/think/log/driver/Test.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\log\driver; 13 | 14 | /** 15 | * 模拟测试输出 16 | */ 17 | class Test 18 | { 19 | /** 20 | * 日志写入接口 21 | * @access public 22 | * @param array $log 日志信息 23 | * @return bool 24 | */ 25 | public function save(array $log = []) 26 | { 27 | return true; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /application/tags.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | // 应用行为扩展定义文件 13 | return [ 14 | // 应用初始化 15 | 'app_init' => [], 16 | // 应用开始 17 | 'app_begin' => [], 18 | // 模块初始化 19 | 'module_init' => [], 20 | // 操作开始执行 21 | 'action_begin' => [], 22 | // 视图内容过滤 23 | 'view_filter' => [], 24 | // 日志写入 25 | 'log_write' => [], 26 | // 应用结束 27 | 'app_end' => [], 28 | ]; 29 | -------------------------------------------------------------------------------- /thinkphp/tpl/default_index.tpl: -------------------------------------------------------------------------------- 1 | *{ padding: 0; margin: 0; } div{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }

:)

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

[ V5.0 版本由 七牛云 独家赞助发布 ]
'; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | // [ 应用入口文件 ] 13 | 14 | if (file_exists(__DIR__ . '/../thinkphp/start.php')) { 15 | // 定义应用目录 16 | define('APP_PATH', __DIR__ . '/../application/'); 17 | // 加载框架引导文件 18 | require __DIR__ . '/../thinkphp/start.php'; 19 | 20 | } else { 21 | // 定义应用目录 22 | define('APP_PATH', __DIR__ . '/application/'); 23 | // 加载框架引导文件 24 | require __DIR__ . '/thinkphp/start.php'; 25 | 26 | } -------------------------------------------------------------------------------- /public/theme/default/index.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |
6 |

7 | 8 |

9 |
10 | 11 | 发表于 12 | 13 |
14 |
15 |
16 |
17 | 18 |
19 |
20 |
21 | 22 |
23 | render(); //输出分页代码 25 | include __THEME__.'/footer.php'; ?> 26 | -------------------------------------------------------------------------------- /public/static/admin/css/setting.css: -------------------------------------------------------------------------------- 1 | .table-responsive{ 2 | overflow: inherit; 3 | } 4 | .form-horizontal{ 5 | margin-top:20px; 6 | } 7 | .value-id{ 8 | margin-top:20px; 9 | } 10 | .comment{ 11 | padding-left:20px; 12 | } 13 | 14 | .bs-callout { 15 | padding: 20px; 16 | margin: 20px 0; 17 | border: 1px solid #eee; 18 | border-left-width: 5px; 19 | border-radius: 3px; 20 | } 21 | .bs-callout h4 { 22 | margin-top: 0; 23 | margin-bottom: 5px; 24 | } 25 | .bs-callout p:last-child { 26 | margin-bottom: 0; 27 | } 28 | .bs-callout code { 29 | border-radius: 3px; 30 | } 31 | 32 | .bs-callout + .bs-callout { 33 | margin-top: -5px; 34 | } 35 | 36 | /* Variations */ 37 | .bs-callout-danger { 38 | border-left-color: #ce4844; 39 | } 40 | .bs-callout-danger h4 { 41 | color: #ce4844; 42 | } 43 | .bs-callout-warning { 44 | border-left-color: #aa6708; 45 | } 46 | .bs-callout-warning h4 { 47 | color: #aa6708; 48 | } 49 | .bs-callout-info { 50 | border-left-color: #1b809e; 51 | } 52 | .bs-callout-info h4 { 53 | color: #1b809e; 54 | } 55 | -------------------------------------------------------------------------------- /public/theme/default/article.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 |
7 |

8 |
9 | 10 | 发表于 11 |
12 |
13 |
14 | 15 |
16 |

EOF

17 | 18 |
19 | 24 |
25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /application/route.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | use think\Route; 13 | 14 | //首页文章列表分页 15 | Route::rule('index/[:page]','index/index/index'); 16 | //分类文章列表分页 17 | Route::rule('category/[:param]/[:page]','index/category/index'); 18 | //文章页 19 | Route::rule('post/[:param]','index/article/index'); 20 | //页面 21 | Route::rule('page/[:param]','index/page/index'); 22 | //搜索 23 | Route::rule('search/[:param]','index/article/search'); 24 | //评论 25 | Route::rule('comment/api','index/comment/api'); 26 | //Rss 27 | Route::rule('rss/[:num]','index/rss/index'); 28 | -------------------------------------------------------------------------------- /public/theme/Oreo/article.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 |
7 |

8 | 9 | 11 |
12 |
13 |
14 | 15 |
16 |
17 |
18 |

如果你想转载,请注明来源或者出处

19 |
20 |
21 |
22 | 23 | 24 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2016 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /thinkphp/library/think/console/output/driver/Nothing.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\output\driver; 13 | 14 | use think\console\Output; 15 | 16 | class Nothing 17 | { 18 | 19 | public function __construct(Output $output) 20 | { 21 | // do nothing 22 | } 23 | 24 | public function write($messages, $newline = false, $options = Output::OUTPUT_NORMAL) 25 | { 26 | // do nothing 27 | } 28 | 29 | public function renderException(\Exception $e) 30 | { 31 | // do nothing 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /thinkphp/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: php 4 | 5 | services: 6 | - memcached 7 | - mongodb 8 | - mysql 9 | - postgresql 10 | - redis-server 11 | 12 | matrix: 13 | fast_finish: true 14 | include: 15 | - php: 5.4 16 | - php: 5.5 17 | - php: 5.6 18 | - php: 7.0 19 | - php: hhvm 20 | allow_failures: 21 | - php: hhvm 22 | 23 | cache: 24 | directories: 25 | - $HOME/.composer/cache 26 | 27 | before_install: 28 | - composer self-update 29 | - mysql -e "create database IF NOT EXISTS test;" -uroot 30 | - psql -c 'DROP DATABASE IF EXISTS test;' -U postgres 31 | - psql -c 'create database test;' -U postgres 32 | 33 | install: 34 | - ./tests/script/install.sh 35 | 36 | script: 37 | ## LINT 38 | - find . -path ./vendor -prune -o -type f -name \*.php -exec php -l {} \; 39 | ## PHP Copy/Paste Detector 40 | - vendor/bin/phpcpd --verbose --exclude vendor ./ || true 41 | ## PHPLOC 42 | - vendor/bin/phploc --exclude vendor ./ 43 | ## PHPUNIT 44 | - vendor/bin/phpunit --coverage-clover=coverage.xml --configuration=phpunit.xml 45 | 46 | after_success: 47 | - bash <(curl -s https://codecov.io/bash) 48 | -------------------------------------------------------------------------------- /vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /thinkphp/library/think/exception/ClassNotFoundException.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\exception; 13 | 14 | class ClassNotFoundException extends \RuntimeException 15 | { 16 | protected $class; 17 | public function __construct($message, $class = '') 18 | { 19 | $this->message = $message; 20 | $this->class = $class; 21 | } 22 | 23 | /** 24 | * 获取类名 25 | * @access public 26 | * @return string 27 | */ 28 | public function getClass() 29 | { 30 | return $this->class; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /application/install/model/Database.php: -------------------------------------------------------------------------------- 1 | 'mysql', 19 | 'hostname' => $host, 20 | 'database' => $name, 21 | 'username' => $user, 22 | 'password' => $password, 23 | 'hostport' => $hostport, 24 | 'charset' => 'utf8', 25 | 'prefix' => $prefix, 26 | ]); 27 | try{ 28 | $db->connect(); 29 | return $db; 30 | }catch(\Exception $e){ 31 | return false; 32 | } 33 | } 34 | 35 | public static function checkPrefix($db){ 36 | try{ 37 | $result = $db->name('setting')->select(); 38 | return $result ? true : false; 39 | }catch(\Exception $e){ 40 | return false; 41 | } 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /public/static/common/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Visual Studio-like style based on original C# coloring by Jason Diamond 4 | 5 | */ 6 | .hljs { 7 | display: block; 8 | overflow-x: auto; 9 | padding: 0.5em; 10 | background: white; 11 | color: black; 12 | } 13 | 14 | .hljs-comment, 15 | .hljs-quote, 16 | .hljs-variable { 17 | color: #008000; 18 | } 19 | 20 | .hljs-keyword, 21 | .hljs-selector-tag, 22 | .hljs-built_in, 23 | .hljs-name, 24 | .hljs-tag { 25 | color: #00f; 26 | } 27 | 28 | .hljs-string, 29 | .hljs-title, 30 | .hljs-section, 31 | .hljs-attribute, 32 | .hljs-literal, 33 | .hljs-template-tag, 34 | .hljs-template-variable, 35 | .hljs-type, 36 | .hljs-addition { 37 | color: #a31515; 38 | } 39 | 40 | .hljs-deletion, 41 | .hljs-selector-attr, 42 | .hljs-selector-pseudo, 43 | .hljs-meta { 44 | color: #2b91af; 45 | } 46 | 47 | .hljs-doctag { 48 | color: #808080; 49 | } 50 | 51 | .hljs-attr { 52 | color: #f00; 53 | } 54 | 55 | .hljs-symbol, 56 | .hljs-bullet, 57 | .hljs-link { 58 | color: #00b0e8; 59 | } 60 | 61 | 62 | .hljs-emphasis { 63 | font-style: italic; 64 | } 65 | 66 | .hljs-strong { 67 | font-weight: bold; 68 | } 69 | -------------------------------------------------------------------------------- /vendor/erusev/parsedown/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Emanuil Rusev, erusev.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /public/theme/Oreo/page/Index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 |
9 |
10 |
11 |

12 | 13 | 15 |
16 |
17 |
18 | 19 |
20 |
21 |
22 |

如果你想转载,请注明来源或者出处

23 |
24 |
25 |
26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /vendor/nette/utils/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nette/utils", 3 | "description": "Nette Utility Classes", 4 | "homepage": "https://nette.org", 5 | "license": ["BSD-3-Clause", "GPL-2.0", "GPL-3.0"], 6 | "authors": [ 7 | { 8 | "name": "David Grudl", 9 | "homepage": "https://davidgrudl.com" 10 | }, 11 | { 12 | "name": "Nette Community", 13 | "homepage": "https://nette.org/contributors" 14 | } 15 | ], 16 | "require": { 17 | "php": ">=5.6.0" 18 | }, 19 | "require-dev": { 20 | "nette/tester": "~2.0", 21 | "tracy/tracy": "^2.3" 22 | }, 23 | "suggest": { 24 | "ext-iconv": "to use Strings::webalize() and toAscii()", 25 | "ext-json": "to use Nette\\Utils\\Json", 26 | "ext-intl": "for script transliteration in Strings::webalize() and toAscii()", 27 | "ext-mbstring": "to use Strings::lower() etc...", 28 | "ext-xml": "to use Strings::length() etc. when mbstring is not available", 29 | "ext-gd": "to use Image" 30 | }, 31 | "conflict": { 32 | "nette/nette": "<2.2" 33 | }, 34 | "autoload": { 35 | "classmap": ["src/"] 36 | }, 37 | "minimum-stability": "dev", 38 | "extra": { 39 | "branch-alias": { 40 | "dev-master": "2.4-dev" 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /application/convert/model/KurBlog.php: -------------------------------------------------------------------------------- 1 | insertAll($data); 28 | } 29 | 30 | public static function getCategoryIds(){ 31 | $result = Db::name("category")->select(); 32 | $data = []; 33 | foreach($result as $v){ 34 | $data[] = $v['id']; 35 | } 36 | return $data; 37 | } 38 | 39 | public static function getPageIds(){ 40 | $result = Db::name("page")->select(); 41 | $data = []; 42 | foreach($result as $v){ 43 | $data[] = $v['id']; 44 | } 45 | return $data; 46 | } 47 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /application/admin/controller/Login.php: -------------------------------------------------------------------------------- 1 | redirect('/admin'); 15 | return false; 16 | } 17 | //获取form提交数据 18 | $data = input('post.'); 19 | $result = $this->validate($data,'Login'); 20 | if($result === true){ 21 | $user = LoginModel::get( 22 | ['username'=>$data['username']] 23 | ); 24 | $password = $data['password']; 25 | if(@$user->password == md5(sha1($password))){ 26 | Session::set('member.uid',$user['id']); 27 | Session::set('member.username',$user['username']); 28 | $this->redirect('/admin'); 29 | return true; 30 | } 31 | } 32 | return view(); 33 | } 34 | 35 | public function Logout(){ 36 | Session::clear(); 37 | $this->redirect('/admin'); 38 | } 39 | } -------------------------------------------------------------------------------- /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/nette/mail/src/Bridges/MailDI/MailExtension.php: -------------------------------------------------------------------------------- 1 | FALSE, 21 | 'host' => NULL, 22 | 'port' => NULL, 23 | 'username' => NULL, 24 | 'password' => NULL, 25 | 'secure' => NULL, 26 | 'timeout' => NULL, 27 | ]; 28 | 29 | 30 | public function loadConfiguration() 31 | { 32 | $builder = $this->getContainerBuilder(); 33 | $config = $this->validateConfig($this->defaults); 34 | 35 | $mailer = $builder->addDefinition($this->prefix('mailer')) 36 | ->setClass(Nette\Mail\IMailer::class); 37 | 38 | if (empty($config['smtp'])) { 39 | $mailer->setFactory(Nette\Mail\SendmailMailer::class); 40 | } else { 41 | $mailer->setFactory(Nette\Mail\SmtpMailer::class, [$config]); 42 | } 43 | 44 | if ($this->name === 'mail') { 45 | $builder->addAlias('nette.mailer', $this->prefix('mailer')); 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /application/admin/view/setting/theme.html: -------------------------------------------------------------------------------- 1 | {include file="template/header" /} 2 | 3 | 4 |

主题设置

5 |
6 | {volist name="data" id="vo"} 7 |
8 |
9 | 10 |
11 | 12 | {neq name="$vo.active" value="true"} 13 | 14 | {/neq} 15 |
16 |
17 |
18 |
{$vo.theme_name}
19 |
20 |
21 | {/volist} 22 |
23 | 27 | 28 | {include file="template/footer" /} 29 | 30 | -------------------------------------------------------------------------------- /public/static/admin/js/setting.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by sinkey on 2017/6/21. 3 | */ 4 | $(document).ready(function(){ 5 | 6 | $(".home").change(function(){ 7 | var type = $('.home input:radio:checked').val(); 8 | if(type == 'article'){ 9 | $(".value-id").css({"display":"none"}); 10 | }else{ 11 | if(type == 'category'){ 12 | $(".value-id label").html('分类ID'); 13 | }else if(type=='page'){ 14 | $(".value-id label").html('页面ID'); 15 | } 16 | $(".value-id").css({"display":"block"}); 17 | 18 | } 19 | }); 20 | 21 | $("#seo-tag-menu li").click(function(){ 22 | var id = $(this).data('id'); 23 | $('#seo-tag-menu li').removeClass('active') 24 | $('#seo-tag-menu .'+id).addClass('active') 25 | $('.seo-tag-list .item').css({ 26 | 'display' : 'none' 27 | }); 28 | $('.form-seo .form-group').css({ 29 | 'display' : 'none' 30 | }); 31 | $(".seo-tag-list ."+id).css({ 32 | 'display' : 'table-row' 33 | }); 34 | $(".form-seo .form-group."+id).css({ 35 | 'display' : 'block' 36 | }) 37 | 38 | }) 39 | 40 | 41 | }); 42 | 43 | -------------------------------------------------------------------------------- /application/admin/view/comment/edit.html: -------------------------------------------------------------------------------- 1 | {include file="template/header" /} 2 | 3 | 4 |

修改评论

5 |
6 | 7 |
8 | 9 | 10 |
11 | 12 |
13 | 14 | 15 |
16 | 17 |
18 | 19 | 20 |
21 | 22 |
23 | 24 | 25 |
26 | 27 | 28 |
29 | 30 | 31 | 32 | {include file="template/footer" /} -------------------------------------------------------------------------------- /thinkphp/library/think/console/command/make/Model.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\command\make; 13 | 14 | use think\console\command\Make; 15 | 16 | class Model extends Make 17 | { 18 | protected $type = "Model"; 19 | 20 | protected function configure() 21 | { 22 | parent::configure(); 23 | $this->setName('make:model') 24 | ->setDescription('Create a new model class'); 25 | } 26 | 27 | protected function getStub() 28 | { 29 | return __DIR__ . '/stubs/model.stub'; 30 | } 31 | 32 | protected function getNamespace($appNamespace, $module) 33 | { 34 | return parent::getNamespace($appNamespace, $module) . '\model'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /thinkphp/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./tests/thinkphp/ 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ./ 23 | 24 | tests 25 | vendor 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /thinkphp/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 | -------------------------------------------------------------------------------- /public/theme/default/static/script.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $(window).on("scroll", function() { 3 | var n = 0; 4 | var r = $(window).scrollTop(); 5 | r >= n && r > 100 ? ($(".fixed").addClass("hidden")) : $(".fixed").removeClass("hidden"), n = r 6 | }); 7 | 8 | var header = $("#header"); 9 | var form = header.find("form"); 10 | var n = 0; 11 | var i = !1; 12 | form.find("button").on("click", function(event) { 13 | form.find("input").val() || event.preventDefault(), header.hasClass("extend-search") || i || (header.addClass("extend-search"), header.removeClass("extend-menu"), i = !0, form.find("input").focus()) 14 | }), $(window).on("keyup", function($) { 15 | 27 === $.which && form.hasClass("show") && form.find("input").val("").blur() 16 | }), form.find("input").on("blur", function($) { 17 | !form.find("input").val() && header.hasClass("extend-search") && (event.preventDefault(), header.removeClass("extend-search"), setTimeout(function() { 18 | i = !1 19 | }, 300)) 20 | }); 21 | 22 | $(".menu-btn").click(function(){ 23 | if($("#nav-list").css("display") == 'block'){ 24 | $("#nav-list").css("display","none"); 25 | }else{ 26 | $("#nav-list").css("display","block"); 27 | } 28 | 29 | 30 | }); 31 | }) -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /application/index/controller/Rss.php: -------------------------------------------------------------------------------- 1 | where('status',1)->order('id desc')->limit($num); 23 | }); 24 | $feed = new RssModel(); 25 | $markdownParser = new Parsedown(); 26 | $feed->title = $this->_K['setting']['blog_name']; 27 | $feed->link = $this->_K['setting']['siteurl']; 28 | $feed->description = $this->_K['setting']['sub_title']; 29 | foreach($res as $v){ 30 | $content = $markdownParser->text($v['content']); 31 | $item = new RssItem(); 32 | $item->title = $v['title']; 33 | $item->link = $this->getURL('article',$v['id']); 34 | $item->setPubDate($v['create_time']); 35 | $item->description = ""; 36 | $feed->addItem($item); 37 | } 38 | return $feed->serve(); 39 | } 40 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /application/convert/view/wordpress/step_1.html: -------------------------------------------------------------------------------- 1 | {include file="template/header" /} 2 | 3 | 6 | 7 |
8 |

数据库信息看起来是正确的,请选择需要转换的内容

9 |
10 | 11 | 14 | 17 | 20 | 23 | 24 |
25 |
26 | 27 | 28 | 29 |
30 | 31 |
32 | 33 | 42 | 43 | 44 | {include file="template/footer" /} 45 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /public/static/admin/js/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 演示:PHP+jQuery+Ajax多图片上传 6 | 7 | 8 | 9 | 31 | 32 | 33 | 34 | 35 | uploading 36 | 37 |
38 | 39 |
40 | 添加图片 41 | 42 |
43 |
44 |
45 | 46 | 47 | 48 | 49 | 50 | 51 |
aaaa
52 | 53 | 54 | -------------------------------------------------------------------------------- /vendor/nette/mail/src/Mail/SendmailMailer.php: -------------------------------------------------------------------------------- 1 | setHeader('Subject', NULL); 33 | $tmp->setHeader('To', NULL); 34 | 35 | $parts = explode(Message::EOL . Message::EOL, $tmp->generateMessage(), 2); 36 | 37 | $args = [ 38 | str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('To')), 39 | str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('Subject')), 40 | str_replace(Message::EOL, PHP_EOL, $parts[1]), 41 | str_replace(Message::EOL, PHP_EOL, $parts[0]), 42 | ]; 43 | if ($this->commandArgs) { 44 | $args[] = (string) $this->commandArgs; 45 | } 46 | $res = Nette\Utils\Callback::invokeSafe('mail', $args, function ($message) use (&$info) { 47 | $info = ": $message"; 48 | }); 49 | if ($res === FALSE) { 50 | throw new SendException("Unable to send email$info."); 51 | } 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /public/static/admin/css/theme.css: -------------------------------------------------------------------------------- 1 | .detail{ 2 | position: fixed; 3 | top:0; 4 | width:100%; 5 | z-index: 2000; 6 | height:100%; 7 | background: rgba(0,0,0,.7); 8 | left:0; 9 | 10 | } 11 | .detail .info{ 12 | position: absolute; 13 | top:100px; 14 | width:70%; 15 | left:15%; 16 | background: #fff; 17 | border:1px solid #eee; 18 | padding:30px; 19 | z-index: 3000; 20 | } 21 | .detail .description{ 22 | margin:10px 0 15px; 23 | } 24 | .btns .btn{ 25 | margin-right:5px; 26 | } 27 | .btns .btn-default{ 28 | margin-right:0; 29 | } 30 | .theme{ 31 | margin:10px 1% 20px; 32 | float:left; 33 | width:23%; 34 | text-align: center; 35 | } 36 | .theme.active .info{ 37 | background: #428bca; 38 | color: #fff; 39 | } 40 | .theme.active img{ 41 | border-color: #428bca; 42 | } 43 | 44 | .thumb{ 45 | text-align: center; 46 | position: relative; 47 | 48 | } 49 | .thumb:hover .more{ 50 | display:block; 51 | } 52 | .thumb img{ 53 | width:100%; 54 | padding:4px; 55 | border-top:1px solid #eee; 56 | border-right:1px solid #eee; 57 | border-left:1px solid #eee; 58 | border-radius: 5px 5px 0 0; 59 | } 60 | .theme .info{ 61 | font-size:15px; 62 | padding: 8px; 63 | background: #f1f1f1; 64 | } 65 | .more{ 66 | display:none; 67 | background: rgba(250,250,250,.8); 68 | position: absolute; 69 | top:0; 70 | width:100%; 71 | height:100%; 72 | padding-top:30%; 73 | } -------------------------------------------------------------------------------- /vendor/nette/mail/contributing.md: -------------------------------------------------------------------------------- 1 | How to contribute & use the issue tracker 2 | ========================================= 3 | 4 | Nette welcomes your contributions. There are several ways to help out: 5 | 6 | * Create an issue on GitHub, if you have found a bug 7 | * Write test cases for open bug issues 8 | * Write fixes for open bug/feature issues, preferably with test cases included 9 | * Contribute to the [documentation](https://nette.org/en/writing) 10 | 11 | Issues 12 | ------ 13 | 14 | Please **do not use the issue tracker to ask questions**. We will be happy to help you 15 | on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). 16 | 17 | A good bug report shouldn't leave others needing to chase you up for more 18 | information. Please try to be as detailed as possible in your report. 19 | 20 | **Feature requests** are welcome. But take a moment to find out whether your idea 21 | fits with the scope and aims of the project. It's up to *you* to make a strong 22 | case to convince the project's developers of the merits of this feature. 23 | 24 | Contributing 25 | ------------ 26 | 27 | If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). 28 | 29 | The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. 30 | 31 | Please do not fix whitespace, format code, or make a purely cosmetic patch. 32 | 33 | Thanks! :heart: 34 | -------------------------------------------------------------------------------- /vendor/nette/utils/contributing.md: -------------------------------------------------------------------------------- 1 | How to contribute & use the issue tracker 2 | ========================================= 3 | 4 | Nette welcomes your contributions. There are several ways to help out: 5 | 6 | * Create an issue on GitHub, if you have found a bug 7 | * Write test cases for open bug issues 8 | * Write fixes for open bug/feature issues, preferably with test cases included 9 | * Contribute to the [documentation](https://nette.org/en/writing) 10 | 11 | Issues 12 | ------ 13 | 14 | Please **do not use the issue tracker to ask questions**. We will be happy to help you 15 | on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). 16 | 17 | A good bug report shouldn't leave others needing to chase you up for more 18 | information. Please try to be as detailed as possible in your report. 19 | 20 | **Feature requests** are welcome. But take a moment to find out whether your idea 21 | fits with the scope and aims of the project. It's up to *you* to make a strong 22 | case to convince the project's developers of the merits of this feature. 23 | 24 | Contributing 25 | ------------ 26 | 27 | If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). 28 | 29 | The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. 30 | 31 | Please do not fix whitespace, format code, or make a purely cosmetic patch. 32 | 33 | Thanks! :heart: 34 | -------------------------------------------------------------------------------- /public/theme/Oreo/footer.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | 12 | 13 | 14 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /application/index/controller/Category.php: -------------------------------------------------------------------------------- 1 | 1]; 19 | if ($param == NULL) { 20 | $category = CategoryModel::all(); 21 | $path = url('index/index/index'); 22 | } else { 23 | $category = CategoryModel::get(is_numeric($param) ? $param : ['slug' => $param]); 24 | $where['category_id'] = $category['id']; 25 | $category = [$category]; 26 | $path = url('index/category/index', ['param' => $param]); 27 | } 28 | //加载文章数据 29 | $res = ArticleModel::where($where) 30 | ->order('id', 'desc') 31 | ->paginate($this->_K['setting']['per_page'], true, [ 32 | 'page' => $page, 33 | 'path' => $path . '/[PAGE]' 34 | ]); 35 | //数据加工 36 | $res = $this->processing($res,$category); 37 | $this->assign('data',$res); 38 | 39 | //SEO信息; 40 | $this->seo_replace['{category_name}'] = $category[0]['title'] ? : ''; 41 | $this->seo_replace['{page}'] = $page; 42 | $this->setSeoData($param == NULL ? 'index' : 'list'); 43 | return $this->view->fetch('/index'); 44 | } 45 | } -------------------------------------------------------------------------------- /application/index/controller/Page.php: -------------------------------------------------------------------------------- 1 | error('参数错误'); 20 | return false; 21 | } 22 | if (is_numeric($param)) { 23 | $res = PageModel::get($param); 24 | } else { 25 | $res = PageModel::get(['slug' => $param]); 26 | } 27 | $markdownParser = new Parsedown(); 28 | $template = $res['template']; 29 | $res['content'] = $markdownParser->text($res['content']); 30 | $res['description'] = empty($res['description']) 31 | ? mb_substr(strip_tags($res['content']),0,$this->_K['setting']['description_length'], 'utf-8') 32 | : $res['description']; 33 | $this->assign('data',$res); 34 | $this->assign('comment',[ 35 | 'type' => 'article', 36 | 'value' => $res['id'], 37 | 'html' => CommentModel::getComment('page',$res['id'],$this->_K['setting']['order_by_time']) 38 | ]); 39 | $this->seo_replace['{title}'] = $res['title']; 40 | $this->seo_replace['{description}'] = $res['description']; 41 | $this->setSeoData('page'); 42 | return $this->view->fetch('/page/'.$template); 43 | } 44 | } -------------------------------------------------------------------------------- /public/theme/default/comment.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |

评论

4 |
5 | 6 |
7 |

发表评论

8 | 9 |
10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 |
18 |
19 | 20 | 21 |
22 |
23 | 24 | 25 |
26 |
27 |
28 | 29 |
30 | 31 | 32 | 33 |
34 |
-------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /application/admin/view/login/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 登录 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 |

19 |
20 | 21 | 22 | 23 |
24 |
25 | 26 |
    27 |
  • 28 |
  • 29 |
  • 30 |
  • 31 |
  • 32 |
  • 33 |
  • 34 |
  • 35 |
  • 36 |
  • 37 |
  • 38 |
  • 39 |
  • 40 |
41 | 42 |
43 | 44 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /public/static/admin/js/link.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by sinke on 2017/6/21. 3 | */ 4 | $(document).ready(function(){ 5 | $(".alter").click(function(){ 6 | var id = $(this).data("id"); 7 | var title = $("#li_"+id+" .title").html(); 8 | var url = $("#li_"+id+" .url").html(); 9 | var description = $("#li_"+id+" .description").html(); 10 | $("#title").val(title); 11 | $("#id").val(id); 12 | $("#url").val(url); 13 | $("#description").val(description); 14 | $(".cancel").css({"display":"inline-block"}); 15 | $(".edit h2").html("修改链接"); 16 | }); 17 | 18 | 19 | $(".delete").click(function(){ 20 | var id = $(this).data("id"); 21 | var title = $("#li_"+id+" .title").html(); 22 | if(confirm("您确定要删除 "+title+" 吗?")){ 23 | $.post("/admin/link/api", { 24 | 'action':'delete', 25 | 'id':id 26 | }, function(data){ 27 | var data = $.parseJSON(data); 28 | if(data.err == 0){ 29 | $("#li_"+id).remove(); 30 | $(".parent-menu-"+id).remove(); 31 | alert('删除成功'); 32 | }else{ 33 | alert('删除失败'); 34 | } 35 | }); 36 | }else{ 37 | return false; 38 | } 39 | }); 40 | 41 | 42 | $(".cancel").click(function(){ 43 | edit_cancel(); 44 | 45 | }); 46 | }); 47 | 48 | function edit_cancel(){ 49 | $("#id").val("0"); 50 | $("#menu-form input:text").val(""); 51 | $(".default-type").click(); 52 | $(".edit h2").html("添加链接"); 53 | $(".cancel").css({"display":"none"}); 54 | } -------------------------------------------------------------------------------- /application/install/view/index/step_2.html: -------------------------------------------------------------------------------- 1 | {include file="template/header" /} 2 | 3 | 6 | 7 |
8 |

数据库连接成功!

9 |

现在您需要填写一些网站的信息

10 |
11 |
12 |
13 | 14 |
15 | 16 |
17 |
18 |
19 | 20 |
21 | 22 |
23 |
24 |
25 | 26 |
27 | 28 |
29 |
30 |
31 | 32 |
33 | 34 |
35 |
36 |
37 |
38 | 39 |
40 |
41 |
42 |
43 | 44 | 45 | {include file="template/footer" /} 46 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /application/admin/view/page/index.html: -------------------------------------------------------------------------------- 1 | {include file="template/header" /} 2 | 3 | 4 |
5 |

所有页面 新建页面

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | {volist name="page_list" id="vo"} 18 | 19 | 20 | 21 | 22 | 23 | 36 | 37 | {/volist} 38 | 39 |
#标题评论数更新日期-
{$vo.id}{$vo.title}{$commentNum[$vo.id]}{$vo.create_time} 24 | 25 |
26 | 29 | 34 |
35 |
40 |
41 | 42 | 43 | {include file="template/footer" /} -------------------------------------------------------------------------------- /application/database.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | return [ 13 | // 数据库类型 14 | 'type' => 'mysql', 15 | // 服务器地址 16 | 'hostname' => '{db_host}', 17 | // 数据库名 18 | 'database' => '{db_name}', 19 | // 用户名 20 | 'username' => '{db_user}', 21 | // 密码 22 | 'password' => '{db_password}', 23 | // 端口 24 | 'hostport' => '{db_port}', 25 | // 连接dsn 26 | 'dsn' => '', 27 | // 数据库连接参数 28 | 'params' => [], 29 | // 数据库编码默认采用utf8 30 | 'charset' => 'utf8', 31 | // 数据库表前缀 32 | 'prefix' => '{db_prefix}', 33 | // 数据库调试模式 34 | 'debug' => true, 35 | // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) 36 | 'deploy' => 0, 37 | // 数据库读写是否分离 主从式有效 38 | 'rw_separate' => false, 39 | // 读写分离后 主服务器数量 40 | 'master_num' => 1, 41 | // 指定从服务器序号 42 | 'slave_no' => '', 43 | // 是否严格检查字段是否存在 44 | 'fields_strict' => true, 45 | // 数据集返回类型 46 | 'resultset_type' => 'array', 47 | // 自动写入时间戳字段 48 | 'auto_timestamp' => false, 49 | // 时间字段取出后的默认时间格式 50 | 'datetime_format' => 'Y-m-d H:i:s', 51 | // 是否需要进行SQL性能分析 52 | 'sql_explain' => false, 53 | ]; 54 | -------------------------------------------------------------------------------- /application/install/extra/db.config.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | return [ 13 | // 数据库类型 14 | 'type' => 'mysql', 15 | // 服务器地址 16 | 'hostname' => '{db_host}', 17 | // 数据库名 18 | 'database' => '{db_name}', 19 | // 用户名 20 | 'username' => '{db_user}', 21 | // 密码 22 | 'password' => '{db_password}', 23 | // 端口 24 | 'hostport' => '{db_port}', 25 | // 连接dsn 26 | 'dsn' => '', 27 | // 数据库连接参数 28 | 'params' => [], 29 | // 数据库编码默认采用utf8 30 | 'charset' => 'utf8', 31 | // 数据库表前缀 32 | 'prefix' => '{db_prefix}', 33 | // 数据库调试模式 34 | 'debug' => true, 35 | // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) 36 | 'deploy' => 0, 37 | // 数据库读写是否分离 主从式有效 38 | 'rw_separate' => false, 39 | // 读写分离后 主服务器数量 40 | 'master_num' => 1, 41 | // 指定从服务器序号 42 | 'slave_no' => '', 43 | // 是否严格检查字段是否存在 44 | 'fields_strict' => true, 45 | // 数据集返回类型 46 | 'resultset_type' => 'array', 47 | // 自动写入时间戳字段 48 | 'auto_timestamp' => false, 49 | // 时间字段取出后的默认时间格式 50 | 'datetime_format' => 'Y-m-d H:i:s', 51 | // 是否需要进行SQL性能分析 52 | 'sql_explain' => false, 53 | ]; 54 | -------------------------------------------------------------------------------- /thinkphp/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /public/theme/Oreo/comment.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 |
6 |
「人生在世,留句话给我吧」
7 |
8 |

发表评论

9 |

人生在世,错别字在所难免,无需纠正,##修改表单信息##

10 | 11 |
12 | 13 | 14 | 15 |
16 |
17 | 18 | 19 |
20 |
21 | 22 | 23 |
24 |
25 | 26 | 27 |
28 |
29 |
30 | 31 |
32 |
33 |
34 | 35 |
36 |
37 |
38 | 39 | 40 |
-------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 27 | if ($useStaticLoader) { 28 | require_once __DIR__ . '/autoload_static.php'; 29 | 30 | call_user_func(\Composer\Autoload\ComposerStaticInit706bbd9ef749912ffdffcaa009eecfbe::getInitializer($loader)); 31 | } else { 32 | $map = require __DIR__ . '/autoload_namespaces.php'; 33 | foreach ($map as $namespace => $path) { 34 | $loader->set($namespace, $path); 35 | } 36 | 37 | $map = require __DIR__ . '/autoload_psr4.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->setPsr4($namespace, $path); 40 | } 41 | 42 | $classMap = require __DIR__ . '/autoload_classmap.php'; 43 | if ($classMap) { 44 | $loader->addClassMap($classMap); 45 | } 46 | } 47 | 48 | $loader->register(true); 49 | 50 | return $loader; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /public/theme/default/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <?=$seo_title?> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 47 |
48 | -------------------------------------------------------------------------------- /vendor/nette/mail/src/Mail/FallbackMailer.php: -------------------------------------------------------------------------------- 1 | mailers = $mailers; 38 | $this->retryCount = $retryCount; 39 | $this->retryWaitTime = $retryWaitTime; 40 | } 41 | 42 | 43 | /** 44 | * Sends email. 45 | * @return void 46 | * @throws FallbackMailerException 47 | */ 48 | public function send(Message $mail) 49 | { 50 | if (!$this->mailers) { 51 | throw new Nette\InvalidArgumentException('At least one mailer must be provided.'); 52 | } 53 | 54 | for ($i = 0; $i < $this->retryCount; $i++) { 55 | if ($i > 0) { 56 | usleep($this->retryWaitTime * 1000); 57 | } 58 | 59 | foreach ($this->mailers as $mailer) { 60 | try { 61 | $mailer->send($mail); 62 | return; 63 | 64 | } catch (SendException $e) { 65 | $failures[] = $e; 66 | $this->onFailure($this, $e, $mailer, $mail); 67 | } 68 | } 69 | } 70 | 71 | $e = new FallbackMailerException('All mailers failed to send the message.'); 72 | $e->failures = $failures; 73 | throw $e; 74 | } 75 | 76 | 77 | /** 78 | * @return static 79 | */ 80 | public function addMailer(IMailer $mailer) 81 | { 82 | $this->mailers[] = $mailer; 83 | return $this; 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/output/question/Confirmation.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\output\question; 13 | 14 | use think\console\output\Question; 15 | 16 | class Confirmation extends Question 17 | { 18 | 19 | private $trueAnswerRegex; 20 | 21 | /** 22 | * 构造方法 23 | * @param string $question 问题 24 | * @param bool $default 默认答案 25 | * @param string $trueAnswerRegex 验证正则 26 | */ 27 | public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i') 28 | { 29 | parent::__construct($question, (bool) $default); 30 | 31 | $this->trueAnswerRegex = $trueAnswerRegex; 32 | $this->setNormalizer($this->getDefaultNormalizer()); 33 | } 34 | 35 | /** 36 | * 获取默认的答案回调 37 | * @return callable 38 | */ 39 | private function getDefaultNormalizer() 40 | { 41 | $default = $this->getDefault(); 42 | $regex = $this->trueAnswerRegex; 43 | 44 | return function ($answer) use ($default, $regex) { 45 | if (is_bool($answer)) { 46 | return $answer; 47 | } 48 | 49 | $answerIsTrue = (bool) preg_match($regex, $answer); 50 | if (false === $default) { 51 | return $answer && $answerIsTrue; 52 | } 53 | 54 | return !$answer || $answerIsTrue; 55 | }; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /thinkphp/library/think/console/command/Clear.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | namespace think\console\command; 12 | 13 | use think\console\Command; 14 | use think\console\Input; 15 | use think\console\input\Option; 16 | use think\console\Output; 17 | 18 | class Clear extends Command 19 | { 20 | protected function configure() 21 | { 22 | // 指令配置 23 | $this 24 | ->setName('clear') 25 | ->addOption('path', 'd', Option::VALUE_OPTIONAL, 'path to clear', null) 26 | ->setDescription('Clear runtime file'); 27 | } 28 | 29 | protected function execute(Input $input, Output $output) 30 | { 31 | $path = $input->getOption('path') ?: RUNTIME_PATH; 32 | 33 | if (is_dir($path)) { 34 | $this->clearPath($path); 35 | } 36 | 37 | $output->writeln("Clear Successed"); 38 | } 39 | 40 | protected function clearPath($path) 41 | { 42 | $path = realpath($path) . DS; 43 | $files = scandir($path); 44 | if ($files) { 45 | foreach ($files as $file) { 46 | if ('.' != $file && '..' != $file && is_dir($path . $file)) { 47 | $this->clearPath($path . $file); 48 | } elseif ('.gitignore' != $file && is_file($path . $file)) { 49 | unlink($path . $file); 50 | } 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /public/static/common/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Base structure 3 | */ 4 | 5 | /* Move down content because we have a fixed navbar that is 50px tall */ 6 | body { 7 | padding-top: 50px; 8 | } 9 | 10 | 11 | /* 12 | * Global add-ons 13 | */ 14 | 15 | .sub-header { 16 | padding-bottom: 10px; 17 | border-bottom: 1px solid #eee; 18 | } 19 | 20 | /* 21 | * Top navigation 22 | * Hide default border to remove 1px line. 23 | */ 24 | .navbar-fixed-top { 25 | border: 0; 26 | } 27 | 28 | /* 29 | * Sidebar 30 | */ 31 | 32 | /* Hide for mobile, show later */ 33 | .sidebar { 34 | display: none; 35 | } 36 | @media (min-width: 768px) { 37 | .sidebar { 38 | position: fixed; 39 | top: 51px; 40 | bottom: 0; 41 | left: 0; 42 | z-index: 1000; 43 | display: block; 44 | padding: 20px; 45 | overflow-x: hidden; 46 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 47 | background-color: #f5f5f5; 48 | border-right: 1px solid #eee; 49 | } 50 | } 51 | 52 | /* Sidebar navigation */ 53 | .nav-sidebar { 54 | margin-right: -21px; /* 20px padding + 1px border */ 55 | margin-bottom: 20px; 56 | margin-left: -20px; 57 | } 58 | .nav-sidebar > li > a { 59 | padding-right: 20px; 60 | padding-left: 20px; 61 | } 62 | .nav-sidebar > .active > a, 63 | .nav-sidebar > .active > a:hover, 64 | .nav-sidebar > .active > a:focus { 65 | color: #fff; 66 | background-color: #428bca; 67 | } 68 | 69 | 70 | /* 71 | * Main content 72 | */ 73 | 74 | .main { 75 | padding: 20px; 76 | } 77 | .main .page-header { 78 | margin-top: 0; 79 | } 80 | 81 | 82 | /* 83 | * Placeholder dashboard ideas 84 | */ 85 | 86 | .placeholders { 87 | margin-bottom: 30px; 88 | text-align: center; 89 | } 90 | .placeholders h4 { 91 | margin-bottom: 0; 92 | } 93 | .placeholder { 94 | margin-bottom: 20px; 95 | } 96 | .placeholder img { 97 | display: inline-block; 98 | border-radius: 50%; 99 | } 100 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /application/convert/model/WordPress.php: -------------------------------------------------------------------------------- 1 | 'mysql', 12 | 'hostname' => $host, 13 | 'database' => $name, 14 | 'username' => $user, 15 | 'password' => $password, 16 | 'charset' => 'utf8', 17 | 'prefix' => $prefix, 18 | ]); 19 | try{ 20 | $db->connect(); 21 | return $db; 22 | }catch(\Exception $e){ 23 | return false; 24 | } 25 | } 26 | 27 | public static function checkPrefix($db){ 28 | try{ 29 | $result = $db->name('users')->select(); 30 | return count($result)>0 ? true : false; 31 | }catch(\Exception $e){ 32 | return false; 33 | } 34 | } 35 | 36 | public static function getPage($db){ 37 | return $db->where('post_type','page')->name('posts')->select(); 38 | } 39 | 40 | public static function getCategory($db){ 41 | $result = $db->name('term_taxonomy')->where('taxonomy','category')->select(); 42 | $ids = []; 43 | foreach($result as $v){ 44 | $ids[] = $v['term_id']; 45 | } 46 | $ids = implode(',',$ids); 47 | return $db->name('terms')->where(['term_id'=>['in',$ids]])->select(); 48 | } 49 | 50 | public static function getArticle($db){ 51 | return $db->where('post_type','post')->name('posts')->select(); 52 | } 53 | 54 | public static function relationships($db){ 55 | $result = $db->name('term_relationships')->select(); 56 | $data = []; 57 | foreach($result as $v){ 58 | $data[$v['object_id']] = $v['term_taxonomy_id']; 59 | } 60 | return $data; 61 | } 62 | 63 | public static function getComment($db){ 64 | return $db->name('comments')->select(); 65 | } 66 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /application/common/model/RssItem.php: -------------------------------------------------------------------------------- 1 | tags = array(); 27 | } 28 | 29 | public function setPubDate($when) 30 | { 31 | if(strtotime($when) == false) 32 | $this->pubDate = date("D, d M Y H:i:s ", $when) . "GMT"; 33 | else 34 | $this->pubDate = date("D, d M Y H:i:s ", strtotime($when)) . "GMT"; 35 | } 36 | 37 | public function getPubDate() 38 | { 39 | if(empty($this->pubDate)) 40 | return date("D, d M Y H:i:s ") . "GMT"; 41 | else 42 | return $this->pubDate; 43 | } 44 | 45 | public function addTag($tag, $value) 46 | { 47 | $this->tags[$tag] = $value; 48 | } 49 | 50 | public function out() 51 | { 52 | $out = ''; 53 | $out .= "\n"; 54 | $out .= "" . $this->title . "\n"; 55 | $out .= "" . $this->link . "\n"; 56 | $out .= "" . $this->description . "\n"; 57 | $out .= "" . $this->getPubDate() . "\n"; 58 | 59 | if($this->attachment != "") 60 | $out .= ""; 61 | 62 | if(empty($this->guid)) $this->guid = $this->link; 63 | $out .= "" . $this->guid . "\n"; 64 | 65 | foreach($this->tags as $key => $val) $out .= "<$key>$val"; 66 | $out .= "\n"; 67 | return $out; 68 | } 69 | 70 | public function enclosure($url, $mimetype, $length) 71 | { 72 | $this->attachment = $url; 73 | $this->mimetype = $mimetype; 74 | $this->length = $length; 75 | } 76 | } -------------------------------------------------------------------------------- /application/convert/view/wordpress/index.html: -------------------------------------------------------------------------------- 1 | {include file="template/header" /} 2 | 3 | 6 | 7 |
8 |

请输入WordPress的数据库配置信息

9 |

通常可以在 /wp-config.php文件中找到。

10 |
11 |
12 |
13 | 14 |
15 | 16 |
17 |
18 |
19 | 20 |
21 | 22 |
23 |
24 |
25 | 26 |
27 | 28 |
29 |
30 |
31 | 32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 | 40 |
41 |
42 |
43 |
44 | 45 |
46 |
47 |
48 |
49 | 50 | 51 | {include file="template/footer" /} 52 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /public/static/admin/js/menu.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by sinkey on 2017/6/20. 3 | */ 4 | $(document).ready(function(){ 5 | $(".alter").click(function(){ 6 | var id = $(this).data("id"); 7 | var title = $("#li_"+id+" .title").html(); 8 | var value = $("#li_"+id+" .value").html(); 9 | var _class = $("#li_"+id+" .class").html(); 10 | var parent_id = $("#li_"+id).data('parent_id'); 11 | var type = $("#li_"+id).data('type'); 12 | $("#title").val(title); 13 | $("#id").val(id); 14 | $("#parent_id").val(parent_id); 15 | $("#value").val(value); 16 | $("#class").val(_class); 17 | $("#type-"+type).click(); 18 | $(".cancel").css({"display":"inline-block"}); 19 | $(".edit h2").html("修改菜单"); 20 | }); 21 | 22 | $(".add-parent").click(function(){ 23 | edit_cancel(); 24 | var id = $(this).data("id"); 25 | $(".edit h2").html("添加子菜单"); 26 | $("#parent_id").val(id); 27 | $(".cancel").css({"display":"inline-block"}); 28 | }); 29 | 30 | $(".delete").click(function(){ 31 | var id = $(this).data("id"); 32 | var title = $("#li_"+id+" .title").html(); 33 | if(confirm("该菜单下的子菜单将会一起删除!\n\n您确定要删除 "+title+" 吗?")){ 34 | $.post("/admin/menu/api", { 35 | 'action':'delete', 36 | 'id':id 37 | }, function(data){ 38 | var data = $.parseJSON(data); 39 | if(data.err == 0){ 40 | $("#li_"+id).remove(); 41 | $(".parent-menu-"+id).remove(); 42 | alert('删除成功'); 43 | }else{ 44 | alert('删除失败'); 45 | } 46 | }); 47 | }else{ 48 | return false; 49 | } 50 | }); 51 | 52 | 53 | $(".cancel").click(function(){ 54 | edit_cancel(); 55 | 56 | }); 57 | }); 58 | 59 | function edit_cancel(){ 60 | $("#id").val("0"); 61 | $("#parent_id").val("0"); 62 | $("#menu-form input:text").val(""); 63 | $(".default-type").click(); 64 | $(".edit h2").html("添加菜单"); 65 | $(".cancel").css({"display":"none"}); 66 | } -------------------------------------------------------------------------------- /public/theme/Oreo/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <?=$title?> - <?=$_K['setting']['blog_name']?> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 | 27 | 45 | -------------------------------------------------------------------------------- /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/nette/utils/src/Utils/ArrayHash.php: -------------------------------------------------------------------------------- 1 | $value) { 28 | if ($recursive && is_array($value)) { 29 | $obj->$key = static::from($value, TRUE); 30 | } else { 31 | $obj->$key = $value; 32 | } 33 | } 34 | return $obj; 35 | } 36 | 37 | 38 | /** 39 | * Returns an iterator over all items. 40 | * @return \RecursiveArrayIterator 41 | */ 42 | public function getIterator() 43 | { 44 | return new \RecursiveArrayIterator((array) $this); 45 | } 46 | 47 | 48 | /** 49 | * Returns items count. 50 | * @return int 51 | */ 52 | public function count() 53 | { 54 | return count((array) $this); 55 | } 56 | 57 | 58 | /** 59 | * Replaces or appends a item. 60 | * @return void 61 | */ 62 | public function offsetSet($key, $value) 63 | { 64 | if (!is_scalar($key)) { // prevents NULL 65 | throw new Nette\InvalidArgumentException(sprintf('Key must be either a string or an integer, %s given.', gettype($key))); 66 | } 67 | $this->$key = $value; 68 | } 69 | 70 | 71 | /** 72 | * Returns a item. 73 | * @return mixed 74 | */ 75 | public function offsetGet($key) 76 | { 77 | return $this->$key; 78 | } 79 | 80 | 81 | /** 82 | * Determines whether a item exists. 83 | * @return bool 84 | */ 85 | public function offsetExists($key) 86 | { 87 | return isset($this->$key); 88 | } 89 | 90 | 91 | /** 92 | * Removes the element from this list. 93 | * @return void 94 | */ 95 | public function offsetUnset($key) 96 | { 97 | unset($this->$key); 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /application/admin/view/article/index.html: -------------------------------------------------------------------------------- 1 | {include file="template/header" /} 2 | 3 | 4 |
5 |

所有文章

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | {volist name="article_list" id="vo"} 19 | 20 | 21 | 22 | 23 | 35 | 36 | 49 | 50 | {/volist} 51 | 52 |
#标题分类评论数更新日期-
{$vo.id}{$vo.title}{$category[$vo.category_id]} 24 | {neq name="$vo.status" value="0"} 25 | {$commentNum[$vo.id]} 26 | {/neq} 27 | {eq name="$vo.status" value="2"} 28 |
29 | {/eq} 30 | {neq name="$vo.status" value="1"} 31 | 32 | {$vo.articleStatus} 33 | {/neq} 34 |
{$vo.create_time} 37 | 38 |
39 | 42 | 47 |
48 |
53 | {$article_list->render()} 54 |
55 | 56 | 57 | {include file="template/footer" /} -------------------------------------------------------------------------------- /public/static/admin/js/comment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by sinke on 2017/6/27. 3 | */ 4 | $(document).ready(function(){ 5 | $(".delete").click(function(){ 6 | var id = $(this).data("id"); 7 | if(confirm("您确定要删除此条评论吗?")){ 8 | $.post("/admin/comment/api", { 9 | 'action':'delete', 10 | 'id':id 11 | }, function(data){ 12 | var data = $.parseJSON(data); 13 | if(data.err == 0){ 14 | $("#li_"+id).remove(); 15 | alert('删除成功'); 16 | }else{ 17 | alert('删除失败'); 18 | } 19 | }); 20 | }else{ 21 | return false; 22 | } 23 | }); 24 | 25 | 26 | $(".edit").click(function(){ 27 | var id = $(this).data('id'); 28 | window.location.href="/admin/comment/edit/"+id; 29 | }) 30 | 31 | $(".u-status-1").click(function(){ 32 | var id = $(this).data("id"); 33 | $.post("/admin/comment/api", { 34 | 'action':'update', 35 | 'id':id, 36 | 'status':1 37 | }, function(data){ 38 | var data = $.parseJSON(data); 39 | if(data.err == 0){ 40 | if($("#comment-list").data('status')=='2'){ 41 | $("#li_"+id).remove(); 42 | }else{ 43 | $("#li_"+id+" .status span").html(''); 44 | } 45 | alert('更新成功'); 46 | }else{ 47 | alert('更新失败'); 48 | } 49 | }); 50 | 51 | }); 52 | 53 | $(".u-status-0").click(function(){ 54 | var id = $(this).data("id"); 55 | $.post("/admin/comment/api", { 56 | 'action':'update', 57 | 'id':id, 58 | 'status':0 59 | }, function(data){ 60 | var data = $.parseJSON(data); 61 | if(data.err == 0){ 62 | if($("#comment-list").data('status')=='1'){ 63 | $("#li_"+id).remove(); 64 | }else{ 65 | $("#li_"+id+" .status span").html('待审核'); 66 | } 67 | alert('更新成功'); 68 | }else{ 69 | alert('更新失败'); 70 | } 71 | }); 72 | 73 | }); 74 | 75 | }); 76 | -------------------------------------------------------------------------------- /public/theme/default/static/comment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by sinke on 2017/6/26. 3 | */ 4 | $(document).ready(function(){ 5 | $("#comment").delegate(".comment-reply-link","click",function(){ 6 | var id = $(this).data("id"); 7 | var author = $(this).data("author"); 8 | $("#parent_id").val(id); 9 | $(".comment-cancel").html('取消回复给'+author); 10 | $(".comment-cancel").css({"display":"inline-block"}); 11 | }); 12 | 13 | $("#comment-submit").click(function(){ 14 | var parent_id = $("#parent_id").val(); 15 | var type = $("#comment .type").val(); 16 | var value = $("#comment .value").val(); 17 | var author = $("#comment #author").val(); 18 | var email = $("#comment #email").val(); 19 | var url = $("#comment #url").val(); 20 | var content = $("#comment-content").val(); 21 | $.post("/comment/api", { 22 | 'action' :'post', 23 | 'parent_id' :parent_id, 24 | 'type' :type, 25 | 'value' :value, 26 | 'author' :author, 27 | 'email' :email, 28 | 'url' :url, 29 | 'content' :content 30 | }, function(data){ 31 | var data = $.parseJSON(data); 32 | if(data.err == 0){ 33 | if(parent_id > 0){ 34 | $("#comment-"+parent_id).append(data.html); 35 | }else{ 36 | $(".comment-list").append(data.html); 37 | } 38 | cancel_comment(); 39 | if(data.status == 0){ 40 | alert('提交成功,您的评论可能需要在审核后才能显示。'); 41 | }else{ 42 | alert('评论成功'); 43 | } 44 | }else{ 45 | alert('评论失败'); 46 | } 47 | }); 48 | return false; 49 | }); 50 | 51 | $(".comment-cancel").click(function(){ 52 | cancel_comment(); 53 | }); 54 | 55 | 56 | }); 57 | 58 | function cancel_comment(){ 59 | $(".comment-cancel").css({"display":"none"}); 60 | $(".comment-cancel").html(''); 61 | $('#comment #parent_id').val('0'); 62 | $('#author').val(''); 63 | $('#email').val(''); 64 | $('#url').val(''); 65 | $('#comment-content').val(''); 66 | 67 | 68 | } -------------------------------------------------------------------------------- /thinkphp/library/think/template/driver/File.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\template\driver; 13 | 14 | use think\Exception; 15 | 16 | class File 17 | { 18 | /** 19 | * 写入编译缓存 20 | * @param string $cacheFile 缓存的文件名 21 | * @param string $content 缓存的内容 22 | * @return void|array 23 | */ 24 | public function write($cacheFile, $content) 25 | { 26 | // 检测模板目录 27 | $dir = dirname($cacheFile); 28 | if (!is_dir($dir)) { 29 | mkdir($dir, 0755, true); 30 | } 31 | // 生成模板缓存文件 32 | if (false === file_put_contents($cacheFile, $content)) { 33 | throw new Exception('cache write error:' . $cacheFile, 11602); 34 | } 35 | } 36 | 37 | /** 38 | * 读取编译编译 39 | * @param string $cacheFile 缓存的文件名 40 | * @param array $vars 变量数组 41 | * @return void 42 | */ 43 | public function read($cacheFile, $vars = []) 44 | { 45 | if (!empty($vars) && is_array($vars)) { 46 | // 模板阵列变量分解成为独立变量 47 | extract($vars, EXTR_OVERWRITE); 48 | } 49 | //载入模版缓存文件 50 | include $cacheFile; 51 | } 52 | 53 | /** 54 | * 检查编译缓存是否有效 55 | * @param string $cacheFile 缓存的文件名 56 | * @param int $cacheTime 缓存时间 57 | * @return boolean 58 | */ 59 | public function check($cacheFile, $cacheTime) 60 | { 61 | // 缓存文件不存在, 直接返回false 62 | if (!file_exists($cacheFile)) { 63 | return false; 64 | } 65 | if (0 != $cacheTime && $_SERVER['REQUEST_TIME'] > filemtime($cacheFile) + $cacheTime) { 66 | // 缓存是否在有效期 67 | return false; 68 | } 69 | return true; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /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/db/builder/Sqlite.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\db\builder; 13 | 14 | use think\db\Builder; 15 | 16 | /** 17 | * Sqlite数据库驱动 18 | */ 19 | class Sqlite extends Builder 20 | { 21 | 22 | /** 23 | * limit 24 | * @access public 25 | * @param string $limit 26 | * @return string 27 | */ 28 | public function parseLimit($limit) 29 | { 30 | $limitStr = ''; 31 | if (!empty($limit)) { 32 | $limit = explode(',', $limit); 33 | if (count($limit) > 1) { 34 | $limitStr .= ' LIMIT ' . $limit[1] . ' OFFSET ' . $limit[0] . ' '; 35 | } else { 36 | $limitStr .= ' LIMIT ' . $limit[0] . ' '; 37 | } 38 | } 39 | return $limitStr; 40 | } 41 | 42 | /** 43 | * 随机排序 44 | * @access protected 45 | * @return string 46 | */ 47 | protected function parseRand() 48 | { 49 | return 'RANDOM()'; 50 | } 51 | 52 | /** 53 | * 字段和表名处理 54 | * @access protected 55 | * @param string $key 56 | * @param array $options 57 | * @return string 58 | */ 59 | protected function parseKey($key, $options = []) 60 | { 61 | $key = trim($key); 62 | if (strpos($key, '.')) { 63 | list($table, $key) = explode('.', $key, 2); 64 | if ('__TABLE__' == $table) { 65 | $table = $this->query->getTable(); 66 | } 67 | if (isset($options['alias'][$table])) { 68 | $table = $options['alias'][$table]; 69 | } 70 | } 71 | if (isset($table)) { 72 | $key = $table . '.' . $key; 73 | } 74 | return $key; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /vendor/topthink/think-installer/src/ThinkTesting.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\composer; 13 | 14 | 15 | use Composer\Installer\LibraryInstaller; 16 | use Composer\Package\PackageInterface; 17 | use Composer\Repository\InstalledRepositoryInterface; 18 | 19 | class ThinkTesting extends LibraryInstaller 20 | { 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | public function getInstallPath(PackageInterface $package) 25 | { 26 | if ('topthink/think-testing' !== $package->getPrettyName()) { 27 | throw new \InvalidArgumentException('Unable to install this library!'); 28 | } 29 | 30 | return parent::getInstallPath($package); 31 | } 32 | 33 | public function install(InstalledRepositoryInterface $repo, PackageInterface $package) 34 | { 35 | parent::install($repo, $package); 36 | 37 | $this->copyTestDir($package); 38 | 39 | 40 | } 41 | 42 | public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) 43 | { 44 | parent::update($repo, $initial, $target); 45 | 46 | $this->copyTestDir($target); 47 | 48 | } 49 | 50 | private function copyTestDir(PackageInterface $package) 51 | { 52 | $appDir = dirname($this->vendorDir); 53 | $source = $this->getInstallPath($package) . DIRECTORY_SEPARATOR . 'example'; 54 | if (!is_file($appDir . DIRECTORY_SEPARATOR . 'phpunit.xml')) { 55 | $this->filesystem->copyThenRemove($source, $appDir); 56 | } else { 57 | $this->filesystem->removeDirectoryPhp($source); 58 | } 59 | } 60 | 61 | /** 62 | * {@inheritDoc} 63 | */ 64 | public function supports($packageType) 65 | { 66 | return 'think-testing' === $packageType; 67 | } 68 | } -------------------------------------------------------------------------------- /thinkphp/library/think/console/command/Help.php: -------------------------------------------------------------------------------- 1 | 10 | // +---------------------------------------------------------------------- 11 | 12 | namespace think\console\command; 13 | 14 | use think\console\Command; 15 | use think\console\Input; 16 | use think\console\input\Argument as InputArgument; 17 | use think\console\input\Option as InputOption; 18 | use think\console\Output; 19 | 20 | class Help extends Command 21 | { 22 | 23 | private $command; 24 | 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | protected function configure() 29 | { 30 | $this->ignoreValidationErrors(); 31 | 32 | $this->setName('help')->setDefinition([ 33 | new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), 34 | new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), 35 | ])->setDescription('Displays help for a command')->setHelp(<<%command.name% command displays help for a given command: 37 | 38 | php %command.full_name% list 39 | 40 | To display the list of available commands, please use the list command. 41 | EOF 42 | ); 43 | } 44 | 45 | /** 46 | * Sets the command. 47 | * @param Command $command The command to set 48 | */ 49 | public function setCommand(Command $command) 50 | { 51 | $this->command = $command; 52 | } 53 | 54 | /** 55 | * {@inheritdoc} 56 | */ 57 | protected function execute(Input $input, Output $output) 58 | { 59 | if (null === $this->command) { 60 | $this->command = $this->getConsole()->find($input->getArgument('command_name')); 61 | } 62 | 63 | $output->describe($this->command, [ 64 | 'raw_text' => $input->getOption('raw'), 65 | ]); 66 | 67 | $this->command = null; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /application/admin/controller/Base.php: -------------------------------------------------------------------------------- 1 | redirect('/admin/login'); 17 | return false; 18 | } 19 | //读取设置 20 | $data = SettingModel::all(); 21 | $setting = []; 22 | foreach ($data as $v) { 23 | $setting[$v['key']] = $v['value']; 24 | } 25 | $this->assign('setting', $setting); 26 | $this->assign('navBar',$this->navBar()); 27 | } 28 | 29 | public function uploadFile() { 30 | $json = [ 31 | 'err' => 0, 32 | 'action' => 'uploadFile', 33 | ]; 34 | $filePath = '/static/upload/'; 35 | $uploadPath = './' . str_replace('/', DS, $filePath); 36 | $file = request()->file('image'); 37 | if (empty($file)) { 38 | $json['err'] = 1; 39 | $json['message'] = '请先选择文件'; 40 | return json_encode($json); 41 | } 42 | $info = $file->validate(['ext' => 'jpg,png,gif'])->move($uploadPath); 43 | if (!$info) { 44 | $json['err'] = 2; 45 | $json['message'] = $file->getError(); 46 | } else { 47 | //上传成功 48 | $json['path'] = $filePath . str_replace('\\', '/', $info->getSaveName()); 49 | } 50 | return json_encode($json); 51 | } 52 | 53 | public function navBar() { 54 | return [ 55 | [ 56 | ['home', '/admin', '仪表盘'] 57 | ], [ 58 | ['article', '/admin/article/', '所有文章'], 59 | ['write', '/admin/article/write/', '写文章'], 60 | ['category', '/admin/category/', '文章分类'] 61 | ], [ 62 | ['page', '/admin/page/', '页面管理'] 63 | ], [ 64 | ['theme', '/admin/setting/theme', '主题'], 65 | ['menu', '/admin/menu/', '菜单'] 66 | ], [ 67 | ['comment', '/admin/comment/', '评论'], 68 | ['link', '/admin/link/', '链接'] 69 | ], [ 70 | ['setting', '/admin/setting/', '设置'] 71 | ], 72 | ]; 73 | } 74 | } -------------------------------------------------------------------------------- /vendor/nette/utils/src/Utils/Random.php: -------------------------------------------------------------------------------- 1 | = 70000) { 41 | for ($i = 0; $i < $length; $i++) { 42 | $res .= $charlist[random_int(0, $chLen - 1)]; 43 | } 44 | return $res; 45 | } 46 | 47 | $bytes = ''; 48 | if (function_exists('openssl_random_pseudo_bytes')) { 49 | $bytes = (string) openssl_random_pseudo_bytes($length, $secure); 50 | if (!$secure) { 51 | $bytes = ''; 52 | } 53 | } 54 | if (strlen($bytes) < $length && function_exists('mcrypt_create_iv')) { 55 | $bytes = (string) mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); 56 | } 57 | if (strlen($bytes) < $length && !defined('PHP_WINDOWS_VERSION_BUILD') && is_readable('/dev/urandom')) { 58 | $bytes = (string) file_get_contents('/dev/urandom', FALSE, NULL, -1, $length); 59 | } 60 | if (strlen($bytes) < $length) { 61 | $rand3 = md5(serialize($_SERVER), TRUE); 62 | $charlist = str_shuffle($charlist); 63 | for ($i = 0; $i < $length; $i++) { 64 | if ($i % 5 === 0) { 65 | list($rand1, $rand2) = explode(' ', microtime()); 66 | $rand1 += lcg_value(); 67 | } 68 | $rand1 *= $chLen; 69 | $res .= $charlist[($rand1 + $rand2 + ord($rand3[$i % strlen($rand3)])) % $chLen]; 70 | $rand1 -= (int) $rand1; 71 | } 72 | return $res; 73 | } 74 | 75 | for ($i = 0; $i < $length; $i++) { 76 | $res .= $charlist[($i + ord($bytes[$i])) % $chLen]; 77 | } 78 | return $res; 79 | } 80 | 81 | } 82 | --------------------------------------------------------------------------------