Full Code of iiYii/getyii for AI

master f6c3f7f241cd cached
409 files
555.5 KB
158.5k tokens
702 symbols
1 requests
Download .txt
Showing preview only (667K chars total). Download the full file or copy to clipboard to get everything.
Repository: iiYii/getyii
Branch: master
Commit: f6c3f7f241cd
Files: 409
Total size: 555.5 KB

Directory structure:
gitextract_1v5jxhfe/

├── .bowerrc
├── .gitignore
├── .travis.yml
├── Dockerfile
├── LICENSE.md
├── README.md
├── backend/
│   ├── assets/
│   │   └── AppAsset.php
│   ├── config/
│   │   ├── .gitignore
│   │   ├── bootstrap.php
│   │   ├── main.php
│   │   └── params.php
│   ├── controllers/
│   │   ├── CenterController.php
│   │   ├── Controller.php
│   │   ├── NavController.php
│   │   ├── NavUrlController.php
│   │   ├── PostController.php
│   │   ├── PostMetaController.php
│   │   ├── RightLinkController.php
│   │   ├── SearchLogController.php
│   │   ├── SiteController.php
│   │   └── UserController.php
│   ├── models/
│   │   ├── .gitkeep
│   │   ├── PostSearch.php
│   │   ├── RightLinkSearch.php
│   │   ├── SearchLogSearch.php
│   │   └── User.php
│   ├── runtime/
│   │   └── .gitignore
│   ├── views/
│   │   ├── layouts/
│   │   │   ├── content.php
│   │   │   ├── header.php
│   │   │   ├── left.php
│   │   │   ├── main-login.php
│   │   │   └── main.php
│   │   ├── nav/
│   │   │   ├── _form.php
│   │   │   ├── create.php
│   │   │   ├── index.php
│   │   │   ├── update.php
│   │   │   └── view.php
│   │   ├── nav-url/
│   │   │   ├── _form.php
│   │   │   ├── create.php
│   │   │   ├── index.php
│   │   │   ├── update.php
│   │   │   └── view.php
│   │   ├── post/
│   │   │   ├── _form.php
│   │   │   ├── _search.php
│   │   │   ├── create.php
│   │   │   ├── index.php
│   │   │   ├── update.php
│   │   │   └── view.php
│   │   ├── post-meta/
│   │   │   ├── _form.php
│   │   │   ├── _search.php
│   │   │   ├── create.php
│   │   │   ├── index.php
│   │   │   ├── update.php
│   │   │   └── view.php
│   │   ├── right-link/
│   │   │   ├── _form.php
│   │   │   ├── _search.php
│   │   │   ├── create.php
│   │   │   ├── index.php
│   │   │   ├── update.php
│   │   │   └── view.php
│   │   ├── search-log/
│   │   │   ├── _search.php
│   │   │   └── index.php
│   │   ├── site/
│   │   │   ├── error.php
│   │   │   ├── index.php
│   │   │   └── login.php
│   │   └── user/
│   │       ├── _form.php
│   │       ├── _search.php
│   │       ├── index.php
│   │       ├── update.php
│   │       └── view.php
│   └── web/
│       ├── .gitignore
│       ├── .htaccess
│       ├── assets/
│       │   └── .gitignore
│       ├── css/
│       │   ├── sb-admin-2.css
│       │   └── site.css
│       ├── js/
│       │   └── sb-admin-2.js
│       └── robots.txt
├── common/
│   ├── assets/
│   │   ├── AtJs.php
│   │   ├── CaretJs.php
│   │   └── DropzoneJs.php
│   ├── components/
│   │   ├── AssetBundle.php
│   │   ├── ComposerInstaller.php
│   │   ├── Config.php
│   │   ├── Controller.php
│   │   ├── DbAuthManager.php
│   │   ├── FileTarget.php
│   │   ├── GlobalFunctions.php
│   │   ├── Mailer.php
│   │   └── db/
│   │       ├── ActiveRecord.php
│   │       ├── Command.php
│   │       ├── Connection.php
│   │       └── Migration.php
│   ├── config/
│   │   ├── .gitignore
│   │   ├── bootstrap.php
│   │   ├── main.php
│   │   └── params.php
│   ├── grid/
│   │   └── EnumColumn.php
│   ├── helpers/
│   │   ├── Arr.php
│   │   ├── Avatar.php
│   │   ├── Formatter.php
│   │   └── UploadHelper.php
│   ├── mail/
│   │   ├── backup.php
│   │   ├── layouts/
│   │   │   └── html.php
│   │   └── passwordResetToken.php
│   ├── messages/
│   │   ├── pt-BR/
│   │   │   ├── backend.php
│   │   │   ├── common.php
│   │   │   └── frontend.php
│   │   └── zh-CN/
│   │       ├── backend.php
│   │       ├── common.php
│   │       └── frontend.php
│   ├── models/
│   │   ├── LoginForm.php
│   │   ├── Nav.php
│   │   ├── NavUrl.php
│   │   ├── Post.php
│   │   ├── PostComment.php
│   │   ├── PostMeta.php
│   │   ├── PostMetaSearch.php
│   │   ├── PostSearch.php
│   │   ├── PostTag.php
│   │   ├── PostTagSearch.php
│   │   ├── RightLink.php
│   │   ├── Search.php
│   │   ├── SearchLog.php
│   │   ├── Session.php
│   │   ├── User.php
│   │   ├── UserInfo.php
│   │   └── UserSearch.php
│   ├── services/
│   │   ├── CommentService.php
│   │   ├── NotificationService.php
│   │   ├── PostService.php
│   │   ├── TopicService.php
│   │   ├── TweetService.php
│   │   └── UserService.php
│   └── widgets/
│       └── JsBlock.php
├── composer.json
├── console/
│   ├── config/
│   │   ├── .gitignore
│   │   ├── bootstrap.php
│   │   ├── main.php
│   │   └── params.php
│   ├── controllers/
│   │   ├── .gitkeep
│   │   ├── InstallController.php
│   │   └── SyncController.php
│   ├── migrations/
│   │   ├── m130524_201442_init.php
│   │   ├── m150104_071047_init_blog.php
│   │   ├── m150104_091352_init_user.php
│   │   ├── m150115_081356_create_user_info.php
│   │   ├── m150201_142415_update_user.php
│   │   ├── m150205_085033_update_post_comment.php
│   │   ├── m150209_015931_setting_init.php
│   │   ├── m150209_090406_create_user_account.php
│   │   ├── m150211_070335_update_user_info.php
│   │   ├── m150212_030127_update_user_info_and_post_meta.php
│   │   ├── m150212_132400_create_topics_table.php
│   │   ├── m150214_070754_update_post_meta.php
│   │   ├── m150412_034147_update_site_setting.php
│   │   ├── m150416_134819_create_notification_table.php
│   │   ├── m150420_060807_update_post_table.php
│   │   ├── m150424_025409_update_table_engine.php
│   │   ├── m150424_031429_update_notification_table.php
│   │   ├── m150424_100155_update_post_meta_table.php
│   │   ├── m150425_031844_create_right_link.php
│   │   ├── m150626_073539_create_nav.php
│   │   ├── m150626_073559_create_nav_url.php
│   │   ├── m150702_130239_create_session_init.php
│   │   ├── m150805_085832_create_search_log_table.php
│   │   ├── m150808_025734_update_table_character.php
│   │   ├── m150829_091943_update_post_table.php
│   │   ├── m160320_093621_create_merit_table.php
│   │   ├── m160321_132724_add_donate_table.php
│   │   ├── m160719_093527_modify_user.php
│   │   ├── m190624_022722_create_spam_table.php
│   │   ├── m190908_053628_init_admin.php
│   │   └── m190908_055507_init_data.php
│   ├── models/
│   │   └── .gitkeep
│   └── runtime/
│       └── .gitignore
├── doc/
│   └── README.md
├── docker-files/
│   ├── docker-compose-example.yml
│   ├── getyii.com.conf
│   └── run.sh
├── environments/
│   ├── dev/
│   │   ├── backend/
│   │   │   ├── config/
│   │   │   │   ├── main-local.php
│   │   │   │   └── params-local.php
│   │   │   └── web/
│   │   │       ├── index-test.php
│   │   │       └── index.php
│   │   ├── common/
│   │   │   └── config/
│   │   │       ├── db.php
│   │   │       ├── main-local.php
│   │   │       └── params-local.php
│   │   ├── console/
│   │   │   └── config/
│   │   │       ├── main-local.php
│   │   │       └── params-local.php
│   │   ├── frontend/
│   │   │   ├── config/
│   │   │   │   ├── main-local.php
│   │   │   │   └── params-local.php
│   │   │   └── web/
│   │   │       ├── index-test.php
│   │   │       └── index.php
│   │   └── yii
│   ├── index.php
│   └── prod/
│       ├── backend/
│       │   ├── config/
│       │   │   ├── main-local.php
│       │   │   └── params-local.php
│       │   └── web/
│       │       └── index.php
│       ├── common/
│       │   └── config/
│       │       ├── db.php
│       │       ├── main-local.php
│       │       └── params-local.php
│       ├── console/
│       │   └── config/
│       │       ├── main-local.php
│       │       └── params-local.php
│       ├── frontend/
│       │   ├── config/
│       │   │   ├── main-local.php
│       │   │   └── params-local.php
│       │   └── web/
│       │       └── index.php
│       └── yii
├── frontend/
│   ├── assets/
│   │   ├── AppAsset.php
│   │   ├── AtJsAsset.php
│   │   ├── BowerAsset.php
│   │   ├── EditorAsset.php
│   │   └── EmojifyAsset.php
│   ├── behaviors/
│   │   └── AfterLoginBehavior.php
│   ├── config/
│   │   ├── .gitignore
│   │   ├── bootstrap.php
│   │   ├── main.php
│   │   ├── params.php
│   │   └── search.ini
│   ├── controllers/
│   │   ├── NotificationController.php
│   │   ├── PostTagController.php
│   │   └── SiteController.php
│   ├── messages/
│   │   └── zh-CN/
│   │       └── app.php
│   ├── models/
│   │   ├── ContactForm.php
│   │   ├── Notification.php
│   │   ├── PasswordResetRequestForm.php
│   │   ├── ResetPasswordForm.php
│   │   └── SignupForm.php
│   ├── modules/
│   │   ├── nav/
│   │   │   ├── Module.php
│   │   │   ├── controllers/
│   │   │   │   └── DefaultController.php
│   │   │   └── views/
│   │   │       └── default/
│   │   │           └── index.php
│   │   ├── topic/
│   │   │   ├── Module.php
│   │   │   ├── controllers/
│   │   │   │   ├── CommentController.php
│   │   │   │   └── DefaultController.php
│   │   │   ├── models/
│   │   │   │   └── Topic.php
│   │   │   └── views/
│   │   │       ├── comment/
│   │   │       │   ├── _form.php
│   │   │       │   ├── _item.php
│   │   │       │   ├── create.php
│   │   │       │   ├── index.php
│   │   │       │   └── update.php
│   │   │       └── default/
│   │   │           ├── _form.php
│   │   │           ├── _item.php
│   │   │           ├── create.php
│   │   │           ├── index.php
│   │   │           ├── update.php
│   │   │           └── view.php
│   │   ├── tweet/
│   │   │   ├── Module.php
│   │   │   ├── controllers/
│   │   │   │   └── DefaultController.php
│   │   │   ├── models/
│   │   │   │   ├── Tweet.php
│   │   │   │   └── TweetSearch.php
│   │   │   └── views/
│   │   │       └── default/
│   │   │           ├── _form.php
│   │   │           ├── _item.php
│   │   │           └── index.php
│   │   └── user/
│   │       ├── Module.php
│   │       ├── controllers/
│   │       │   ├── ActionController.php
│   │       │   ├── DefaultController.php
│   │       │   ├── SecurityController.php
│   │       │   └── SettingController.php
│   │       ├── models/
│   │       │   ├── AccountForm.php
│   │       │   ├── AvatarForm.php
│   │       │   ├── Donate.php
│   │       │   ├── UserAccount.php
│   │       │   └── UserMeta.php
│   │       └── views/
│   │           ├── default/
│   │           │   ├── _view.php
│   │           │   └── show.php
│   │           └── setting/
│   │               ├── _alert.php
│   │               ├── _menu.php
│   │               ├── account.php
│   │               ├── avatar.php
│   │               ├── donate.php
│   │               ├── networks.php
│   │               └── profile.php
│   ├── runtime/
│   │   └── .gitignore
│   ├── views/
│   │   ├── layouts/
│   │   │   └── main.php
│   │   ├── notification/
│   │   │   ├── _item.php
│   │   │   └── index.php
│   │   ├── partials/
│   │   │   ├── markdwon_help.php
│   │   │   └── users.php
│   │   └── site/
│   │       ├── _item.php
│   │       ├── about.php
│   │       ├── contact.php
│   │       ├── contributors.php
│   │       ├── error.php
│   │       ├── getstart.php
│   │       ├── index.php
│   │       ├── login.php
│   │       ├── markdown.php
│   │       ├── requestPasswordResetToken.php
│   │       ├── resetPassword.php
│   │       ├── signup.php
│   │       ├── tags.php
│   │       ├── timeline.php
│   │       └── users.php
│   ├── web/
│   │   ├── .gitignore
│   │   ├── .htaccess
│   │   ├── assets/
│   │   │   └── .gitignore
│   │   ├── css/
│   │   │   ├── global.css
│   │   │   ├── site-ruyi.css
│   │   │   └── site.css
│   │   ├── js/
│   │   │   ├── At.js
│   │   │   ├── editor.js
│   │   │   ├── jquery.pin.js
│   │   │   ├── main.js
│   │   │   ├── nav.js
│   │   │   └── topic.js
│   │   ├── robots.txt
│   │   └── uploads/
│   │       └── .gitignore
│   └── widgets/
│       ├── Alert.php
│       ├── Connect.php
│       ├── Nav.php
│       ├── NewestPost.php
│       ├── Node.php
│       ├── Panel.php
│       ├── TopicSidebar.php
│       └── views/
│           ├── nav.php
│           ├── node.php
│           ├── panel.php
│           └── topicSidebar.php
├── init
├── init.bat
├── requirements.php
├── tests/
│   ├── README.md
│   ├── codeception/
│   │   ├── _output/
│   │   │   └── .gitignore
│   │   ├── backend/
│   │   │   ├── .gitignore
│   │   │   ├── _bootstrap.php
│   │   │   ├── _output/
│   │   │   │   └── .gitignore
│   │   │   ├── acceptance/
│   │   │   │   ├── LoginCept.php
│   │   │   │   └── _bootstrap.php
│   │   │   ├── acceptance.suite.yml
│   │   │   ├── codeception.yml
│   │   │   ├── functional/
│   │   │   │   ├── LoginCept.php
│   │   │   │   └── _bootstrap.php
│   │   │   ├── functional.suite.yml
│   │   │   ├── unit/
│   │   │   │   ├── DbTestCase.php
│   │   │   │   ├── TestCase.php
│   │   │   │   ├── _bootstrap.php
│   │   │   │   └── fixtures/
│   │   │   │       └── data/
│   │   │   │           └── .gitkeep
│   │   │   └── unit.suite.yml
│   │   ├── bin/
│   │   │   ├── _bootstrap.php
│   │   │   ├── yii
│   │   │   └── yii.bat
│   │   ├── common/
│   │   │   ├── .gitignore
│   │   │   ├── _bootstrap.php
│   │   │   ├── _output/
│   │   │   │   └── .gitignore
│   │   │   ├── _pages/
│   │   │   │   └── LoginPage.php
│   │   │   ├── _support/
│   │   │   │   └── FixtureHelper.php
│   │   │   ├── codeception.yml
│   │   │   ├── fixtures/
│   │   │   │   ├── UserFixture.php
│   │   │   │   └── data/
│   │   │   │       └── init_login.php
│   │   │   ├── templates/
│   │   │   │   └── fixtures/
│   │   │   │       └── user.php
│   │   │   ├── unit/
│   │   │   │   ├── DbTestCase.php
│   │   │   │   ├── TestCase.php
│   │   │   │   ├── _bootstrap.php
│   │   │   │   ├── fixtures/
│   │   │   │   │   └── data/
│   │   │   │   │       └── models/
│   │   │   │   │           └── user.php
│   │   │   │   └── models/
│   │   │   │       └── LoginFormTest.php
│   │   │   └── unit.suite.yml
│   │   ├── config/
│   │   │   ├── acceptance.php
│   │   │   ├── backend/
│   │   │   │   ├── acceptance.php
│   │   │   │   ├── config.php
│   │   │   │   ├── functional.php
│   │   │   │   └── unit.php
│   │   │   ├── common/
│   │   │   │   └── unit.php
│   │   │   ├── config.php
│   │   │   ├── console/
│   │   │   │   └── unit.php
│   │   │   ├── frontend/
│   │   │   │   ├── acceptance.php
│   │   │   │   ├── config.php
│   │   │   │   ├── functional.php
│   │   │   │   └── unit.php
│   │   │   ├── functional.php
│   │   │   └── unit.php
│   │   ├── console/
│   │   │   ├── .gitignore
│   │   │   ├── _bootstrap.php
│   │   │   ├── _output/
│   │   │   │   └── .gitignore
│   │   │   ├── codeception.yml
│   │   │   ├── unit/
│   │   │   │   ├── DbTestCase.php
│   │   │   │   ├── TestCase.php
│   │   │   │   ├── _bootstrap.php
│   │   │   │   └── fixtures/
│   │   │   │       └── data/
│   │   │   │           └── .gitkeep
│   │   │   └── unit.suite.yml
│   │   └── frontend/
│   │       ├── .gitignore
│   │       ├── _bootstrap.php
│   │       ├── _output/
│   │       │   └── .gitignore
│   │       ├── _pages/
│   │       │   ├── AboutPage.php
│   │       │   ├── ContactPage.php
│   │       │   └── SignupPage.php
│   │       ├── acceptance/
│   │       │   ├── AboutCept.php
│   │       │   ├── ContactCept.php
│   │       │   ├── HomeCept.php
│   │       │   ├── LoginCept.php
│   │       │   ├── SignupCest.php
│   │       │   └── _bootstrap.php
│   │       ├── acceptance.suite.yml
│   │       ├── codeception.yml
│   │       ├── functional/
│   │       │   ├── AboutCept.php
│   │       │   ├── ContactCept.php
│   │       │   ├── HomeCept.php
│   │       │   ├── LoginCept.php
│   │       │   ├── SignupCest.php
│   │       │   └── _bootstrap.php
│   │       ├── functional.suite.yml
│   │       ├── unit/
│   │       │   ├── DbTestCase.php
│   │       │   ├── TestCase.php
│   │       │   ├── _bootstrap.php
│   │       │   ├── fixtures/
│   │       │   │   └── data/
│   │       │   │       └── models/
│   │       │   │           └── user.php
│   │       │   └── models/
│   │       │       ├── ContactFormTest.php
│   │       │       ├── PasswordResetRequestFormTest.php
│   │       │       ├── ResetPasswordFormTest.php
│   │       │       └── SignupFormTest.php
│   │       └── unit.suite.yml
│   └── codeception.yml
└── yii.bat

================================================
FILE CONTENTS
================================================

================================================
FILE: .bowerrc
================================================
{
    "directory" : "vendor/bower"
}


================================================
FILE: .gitignore
================================================
# yii console command
/yii

# phpstorm 项目文件
.idea

# netbeans 项目文件
nbproject

# zend studio for eclipse 项目文件
.buildpath
.project
.settings

# windows 缩略图换成
Thumbs.db

# composer 供应商目录
/vendor

# composer 它本身是不需要的(客户端自行升级最新版)
composer.phar

# Mac DS_Store 文件
.DS_Store

# phpunit 它本身是不需要的
phpunit.phar
# 本地 phpunit 配置文件
/phpunit.xml

/docker-compose.yml
/supervisord.log
/supervisord.pid


# database config
/common/config/db-local.php

# install lock file
install.lock


================================================
FILE: .travis.yml
================================================
language: php
php:
  - 5.4
  - 5.5
  - 5.6

install:
  - travis_retry composer self-update && composer --version
  - travis_retry composer global require "fxp/composer-asset-plugin:~1.1.1"
  - export PATH="$HOME/.composer/vendor/bin:$PATH"

before_script: composer install --prefer-source

#script: phpunit --configuration phpunit.xml.dist

cache:
  directories:
    - vendor

#matrix:
#  allow_failures:
#    - php: hhvm

================================================
FILE: Dockerfile
================================================
FROM dcb9/php-fpm:latest

MAINTAINER Bob <bob@phpor.me>

RUN apt-get update \
  && apt-get install -y --no-install-recommends git vim \
  && rm -rf /var/lib/apt/lists/*

# http://serverfault.com/questions/599103/make-a-docker-application-write-to-stdout
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
  && ln -sf /dev/stderr /var/log/nginx/error.log \
  && mkdir /app
WORKDIR /app

ENV COMPOSER_HOME /root/.composer
ENV PATH /root/.composer/vendor/bin:$PATH
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
  # add chinese image http://pkg.phpcomposer.com/
  && composer config -g repositories.packagist composer http://packagist.phpcomposer.com \
  && /usr/local/bin/composer global require --prefer-source --no-interaction "fxp/composer-asset-plugin"

COPY docker-files/getyii.com.conf /etc/nginx/conf.d/
RUN docker-php-ext-install mysqli pdo pdo_mysql \
  && rm -rf /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/example_ssl.conf
COPY . /app/

RUN chmod 700 docker-files/run.sh init

VOLUME ["/root/.composer", "/app/vendor"]
CMD ["docker-files/run.sh"]
EXPOSE 80


================================================
FILE: LICENSE.md
================================================
The Yii framework is free software. It is released under the terms of
the following BSD License.

Copyright © 2008 by Yii Software LLC (http://www.yiisoft.com)
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

 * Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in
   the documentation and/or other materials provided with the
   distribution.
 * Neither the name of Yii Software LLC nor the names of its
   contributors may be used to endorse or promote products derived
   from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.


================================================
FILE: README.md
================================================
GetYii
==================

[![Latest Stable Version](https://poser.pugx.org/iiyii/getyii/v/stable)](https://packagist.org/packages/iiyii/getyii) 
[![Total Downloads](https://poser.pugx.org/iiyii/getyii/downloads)](https://packagist.org/packages/iiyii/getyii) 
[![Latest Unstable Version](https://poser.pugx.org/iiyii/getyii/v/unstable)](https://packagist.org/packages/iiyii/getyii) 
[![License](https://poser.pugx.org/iiyii/getyii/license)](https://packagist.org/packages/iiyii/getyii)

community for Yii2

## 说明

你现在看到的是全新版本的 GetYii 之前的版本我放在 V1 分支上面了,那个版本以后可能就不会更新了。
「doc/images」文件夹里面有截图,你们可以看一下。

全新的 GetYii 只专注于社区,现在基本功能已经 OK 了,以后我们会不断完善的。分享我们的 [trello 项目管理地址](https://trello.com/b/rsZAtG1Y/getyii)。

## 项目搭建

### 原始安装方法(推荐)

1、首先你要安装 [Composer](http://www.yiiframework.com/doc-2.0/guide-start-installation.html#installing-via-composer),然后你需要手动去新建一个数据库,比方说新建 `getyii` 数据库,如果想使用 emoji 表情的话,意见使用 `utf8mb4` 编码格式,不想用的话,
建议使用 `utf8` 编码格式。

```
git clone https://github.com/iiYii/getyii.git
cd getyii
composer install
php init
```

2、然后修改数据库配置文件的配置信息

```
vim common/config/db.php
```

再使用运行我写的安装程序(帮你生成数据库表和假数据)

```
php yii install 
```

或者直接执行数据库迁移工具生成数据库表

```
php yii migrate 
```

### composer 安装方法(可能不是最新的)

1、首先你要安装 [Composer](http://www.yiiframework.com/doc-2.0/guide-start-installation.html#installing-via-composer),然后你需要手动去新建一个数据库,比方说新建 `getyii` 数据库,如果想使用 emoji 表情的话,意见使用 `utf8mb4` 编码格式,不想用的话,
建议使用 `utf8` 编码格式。

```
composer create-project --prefer-dist --stability=dev iiyii/getyii getyii
cd getyii
php init
```

2、然后复制一份数据库配置,并且修改数据库配置,

```
cp common/config/db.php common/config/db-local.php
```

再使用运行我写的安装程序(帮你生成数据库表和假数据)

```
php yii install 
```

或者直接执行数据库迁移工具生成数据库表

```
php yii migrate 
```

### docker 搭建方法

1. 安装好 docker 保证可以运行 docker 和 docker-compose 命令
2. 克隆代码到你本地,并 cd 到相应目录
3. 启动 getyii 应用

$ cp docker-files/docker-compose-example.yml docker-compose.yml

$ docker-compose up -d

访问 getyii

添加以下两个域名加到自己机器的 host 里面

	<your_docker_ip> <your_name>.dev.getyii.com 前台
	<your_docker_ip> <your_name>.dev.admin.getyii.com 后台

### 用户相关

1. 把 user 表中的某用户值 role 字段值改为20,即为前台管理员,目前可以给帖子加精华,不能登录后台。
1. 把 user 表中的某用户值 role 字段值改为30,即为超级管理员,可登录后台。


## 文档和手册

1. [Yii2手册](http://book.getyii.com)
2. [中文 Composer 手册](http://docs.phpcomposer.com/)


## 安装遇到问题怎么办?

建议在官网的[社区版块](http://www.getyii.com/topic/default/create)**新手提问**下面提问,我会抽空亲自回答。请最大可能的把问题描述清楚,以免浪费我们彼此的时间。

## 交流群

- Yii2 中国交流群:343188481
- Get√Yii 开发者群:321493381

## 捐赠

![微信支付](https://raw.githubusercontent.com/iiYii/getyii/master/wechat-pay.png)
![支付宝支付](https://raw.githubusercontent.com/iiYii/getyii/master/ali-pay.png)

手机微信或者支付宝扫描上方二维码可向本项目捐款


感谢以下这些朋友的资金支持,所得捐赠将用于改善网站服务器、购买开发/调试设备&工具。


捐赠人    | 金额 | 时间 | 说明
-------|------|------ | ------
张**  | 1.00  | 2015年7月7日 | http://asjmtz.com/
*作军  | 100.00 | 2015年08月07日 | dba-china
树*  | 333.00 | 2015年09月11日 | http://www.21cnjy.com/
*作军  | 300.00 | 2016年04月28日 | dba-china
*勇  | 20.00 | 2017年05月31日 | http://www.fecshop.com/
*勇  | 66.00 | 2017年12月21日 | http://www.fecshop.com/


## 他们正在使用 GetYii

- DBA-CHINA
- [Fecshop 社区](http://www.fecshop.com/)

## 感谢

- 感谢 [Ruby-China](https://github.com/ruby-china/ruby-china) 的开源代码。
- 感谢 [PHPHub](https://github.com/summerblue/phphub) 的开源代码。
- 感谢 [huajuan](https://github.com/callmez/huajuan) 的开源代码。
- 最后再感谢一下女朋友的支持 <(▰˘◡˘▰)>。

PS:

如果你暂时无法使用 `composer` 的话,访问链接: <http://pan.baidu.com/s/1eQnsn7s> 密码: ux6c 下载 zip 文件解压就可以用了。然后你要做的是:

- 新建数据库导入 getyii-2015-11-3.sql 数据库
- 修改 `common\config\db-local.php` 文件的数据库配置
- 默认用户名是`admin`,密码是`123456`


================================================
FILE: backend/assets/AppAsset.php
================================================
<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace backend\assets;

use yii\web\AssetBundle;

/**
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class AppAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'css/site.css',
    ];
    public $js = [
    ];
    public $depends = [
        'yii\web\YiiAsset',
        'yii\bootstrap\BootstrapAsset',
    ];
}


================================================
FILE: backend/config/.gitignore
================================================
main-local.php
params-local.php

================================================
FILE: backend/config/bootstrap.php
================================================
<?php


================================================
FILE: backend/config/main.php
================================================
<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-backend',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'backend\controllers',
    'bootstrap' => ['log'],
    'language' => 'zh-CN',
    'modules' => [
        'setting' => [
            'class' => 'funson86\setting\Module',
            'controllerNamespace' => 'funson86\setting\controllers',
        ],
        'backup' => [
            'class' => 'yiier\backup\Module',
        ],
        'merit' => [
            'class' => 'yiier\merit\Module',
        ],
    ],
    'components' => [
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
            ],
        ],
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
    ],
    'params' => $params,
];


================================================
FILE: backend/config/params.php
================================================
<?php
return [
    'adminEmail' => 'admin@example.com',
];


================================================
FILE: backend/controllers/CenterController.php
================================================
<?php
namespace backend\controllers;

use Yii;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;
/**
 * Site controller
 */
class CenterController extends Controller
{
    /**
     * @inheritdoc
     */
    public $layout = 'center';


    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'actions' => ['login', 'error'],
                        'allow' => true,
                    ],
                    [
                        'actions' => ['index','test'],
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'logout' => ['post'],
                ],
            ],
        ];
    }

    /**
     * @inheritdoc
     */
    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
        ];
    }



    public function actionIndex()
    {
        return $this->render('index');
    }

    public function actionTest()
    {
        return $this->render('index');
    }

}


================================================
FILE: backend/controllers/Controller.php
================================================
<?php
/**
 * author     : forecho <caizh@chexiu.cn>
 * createTime : 2016/3/10 14:39
 * description:
 */

namespace backend\controllers;

use yii\filters\AccessControl;
use common\models\User;
use yii\web\ForbiddenHttpException;

class Controller extends \yii\web\Controller
{
    public function behaviors()
    {
        return [
            // 后台必须登录才能使用
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
        ];
    }


    /**
     * @param \yii\base\Action $action
     * @return bool
     * @throws \yii\web\BadRequestHttpException
     */
    public function beforeAction($action)
    {
        if (parent::beforeAction($action)) {
            $uniqueid = $action->controller->action->uniqueid;
            if (!in_array($uniqueid, ['site/login', 'site/logout', 'site/error']) && !User::currUserIsSuperAdmin()) {
                throw new ForbiddenHttpException;
            }
            return true;
        } else {
            return false;
        }
    }
}

================================================
FILE: backend/controllers/NavController.php
================================================
<?php

namespace backend\controllers;

use Yii;
use common\models\Nav;
use yii\data\ActiveDataProvider;
use yii\web\NotFoundHttpException;

/**
 * NavController implements the CRUD actions for Nav model.
 */
class NavController extends Controller
{
    /**
     * Lists all Nav models.
     * @return mixed
     */
    public function actionIndex()
    {
        $dataProvider = new ActiveDataProvider([
            'query' => Nav::find(),
        ]);

        return $this->render('index', [
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single Nav model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new Nav model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new Nav();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing Nav model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing Nav model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the Nav model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return Nav the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = Nav::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


================================================
FILE: backend/controllers/NavUrlController.php
================================================
<?php

namespace backend\controllers;

use Yii;
use common\models\NavUrl;
use yii\data\ActiveDataProvider;
use yii\web\NotFoundHttpException;

/**
 * NavUrlController implements the CRUD actions for NavUrl model.
 */
class NavUrlController extends Controller
{

    /**
     * Lists all NavUrl models.
     * @return mixed
     */
    public function actionIndex()
    {
        $dataProvider = new ActiveDataProvider([
            'query' => NavUrl::find(),
        ]);

        return $this->render('index', [
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single NavUrl model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new NavUrl model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new NavUrl();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing NavUrl model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing NavUrl model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the NavUrl model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return NavUrl the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = NavUrl::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


================================================
FILE: backend/controllers/PostController.php
================================================
<?php

namespace backend\controllers;

use Yii;
use common\models\Post;
use backend\models\PostSearch;
use yii\web\NotFoundHttpException;

/**
 * PostController implements the CRUD actions for Post model.
 */
class PostController extends Controller
{
    /**
     * Lists all Post models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new PostSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single Post model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new Post model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new Post();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }


    /**
     * Updates an existing Post model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing Post model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the Post model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return Post the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = Post::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


================================================
FILE: backend/controllers/PostMetaController.php
================================================
<?php

namespace backend\controllers;

use Yii;
use common\models\PostMeta;
use common\models\PostMetaSearch;
use yii\web\NotFoundHttpException;

/**
 * PostMetaController implements the CRUD actions for PostMeta model.
 */
class PostMetaController extends Controller
{
    /**
     * Lists all PostMeta models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new PostMetaSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Creates a new PostMeta model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new PostMeta();
        $model->order = 999;
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect('index');
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing PostMeta model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect('index');
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing PostMeta model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the PostMeta model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return PostMeta the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = PostMeta::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


================================================
FILE: backend/controllers/RightLinkController.php
================================================
<?php

namespace backend\controllers;

use Yii;
use common\models\RightLink;
use backend\models\RightLinkSearch;
use yii\web\NotFoundHttpException;

/**
 * RightLinkController implements the CRUD actions for RightLink model.
 */
class RightLinkController extends Controller
{
    /**
     * Lists all RightLink models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new RightLinkSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single RightLink model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new RightLink model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new RightLink();
        $request = Yii::$app->request->post();
        $request['RightLink']['created_user'] = Yii::$app->user->identity->username;

        if ($model->load($request) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing RightLink model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing RightLink model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the RightLink model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return RightLink the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = RightLink::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}

================================================
FILE: backend/controllers/SearchLogController.php
================================================
<?php

namespace backend\controllers;

use Yii;
use common\models\SearchLog;
use backend\models\SearchLogSearch;
use yii\web\NotFoundHttpException;

/**
 * SearchLogController implements the CRUD actions for SearchLog model.
 */
class SearchLogController extends Controller
{
    /**
     * Lists all SearchLog models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new SearchLogSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Deletes an existing SearchLog model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the SearchLog model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return SearchLog the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = SearchLog::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


================================================
FILE: backend/controllers/SiteController.php
================================================
<?php
namespace backend\controllers;

use Yii;
use yii\filters\AccessControl;
use common\models\LoginForm;
use yii\filters\VerbFilter;

/**
 * Site controller
 */
class SiteController extends Controller
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'actions' => ['login', 'error'],
                        'allow' => true,
                    ],
                    [
                        'actions' => ['logout', 'index'],
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'logout' => ['post'],
                ],
            ],
        ];
    }

    /**
     * @param \yii\base\Action $action
     * @return bool
     * @throws \yii\web\BadRequestHttpException
     */
    public function beforeAction($action)
    {
        if (parent::beforeAction($action)) {
            if ($action->id == 'error' && Yii::$app->user->isGuest) {
                $this->layout = 'main-login';
            }
            return true;
        } else {
            return false;
        }
    }

    /**
     * @inheritdoc
     */
    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
        ];
    }

    public function actionIndex()
    {
        return $this->render('index');
    }

    public function actionLogin()
    {
        if (!\Yii::$app->user->isGuest) {
            return $this->goHome();
        }

        $model = new LoginForm();
        if ($model->load(Yii::$app->request->post()) && $model->loginAdmin()) {
            return $this->goBack();
        } else {
            $data['model'] = $model;
            return $this->render('login', $data);
        }
    }

    public function actionLogout()
    {
        Yii::$app->user->logout();

        return $this->goHome();
    }
}


================================================
FILE: backend/controllers/UserController.php
================================================
<?php

namespace backend\controllers;

use Yii;
use common\models\User;
use common\models\UserSearch;
use yii\web\NotFoundHttpException;

/**
 * UserController implements the CRUD actions for User model.
 */
class UserController extends Controller
{
    /**
     * Lists all User models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new UserSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single User model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new User model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new User();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing User model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing User model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the User model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return User the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = User::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


================================================
FILE: backend/models/.gitkeep
================================================
*


================================================
FILE: backend/models/PostSearch.php
================================================
<?php

namespace backend\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\Post;

/**
 * PostSearch represents the model behind the search form about `common\Models\Post`.
 */
class PostSearch extends Post
{
    public $category_name;
    public $username;

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'post_meta_id', 'user_id', 'view_count', 'comment_count', 'favorite_count', 'like_count', 'thanks_count', 'hate_count', 'status', 'order', 'created_at', 'updated_at'], 'integer'],
            [['type', 'title', 'author', 'excerpt', 'image', 'content', 'tags', 'category_name', 'username'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * @param $params
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Post::find()->joinWith(['category', 'user']);

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'pageSize' => 20,
            ],
            'sort' => ['defaultOrder' => [
                'order' => SORT_ASC,
                'updated_at' => SORT_DESC,
            ]]
        ]);

        $dataProvider->sort->attributes['category_name'] = [
            'asc' => ['name' => SORT_ASC],
            'desc' => ['name' => SORT_DESC],
        ];
        $dataProvider->sort->attributes['username'] = [
            'asc' => ['username' => SORT_ASC],
            'desc' => ['username' => SORT_DESC],
        ];

        if (!($this->load($params) && $this->validate())) {
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'post_meta_id' => $this->post_meta_id,
            'user_id' => $this->user_id,
            'view_count' => $this->view_count,
            'comment_count' => $this->comment_count,
            'favorite_count' => $this->favorite_count,
            'like_count' => $this->like_count,
            'thanks_count' => $this->thanks_count,
            'hate_count' => $this->hate_count,
            Post::tableName() . '.status' => $this->status,
            'order' => $this->order,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', Post::tableName() . '.type', $this->type])
            ->andFilterWhere(['like', 'title', $this->title])
            ->andFilterWhere(['like', 'author', $this->author])
            ->andFilterWhere(['like', 'excerpt', $this->excerpt])
            ->andFilterWhere(['like', 'image', $this->image])
            ->andFilterWhere(['like', 'content', $this->content])
            ->andFilterWhere(['like', 'tags', $this->tags])
            ->andFilterWhere(['like', 'name', $this->category_name])
            ->andFilterWhere(['like', 'username', $this->username]);

        return $dataProvider;
    }
}


================================================
FILE: backend/models/RightLinkSearch.php
================================================
<?php

namespace backend\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\RightLink;

/**
 * RightLinkSearch represents the model behind the search form about `common\models\RightLink`.
 */
class RightLinkSearch extends RightLink
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'type', 'created_at', 'updated_at'], 'integer'],
            [['title', 'url', 'image', 'content', 'created_user'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = RightLink::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'type' => $this->type,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', 'title', $this->title])
            ->andFilterWhere(['like', 'url', $this->url])
            ->andFilterWhere(['like', 'image', $this->image])
            ->andFilterWhere(['like', 'content', $this->content])
            ->andFilterWhere(['like', 'created_user', $this->created_user]);

        return $dataProvider;
    }
}

================================================
FILE: backend/models/SearchLogSearch.php
================================================
<?php

namespace backend\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\SearchLog;

/**
 * SearchLogSearch represents the model behind the search form about `common\models\SearchLog`.
 */
class SearchLogSearch extends SearchLog
{
    public $username;
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'user_id', 'created_at'], 'integer'],
            [['keyword', 'username'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = SearchLog::find()->joinWith('user');

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $dataProvider->sort->attributes['username'] = [
            'asc' => ['username' => SORT_ASC],
            'desc' => ['username' => SORT_DESC],
        ];

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'user_id' => $this->user_id,
            'created_at' => $this->created_at,
        ]);

        $query->andFilterWhere(['like', 'keyword', $this->keyword])
            ->andFilterWhere(['like', 'username', $this->username]);;

        return $dataProvider;
    }
}


================================================
FILE: backend/models/User.php
================================================
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%user}}".
 *
 * @property integer $id
 * @property string $username
 * @property string $auth_key
 * @property string $password_hash
 * @property string $password_reset_token
 * @property string $email
 * @property integer $role
 * @property integer $status
 * @property integer $created_at
 * @property integer $updated_at
 */
class User extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%user}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['username', 'auth_key', 'password_hash', 'email', 'created_at', 'updated_at'], 'required'],
            [['role', 'status', 'created_at', 'updated_at'], 'integer'],
            [['username', 'password_hash', 'password_reset_token', 'email'], 'string', 'max' => 255],
            [['auth_key'], 'string', 'max' => 32]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'username' => Yii::t('app', 'Username'),
            'auth_key' => Yii::t('app', 'Auth Key'),
            'password_hash' => Yii::t('app', 'Password Hash'),
            'password_reset_token' => Yii::t('app', 'Password Reset Token'),
            'email' => Yii::t('app', 'Email'),
            'role' => Yii::t('app', 'Role'),
            'status' => Yii::t('app', 'Status'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
        ];
    }
}


================================================
FILE: backend/runtime/.gitignore
================================================
*
!.gitignore

================================================
FILE: backend/views/layouts/content.php
================================================
<?php
use yii\widgets\Breadcrumbs;
use dmstr\widgets\Alert;

?>
<div class="content-wrapper">
    <section class="content-header">
        <?php if (isset($this->blocks['content-header'])) { ?>
            <h1><?= $this->blocks['content-header'] ?></h1>
        <?php } else { ?>
            <h1>
                <?php
                if ($this->title !== null) {
                    echo \yii\helpers\Html::encode($this->title);
                } else {
                    echo \yii\helpers\Inflector::camel2words(
                        \yii\helpers\Inflector::id2camel($this->context->module->id)
                    );
                    echo ($this->context->module->id !== \Yii::$app->id) ? '<small>Module</small>' : '';
                } ?>
            </h1>
        <?php } ?>

        <?=
        Breadcrumbs::widget(
            [
                'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
            ]
        ) ?>
    </section>

    <section class="content">
        <?= Alert::widget() ?>
        <?= $content ?>
    </section>
</div>

<footer class="main-footer">
    <div class="pull-right hidden-xs">
        <b>Version</b> 2.0
    </div>
    <strong>Copyright &copy; 2014-2015 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights
    reserved.
</footer>

<!-- Add the sidebar's background. This div must be placed
     immediately after the control sidebar -->
<div class='control-sidebar-bg'></div>

================================================
FILE: backend/views/layouts/header.php
================================================
<?php
use yii\helpers\Html;

/* @var $this \yii\web\View */
/* @var $content string */
?>

<header class="main-header">

    <?= Html::a('<span class="logo-mini">APP</span><span class="logo-lg">' . Yii::$app->setting->get('siteName') . '</span>', Yii::$app->homeUrl, ['class' => 'logo']) ?>

    <nav class="navbar navbar-static-top" role="navigation">

        <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
            <span class="sr-only">Toggle navigation</span>
        </a>

        <div class="navbar-custom-menu">

            <ul class="nav navbar-nav">
                <!-- User Account: style can be found in dropdown.less -->
                <li>
                    <?= Html::a(
                        'Logout (' . Yii::$app->user->identity->username . ')',
                        ['/site/logout'],
                        ['data-method' => 'post', 'class' => 'btn btn-flat']
                    ) ?>
                </li>
            </ul>
        </div>
    </nav>
</header>


================================================
FILE: backend/views/layouts/left.php
================================================
<aside class="main-sidebar">

    <section class="sidebar">

        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left image">
                <img src="<?= $directoryAsset ?>/img/user2-160x160.jpg" class="img-circle" alt="User Image"/>
            </div>
            <div class="pull-left info">
                <p><?= Yii::$app->user->identity->username ?></p>

                <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
            </div>
        </div>

        <!-- search form -->
        <form action="#" method="get" class="sidebar-form">
            <div class="input-group">
                <input type="text" name="q" class="form-control" placeholder="Search..."/>
              <span class="input-group-btn">
                <button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
            </div>
        </form>
        <!-- /.search form -->

        <?php
            $debugMenu = [];
            if (!YII_ENV_TEST) {
                $debugMenu = [
                    ['label' => 'Menu Yii2', 'options' => ['class' => 'header']],
                    [
                        'label' => 'Same tools',
                        'icon' => 'fa fa-share',
                        'url' => '#',
                        'items' => [
                            ['label' => 'Gii', 'icon' => 'file-code-o', 'url' => ['/gii']],
                            ['label' => 'Debug', 'icon' => 'dashboard', 'url' => ['/debug']]
                        ],
                    ]
                ];
            }
        ?>

        <?= dmstr\widgets\Menu::widget(
            [
                'options' => ['class' => 'sidebar-menu tree','data-widget'=>'tree'],
                'items' => array_merge([
                    ['label' => 'Menu', 'options' => ['class' => 'header']],
                    ['label' => '用户管理', 'icon' => 'users', 'url' => ['/user/index']],
                    ['label' => '文章管理', 'icon' => 'comment-o', 'url' => ['/post/index']],
                    ['label' => '分类管理', 'icon' => 'th-list', 'url' => ['/post-meta']],
                    ['label' => '网站配置', 'icon' => 'cog', 'url' => ['/setting/default']],
                    [
                        'label' => '网站导航', 'url' => '#', 'icon' => 'share',
                        'items' => [
                            ['label' => '导航分类', 'icon' => 'plane', 'url' => ['/nav/index']],
                            ['label' => '导航链接', 'icon' => 'plane', 'url' => ['/nav-url/index']],
                        ]
                    ],
                    [
                        'label' => '积分模块', 'url' => '#', 'icon' => 'share',
                        'items' => [
                            ['label' => '积分模板', 'icon' => 'money', 'url' => ['/merit/merit-template']],
                            ['label' => '会员积分', 'icon' => 'money', 'url' => ['/merit/merit']],
                            ['label' => '积分日志', 'icon' => 'money', 'url' => ['/merit/merit-log']],
                        ]
                    ],
                    ['label' => '搜索日志', 'icon' => 'search', 'url' => ['/search-log/index']],
                    ['label' => '右边栏设置', 'icon' => 'diamond', 'url' => ['/right-link/index']],
                ], $debugMenu),
            ]
        ) ?>

    </section>

</aside>


================================================
FILE: backend/views/layouts/main-login.php
================================================
<?php
use backend\assets\AppAsset;
use yii\helpers\Html;

/* @var $this \yii\web\View */
/* @var $content string */

dmstr\web\AdminLteAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body class="login-page">

<?php $this->beginBody() ?>

    <?= $content ?>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>


================================================
FILE: backend/views/layouts/main.php
================================================
<?php
use yii\helpers\Html;

/* @var $this \yii\web\View */
/* @var $content string */


if (Yii::$app->controller->action->id === 'login') { 
/**
 * Do not use this code in your template. Remove it. 
 * Instead, use the code  $this->layout = '//main-login'; in your controller.
 */
    echo $this->render(
        'main-login',
        ['content' => $content]
    );
} else {

    if (class_exists('backend\assets\AppAsset')) {
        backend\assets\AppAsset::register($this);
    } else {
        app\assets\AppAsset::register($this);
    }

    dmstr\web\AdminLteAsset::register($this);

    $directoryAsset = Yii::$app->assetManager->getPublishedUrl('@vendor/almasaeed2010/adminlte/dist');
    ?>
    <?php $this->beginPage() ?>
    <!DOCTYPE html>
    <html lang="<?= Yii::$app->language ?>">
    <head>
        <meta charset="<?= Yii::$app->charset ?>"/>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <?= Html::csrfMetaTags() ?>
        <title><?= Html::encode(Yii::$app->setting->get('siteName')) ?></title>
        <?php $this->head() ?>
    </head>
    <body class="hold-transition skin-blue sidebar-mini">
    <?php $this->beginBody() ?>
    <div class="wrapper">

        <?= $this->render(
            'header.php',
            ['directoryAsset' => $directoryAsset]
        ) ?>

        <?= $this->render(
            'left.php',
            ['directoryAsset' => $directoryAsset]
        )
        ?>

        <?= $this->render(
            'content.php',
            ['content' => $content, 'directoryAsset' => $directoryAsset]
        ) ?>

    </div>

    <?php $this->endBody() ?>
    </body>
    </html>
    <?php $this->endPage() ?>
<?php } ?>


================================================
FILE: backend/views/nav/_form.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\Nav */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="nav-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'alias')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'order')->textInput() ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>


================================================
FILE: backend/views/nav/create.php
================================================
<?php

/* @var $this yii\web\View */
/* @var $model common\models\Nav */

$this->title = Yii::t('app', 'Create Nav');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Navs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="nav-create">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>


================================================
FILE: backend/views/nav/index.php
================================================
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Navs');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="nav-index">

    <p>
        <?= Html::a(Yii::t('app', 'Create Nav'), ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'name',
            'alias',
            'order',
            'created_at',
            // 'updated_at',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>

</div>


================================================
FILE: backend/views/nav/update.php
================================================
<?php

/* @var $this yii\web\View */
/* @var $model common\models\Nav */

$this->title = Yii::t('app', 'Update {modelClass}: ', [
    'modelClass' => 'Nav',
]) . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Navs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'Update');
?>
<div class="nav-update">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>


================================================
FILE: backend/views/nav/view.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\Nav */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Navs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="nav-view">

    <p>
        <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'name',
            'alias',
            'order',
            'created_at',
            'updated_at',
        ],
    ]) ?>

</div>


================================================
FILE: backend/views/nav-url/_form.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Nav;

/* @var $this yii\web\View */
/* @var $model common\models\NavUrl */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="nav-url-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'nav_id')->dropDownList(Nav::getNavList()) ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'order')->textInput() ?>


    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>


================================================
FILE: backend/views/nav-url/create.php
================================================
<?php

/* @var $this yii\web\View */
/* @var $model common\models\NavUrl */

$this->title = Yii::t('app', 'Create Nav Url');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Nav Urls'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="nav-url-create">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>


================================================
FILE: backend/views/nav-url/index.php
================================================
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Nav Urls');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="nav-url-index">

    <p>
        <?= Html::a(Yii::t('app', 'Create Nav Url'), ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'nav_id',
            'title',
            'url:url',
            'description',
            // 'order',
            // 'user_id',
            // 'created_at',
            // 'updated_at',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>

</div>


================================================
FILE: backend/views/nav-url/update.php
================================================
<?php

/* @var $this yii\web\View */
/* @var $model common\models\NavUrl */

$this->title = Yii::t('app', 'Update {modelClass}: ', [
    'modelClass' => 'Nav Url',
]) . ' ' . $model->title;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Nav Urls'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'Update');
?>
<div class="nav-url-update">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>


================================================
FILE: backend/views/nav-url/view.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\NavUrl */

$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Nav Urls'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="nav-url-view">

    <p>
        <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'nav_id',
            'title',
            'url:url',
            'description',
            'order',
            'user_id',
            'created_at',
            'updated_at',
        ],
    ]) ?>

</div>


================================================
FILE: backend/views/post/_form.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\Models\Post */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="post-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'post_meta_id')->textInput(['maxlength' => 11]) ?>

    <?= $form->field($model, 'user_id')->textInput(['maxlength' => 11]) ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'author')->textInput(['maxlength' => 100]) ?>

    <?= $form->field($model, 'excerpt')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'image')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'content')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'tags')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'view_count')->textInput(['maxlength' => 11]) ?>

    <?= $form->field($model, 'comment_count')->textInput(['maxlength' => 11]) ?>

    <?= $form->field($model, 'favorite_count')->textInput(['maxlength' => 11]) ?>

    <?= $form->field($model, 'like_count')->textInput(['maxlength' => 11]) ?>

    <?= $form->field($model, 'hate_count')->textInput(['maxlength' => 11]) ?>

    <?= $form->field($model, 'status')->textInput() ?>

    <?= $form->field($model, 'order')->textInput(['maxlength' => 11]) ?>

    <?= $form->field($model, 'created_at')->textInput(['maxlength' => 11]) ?>

    <?= $form->field($model, 'updated_at')->textInput(['maxlength' => 11]) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>


================================================
FILE: backend/views/post/_search.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\Models\PostSearch */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="post-search">

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'post_meta_id') ?>

    <?= $form->field($model, 'user_id') ?>

    <?= $form->field($model, 'title') ?>

    <?= $form->field($model, 'author') ?>

    <?php // echo $form->field($model, 'excerpt') ?>

    <?php // echo $form->field($model, 'image') ?>

    <?php // echo $form->field($model, 'content') ?>

    <?php // echo $form->field($model, 'tags') ?>

    <?php // echo $form->field($model, 'view_count') ?>

    <?php // echo $form->field($model, 'comment_count') ?>

    <?php // echo $form->field($model, 'favorite_count') ?>

    <?php // echo $form->field($model, 'like_count') ?>

    <?php // echo $form->field($model, 'hate_count') ?>

    <?php // echo $form->field($model, 'status') ?>

    <?php // echo $form->field($model, 'order') ?>

    <?php // echo $form->field($model, 'created_at') ?>

    <?php // echo $form->field($model, 'updated_at') ?>

    <div class="form-group">
        <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>


================================================
FILE: backend/views/post/create.php
================================================
<?php

/* @var $this yii\web\View */
/* @var $model common\Models\Post */

$this->title = 'Create Post';
$this->params['breadcrumbs'][] = ['label' => 'Posts', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="post-create">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>


================================================
FILE: backend/views/post/index.php
================================================
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use common\models\Post;

/* @var $this yii\web\View */
/* @var $searchModel common\Models\PostSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Posts';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="post-index">

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('Create Post', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            [
                'attribute' => 'id',
                'options' => ['width' => '10px'],
            ],
            'title',
            [
                'attribute' => 'category_name',
                'filter' => Html::activeTextInput($searchModel, 'category_name', ['class' => 'form-control']),
                'format' => 'raw',
                'value' => function ($data) {
                    return $data->category['name'];
                },
            ],
            [
                'attribute' => 'username',
                'filter' => Html::activeTextInput($searchModel, 'username', ['class' => 'form-control']),
                'value' => function ($data) {
                    return $data->user['username'];
                },
            ],
//             'tags',
            [
                'attribute' => 'view_count',
                'options' => ['width' => '10px'],
            ],
            [
                'attribute' => 'comment_count',
                'options' => ['width' => '10px'],
            ],
//            [
//                'attribute' => 'favorite_count',
//                'options' => ['width' => '10px'],
//            ],
//            [
//                'attribute' => 'like_count',
//                'options' => ['width' => '10px'],
//            ],
//            [
//                'attribute' => 'hate_count',
//                'options' => ['width' => '10px'],
//            ],
            [
                'attribute' => 'order',
                'options' => ['width' => '10px'],
            ],
            [
                'class' => \common\grid\EnumColumn::className(),
                'attribute' => 'status',
                'filter' => Post::getStatuses(),
                'enum' => Post::getStatuses(),
            ],
            'updated_at:datetime',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>

</div>


================================================
FILE: backend/views/post/update.php
================================================
<?php

/* @var $this yii\web\View */
/* @var $model common\Models\Post */

$this->title = 'Update Post: ' . ' ' . $model->title;
$this->params['breadcrumbs'][] = ['label' => 'Posts', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="post-update">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>


================================================
FILE: backend/views/post/view.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\Models\Post */

$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => 'Posts', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="post-view">

    <p>
        <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('Delete', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'post_meta_id',
            'user_id',
            'title',
            'author',
            'excerpt',
            'image',
            'content:ntext',
            'tags',
            'view_count',
            'comment_count',
            'favorite_count',
            'like_count',
            'hate_count',
            'status',
            'order',
            'created_at',
            'updated_at',
        ],
    ]) ?>

</div>


================================================
FILE: backend/views/post-meta/_form.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\PostMeta */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="post-meta-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => 100]) ?>

    <?= $form->field($model, 'parent')->dropDownList([0 => '根目录'] + $model->getParents()) ?>

    <?= $form->field($model, 'alias')->textInput(['maxlength' => 32]) ?>

    <?= $form->field($model, 'type')->dropDownList($model->types) ?>

    <?= $form->field($model, 'description')->textarea(['row' => 6]) ?>

    <?= $form->field($model, 'order')->textInput(['maxlength' => 11]) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>


================================================
FILE: backend/views/post-meta/_search.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\PostMetaSearch */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="post-meta-search">

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'name') ?>

    <?= $form->field($model, 'type') ?>

    <div class="form-group">
        <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>


================================================
FILE: backend/views/post-meta/create.php
================================================
<?php

/* @var $this yii\web\View */
/* @var $model common\models\PostMeta */

$this->title = 'Create Post Meta';
$this->params['breadcrumbs'][] = ['label' => 'Post Metas', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="post-meta-create">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>


================================================
FILE: backend/views/post-meta/index.php
================================================
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\PostMetaSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Post Metas';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="post-meta-index">

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('Create Post Meta', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'name',
            'parent',
            'alias',
            'type',
            'description',
            // 'count',
            // 'order',
            // 'created_at',
            // 'updated_at',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>

</div>


================================================
FILE: backend/views/post-meta/update.php
================================================
<?php

/* @var $this yii\web\View */
/* @var $model common\models\PostMeta */

$this->title = 'Update Post Meta: ' . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Post Metas', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="post-meta-update">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>


================================================
FILE: backend/views/post-meta/view.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\PostMeta */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Post Metas', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="post-meta-view">

    <p>
        <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('Delete', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'name',
            'parent',
            'alias',
            'type',
            'description',
            'count',
            'order',
            'created_at',
            'updated_at',
        ],
    ]) ?>

</div>


================================================
FILE: backend/views/right-link/_form.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\RightLink */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="right-link-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'type')->dropDownList($model->getTypes()) ?>

    <?= $form->field($model, 'url')->textInput(['maxlength' => 225]) ?>

    <?= $form->field($model, 'image')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'content')->textarea(['row' => 10]) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>

================================================
FILE: backend/views/right-link/_search.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\models\RightLinkSearch */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="right-link-search">

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'title') ?>

    <?= $form->field($model, 'url') ?>

    <?= $form->field($model, 'image') ?>

    <?= $form->field($model, 'content') ?>

    <?php // echo $form->field($model, 'type') ?>

    <?php // echo $form->field($model, 'created_user') ?>

    <?php // echo $form->field($model, 'created_at') ?>

    <?php // echo $form->field($model, 'updated_at') ?>

    <div class="form-group">
        <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>

================================================
FILE: backend/views/right-link/create.php
================================================
<?php

/* @var $this yii\web\View */
/* @var $model common\models\RightLink */

$this->title = 'Create Right Link';
$this->params['breadcrumbs'][] = ['label' => 'Right Links', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="right-link-create">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>

================================================
FILE: backend/views/right-link/index.php
================================================
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\RightLinkSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '右边栏设置';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="right-link-index">

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('Create Right Link', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'title',
            'type',
            'url:url',
//            'image',
//            'content',
            // 'created_user',
            // 'created_at',
            // 'updated_at',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>

</div>

================================================
FILE: backend/views/right-link/update.php
================================================
<?php

/* @var $this yii\web\View */
/* @var $model common\models\RightLink */

$this->title = 'Update Right Link: ' . ' ' . $model->title;
$this->params['breadcrumbs'][] = ['label' => 'Right Links', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="right-link-update">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>

================================================
FILE: backend/views/right-link/view.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\RightLink */

$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => 'Right Links', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="right-link-view">

    <p>
        <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('Delete', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'title',
            'url:url',
            'image',
            'content',
            'type',
            'created_user',
            'created_at',
            'updated_at',
        ],
    ]) ?>

</div>

================================================
FILE: backend/views/search-log/_search.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\models\SearchLogSearch */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="search-log-search">

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'user_id') ?>

    <?= $form->field($model, 'keyword') ?>

    <?= $form->field($model, 'created_at') ?>

    <div class="form-group">
        <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>


================================================
FILE: backend/views/search-log/index.php
================================================
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\SearchLogSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Search Logs';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="search-log-index">

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>


    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            [
                'attribute' => 'username',
                'filter' => Html::activeTextInput($searchModel, 'username', ['class' => 'form-control']),
                'format' => 'raw',
                'value' => function ($data) {
                    return $data->user['username'];
                },
            ],
            'keyword',
            'created_at:datetime',

            ['class' => 'yii\grid\ActionColumn', 'template' => '{delete}'],
        ],
    ]); ?>

</div>


================================================
FILE: backend/views/site/error.php
================================================
<?php

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $name string */
/* @var $message string */
/* @var $exception Exception */

$this->title = $name;
?>
<!-- Main content -->
<section class="content">

    <div class="error-page">
        <h2 class="headline text-info"><i class="fa fa-warning text-yellow"></i></h2>

        <div class="error-content">
            <h3><?= $name ?></h3>

            <p>
                <?= nl2br(Html::encode($message)) ?>
            </p>

            <p>
                The above error occurred while the Web server was processing your request.
                Please contact us if you think this is a server error. Thank you.
                Meanwhile, you may <a href='<?= Yii::$app->homeUrl ?>'>return to dashboard</a> or try using the search
                form.
            </p>

            <form class='search-form'>
                <div class='input-group'>
                    <input type="text" name="search" class='form-control' placeholder="Search"/>

                    <div class="input-group-btn">
                        <button type="submit" name="submit" class="btn btn-primary"><i class="fa fa-search"></i>
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>

</section>


================================================
FILE: backend/views/site/index.php
================================================
<?php
/* @var $this yii\web\View */

$this->title = 'My Yii Application';
?>
<div class="site-index">

    <div class="jumbotron">
        <h1>Congratulations!</h1>

        <p class="lead">You have successfully created your Yii-powered application.</p>

        <p><a class="btn btn-lg btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p>
    </div>

    <div class="body-content">

        <div class="row">
            <div class="col-lg-4">
                <h2>Heading</h2>

                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
                    dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
                    ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
                    fugiat nulla pariatur.</p>

                <p><a class="btn btn-default" href="http://www.yiiframework.com/doc/">Yii Documentation &raquo;</a></p>
            </div>
            <div class="col-lg-4">
                <h2>Heading</h2>

                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
                    dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
                    ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
                    fugiat nulla pariatur.</p>

                <p><a class="btn btn-default" href="http://www.yiiframework.com/forum/">Yii Forum &raquo;</a></p>
            </div>
            <div class="col-lg-4">
                <h2>Heading</h2>

                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
                    dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
                    ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
                    fugiat nulla pariatur.</p>

                <p><a class="btn btn-default" href="http://www.yiiframework.com/extensions/">Yii Extensions &raquo;</a></p>
            </div>
        </div>

    </div>
</div>


================================================
FILE: backend/views/site/login.php
================================================
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

$this->title = Yii::t('backend', 'Sign in');

$fieldOptions1 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-envelope form-control-feedback'></span>"
];

$fieldOptions2 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>"
];
?>

<div class="login-box">
    <div class="login-logo">
        <a href="#"><b>Get</b>Yii</a>
    </div>
    <!-- /.login-logo -->
    <div class="login-box-body">
        <p class="login-box-msg"><?= $this->title ?></p>

        <?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?>

        <?= $form
            ->field($model, 'username', $fieldOptions1)
            ->label(false)
            ->textInput(['placeholder' => $model->getAttributeLabel('username')]) ?>

        <?= $form
            ->field($model, 'password', $fieldOptions2)
            ->label(false)
            ->passwordInput(['placeholder' => $model->getAttributeLabel('password')]) ?>

        <div class="row">
            <div class="col-xs-8">
                <?= $form->field($model, 'rememberMe')->checkbox() ?>
            </div>
            <!-- /.col -->
            <div class="col-xs-4">
                <?= Html::submitButton(Yii::t('backend', 'Sign in'), ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']) ?>
            </div>
            <!-- /.col -->
        </div>


        <?php ActiveForm::end(); ?>

    </div>
    <!-- /.login-box-body -->
</div><!-- /.login-box -->


================================================
FILE: backend/views/user/_form.php
================================================
<?php

use common\models\User;
use conquer\select2\Select2Widget;
use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\User */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="user-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'role')->widget(Select2Widget::classname(), [
        'items' => ['' => '选择一个权限'] + User::getRoleList(),
    ]); ?>

    <?= $form->field($model, 'status')->widget(Select2Widget::classname(), [
        'items' => ['' => '选择一个状态'] + User::getStatusList(),
    ]); ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>
</div>


================================================
FILE: backend/views/user/_search.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\UserSearch */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="user-search">

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'username') ?>

    <?= $form->field($model, 'avatar') ?>

    <?= $form->field($model, 'auth_key') ?>

    <?= $form->field($model, 'password_hash') ?>

    <?php // echo $form->field($model, 'password_reset_token') ?>

    <?php // echo $form->field($model, 'email') ?>

    <?php // echo $form->field($model, 'tagline') ?>

    <?php // echo $form->field($model, 'role') ?>

    <?php // echo $form->field($model, 'status') ?>

    <?php // echo $form->field($model, 'created_at') ?>

    <?php // echo $form->field($model, 'updated_at') ?>

    <div class="form-group">
        <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>


================================================
FILE: backend/views/user/index.php
================================================
<?php

use common\models\User;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Users';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'username',
            'avatar',
            // 'password_reset_token',
            // 'email:email',
            // 'tagline',
             [
                 'attribute' => 'role',
                 'value' => function($model) {
                     return User::getRole($model->role)['name'];
                 },
             ],
            // 'status',
             'created_at:datetime',
             'updated_at:datetime',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>

</div>


================================================
FILE: backend/views/user/update.php
================================================
<?php

/* @var $this yii\web\View */
/* @var $model common\models\User */

$this->title = 'Update User: ' . ' ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="user-update">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>


================================================
FILE: backend/views/user/view.php
================================================
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\User */

$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-view">

    <p>
        <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('Delete', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'username',
            'avatar',
            'auth_key',
            'password_hash',
            'password_reset_token',
            'email:email',
            'tagline',
            'role',
            'status',
            'created_at',
            'updated_at',
        ],
    ]) ?>

</div>


================================================
FILE: backend/web/.gitignore
================================================
/index.php
/index-test.php


================================================
FILE: backend/web/.htaccess
================================================
# use mod_rewrite for pretty URL support
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php

# 七牛云存储的回调会传送HTTP_AUTHORIZATION认证秘钥,一定要放在最rewrite的后面.防止影响
# PHP在CGI模式下的认证信息的获取
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

================================================
FILE: backend/web/assets/.gitignore
================================================
*
!.gitignore


================================================
FILE: backend/web/css/sb-admin-2.css
================================================
/*!
 * Start Bootstrap - SB Admin 2 Bootstrap Admin Theme (http://startbootstrap.com)
 * Code licensed under the Apache License v2.0.
 * For details, see http://www.apache.org/licenses/LICENSE-2.0.
 */

body {
    background-color: #f8f8f8;
}

#wrapper {
    width: 100%;
}

#page-wrapper {
    padding: 0 15px;
    min-height: 568px;
    background-color: #fff;
}

@media(min-width:768px) {
    #page-wrapper {
        position: inherit;
        margin: 52px 0 0 250px;
        padding: 0 30px;
        border-left: 1px solid #e7e7e7;
    }
}

.navbar-top-links li {
    display: inline-block;
}

.navbar-top-links li:last-child {
    margin-right: 15px;
}

.navbar-top-links li a {
    padding: 15px;
    min-height: 50px;
}

.navbar-top-links .dropdown-menu li {
    display: block;
}

.navbar-top-links .dropdown-menu li:last-child {
    margin-right: 0;
}

.navbar-top-links .dropdown-menu li a {
    padding: 3px 20px;
    min-height: 0;
}

.navbar-top-links .dropdown-menu li a div {
    white-space: normal;
}

.navbar-top-links .dropdown-messages,
.navbar-top-links .dropdown-tasks,
.navbar-top-links .dropdown-alerts {
    width: 310px;
    min-width: 0;
}

.navbar-top-links .dropdown-messages {
    margin-left: 5px;
}

.navbar-top-links .dropdown-tasks {
    margin-left: -59px;
}

.navbar-top-links .dropdown-alerts {
    margin-left: -123px;
}

.navbar-top-links .dropdown-user {
    right: 0;
    left: auto;
}

.sidebar .sidebar-nav.navbar-collapse {
    padding-right: 0;
    padding-left: 0;
}

.sidebar .sidebar-search {
    padding: 15px;
}

.sidebar ul li {
    border-bottom: 1px solid #e7e7e7;
}

.sidebar ul li a.active {
    background-color: #eee;
}

.sidebar .arrow {
    float: right;
}

.sidebar .fa.arrow:before {
    content: "\f104";
}

.sidebar .active>a>.fa.arrow:before {
    content: "\f107";
}

.sidebar .nav-second-level li,
.sidebar .nav-third-level li {
    border-bottom: 0!important;
}

.sidebar .nav-second-level li a {
    padding-left: 37px;
}

.sidebar .nav-third-level li a {
    padding-left: 52px;
}

@media(min-width:768px) {
    .sidebar {
        z-index: 1;
        position: absolute;
        width: 250px;
        margin-top: 51px;
    }

    .navbar-top-links .dropdown-messages,
    .navbar-top-links .dropdown-tasks,
    .navbar-top-links .dropdown-alerts {
        margin-left: auto;
    }
}

.btn-outline {
    color: inherit;
    background-color: transparent;
    transition: all .5s;
}

.btn-primary.btn-outline {
    color: #428bca;
}

.btn-success.btn-outline {
    color: #5cb85c;
}

.btn-info.btn-outline {
    color: #5bc0de;
}

.btn-warning.btn-outline {
    color: #f0ad4e;
}

.btn-danger.btn-outline {
    color: #d9534f;
}

.btn-primary.btn-outline:hover,
.btn-success.btn-outline:hover,
.btn-info.btn-outline:hover,
.btn-warning.btn-outline:hover,
.btn-danger.btn-outline:hover {
    color: #fff;
}

.chat {
    margin: 0;
    padding: 0;
    list-style: none;
}

.chat li {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px dotted #999;
}

.chat li.left .chat-body {
    margin-left: 60px;
}

.chat li.right .chat-body {
    margin-right: 60px;
}

.chat li .chat-body p {
    margin: 0;
}

.panel .slidedown .glyphicon,
.chat .glyphicon {
    margin-right: 5px;
}

.chat-panel .panel-body {
    height: 350px;
    overflow-y: scroll;
}

.login-panel {
    margin-top: 25%;
}

.flot-chart {
    display: block;
    height: 400px;
}

.flot-chart-content {
    width: 100%;
    height: 100%;
}

table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
table.dataTable thead .sorting_asc_disabled,
table.dataTable thead .sorting_desc_disabled {
    background: 0 0;
}

table.dataTable thead .sorting_asc:after {
    content: "\f0de";
    float: right;
    font-family: fontawesome;
}

table.dataTable thead .sorting_desc:after {
    content: "\f0dd";
    float: right;
    font-family: fontawesome;
}

table.dataTable thead .sorting:after {
    content: "\f0dc";
    float: right;
    font-family: fontawesome;
    color: rgba(50,50,50,.5);
}

.btn-circle {
    width: 30px;
    height: 30px;
    padding: 6px 0;
    border-radius: 15px;
    text-align: center;
    font-size: 12px;
    line-height: 1.428571429;
}

.btn-circle.btn-lg {
    width: 50px;
    height: 50px;
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 18px;
    line-height: 1.33;
}

.btn-circle.btn-xl {
    width: 70px;
    height: 70px;
    padding: 10px 16px;
    border-radius: 35px;
    font-size: 24px;
    line-height: 1.33;
}

.show-grid [class^=col-] {
    padding-top: 10px;
    padding-bottom: 10px;
    border: 1px solid #ddd;
    background-color: #eee!important;
}

.show-grid {
    margin: 15px 0;
}

.huge {
    font-size: 40px;
}

.panel-green {
    border-color: #5cb85c;
}

.panel-green .panel-heading {
    border-color: #5cb85c;
    color: #fff;
    background-color: #5cb85c;
}

.panel-green a {
    color: #5cb85c;
}

.panel-green a:hover {
    color: #3d8b3d;
}

.panel-red {
    border-color: #d9534f;
}

.panel-red .panel-heading {
    border-color: #d9534f;
    color: #fff;
    background-color: #d9534f;
}

.panel-red a {
    color: #d9534f;
}

.panel-red a:hover {
    color: #b52b27;
}

.panel-yellow {
    border-color: #f0ad4e;
}

.panel-yellow .panel-heading {
    border-color: #f0ad4e;
    color: #fff;
    background-color: #f0ad4e;
}

.panel-yellow a {
    color: #f0ad4e;
}

.panel-yellow a:hover {
    color: #df8a13;
}

/*面包屑*/
.breadcrumb {
   background-color: #fff;
    padding: 17px 0 0;
}

================================================
FILE: backend/web/css/site.css
================================================
html,
body {
    height: 100%;
}

.wrap {
    min-height: 100%;
    height: auto;
    margin: 0 auto -60px;
    padding: 0 0 60px;
}

.wrap > .container {
    padding: 70px 15px 20px;
}

.footer {
    height: 60px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

.jumbotron {
    text-align: center;
    background-color: transparent;
}

.jumbotron .btn {
    font-size: 21px;
    padding: 14px 24px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    position: relative;
    top: 1px;
    display: inline-block;
    font-family: 'Glyphicons Halflings';
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    padding-left: 5px;
}

a.asc:after {
    content: /*"\e113"*/ "\e151";
}

a.desc:after {
    content: /*"\e114"*/ "\e152";
}

.sort-numerical a.asc:after {
    content: "\e153";
}

.sort-numerical a.desc:after {
    content: "\e154";
}

.sort-ordinal a.asc:after {
    content: "\e155";
}

.sort-ordinal a.desc:after {
    content: "\e156";
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/*面包屑*/
#page-wrapper {
    margin: 52px 0 0 250px;
}
.breadcrumb {
   background-color: #fff;
    padding: 17px 0 0;
}

================================================
FILE: backend/web/js/sb-admin-2.js
================================================
$(function() {

    $('#side-menu').metisMenu();

});

//Loads the correct sidebar on window load,
//collapses the sidebar on window resize.
// Sets the min-height of #page-wrapper to window size
$(function() {
    $(window).bind("load resize", function() {
        topOffset = 50;
        width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
        if (width < 768) {
            $('div.navbar-collapse').addClass('collapse')
            topOffset = 100; // 2-row-menu
        } else {
            $('div.navbar-collapse').removeClass('collapse')
        }

        height = (this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height;
        height = height - topOffset;
        if (height < 1) height = 1;
        if (height > topOffset) {
            $("#page-wrapper").css("min-height", (height) + "px");
        }
    })
})


================================================
FILE: backend/web/robots.txt
================================================
User-Agent: *
Disallow: /


================================================
FILE: common/assets/AtJs.php
================================================
<?php
namespace common\assets;

use yii\web\AssetBundle;

/**
 * @author forecho <caizhenghai@gmail.com>
 */
class AtJs extends AssetBundle
{
    public $sourcePath = '@bower/At.js/dist';

    public $css = [
        'css/jquery.atwho.min.css',
    ];

    public $js = [
        'js/jquery.atwho.min.js',
    ];
}


================================================
FILE: common/assets/CaretJs.php
================================================
<?php
namespace common\assets;

use yii\web\AssetBundle;

/**
 * @author forecho <caizhenghai@gmail.com>
 */
class CaretJs extends AssetBundle
{
    public $sourcePath = '@bower/caret.js/dist';

    public $css = [];

    public $js = [
        'jquery.caret.min.js',
    ];
}


================================================
FILE: common/assets/DropzoneJs.php
================================================
<?php
namespace common\assets;

use yii\web\AssetBundle;

/**
 * @author forecho <caizhenghai@gmail.com>
 */
class DropzoneJs extends AssetBundle
{
    public $sourcePath = '@vendor/enyo/dropzone/dist/min';

    public $css = [
        'dropzone.min.css',
    ];

    public $js = [
        'dropzone.min.js',
    ];
}


================================================
FILE: common/components/AssetBundle.php
================================================
<?php
namespace common\components;

class AssetBundle extends \yii\web\AssetBundle
{
    public $publishOptions = [
        'forceCopy' => YII_DEBUG // debug模式时强制拷贝
    ];
}

================================================
FILE: common/components/ComposerInstaller.php
================================================
<?php
/**
 * author     : forecho <caizhenghai@gmail.com>
 * createTime : 16/8/7 上午10:44
 * description:
 */

namespace common\components;

use yii\composer\Installer;

class ComposerInstaller extends Installer
{
    public static function initProject($event)
    {
    }
}

================================================
FILE: common/components/Config.php
================================================
<?php
namespace common\components;

use Yii;
use yii\base\Object;
use yii\base\InvalidCallException;
use yii\base\InvalidConfigException;

class Config extends Object
{
    protected $data;

    /**
     * model class 名,如果未指定初始数据, 会根据此值从model类中取数据
     * @var string
     */
    public $loadModel;
    /**
     * 如果指定了loadModel, 缓存的键值,必须注意cache键值, 缓存的键值会经过md5加密, 未指定会使用loadModel代替
     * @var string
     */
    private $_cacheKey;
    /**
     * 缓存时间, 如果为0表示永久缓存, false 表示不缓存
     * @var int|bool
     */
    public $cacheTime = 3600;

    public $autoSave = true;

    /**
     * 数据保存
     * @var array
     */
    private $_data = [];

    /**
     * 被修改的设置键值(当需要触发保存设置时.可以从该设置中查询修改了的值然后保存)
     * @var array
     */
    private $_changedDataKeys = [];

    /**
     * 从model类指定的存储介质中(数据库, 缓存数据库, nosql数据库等...)取数据
     * @throws \yii\base\InvalidConfigException
     */
    public function init()
    {
        if ($this->loadModel !== null) {
            $loadModel = $this->loadModel;

            if (!method_exists($loadModel, 'getData')) {
                throw new InvalidConfigException("Class {$loadModel}::getData() is undefined.");
            } elseif ($this->cacheTime !== false) {
                $cache = Yii::$app->getCache();
                $cacheKey = $this->getCacheKey();
                if (($data = $cache->get($cacheKey, false)) === false) {
                    $data = $loadModel::getData();
                    $cache->set($cacheKey, $data, $this->cacheTime);
                }
            } else {
                $data = $loadModel::getData();
            }
            $this->setData($data);

            // 自动保存修改后的数据
            $this->autoSave && register_shutdown_function(function () {
                $this->saveData();
            });
        }
    }

    /**
     * 获取设置数据
     * @return array
     */
    public function getData()
    {
        return $this->_data;
    }

    /**
     * 设置设置数据
     * @param $data
     */
    public function setData($data)
    {
        $this->_data = $data;
    }

    /**
     * 设置指定键值的设置数据
     * @param $name
     * @param $value
     */
    public function set($name, $value)
    {
        $this->_data[$name] = $value;
        $this->_changedDataKeys[] = $name;
    }

    /**
     * 获取指定键值的设置数据
     * @param $name
     * @param null $defaultValue
     * @return null
     */
    public function get($name, $defaultValue = null)
    {
        return array_key_exists($name, $this->_data) ? $this->_data[$name] : $defaultValue;
    }

    public function setCacheKey($cacheKey)
    {
        $this->_cacheKey = $cacheKey;
    }

    public function getCacheKey()
    {
        if ($this->_cacheKey === null) {
            if ($this->loadModel === null) {
                throw new InvalidCallException('The cacheKey property of Config class must be set.');
            }
            $this->setCacheKey('menu_' . md5($this->loadModel));
        }
        return $this->_cacheKey;
    }

    /**
     * 保存数据(智慧保存修改后的数据)
     * @return mixed
     * @throws \yii\base\InvalidCallException
     */
    public function saveData()
    {
        if ($this->loadModel === null) {
            throw new InvalidCallException("The data of class Config can't save. becase loadModel is not set.");
        }
        $loadModel = $this->loadModel;
        $data = [];
        foreach (array_unique($this->_changedDataKeys) as $name) { // 去重取出修改后的数据
            $data[$name] = $this->get($name);
        }
        if (empty($data)) {
            return true;
        } elseif ($loadModel::saveData($data)) {
            $this->_changedDataKeys; //保存后可以清空了
            Yii::$app->getCache()->delete($this->getCacheKey()); // 更新数据后清除旧缓存
            return true;
        }
        return false;
    }
}

//class Config extends Object implements \Countable, \Iterator, \ArrayAccess
//{
//    /**
//     * model class 名,如果未指定初始数据, 会根据此值从model类中取数据
//     * @var string
//     */
//    protected $loadModel;
//    /**
//     * 如果指定了loadModel, 缓存的键值,必须注意cache键值, 缓存的键值会经过md5加密, 未指定会使用loadModel代替
//     * @var string
//     */
//    protected $cacheKey;
//    /**
//     * 缓存时间, 如果为0表示永久缓存, false 表示不缓存
//     * @var int|bool
//     */
//    protected $cacheTime = 3600;
//
//    /**
//     * Config 根据数据深度来循环, 该属性会用来标记最终父级分支
//     * @var array
//     */
//    protected $topClass;
//
//    /**
//     * Whether modifications to configuration data are allowed.
//     *
//     * @var bool
//     */
//    protected $allowModifications = true;
//
//    /**
//     * Number of elements in configuration data.
//     *
//     * @var int
//     */
//    protected $count;
//
//    /**
//     * Data within the configuration.
//     *
//     * @var array
//     */
//    protected $data = array();
//
//    /**
//     * Used when unsetting values during iteration to ensure we do not skip
//     * the next element.
//     *
//     * @var bool
//     */
//    protected $skipNextIteration;
//
//    public function __construct(array $data = null, array $properties = [])
//    {
//        foreach ($properties as $name => $value) {
//            $this->$name = $value;
//        }
//
//        if ($data !== null) {
//            $this->setData($data);
//        } else {
//            $this->init();
//        }
//    }
//
//    protected function setData(array $array)
//    {
//        foreach ($array as $key => $value) {
//            if (is_array($value)) {
//                $this->data[$key] = new static($value, [
//                    'allowModifications' => $this->allowModifications,
//                    'topClass' => $this->topClass
//                ]);
//            } else {
//                $this->data[$key] = $value;
//            }
//
//            $this->count++;
//        }
//    }
//
//    public function init()
//    {
//        if ($this->loadModel !== null) {
//            $loadModel = $this->loadModel;
//            if (!method_exists($loadModel, 'getData')) {
//                throw new InvalidConfigException("Class {$loadModel}::getData() is undefined.");
//            } elseif ($this->cacheTime === false) {
//                $data = $loadModel::getData();
//            } else {
//                $cache = Yii::$app->get('cache');
//                $cacheKey = md5($this->cacheKey ? $this->cacheKey : $this->loadModel);
//                if (($data = $cache->get($cacheKey, false)) === false) {
//                    $data = $loadModel::getData();
//                    $cache->set($cacheKey, $data, $this->cacheTime);
//                }
//            }
//            $this->setData($data);
//        }
//    }
//
//    /**
//     * Retrieve a value and return $default if there is no element set.
//     *
//     * @param  string $name
//     * @param  mixed  $default
//     * @return mixed
//     */
//    public function get($name, $default = null)
//    {
//        if (array_key_exists($name, $this->data)) {
//            return $this->data[$name];
//        }
//
//        return $default;
//    }
//
//    /**
//     * Magic function so that $obj->value will work.
//     *
//     * @param  string $name
//     * @return mixed
//     */
//    public function __get($name)
//    {
//        return $this->get($name);
//    }
//
//    /**
//     * Set a value in the config.
//     *
//     * Only allow setting of a property if $allowModifications  was set to true
//     * on construction. Otherwise, throw an exception.
//     *
//     * @param  string $name
//     * @param  mixed  $value
//     * @return void
//     * @throws Exception\RuntimeException
//     */
//    public function __set($name, $value)
//    {
//        if ($this->allowModifications) {
//
//            if (is_array($value)) {
//                $value = new static($value, true);
//            }
//
//            if (null === $name) {
//                $this->data[] = $value;
//            } else {
//                $this->data[$name] = $value;
//            }
//
//            $this->count++;
//        } else {
//            throw new Exception\RuntimeException('Config is read only');
//        }
//    }
//
//    /**
//     * Deep clone of this instance to ensure that nested Zend\Configs are also
//     * cloned.
//     *
//     * @return void
//     */
//    public function __clone()
//    {
//        $array = array();
//
//        foreach ($this->data as $key => $value) {
//            if ($value instanceof self) {
//                $array[$key] = clone $value;
//            } else {
//                $array[$key] = $value;
//            }
//        }
//
//        $this->data = $array;
//    }
//
//    /**
//     * Return an associative array of the stored data.
//     *
//     * @return array
//     */
//    public function toArray()
//    {
//        $array = array();
//        $data  = $this->data;
//
//        /** @var self $value */
//        foreach ($data as $key => $value) {
//            if ($value instanceof self) {
//                $array[$key] = $value->toArray();
//            } else {
//                $array[$key] = $value;
//            }
//        }
//
//        return $array;
//    }
//
//    /**
//     * isset() overloading
//     *
//     * @param  string $name
//     * @return bool
//     */
//    public function __isset($name)
//    {
//        return isset($this->data[$name]);
//    }
//
//    /**
//     * unset() overloading
//     *
//     * @param  string $name
//     * @return void
//     * @throws Exception\InvalidArgumentException
//     */
//    public function __unset($name)
//    {
//        if (!$this->allowModifications) {
//            throw new Exception\InvalidArgumentException('Config is read only');
//        } elseif (isset($this->data[$name])) {
//            unset($this->data[$name]);
//            $this->count--;
//            $this->skipNextIteration = true;
//        }
//    }
//
//    /**
//     * count(): defined by Countable interface.
//     *
//     * @see    Countable::count()
//     * @return int
//     */
//    public function count()
//    {
//        return $this->count;
//    }
//
//    /**
//     * current(): defined by Iterator interface.
//     *
//     * @see    Iterator::current()
//     * @return mixed
//     */
//    public function current()
//    {
//        $this->skipNextIteration = false;
//        return current($this->data);
//    }
//
//    /**
//     * key(): defined by Iterator interface.
//     *
//     * @see    Iterator::key()
//     * @return mixed
//     */
//    public function key()
//    {
//        return key($this->data);
//    }
//
//    /**
//     * next(): defined by Iterator interface.
//     *
//     * @see    Iterator::next()
//     * @return void
//     */
//    public function next()
//    {
//        if ($this->skipNextIteration) {
//            $this->skipNextIteration = false;
//            return;
//        }
//
//        next($this->data);
//    }
//
//    /**
//     * rewind(): defined by Iterator interface.
//     *
//     * @see    Iterator::rewind()
//     * @return void
//     */
//    public function rewind()
//    {
//        $this->skipNextIteration = false;
//        reset($this->data);
//    }
//
//    /**
//     * valid(): defined by Iterator interface.
//     *
//     * @see    Iterator::valid()
//     * @return bool
//     */
//    public function valid()
//    {
//        return ($this->key() !== null);
//    }
//
//    /**
//     * offsetExists(): defined by ArrayAccess interface.
//     *
//     * @see    ArrayAccess::offsetExists()
//     * @param  mixed $offset
//     * @return bool
//     */
//    public function offsetExists($offset)
//    {
//        return $this->__isset($offset);
//    }
//
//    /**
//     * offsetGet(): defined by ArrayAccess interface.
//     *
//     * @see    ArrayAccess::offsetGet()
//     * @param  mixed $offset
//     * @return mixed
//     */
//    public function offsetGet($offset)
//    {
//        return $this->__get($offset);
//    }
//
//    /**
//     * offsetSet(): defined by ArrayAccess interface.
//     *
//     * @see    ArrayAccess::offsetSet()
//     * @param  mixed $offset
//     * @param  mixed $value
//     * @return void
//     */
//    public function offsetSet($offset, $value)
//    {
//        $this->__set($offset, $value);
//    }
//
//    /**
//     * offsetUnset(): defined by ArrayAccess interface.
//     *
//     * @see    ArrayAccess::offsetUnset()
//     * @param  mixed $offset
//     * @return void
//     */
//    public function offsetUnset($offset)
//    {
//        $this->__unset($offset);
//    }
//
//    /**
//     * Merge another Config with this one.
//     *
//     * For duplicate keys, the following will be performed:
//     * - Nested Configs will be recursively merged.
//     * - Items in $merge with INTEGER keys will be appended.
//     * - Items in $merge with STRING keys will overwrite current values.
//     *
//     * @param  Config $merge
//     * @return Config
//     */
//    public function merge(Config $merge)
//    {
//        /** @var Config $value */
//        foreach ($merge as $key => $value) {
//            if (array_key_exists($key, $this->data)) {
//                if (is_int($key)) {
//                    $this->data[] = $value;
//                } elseif ($value instanceof self && $this->data[$key] instanceof self) {
//                    $this->data[$key]->merge($value);
//                } else {
//                    if ($value instanceof self) {
//                        $this->data[$key] = new static($value->toArray(), $this->allowModifications);
//                    } else {
//                        $this->data[$key] = $value;
//                    }
//                }
//            } else {
//                if ($value instanceof self) {
//                    $this->data[$key] = new static($value->toArray(), $this->allowModifications);
//                } else {
//                    $this->data[$key] = $value;
//                }
//
//                $this->count++;
//            }
//        }
//
//        return $this;
//    }
//
//    /**
//     * Prevent any more modifications being made to this instance.
//     *
//     * Useful after merge() has been used to merge multiple Config objects
//     * into one object which should then not be modified again.
//     *
//     * @return void
//     */
//    public function setReadOnly()
//    {
//        $this->allowModifications = false;
//
//        /** @var Config $value */
//        foreach ($this->data as $value) {
//            if ($value instanceof self) {
//                $value->setReadOnly();
//            }
//        }
//    }
//
//    /**
//     * Returns whether this Config object is read only or not.
//     *
//     * @return bool
//     */
//    public function isReadOnly()
//    {
//        return !$this->allowModifications;
//    }
//}

================================================
FILE: common/components/Controller.php
================================================
<?php

namespace common\components;

use Yii;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
use yii\web\Response;
use yiier\merit\MeritBehavior;

class Controller extends \yii\web\Controller
{
    public function behaviors()
    {
        return ArrayHelper::merge(parent::behaviors(), [
            'returnUrl' => [
                'class' => 'yiier\returnUrl\ReturnUrl',
                'uniqueIds' => ['site/qr', 'site/login', 'user/security/auth', 'site/reset-password']
            ],
            MeritBehavior::className(),
        ]);
    }

    public function beforeAction($action)
    {
        if (parent::beforeAction($action)) {
            return true;
        } else {
            return false;
        }
    }

    public function afterAction($action, $result)
    {
        if (!Yii::$app->user->isGuest) {
            $actionName = "frontend@{$this->module->id}_{$this->id}_{$action->id}";
        }
        return parent::afterAction($action, $result);
    }

    /**
     * 显示flash信息
     * @param $message string 信息显示内容
     * @param string $type 信息显示类型, ['info', 'success', 'error', 'warning']
     * @param null $url 跳转地址
     * @throws \yii\base\ExitException
     */
    public function flash($message, $type = 'info', $url = null)
    {
        Yii::$app->getSession()->setFlash($type, $message);
        if ($url !== null) {
            Yii::$app->end(0, $this->redirect($url));
        }
    }

    /**
     * @param $message string 信息显示内容
     * @param string $type 信息显示类型, ['info', 'success', 'error', 'warning']
     * @param null $redirect 跳转地址
     * @param null $resultType 信息显示格式
     * @return array|string
     */
    public function message($message, $type = 'info', $redirect = null, $resultType = null)
    {
        $resultType === null && $resultType = Yii::$app->getRequest()->getIsAjax() ? 'json' : 'html';
        is_array($redirect) && $redirect = Url::to($redirect);
        $data = [
            'type' => $type,
            'message' => $message,
            'redirect' => $redirect
        ];

        if ($resultType === 'json') {
            Yii::$app->getResponse()->format = Response::FORMAT_JSON;
            return $data;
        } elseif ($resultType === 'html') {
            return $this->render('/common/message', $data);
        }
    }

    // public $ajaxLayout = '/ajaxMain';
    // public function findLayoutFile($view)
    // {
    //     if (($this->layout === null) && ($this->ajaxLayout !== false) && Yii::$app->getRequest()->getIsAjax()) {
    //         $this->layout = $this->ajaxLayout;
    //     }
    //     return parent::findLayoutFile($view);
    // }
}

================================================
FILE: common/components/DbAuthManager.php
================================================
<?php
namespace common\components;

use yii\db\Query;
use yii\rbac\Item;
use yii\rbac\DbManager;

class DbAuthManager extends DbManager
{
    protected function getChildrenListOfType($type)
    {
        $query = (new Query)->from($this->itemChildTable)
            ->join('INNER JOIN', $this->itemTable, implode(' AND ', [
                $this->itemTable . '.name=' . $this->itemChildTable . '.child',
                $this->itemTable . '.type = ' . $type
            ]));
        $parents = [];
        foreach ($query->all($this->db) as $row) {
            $parents[$row['parent']][] = $row['child'];
        }
        return $parents;
    }

    /**
     * @params bool $recursive 是否递归显示子角色权限
     * @inheritdoc
     */
    public function getPermissionsByRole($roleName, $recursive = true)
    {
        $childrenList = $recursive ? $this->getChildrenList() : $this->getChildrenListOfType(Item::TYPE_PERMISSION);
        $result = [];
        $this->getChildrenRecursive($roleName, $childrenList, $result);
        if (empty($result)) {
            return [];
        }
        $query = (new Query)->from($this->itemTable)->where([
            'type' => Item::TYPE_PERMISSION,
            'name' => array_keys($result),
        ]);
        $permissions = [];
        foreach ($query->all($this->db) as $row) {
            $permissions[$row['name']] = $this->populateItem($row);
        }
        return $permissions;
    }
}


================================================
FILE: common/components/FileTarget.php
================================================
<?php

/**
 * author     : forecho <caizhenghai@gmail.com>
 * createTime : 2015/12/22 18:13
 * description:
 */
namespace common\components;

use Yii;
use yii\helpers\FileHelper;

class FileTarget extends \yii\log\FileTarget
{
    /**
     * @var bool 是否启用日志前缀 (@app/runtime/logs/error/20151223_app.log)
     */
    public $enableDatePrefix = false;

    /**
     * @var bool 启用日志等级目录
     */
    public $enableCategoryDir = false;

    private $_logFilePath = '';

    public function init()
    {
        if ($this->logFile === null) {
            $this->logFile = Yii::$app->getRuntimePath() . '/logs/app.log';
        } else {
            $this->logFile = Yii::getAlias($this->logFile);
        }
        $this->_logFilePath = dirname($this->logFile);

        // 启用日志前缀
        if ($this->enableDatePrefix) {
            $filename = basename($this->logFile);
            $this->logFile = $this->_logFilePath . '/' . date('Ymd') . '_' . $filename;
        }

        if (!is_dir($this->_logFilePath)) {
            FileHelper::createDirectory($this->_logFilePath, $this->dirMode, true);
        }

        if ($this->maxLogFiles < 1) {
            $this->maxLogFiles = 1;
        }
        if ($this->maxFileSize < 1) {
            $this->maxFileSize = 1;
        }

    }
}

================================================
FILE: common/components/GlobalFunctions.php
================================================
<?php

use yii\web\Response;

if (!function_exists('env')) {

    function env($envName, $default = false)
    {
        $envName = getenv($envName);

        return $envName === false ? $default : $envName;
    }
}


if (!function_exists('app')) {
    /**
     * App或App的定义组件
     *
     * @param null $component Yii组件名称
     * @param bool $throwException 获取未定义组件是否报错
     * @return null|object|\yii\console\Application|\yii\web\Application
     * @throws \yii\base\InvalidConfigException
     */
    function app($component = null, $throwException = true)
    {
        if ($component === null) {
            return Yii::$app;
        }
        return Yii::$app->get($component, $throwException);
    }
}
if (!function_exists('t')) {
    /**
     * i18n 国际化
     * @param $category
     * @param $message
     * @param array $params
     * @param null $language
     * @return string
     */
    function t($category, $message, $params = [], $language = null)
    {
        return Yii::t($category, $message, $params, $language);
    }
}

if (!function_exists('user')) {
    /**
     * User组件或者(设置|返回)identity属性
     *
     * @param null|string|array $attribute idenity属性
     * @return \yii\web\User|string|array
     */
    function user($attribute = null)
    {
        if ($attribute === null) {
            return Yii::$app->getUser();
        }
        if (is_array($attribute)) {
            return Yii::$app->getUser()->getIdentity()->setAttributes($attribute);
        }
        return Yii::$app->getUser()->getIdentity()->{$attribute};
    }
}
if (!function_exists('request')) {
    /**
     * Request组件或者通过Request组件获取GET值
     *
     * @param string $key
     * @param mixed $default
     * @return \yii\web\Request|string|array
     */
    function request($key = null, $default = null)
    {
        if ($key === null) {
            return Yii::$app->getRequest();
        }
        return Yii::$app->getRequest()->getQueryParam($key, $default);
    }
}
if (!function_exists('response')) {
    /**
     * Response组件或者通过Response组织内容
     *
     * @param string $content 响应内容
     * @param string $format 响应格式
     * @return \yii\web\Response
     */
    function response($content = '', $format = Response::FORMAT_HTML, $status = null)
    {
        $response = Yii::$app->getResponse();
        if (func_num_args() !== 0) {
            $response->format = $format;
            if ($status !== null) {
                $response->setStatusCode($status);
            }
            if ($format === Response::FORMAT_HTML) {
                $response->content = $content;
            } else {
                $response->data = $content;
            }
        }
        return $response;
    }
}

if (!function_exists('params')) {
    /**
     * params 组件或者通过 params 组件获取GET值
     * @param $key
     * @return mixed|\yii\web\Session
     */
    function params($key)
    {
        return Yii::$app->params[$key];
    }
}

/**
 * @param $message
 * @param bool|true $debug
 */
function pr($message, $debug = true)
{
    echo '<pre>';
    print_r($message);
    echo '</pre>';
    if ($debug) {
        die;
    }
}

================================================
FILE: common/components/Mailer.php
================================================
<?php

namespace common\components;

use yii\base\Component;

class Mailer extends Component
{
    /** @var string */
    public $viewPath = '@dektrium/user/views/mail';
    /** @var string|array */
    public $sender = 'no-reply@example.com';
    /** @var string */
    public $welcomeSubject;
    /** @var string */
    public $confirmationSubject;
    /** @var string */
    public $reconfirmationSubject;
    /** @var string */
    public $recoverySubject;

    public function init()
    {
        parent::init();
        \Yii::$app->set('mailer', [
            'class' => 'yii\swiftmailer\Mailer',
            'viewPath' => '@common/mail',
            'transport' => [
                'class' => 'Swift_SmtpTransport',
                'host' => \Yii::$app->setting->get('smtpHost'),
                'username' => \Yii::$app->setting->get('smtpUser'),
                'password' => \Yii::$app->setting->get('smtpPassword'),
                'port' => \Yii::$app->setting->get('smtpPort'),
                // 'mail' => \Yii::$app->setting->get('smtpMail'), // 显示地址
                'encryption' => 'tls',
            ],
        ]);
    }

    /**
     * Sends an email to a user with credentials and confirmation link.
     *
     * @param  User $user
     * @param  Token $token
     * @return bool
     */
    public function sendWelcomeMessage(User $user, Token $token = null)
    {
        return $this->sendMessage($user->email,
            $this->welcomeSubject,
            'welcome',
            ['user' => $user, 'token' => $token]
        );
    }

    /**
     * @param  string $to
     * @param  string $subject
     * @param  string $view
     * @param  array $params
     * @return bool
     */
    protected function sendMessage($to, $subject, $view, $params = [])
    {
        $mailer = \Yii::$app->mailer;
        $mailer->viewPath = $this->viewPath;
        $mailer->getView()->theme = \Yii::$app->view->theme;

        return $mailer->compose(['html' => $view, 'text' => 'text/' . $view], $params)
            ->setTo($to)
            ->setFrom($this->sender)
            ->setSubject($subject)
            ->send();
    }

    /**
     * Sends an email to a user with confirmation link.
     *
     * @param  User $user
     * @param  Token $token
     * @return bool
     */
    public function sendConfirmationMessage(User $user, Token $token)
    {
        return $this->sendMessage($user->email,
            $this->confirmationSubject,
            'confirmation',
            ['user' => $user, 'token' => $token]
        );
    }

    /**
     * Sends an email to a user with reconfirmation link.
     *
     * @param  User $user
     * @param  Token $token
     * @return bool
     */
    public function sendReconfirmationMessage(User $user, Token $token)
    {
        if ($token->type == Token::TYPE_CONFIRM_NEW_EMAIL) {
            $email = $user->unconfirmed_email;
        } else {
            $email = $user->email;
        }
        return $this->sendMessage($email,
            $this->reconfirmationSubject,
            'reconfirmation',
            ['user' => $user, 'token' => $token]
        );
    }

    /**
     * Sends an email to a user with recovery link.
     *
     * @param  User $user
     * @param  Token $token
     * @return bool
     */
    public function sendRecoveryMessage(User $user, Token $token)
    {
        return $this->sendMessage($user->email,
            $this->recoverySubject,
            'recovery',
            ['user' => $user, 'token' => $token]
        );
    }
}

================================================
FILE: common/components/db/ActiveRecord.php
================================================
<?php
namespace common\components\db;

class ActiveRecord extends \yii\db\ActiveRecord
{
	/**
     * 自动更新created_at和updated_at时间
     * @return array
     */
    public function behaviors()
    {
        return [
            'timestamp' => [
                'class' => 'yii\behaviors\TimestampBehavior',
            ],
        ];
    }
}

================================================
FILE: common/components/db/Command.php
================================================
<?php
namespace common\components\db;

class Command extends \yii\db\Command
{

    /**
     * @param $replace 是否替换数据,如果为真, 则创建REPLACE INTO sql语句 (Only Mysql)
     * @see \yii\db\Command::batchInsert();
     */
    public function batchReplace($table, $columns, $rows)
    {
        $sql = $this->db->getQueryBuilder()->batchInsert($table, $columns, $rows);
        return $this->setSql('REPLACE' . substr($sql, strpos($sql, ' ')));
    }

}

?>

================================================
FILE: common/components/db/Connection.php
================================================
<?php
namespace common\components\db;

class Connection extends \yii\db\Connection
{
    /**
     * @see \yii\db\Connection::createCommand
     */
    public function createCommand($sql = null, $params = [])
    {
        $this->open();
        $command = new Command([ // 使用了继承了之后的Command类..
            'db' => $this,
            'sql' => $sql,
        ]);

        return $command->bindValues($params);
    }
}

================================================
FILE: common/components/db/Migration.php
================================================
<?php
namespace common\components\db;

class Migration extends \yii\db\Migration
{
    /**
     * 创建表选项
     * @var string
     */
    public $tableOptions = null;

    /**
     * 是否事务性存储表, 则创建为事务性表. 默认不使用
     * @var bool
     */
    public $useTransaction = false;


    public function init()
    {
        parent::init();

        if ($this->db->driverName === 'mysql') { //Mysql 表选项
            $engine = $this->useTransaction ? 'InnoDB' : 'MyISAM';
            $this->tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=' . $engine;
        }
    }
}

================================================
FILE: common/config/.gitignore
================================================
main-local.php
params-local.php
db.php


================================================
FILE: common/config/bootstrap.php
================================================
<?php
Yii::setAlias('common', dirname(__DIR__));
Yii::setAlias('root', dirname(dirname(__DIR__)));
Yii::setAlias('frontend', dirname(dirname(__DIR__)) . '/frontend');
Yii::setAlias('backend', dirname(dirname(__DIR__)) . '/backend');
Yii::setAlias('console', dirname(dirname(__DIR__)) . '/console');


================================================
FILE: common/config/main.php
================================================
<?php
return [
//    'aliases' => [
//        '@bower' => '@vendor/bower-asset',
//        '@npm' => '@vendor/npm-asset',
//    ],
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'timeZone' => 'Asia/Shanghai', //time zone affect the formatter datetime format
    'language' => 'zh-CN',
    'modules' => [
    ],
    'components' => [
        'formatter' => [ //for the showing of date datetime
            'dateFormat' => 'yyyy-MM-dd',
            'locale' => 'zh-CN',
            'datetimeFormat' => 'yyyy-MM-dd HH:mm:ss',
            'decimalSeparator' => ',',
            'thousandSeparator' => ' ',
            'currencyCode' => 'CNY',
        ],
        'setting' => [
            'class' => 'funson86\setting\Setting',
        ],
        'qr' => [
            'class' => '\Da\QrCode\Component\QrCodeComponent',
//            'label' => '2amigos consulting group llc',
            'size' => 500 // big and nice :D
            // ... you can configure more properties of the component here
        ],
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'viewPath' => '@common/mail',
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
            //'class' => 'yii\caching\ApcCache',
            'cachePath' => '@backend/runtime/cache',
        ],
        'slack' => [
            'httpclient' => ['class' => 'yii\httpclient\Client'],
            'class' => 'understeam\slack\Client',
            'url' => '',
        ],
//        'assetManager' => [
//            'linkAssets' => true,
//        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'understeam\slack\LogTarget',
                    'enabled' => false, // 是否开启错误信息发送 Slack 服务,默认否
                    'levels' => ['error'],
                    'categories' => [
                        'yii\db\*',
                        'yii\web\HttpException:*',
                    ],
                    'except' => [
                        'yii\web\HttpException:404', // 除了404错误
                    ],
                    'exportInterval' => 1, // Send logs on every message
                    'logVars' => [],
                ],
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning', 'info', 'trace'],
                ],
                /**
                 * 错误级别日志:当某些需要立马解决的致命问题发生的时候,调用此方法记录相关信息。
                 * 使用方法:Yii::error()
                 */
                [
                    'class' => 'common\components\FileTarget',
                    // 日志等级
                    'levels' => ['error'],
                    // 被收集记录的额外数据
                    'logVars' => ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_SERVER'],
                    // 指定日志保存的文件名
                    'logFile' => '@app/runtime/logs/error/app.log',
                    // 是否开启日志 (@app/runtime/logs/error/20151223_app.log)
                    'enableDatePrefix' => true,
                ],
                /**
                 * 警告级别日志:当某些期望之外的事情发生的时候,使用该方法。
                 * 使用方法:Yii::warning()
                 */
                [
                    'class' => 'common\components\FileTarget',
                    // 日志等级
                    'levels' => ['warning'],
                    // 被收集记录的额外数据
                    'logVars' => ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_SERVER'],
                    // 指定日志保存的文件名
                    'logFile' => '@app/runtime/logs/warning/app.log',
                    // 是否开启日志 (@app/runtime/logs/warning/20151223_app.log)
                    'enableDatePrefix' => true,
                ],
                /**
                 * info 级别日志:在某些位置记录一些比较有用的信息的时候使用。
                 * 使用方法:Yii::info()
                 */
                [
                    'class' => 'common\components\FileTarget',
                    'enabled' => YII_DEBUG, // debug 模式才开启
                    // 日志等级
                    'levels' => ['info'],
                    // 被收集记录的额外数据
                    'logVars' => ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_SERVER'],
                    // 指定日志保存的文件名
                    'logFile' => '@app/runtime/logs/info/app.log',
                    // 是否开启日志 (@app/runtime/logs/info/20151223_app.log)
                    'enableDatePrefix' => true,
                ],
                /**
                 * trace 级别日志:记录关于某段代码运行的相关消息。主要是用于开发环境。
                 * 使用方法:Yii::trace()
                 */
                [
                    'class' => 'common\components\FileTarget',
                    'enabled' => YII_DEBUG, // debug 模式才开启
                    // 日志等级
                    'levels' => ['trace'],
                    // 被收集记录的额外数据
                    'logVars' => ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_SERVER'],
                    // 指定日志保存的文件名
                    'logFile' => '@app/runtime/logs/trace/app.log',
                    // 是否开启日志 (@app/runtime/logs/trace/20151223_app.log)
                    'enableDatePrefix' => true,
                ],
            ],
        ],
        'session' => [
            'class' => 'yii\web\DbSession',
        ],
        'db' => require(__DIR__ . '/db.php'),
        'i18n' => [
            'translations' => [
                'frontend*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@common/messages',
                ],
                'backend*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@common/messages',
                ],
                'common*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@common/messages',
                ],
            ],
        ],
    ],
];


================================================
FILE: common/config/params.php
================================================
<?php
return [
    'adminEmail' => 'caizhenghai@gmail.com',
    'backupEmail' => 'caizhenghai@qq.com',
    'supportEmail' => 'forecho@foxmail.com',
    'user.passwordResetTokenExpire' => 3600,
//    'avatarPath' => Yii::$app->basePath . '/uploads/avatars/',
//    'avatarUrl' => Yii::$app->urlManager->baseUrl . '/uploads/avatars/',
    'avatarPath' => '/web/uploads/avatars/',
    'avatarUrl' => '/uploads/avatars/',
    'avatarCachePath' => '/web/uploads/avatars/cache/',
    'avatarCacheUrl' => '/uploads/avatars/cache/',
    'icon-framework' => 'fa',  // Font Awesome Icon framework
    'qrCodePath' => '/web/uploads/qr-code/',
    'qrCodeUrl' => '/uploads/qr-code/',
    'newUserPostLimit' => 0, // 防止 spam,可限制新注册用户多少秒之后才能发帖,默认 0 代表不限制,单位是秒
    'smToken' => '', // https://sm.ms/home/apitoken
    'createPostNeedVerify' => false, // 发帖是否需要审核
];


================================================
FILE: common/grid/EnumColumn.php
================================================
<?php
namespace common\grid;

use yii\grid\DataColumn;
use yii\helpers\ArrayHelper;

/**
 * Class EnumColumn
 * [
 *      'class' => 'common\grid\EnumColumn',
 *      'attribute' => 'role',
 *      'enum' => User::getRoles()
 * ]
 * @package common\components\grid
 */
class EnumColumn extends DataColumn
{
    /**
     * @var array List of value => name pairs
     */
    public $enum = [];
    /**
     * @var bool
     */
    public $loadFilterDefaultValues = true;

    /**
     * @inheritdoc
     */
    public function init()
    {
        if ($this->loadFilterDefaultValues && $this->filter === null) {
            $this->filter = $this->enum;
        }
    }

    /**
     * @param mixed $model
     * @param mixed $key
     * @param int $index
     * @return mixed
     */
    public function getDataCellValue($model, $key, $index)
    {
        $value = parent::getDataCellValue($model, $key, $index);
        return ArrayHelper::getValue($this->enum, $value, $value);
    }
}


================================================
FILE: common/helpers/Arr.php
================================================
<?php
/**
 * author     : forecho <caizhenghai@gmail.com>
 * createTime : 16/3/19 上午9:57
 * description:
 */

namespace common\helpers;


use yii\helpers\ArrayHelper;

class Arr extends ArrayHelper
{
    /**
     * 随机筛选$num个数组
     * @param array $arr
     * @param int $num
     * @return array|false
     */
    public static function arrayRandomAssoc(Array $arr, $num = 1)
    {
        if (!$arr) {
            return false;
        }
        $keys = array_keys($arr);
        shuffle($keys);

        $r = [];
        for ($i = 0; $i < $num; $i++) {
            $r[$keys[$i]] = $arr[$keys[$i]];
        }
        return $r;
    }
}

================================================
FILE: common/helpers/Avatar.php
================================================
<?php
/**
 * author     : forecho <caizhenghai@gmail.com>
 * createTime : 15/5/17 下午4:14
 * description:
 */

namespace common\helpers;

class Avatar
{
    public $email;
    public $size;

    public function __construct($email, $size = 50)
    {
        $this->email = $email;
        $this->size = $size;
    }

    public function getAvater()
    {
        // 说明: Gravatar 随机头像太丑了 所以使用 Identicon 随机头像
        // TODO 保存头像图片 加缓存
        // return $this->getGravatar();
        $identicon = new \Identicon\Identicon();
        return $identicon->getImageDataUri($this->email, $this->size);
    }

    /**
     * 根据 email 获取 gravatar 头像的地址
     * @return string
     */
    private function getGravatar()
    {
        $hash = md5(strtolower(trim($this->email)));
        return sprintf('http://gravatar.com/avatar/%s?s=%d&d=%s', $hash, $this->size, 'identicon');
    }

    /**
     * 验证email是否有对应的 Gravatar 头像(效率太低)
     * @return bool
     */
    private function validateGravatar()
    {
        $hash = md5(strtolower(trim($this->email)));
        $uri = 'http://gravatar.com/avatar/' . $hash . '?d=404';
        $headers = @get_headers($uri);
        if (!preg_match("|200|", $headers[0])) {
            return false;
        } else {
            return true;
        }
    }
}

================================================
FILE: common/helpers/Formatter.php
================================================
<?php
/**
 * author     : forecho <caizhenghai@gmail.com>
 * createTime : 2015/8/4 14:19
 * description:
 */

namespace common\helpers;

class Formatter
{
    const DATE_FORMAT = 'php:Y-m-d';
    const DATETIME_FORMAT = 'php:Y-m-d H:i:s';
    const TIME_FORMAT = 'php:H:i:s';

    public static function convert($dateStr, $type = 'date', $format = null)
    {
        if ($type === 'datetime') {
            $fmt = ($format == null) ? self::DATETIME_FORMAT : $format;
        } elseif ($type === 'time') {
            $fmt = ($format == null) ? self::TIME_FORMAT : $format;
        } else {
            $fmt = ($format == null) ? self::DATE_FORMAT : $format;
        }
        return \Yii::$app->formatter->asDate($dateStr, $fmt);
    }

    /**
     * 相对时间
     * @param $dateStr
     * @return string
     */
    public static function relative($dateStr)
    {
        return \Yii::$app->formatter->asRelativeTime($dateStr);
    }
}

================================================
FILE: common/helpers/UploadHelper.php
================================================
<?php
/**
 * Created by PhpStorm.
 * User: user
 * Date: 2017/1/18
 * Time: 17:56
 */

namespace common\helpers;


class UploadHelper
{
    public static function getCurlValue($filename, $contentType, $postname)
    {
        // PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
        // See: https://wiki.php.net/rfc/curl-file-upload
        if (function_exists('curl_file_create')) {
            return curl_file_create($filename, $contentType, $postname);
        }

        // Use the old style if using an older version of PHP
        $value = "@{$filename};filename=" . $postname;
        if ($contentType) {
            $value .= ';type=' . $contentType;
        }

        return $value;
    }

}

================================================
FILE: common/mail/backup.php
================================================


数据库备份成功!!!!



================================================
FILE: common/mail/layouts/html.php
================================================
<?php
use yii\helpers\Html;

/* @var $this \yii\web\View view component instance */
/* @var $message \yii\mail\MessageInterface the message being composed */
/* @var $content string main view render result */
?>
<?php $this->beginPage() ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?= Yii::$app->charset ?>" />
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body>
    <?php $this->beginBody() ?>
    <?= $content ?>
    <?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>


================================================
FILE: common/mail/passwordResetToken.php
================================================
<?php
use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $user common\models\User */

$resetLink = Yii::$app->urlManager->createAbsoluteUrl(['site/reset-password', 'token' => $user->password_reset_token]);
?>

Hello <?= Html::encode($user->username) ?>,

Follow the link below to reset your password:

<?= Html::a(Html::encode($resetLink), $resetLink) ?>


================================================
FILE: common/messages/pt-BR/backend.php
================================================
<?php
return [
    'DELETED' => 'EXCLUÍDO',
    'ACTIVE' => 'ATIVO',
    'EXCELLENT' => 'EXCELENTE',
    'TOP' => 'TOP',
    'Username' => 'Usuário',
    'Password' => 'Senha',
    'Remember Me' => 'Lembrar-me',
    'Sign in' => 'Acessar',
    'Article View' => 'Ver artigo',
    'Page View' => 'Ver Página',
    '"{attribute}" must be a valid JSON' => '"{attribute}" precisa ser JSON válido',
    'Active' => 'Ativo',
    'Article ID' => 'ID artigo',
    'Author' => 'Autor',
    'Base URL' => 'URL Base',
    'Base Url' => 'Url Base',
    'Body' => 'Corpo',
    'Caption' => 'Legenda',
    'Carousel ID' => 'Carrossel ID',
    'Category' => 'Categoria',
    'Comment' => 'Comentario',
    'Component' => 'Componente',
    'Config' => 'Configuracão',
    'Created At' => 'Criado Em',
    'Created at' => 'Criado em',
    'Deleted' => 'Excluído',
    'Down to maintenance.' => 'Desativado para manutenção',
    'E-mail' => 'E-mail',
    'File Type' => 'Tipo de arquivo',
    'Firstname' => 'Nome',
    'Gender' => 'Genero',
    'ID' => 'ID',
    'Image' => 'Imagen',
    'Key' => 'Chave',
    'Last login' => 'Ultimo Login',
    'Lastname' => 'Ultimo Nome',
    'Locale' => 'Localidade',
    'Middlename' => 'Nome do meio',
    'Name' => 'Nome',
    'Order' => 'Ordem',
    'Parent Category' => 'Categoria Pai',
    'Path' => 'Caminho',
    'Picture' => 'Imagen',
    'Published' => 'Publicado',
    'Published At' => 'Publicado em',
    'Size' => 'Tamanho',
    'Slug' => 'Slug',
    'Status' => 'Status',
    'Thumbnail' => 'Miniatura',
    'Title' => 'Título',
    'Type' => 'Tipo',
    'Updated At' => 'Atualizado Em',
    'Updated at' => 'Atualizado em',
    'Updater' => 'Atualizado por',
    'Upload Ip' => 'IP',
    'Url' => 'Url',
    'User ID' => 'ID do Usuario',
    'Value' => 'Valor',
];

================================================
FILE: common/messages/pt-BR/common.php
================================================
<?php
return [
    'DELETED' => 'EXCLUIDO',
    'ACTIVE' => 'ATIVO',
    'EXCELLENT' => 'EXCELENTE',
    'TOP' => 'TOP',
    'Username' => 'Usuário',
    'Password' => 'Senha',
    'Remember Me' => 'Lembrar-me',
    'Incorrect username or password.' => 'Usuário ou senha inválido',
    'You don\'t have permission to login.' => 'Você não tem permissão pra autenticar',
    'User ID' => 'ID do usuário',
    'Type' => 'Tipo',
    'Merit' => 'Mérito',
    'Created At' => 'Criado em',
    'Updated At' => 'Alterado em',
    'Merit Template ID' => 'Cod Template Merit',
    'Description' => 'Descrição',
    'Action Type' => 'Tipo de Ação',
    'Increment' => 'Incremento',
];

================================================
FILE: common/messages/pt-BR/frontend.php
================================================
<?php
return [
    'created_at {datetime}' => 'criado em {datetime}',
    'reply_at {datetime}' => 'respondido em {datetime}',
    'last_by' => 'Por',
];

================================================
FILE: common/messages/zh-CN/backend.php
================================================
<?php
return [
    'DELETED' => '已删除',
    'ACTIVE' => '正常',
    'EXCELLENT' => '推荐',
    'TOP' => '置顶',
    'Username' => '用户名',
    'Password' => '密码',
    'Remember Me' => '记住我',
    'Sign in' => '登录',
    'Article View' => 'Vista de Artículo',
    'Page View' => 'Vista de Página',
    '"{attribute}" must be a valid JSON' => '"{attribute}" debe de ser JSON válido',
    'Active' => 'Activo',
    'Article ID' => 'ID Artículo',
    'Author' => 'Autor',
    'Base URL' => 'URL Base',
    'Base Url' => 'Url Base',
    'Body' => 'Cuerpo',
    'Caption' => 'Leyenda',
    'Carousel ID' => 'Carrusel ID',
    'Category' => 'Categoría',
    'Comment' => 'Comentario',
    'Component' => 'Componente',
    'Config' => 'Configuración',
    'Created At' => 'Creado el',
    'Created at' => 'Creado el',
    'Deleted' => 'Borrado',
    'Down to maintenance.' => 'Apagado por mantenimiento.',
    'E-mail' => 'E-mail',
    'File Type' => 'Tipo fichero',
    'Firstname' => 'Nombre',
    'Gender' => 'Género',
    'ID' => 'ID',
    'Image' => 'Imagen',
    'Key' => 'Clave',
    'Last login' => 'ültimo Login',
    'Lastname' => 'Apellido',
    'Locale' => 'Pais',
    'Middlename' => 'Segundo Nombre',
    'Name' => 'Nombre',
    'Order' => 'Orden',
    'Parent Category' => 'Categoría Padre',
    'Path' => 'Ruta',
    'Picture' => 'Imagen',
    'Published' => 'Publicado',
    'Published At' => 'Publicado el',
    'Size' => 'Tamaño',
    'Slug' => 'Slug',
    'Status' => 'Estado',
    'Thumbnail' => 'Miniatura',
    'Title' => 'Título',
    'Type' => 'Tipo',
    'Updated At' => 'Actualizado el',
    'Updated at' => 'Actualizado el',
    'Updater' => 'Actualizado por',
    'Upload Ip' => 'IP',
    'Url' => 'Url',
    'User ID' => 'Usuario ID',
    'Value' => 'Valor',
];

================================================
FILE: common/messages/zh-CN/common.php
================================================
<?php

return [
    'DELETED' => '已删除',
    'ACTIVE' => '正常',
    'EXCELLENT' => '推荐',
    'TOP' => '置顶',

    'Username' => '用户名/邮箱',
    'Password' => '密码',
    'Remember Me' => '记住我',
    'Incorrect username or password.' => '用户名密码验证失败。',
    'You don\'t have permission to login.' => '你没有登录权限。',
    'User ID' => '用户 ID',
    'Type' => '分类',
    'Merit' => '总值',
    'Created At' => '创建时间',
    'Updated At' => '更新时间',
    'Merit Template ID' => '模板ID',
    'Description' => '描述',
    'Action Type' => '操作类型  0减去 1新增',
    'Increment' => '变化值',


];

================================================
FILE: common/messages/zh-CN/frontend.php
================================================
<?php

return [
    'created_at {datetime}' => '于 {datetime} 发布',
    'reply_at {datetime}' => '于 {datetime} 回复',
    'last_by' => '最后由',

];

================================================
FILE: common/models/LoginForm.php
================================================
<?php
namespace common\models;

use Yii;
use yii\base\Model;

/**
 * Login form
 */
class LoginForm extends Model
{
    public $username;
    public $password;
    public $rememberMe = true;
    private $_user = false;

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            // username and password are both required
            [['username', 'password'], 'required'],
            // rememberMe must be a boolean value
            ['rememberMe', 'boolean'],
            // password is validated by validatePassword()
            ['password', 'validatePassword'],
        ];
    }

    /**
     * Validates the password.
     * This method serves as the inline validation for password.
     *
     * @param string $attribute the attribute currently being validated
     * @param array $params the additional name-value pairs given in the rule
     */
    public function validatePassword($attribute, $params)
    {
        if (!$this->hasErrors()) {
            $user = $this->getUser();
            if (!$user || !$user->validatePassword($this->password)) {
                $this->addError($attribute, Yii::t('common', 'Incorrect username or password.'));
            }
        }
    }

    /**
     * Logs in a user using the provided username and password.
     *
     * @return boolean whether the user is logged in successfully
     */
    public function login()
    {
        if ($this->validate()) {
            return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
        } else {
            return false;
        }
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'username' => Yii::t('common', 'Username'),
            'password' => Yii::t('common', 'Password'),
            'rememberMe' => Yii::t('common', 'Remember Me'),
        ];
    }

    /**
     * email 邮箱登录
     * @user onyony
     * @return bool|null|static
     */
    public function getUser()
    {
        if ($this->_user === false) {
            if (strpos($this->username, "@"))
                $this->_user = User::findByEmail($this->username); //email 登录
            else
                $this->_user = User::findByUsername($this->username);
        }

        return $this->_user;
    }

    /**
     * 登陆之后更新用户资料
     * @return bool
     */
    public function updateUserInfo()
    {
        /** @var UserInfo $model */
        $model = UserInfo::findOne(['user_id' => Yii::$app->user->getId()]);
        $model->login_count += 1;
        $model->prev_login_time = $model->last_login_time;
        $model->prev_login_ip = $model->last_login_ip;
        $model->last_login_time = time();
        $model->last_login_ip = Yii::$app->getRequest()->getUserIP();

        if (!Yii::$app->session->isActive) {
            Yii::$app->session->open();
        }
        $model->session_id = Yii::$app->session->id;
        Yii::$app->session->close();

        if ($model->save()) {
            return true;
        } else {
            return false;
        }
    }

    public function loginAdmin()
    {
        if ($this->validate()) {
            if (User::isSuperAdmin($this->username)) {
                return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
            }
            $this->addError('username', 'You don\'t have permission to login.');
        } else {
            $this->addError('password', Yii::t('common', 'Incorrect username or password.'));
        }
        return false;
    }
}


================================================
FILE: common/models/Nav.php
================================================
<?php

namespace common\models;

use Yii;
use yii\helpers\ArrayHelper;

/**
 * This is the model class for table "nav".
 *
 * @property integer $id
 * @property string $name
 * @property string $alias
 * @property integer $order
 * @property string $created_at
 * @property string $updated_at
 */
class Nav extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%nav}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name','alias','order'], 'required'],
            [['order'], 'integer'],
            [['name', 'alias'], 'string', 'max' => 50]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'name' => Yii::t('app', 'Name'),
            'alias' => Yii::t('app', 'Alias'),
            'order' => Yii::t('app', 'Order'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
        ];
    }

    public static function getNavList()
    {
        $data_array = ArrayHelper::map(static::find()->orderBy(['order' => SORT_ASC])->all(), 'id', 'name');
        return $data_array;
    }

}


================================================
FILE: common/models/NavUrl.php
================================================
<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "nav_url".
 *
 * @property integer $id
 * @property integer $nav_id
 * @property string $title
 * @property string $url
 * @property string $description
 * @property integer $order
 * @property integer $user_id
 * @property string $created_at
 * @property string $updated_at
 */
class NavUrl extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%nav_url}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['nav_id', 'order'], 'integer'],
            [['title', 'url', 'nav_id','order'], 'required'],
            [['title', 'description'], 'string', 'max' => 255],
            [['url'], 'string', 'max' => 225]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'nav_id' => Yii::t('app', 'Nav ID'),
            'title' => Yii::t('app', 'Title'),
            'url' => Yii::t('app', 'Url'),
            'description' => Yii::t('app', 'Description'),
            'order' => Yii::t('app', 'Order'),
            'user_id' => Yii::t('app', 'User ID'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
        ];
    }


}


================================================
FILE: common/models/Post.php
================================================
<?php

namespace common\models;

use common\components\db\ActiveRecord;
use Yii;
use yiier\antiSpam\SpamValidator;

/**
 * This is the model class for table "post".
 *
 * @property integer $id
 * @property string $type
 * @property integer $post_meta_id
 * @property integer $user_id
 * @property string $title
 * @property string $author
 * @property string $excerpt
 * @property string $image
 * @property string $content
 * @property string|array $tags
 * @property string $last_comment_time
 * @property string $last_comment_username
 * @property integer $view_count
 * @property integer $comment_count
 * @property integer $favorite_count
 * @property integer $like_count
 * @property integer $thanks_count
 * @property integer $hate_count
 * @property integer $status
 * @property integer $order
 * @property integer $created_at
 * @property integer $updated_at
 *
 * @property PostMeta $category
 * @property User $user
 */
class Post extends ActiveRecord
{
    /**
     * 博客文章
     */
    const TYPE_BLOG = 'blog';

    /**
     * 社区话题
     */
    const TYPE_TOPIC = 'topic';

    /**
     * 置顶
     */
    const STATUS_TOP = 3;

    /**
     * 推荐
     */
    const STATUS_EXCELLENT = 2;

    /**
     * 发布
     */
    const STATUS_ACTIVE = 1;

    /**
     * 删除
     */
    const STATUS_DELETED = 0;


    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%post}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['post_meta_id', 'title', 'content'], 'required'],
            [
                [
                    'post_meta_id',
                    'user_id',
                    'view_count',
                    'comment_count',
                    'last_comment_time',
                    'favorite_count',
                    'like_count',
                    'thanks_count',
                    'hate_count',
                    'status',
                    'order',
                    'created_at',
                    'updated_at'
                ],
                'integer'
            ],
            [['content'], 'string', 'min' => 2],
            ['content', 'validateLimitPostTime'],
            [['type'], 'string', 'max' => 32],
            [['last_comment_username'], 'string', 'max' => 20],
            [['title'], 'string', 'max' => 50, 'min' => 2],
            [['excerpt', 'image'], 'string', 'max' => 255],
            [['author'], 'string', 'max' => 100],
            [['cc', 'tags'], 'safe'],
            ['content', SpamValidator::className(), 'message' => '请勿发表垃圾内容'],
            ['title', SpamValidator::className(), 'message' => '请勿发表垃圾内容'],
        ];
    }

    /**
     * 验证新用户是否能发帖
     * @param $attribute
     */
    public function validateLimitPostTime($attribute)
    {
        if ($time = $this->limitPostTime()) {
            $this->addError($attribute, "新注册用户只能回帖,{$time}秒之后才能发帖。");
        }
    }

    /**
     * 新用户N秒之后才能发帖
     * @return bool|int
     */
    public function limitPostTime()
    {
        $userCreatedAt = Yii::$app->user->identity['created_at'];
        $newUserPostLimit = params('newUserPostLimit');
        if ($newUserPostLimit && time() - $userCreatedAt < $newUserPostLimit) {
            return $newUserPostLimit - (time() - $userCreatedAt);
        }
        return false;
    }

    /**
     * 限制发帖间隔
     * @return bool|int
     */
    public function limitPostingIntervalTime()
    {
        $lastPostCreatedAt = Post::find()->select('created_at')->where(['type' => self::TYPE_TOPIC])->orderBy(['created_at' => SORT_DESC])->scalar();
        $postingIntervalLimit = params('postingIntervalLimit');
        if ($postingIntervalLimit && time() - $lastPostCreatedAt < $postingIntervalLimit) {
            return $postingIntervalLimit - (time() - $lastPostCreatedAt);
        }
        return false;
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'type' => '内容类型',
            'post_meta_id' => '分类',
            'category_name' => '分类',
            'user_id' => '用户ID',
            'username' => '用户',
            'title' => '标题',
            'author' => '作者',
            'excerpt' => '摘要',
            'image' => '封面图片',
            'content' => '内容',
            'tags' => '标签',
            'last_comment_username' => '最后回复用户',
            'last_comment_time' => '最后评论时间',
            'view_count' => '查看数',
            'comment_count' => '评论数',
            'favorite_count' => '收藏数',
            'like_count' => '喜欢数',
            'thanks_count' => '感谢数',
            'hate_count' => '讨厌数',
            'status' => '状态',
            'order' => '排序',
            'created_at' => '创建时间',
            'updated_at' => '修改时间',
            'cc' => '注明版权信息(原创文章欢迎使用)',
        ];
    }

    public function getUser()
    {
        return $this->hasOne(User::className(), ['id' => 'user_id']);
    }


    public function getUserInfo()
    {
        return $this->hasOne(UserInfo::className(), ['user_id' => 'user_id']);
    }


    public function getCategory()
    {
        return $this->hasOne(PostMeta::className(), ['id' => 'post_meta_id']);
    }

    public function isCurrent()
    {
        return $this->user_id == Yii::$app->user->id;
    }

    public function beforeSave($insert)
    {
        if (parent::beforeSave($insert)) {
            return true;
        } else {
            return false;
        }
    }

    /**
     * @param bool $status
     * @return array|mixed
     */
    public static function getStatuses($status = false)
    {
        $statuses = [
            self::STATUS_DELETED => Yii::t('common', 'DELETED'),
            self::STATUS_ACTIVE => Yii::t('common', 'ACTIVE'),
            self::STATUS_EXCELLENT => Yii::t('common', 'EXCELLENT'),
            self::STATUS_TOP => Yii::t('common', 'TOP'),
        ];

        return $status !== false ? ArrayHelper::getValue($statuses, $status) : $statuses;
    }


}


================================================
FILE: common/models/PostComment.php
================================================
<?php

namespace common\models;

use common\components\db\ActiveRecord;
use common\services\NotificationService;
use common\services\PostService;
use frontend\modules\topic\models\Topic;
use frontend\modules\user\models\UserMeta;
use Yii;
use yii\db\Query;
use yii\web\NotFoundHttpException;
use yiier\antiSpam\SpamValidator;

/**
 * This is the model class for table "post_comment".
 *
 * @property integer $id
 * @property string $parent
 * @property string $post_id
 * @property string $comment
 * @property integer $status
 * @property string $user_id
 * @property string $like_count
 * @property string $ip
 * @property string $created_at
 * @property string $updated_at
 *
 * @property Topic $topic
 * @property Post $post
 */
class PostComment extends ActiveRecord
{
    const TYPE = 'comment';
    /**
     * 发布
     */
    const STATUS_ACTIVE = 1;

    /**
     * 删除
     */
    const STATUS_DELETED = 0;

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%post_comment}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['parent', 'post_id', 'status', 'user_id', 'like_count', 'created_at', 'updated_at'], 'integer'],
            [['post_id', 'comment', 'user_id', 'ip'], 'required'],
            [['comment'], 'string', 'min' => 1],
            ['comment', SpamValidator::className(), 'message' => '请勿发表垃圾内容'],
            [['ip'], 'string', 'max' => 255]
        ];
    }

    public function getUser()
    {
        return $this->hasOne(User::className(), ['id' => 'user_id']);
    }

    public function getPost()
    {
        return $this->hasOne(Post::className(), ['id' => 'post_id']);
    }

    public function getTopic()
    {
        return $this->hasOne(Topic::className(), ['id' => 'post_id'])->where(['type' => 'topic']);
    }

    public function getLike()
    {
        $model = new UserMeta();
        return $model->isUserAction(self::TYPE, 'like', $this->id);
    }

    /**
     * 通过ID获取指定评论
     * @param $id
     * @param string $condition
     * @return array|null|\yii\db\ActiveRecord|static
     * @throws NotFoundHttpException
     */
    public static function findModel($id, $condition = '')
    {
        if (!$model = Yii::$app->cache->get('comment' . $id)) {
            $model = static::find()
                ->where(['id' => $id])
                ->andWhere($condition)
                ->one();
        }
        if ($model !== null) {
            Yii::$app->cache->set('comment' . $id, $model, 0);
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

    /**
     * 通过ID获取指定评论
     * @param $id
     * @return array|null|\yii\db\ActiveRecord|static
     * @throws NotFoundHttpException
     */
    public static function findComment($id)
    {
        return static::findModel($id, ['status' => self::STATUS_ACTIVE]);
    }

    /**
     * 获取已经删除过的评论
     * @param $id
     * @return array|null|\yii\db\ActiveRecord
     * @throws NotFoundHttpException
     */
    public static function findDeletedComment($id)
    {
        return static::findModel($id, ['status' => self::STATUS_DELETED]);
    }

    /**
     * 评论列表
     * @param $postId
     * @return Query
     */
    public static function findCommentList($postId)
    {
        return static::find()->with('user')->where(['post_id' => $postId]);
    }

    /**
     * 自己写的评论
     * @return bool
     */
    public function isCurrent()
    {
        return $this->user_id == Yii::$app->user->id;
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'parent' => '父级评论',
            'post_id' => '文章ID',
            'comment' => '评论',
            'status' => '1为正常 0为禁用',
            'user_id' => '用户ID',
            'like_count' => '喜欢数',
            'ip' => '评论者ip地址',
            'created_at' => '创建时间',
            'updated_at' => '修改时间',
        ];
    }

    public $atUsers;

    public function beforeSave($insert)
    {
        if (!parent::beforeSave($insert)) {
            return false;
        }

        $this->comment = PostService::contentComment($this->comment, $this);
        return true;
    }

    public function afterSave($insert, $changedAttributes)
    {
        parent::afterSave($insert, $changedAttributes);

        $post = $this->topic;

        (new UserMeta())->saveNewMeta('topic', $this->post_id, 'follow');
        (new NotificationService())->newReplyNotify(\Yii::$app->user->identity, $post, $this, $this->atUsers);
        // 更新回复时间
        $post->lastCommentToUpdate(\Yii::$app->user->identity->username);
        if ($insert) {
            // 评论计数器
            Topic::updateAllCounters(['comment_count' => 1], ['id' => $post->id]);
            // 更新个人总统计
            UserInfo::updateAllCounters(['comment_count' => 1], ['user_id' => $this->user_id]);
        }

        \Yii::$app->cache->set('comment' . $this->id, $this, 0);

    }
}


================================================
FILE: common/models/PostMeta.php
================================================
<?php

namespace common\models;

use DevGroup\TagDependencyHelper\CacheableActiveRecord;
use DevGroup\TagDependencyHelper\NamingHelper;
use DevGroup\TagDependencyHelper\TagDependencyTrait;
use Yii;
use yii\caching\TagDependency;
use yii\helpers\ArrayHelper;
use common\components\db\ActiveRecord;

/**
 * This is the model class for table "post_meta".
 *
 * @property integer $id
 * @property string $name
 * @property string $alias
 * @property string $type
 * @property string $description
 * @property string $count
 * @property string $order
 * @property string $created_at
 * @property string $updated_at
 * @property PostMeta[] $children
 */
class PostMeta extends ActiveRecord
{

    use TagDependencyTrait;

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%post_meta}}';
    }

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return ArrayHelper::merge(parent::behaviors(), [
            'class' => CacheableActiveRecord::className(),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['count', 'order', 'created_at', 'updated_at', 'parent'], 'integer'],
            [['name'], 'string', 'max' => 100],
            [['alias', 'type'], 'string', 'max' => 32],
            [['description'], 'string', 'max' => 255],
            [['alias'], 'unique']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '名称',
            'parent' => '父级分类',
            'alias' => '变量(别名)',
            'type' => '项目类型',
            'description' => '选项描述',
            'count' => '项目所属内容个数',
            'order' => '项目排序',
            'created_at' => '创建时间',
            'updated_at' => '修改时间',
        ];
    }

    public static function blogCategory()
    {

        return ArrayHelper::map(static::find()->where(['type' => 'blog_category'])->all(), 'id', 'name');
    }

    public static function topicCategory()
    {
        $parents = ArrayHelper::map(
            static::find()->where(['parent' => null])->orWhere(['parent' => 0])->orderBy(['order' => SORT_ASC])->all(),
            'id', 'name'
        );
        $nodes = [];
        foreach ($parents as $key => $value) {
            $nodes[$value] = ArrayHelper::map(static::find()->where(['parent' => $key])->asArray()->all(), 'id', 'name');
        }
        return $nodes;
    }

    /**
     * 返回无人区节点id
     * @return PostMeta|int
     */
    public static function noManLandId()
    {
        /** @var PostMeta $postMeta */
        $postMeta = self::find()->where(['alias' => 'no-man-land'])->one();
        if ($postMeta) {
            return $postMeta->id;
        }
        return $postMeta;
    }

    public function getChildren()
    {
        return $this->hasMany(self::className(), ['parent' => 'id'])->from(self::tableName() . ' p2');
    }

    public function getTypes()
    {
        return [
            'topic_category' => '社区分类',
            'blog_category' => '文章分类',
        ];
    }

    /**
     * @param array $conditions
     * @return array
     */
    public static function getNodesMap($conditions = [])
    {
        return ArrayHelper::map(static::find()->where(['type' => 'topic_category'])->andFilterWhere($conditions)->all(), 'alias', 'name');
    }

    /**
     * @return array
     */
    public function getParents()
    {
        return ArrayHelper::map(static::find()->where(['parent' => 0])->all(), 'id', 'name');
    }

    /**
     * 获取父子节点
     * @return array
     */
    public static function getNodes()
    {
        $cacheKey = md5(__METHOD__);
        if (false === $nodes = \Yii::$app->cache->get($cacheKey)) {
            $parents = PostMeta::find()->where([PostMeta::tableName() . '.parent' => [0, null]])->joinWith('children')->orderBy(['order' => SORT_ASC])->all();
            /*** @var  PostMeta $parent */
            foreach ($parents as $parent) {
                $nodes[$parent->alias] = $parent;
            }
            //一天缓存
            \Yii::$app->cache->set($cacheKey, $nodes, 86400,
                new TagDependency([
                    'tags' => [NamingHelper::getCommonTag(PostMeta::className())]
                ])
            );
        }
        return $nodes;
    }
}


================================================
FILE: common/models/PostMetaSearch.php
================================================
<?php

namespace common\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\PostMeta;

/**
 * PostMetaSearch represents the model behind the search form about `common\models\PostMeta`.
 */
class PostMetaSearch extends PostMeta
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'count', 'order', 'created_at', 'updated_at'], 'integer'],
            [['name', 'alias', 'type', 'description'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = PostMeta::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'count' => $this->count,
            'order' => $this->order,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', 'name', $this->name])
            ->andFilterWhere(['like', 'alias', $this->alias])
            ->andFilterWhere(['like', 'type', $this->type])
            ->andFilterWhere(['like', 'description', $this->description]);

        return $dataProvider;
    }
}


================================================
FILE: common/models/PostSearch.php
================================================
<?php

namespace common\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\Post;

/**
 * PostSearch represents the model behind the search form about `common\Models\Post`.
 */
class PostSearch extends Post
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'view_count', 'comment_count', 'favorite_count', 'like_count', 'thanks_count', 'hate_count', 'status', 'order', 'created_at', 'updated_at'], 'integer'],
            [['type', 'title', 'author', 'excerpt', 'image', 'content', 'tags', 'id', 'post_meta_id'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * @param $params
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Post::find()->with('user', 'category');

        // 如果有无人区节点 帖子列表过滤无人区节点的帖子
        if (PostMeta::noManLandId() && (empty($params['PostSearch']['post_meta_id']) || $params['PostSearch']['post_meta_id'] != PostMeta::noManLandId())) {
            $query->andWhere(['!=', 'post_meta_id', PostMeta::noManLandId()]);
        }

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'pageSize' => 20,
            ],
            'sort' => ['defaultOrder' => [
                'order' => SORT_ASC,
                'last_comment_time' => SORT_DESC,
                'created_at' => SORT_DESC,
            ]]
        ]);

        if (!($this->load($params) && $this->validate())) {
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'post_meta_id' => $this->post_meta_id,
            'user_id' => $this->user_id,
            'view_count' => $this->view_count,
            'comment_count' => $this->comment_count,
            'favorite_count' => $this->favorite_count,
            'like_count' => $this->like_count,
            'thanks_count' => $this->thanks_count,
            'hate_count' => $this->hate_count,
            'status' => $this->status,
            'order' => $this->order,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', 'type', $this->type])
            ->andFilterWhere(['like', 'title', $this->title])
            ->andFilterWhere(['like', 'author', $this->author])
            ->andFilterWhere(['like', 'excerpt', $this->excerpt])
            ->andFilterWhere(['like', 'image', $this->image])
            ->andFilterWhere(['like', 'content', $this->content])
            ->andFilterWhere(['like', 'tags', $this->tags]);

        return $dataProvider;
    }
}


================================================
FILE: common/models/PostTag.php
================================================
<?php

namespace common\models;

use Yii;
use common\components\db\ActiveRecord;

/**
 * This is the model class for table "post_tag".
 *
 * @property integer $id
 * @property string $name
 * @property string $count
 * @property string $created_at
 * @property integer $updated_at
 */
class PostTag extends ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%post_tag}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['count', 'created_at', 'updated_at'], 'integer'],
            [['name'], 'string', 'max' => 20]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '名称',
            'count' => '计数',
            'created_at' => '创建时间',
            'updated_at' => '修改时间',
        ];
    }
}


================================================
FILE: common/models/PostTagSearch.php
================================================
<?php

namespace common\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;

/**
 * PostTagSearch represents the model behind the search form about `common\models\PostTag`.
 */
class PostTagSearch extends PostTag
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'count', 'created_at', 'updated_at'], 'integer'],
            [['name'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = PostTag::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'count' => $this->count,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', 'name', $this->name]);

        return $dataProvider;
    }
}


================================================
FILE: common/models/RightLink.php
================================================
<?php

namespace common\models;

use common\components\db\ActiveRecord;
use Yii;

/**
 * This is the model class for table "right_link".
 *
 * @property integer $id
 * @property string $title
 * @property string $url
 * @property string $image
 * @property string $content
 * @property integer $type
 * @property string $created_user
 * @property integer $created_at
 * @property integer $updated_at
 */
class RightLink extends ActiveRecord
{
    /**
     * 推荐资源
     */
    const RIGHT_LINK_TYPE_RSOURCES = 1;
    /**
     * 小贴士
     */
    const RIGHT_LINK_TYPE_TIPS = 2;
    /**
     * 友情链接
     */
    const RIGHT_LINK_TYPE_LINKS = 3;
    /**
     * 首页提示语
     */
    const RIGHT_LINK_TYPE_HEADLINE = 4;

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%right_link}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title', 'created_user'], 'required'],
            [['type', 'created_at', 'updated_at'], 'integer'],
            [['title', 'image', 'content'], 'string', 'max' => 255],
            [['url'], 'string', 'max' => 225],
            [['created_user'], 'string', 'max' => 32]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => '名称',
            'url' => 'Url',
            'image' => '图片链接',
            'content' => '内容',
            'type' => '展示类别',
            'created_user' => '创建人',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }

    /**
     * 分类
     * @return array
     */
    public function getTypes()
    {
        return [
            '1' => '推荐资源',
            '2' => '小贴士',
            '3' => '友情链接',
            '4' => '首页提示语',
        ];
    }
}


================================================
FILE: common/models/Search.php
================================================
<?php

namespace common\models;


/**
 * This is the model class for table "topic".
 *
 * @property integer $topic_id
 * @property string $title
 * @property string $content
 * @property integer $status
 * @property integer $updated_at
 */
class Search extends \hightman\xunsearch\ActiveRecord
{
    public static function search($keyword)
    {
        return self::find()->where($keyword)->andWhere(['status' => [1, 2]])
                ->asArray()
                ->offset(0)
                ->limit(1000)
                ->all();
    }
}


================================================
FILE: common/models/SearchLog.php
================================================
<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "search_log".
 *
 * @property integer $id
 * @property integer $user_id
 * @property string $keyword
 * @property integer $created_at
 */
class SearchLog extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%search_log}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'created_at'], 'integer'],
            [['keyword'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'user_id' => Yii::t('app', '用户ID'),
            'username' => Yii::t('app', '用户名'),
            'keyword' => Yii::t('app', '搜索关键词'),
            'created_at' => Yii::t('app', '创建时间'),
        ];
    }

    public function getUser()
    {
        return $this->hasOne(User::className(), ['id' => 'user_id']);
    }

}


================================================
FILE: common/models/Session.php
================================================
<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "session".
 *
 * @property string $id
 * @property integer $expire
 * @property resource $data
 */
class Session extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%session}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['expire'], 'integer'],
            [['data'], 'string'],
            [['id'], 'string', 'max' => 40]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'expire' => Yii::t('app', 'Expire'),
            'data' => Yii::t('app', 'Data'),
        ];
    }
}


================================================
FILE: common/models/User.php
================================================
<?php
namespace common\models;

use common\helpers\Avatar;
use Yii;
use yii\base\NotSupportedException;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
use yii\helpers\FileHelper;
use yii\web\IdentityInterface;
use yiier\merit\models\Merit;
use frontend\modules\user\models\UserAccount;

/**
 * User model
 *
 * @property integer $id
 * @property string $username
 * @property string $avatar
 * @property string $password_hash
 * @property string $password_reset_token
 * @property string $email
 * @property string $auth_key
 * @property integer $role
 * @property integer $status
 * @property integer $created_at
 * @property integer $updated_at
 * @property string $tagline
 * @property string $password write-only password
 *
 * @property string $userAvatar
 * @property Merit $merit
 */
class User extends ActiveRecord implements IdentityInterface
{
    const STATUS_DELETED = 0;
    const STATUS_ACTIVE = 10;
    const ROLE_USER = 10;
    const ROLE_ADMIN = 20;
    const ROLE_SUPER_ADMIN = 30;

    use \DevGroup\TagDependencyHelper\TagDependencyTrait;

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%user}}';
    }

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            TimestampBehavior::className(),
            'CacheableActiveRecord' => [
                'class' => \DevGroup\TagDependencyHelper\CacheableActiveRecord::className(),
            ],
        ];
    }


    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            ['status', 'default', 'value' => self::STATUS_ACTIVE],
            ['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_DELETED]],

            ['role', 'default', 'value' => 10],
            ['role', 'in', 'range' => [self::ROLE_USER, self::ROLE_ADMIN, self::ROLE_SUPER_ADMIN]],
        ];
    }

    /**
     * @inheritdoc
     */
    public static function findIdentity($id)
    {
        return static::findOne(['id' => $id, 'status' => self::STATUS_ACTIVE]);
    }

    /**
     * @inheritdoc
     */
    public static function findIdentityByAccessToken($token, $type = null)
    {
        throw new NotSupportedException('"findIdentityByAccessToken" is not implemented.');
    }

    /**
     * Finds user by username
     *
     * @param string $username
     * @return static|null
     */
    public static function findByUsername($username)
    {
        return static::findOne(['username' => $username, 'status' => self::STATUS_ACTIVE]);
    }

    /**
     * 邮箱登录
     * @user onyony
     * @param $email
     * @return null|static
     */
    public static function findByEmail($email)
    {
        return static::findOne(['email' => $email, 'status' => self::STATUS_ACTIVE]);
    }

    /**
     * Finds user by password reset token
     *
     * @param string $token password reset token
     * @return static|null
     */
    public static function findByPasswordResetToken($token)
    {
        if (!static::isPasswordResetTokenValid($token)) {
            return null;
        }

        return static::findOne([
            'password_reset_token' => $token,
            'status' => self::STATUS_ACTIVE,
        ]);
    }

    /**
     * Finds out if password reset token is valid
     *
     * @param string $token password reset token
     * @return boolean
     */
    public static function isPasswordResetTokenValid($token)
    {
        if (empty($token)) {
            return false;
        }
        $expire = Yii::$app->params['user.passwordResetTokenExpire'];
        $parts = explode('_', $token);
        $timestamp = (int)end($parts);
        return $timestamp + $expire >= time();
    }

    /**
     * @inheritdoc
     */
    public function getId()
    {
        return $this->getPrimaryKey();
    }

    /**
     * @inheritdoc
     */
    public function getAuthKey()
    {
        return $this->auth_key;
    }

    /**
     * @inheritdoc
     */
    public function validateAuthKey($authKey)
    {
        return $this->getAuthKey() === $authKey;
    }

    /**
     * Validates password
     *
     * @param string $password password to validate
     * @return boolean if password provided is valid for current user
     */
    public function validatePassword($password)
    {
        return Yii::$app->security->validatePassword($password, $this->password_hash);
    }

    /**
     * Generates password hash from password and sets it to the model
     *
     * @param string $password
     */
    public function setPassword($password)
    {
        $this->password_hash = Yii::$app->security->generatePasswordHash($password);
    }

    /**
     * Generates "remember me" authentication key
     */
    public function generateAuthKey()
    {
        $this->auth_key = Yii::$app->security->generateRandomString();
    }

    /**
     * Generates new password reset token
     */
    public function generatePasswordResetToken()
    {
        $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();
    }

    /**
     * Removes password reset token
     */
    public function removePasswordResetToken()
    {
        $this->password_reset_token = null;
    }

    /**
     * 获取用户头像
     * @param int $size
     * @return string
     * @throws \yii\base\Exception
     */
    public function getUserAvatar($size = 50)
    {
        if ($this->avatar) {
            // TODO 写法更优雅
            $avatarPath = Yii::$app->basePath . Yii::$app->params['avatarPath'];
            $avatarCachePath = Yii::$app->basePath . Yii::$app->params['avatarCachePath'];
            FileHelper::createDirectory($avatarCachePath); // 创建文件夹
            if (file_exists($avatarCachePath . $size . '_' . $this->avatar)) {
                // 缓存头像是否存在
                return Yii::$app->params['avatarCacheUrl'] . $size . '_' . $this->avatar;
            }
            if (file_exists($avatarPath . $this->avatar)) {
                // 原始头像是否存在
                \yii\imagine\Image::thumbnail($avatarPath . $this->avatar, $size, $size)
                    ->save($avatarCachePath . $size . '_' . $this->avatar, ['quality' => 100]);
                return Yii::$app->params['avatarCacheUrl'] . $size . '_' . $this->avatar;
            }
        }
        return (new Avatar($this->email, $size))->getAvater();
    }

    public function getUserInfo()
    {
        return $this->hasOne(UserInfo::className(), ['user_id' => 'id']);
    }

    public function getMerit()
    {
        return $this->hasOne(Merit::className(), ['user_id' => 'id']);
    }

    /**
     * @return array
     */
    public function getAccounts()
    {
        $connected = [];
        $accounts = $this->hasMany(UserAccount::className(), ['user_id' => 'id'])->all();

        // @var Account $account
        foreach ($accounts as $account) {
            $connected[$account->provider] = $account;
        }

        return $connected;
    }

    /** @inheritdoc */
    public function afterSave($insert, $changedAttributes)
    {
        if ($insert) {
            $time = time();
            $ip = isset(Yii::$app->request->userIP) ? Yii::$app->request->userIP : '127.0.0.1';
            $userInfo = Yii::createObject([
                'class' => UserInfo::className(),
                'user_id' => $this->id,
                'prev_login_time' => $time,
                'prev_login_ip' => $ip,
                'last_login_time' => $time,
                'last_login_ip' => $ip,
                'created_at' => $time,
                'updated_at' => $time,
            ]);
            $userInfo->save();
        }
        parent::afterSave($insert, $changedAttributes);
    }


    public static function isAdmin($username)
    {
        if (static::findOne(['username' => $username, 'role' => self::ROLE_ADMIN])) {
            return true;
        } else {
            return false;
        }
    }

    public static function isSuperAdmin($username)
    {
        if (static::findOn
Download .txt
gitextract_1v5jxhfe/

├── .bowerrc
├── .gitignore
├── .travis.yml
├── Dockerfile
├── LICENSE.md
├── README.md
├── backend/
│   ├── assets/
│   │   └── AppAsset.php
│   ├── config/
│   │   ├── .gitignore
│   │   ├── bootstrap.php
│   │   ├── main.php
│   │   └── params.php
│   ├── controllers/
│   │   ├── CenterController.php
│   │   ├── Controller.php
│   │   ├── NavController.php
│   │   ├── NavUrlController.php
│   │   ├── PostController.php
│   │   ├── PostMetaController.php
│   │   ├── RightLinkController.php
│   │   ├── SearchLogController.php
│   │   ├── SiteController.php
│   │   └── UserController.php
│   ├── models/
│   │   ├── .gitkeep
│   │   ├── PostSearch.php
│   │   ├── RightLinkSearch.php
│   │   ├── SearchLogSearch.php
│   │   └── User.php
│   ├── runtime/
│   │   └── .gitignore
│   ├── views/
│   │   ├── layouts/
│   │   │   ├── content.php
│   │   │   ├── header.php
│   │   │   ├── left.php
│   │   │   ├── main-login.php
│   │   │   └── main.php
│   │   ├── nav/
│   │   │   ├── _form.php
│   │   │   ├── create.php
│   │   │   ├── index.php
│   │   │   ├── update.php
│   │   │   └── view.php
│   │   ├── nav-url/
│   │   │   ├── _form.php
│   │   │   ├── create.php
│   │   │   ├── index.php
│   │   │   ├── update.php
│   │   │   └── view.php
│   │   ├── post/
│   │   │   ├── _form.php
│   │   │   ├── _search.php
│   │   │   ├── create.php
│   │   │   ├── index.php
│   │   │   ├── update.php
│   │   │   └── view.php
│   │   ├── post-meta/
│   │   │   ├── _form.php
│   │   │   ├── _search.php
│   │   │   ├── create.php
│   │   │   ├── index.php
│   │   │   ├── update.php
│   │   │   └── view.php
│   │   ├── right-link/
│   │   │   ├── _form.php
│   │   │   ├── _search.php
│   │   │   ├── create.php
│   │   │   ├── index.php
│   │   │   ├── update.php
│   │   │   └── view.php
│   │   ├── search-log/
│   │   │   ├── _search.php
│   │   │   └── index.php
│   │   ├── site/
│   │   │   ├── error.php
│   │   │   ├── index.php
│   │   │   └── login.php
│   │   └── user/
│   │       ├── _form.php
│   │       ├── _search.php
│   │       ├── index.php
│   │       ├── update.php
│   │       └── view.php
│   └── web/
│       ├── .gitignore
│       ├── .htaccess
│       ├── assets/
│       │   └── .gitignore
│       ├── css/
│       │   ├── sb-admin-2.css
│       │   └── site.css
│       ├── js/
│       │   └── sb-admin-2.js
│       └── robots.txt
├── common/
│   ├── assets/
│   │   ├── AtJs.php
│   │   ├── CaretJs.php
│   │   └── DropzoneJs.php
│   ├── components/
│   │   ├── AssetBundle.php
│   │   ├── ComposerInstaller.php
│   │   ├── Config.php
│   │   ├── Controller.php
│   │   ├── DbAuthManager.php
│   │   ├── FileTarget.php
│   │   ├── GlobalFunctions.php
│   │   ├── Mailer.php
│   │   └── db/
│   │       ├── ActiveRecord.php
│   │       ├── Command.php
│   │       ├── Connection.php
│   │       └── Migration.php
│   ├── config/
│   │   ├── .gitignore
│   │   ├── bootstrap.php
│   │   ├── main.php
│   │   └── params.php
│   ├── grid/
│   │   └── EnumColumn.php
│   ├── helpers/
│   │   ├── Arr.php
│   │   ├── Avatar.php
│   │   ├── Formatter.php
│   │   └── UploadHelper.php
│   ├── mail/
│   │   ├── backup.php
│   │   ├── layouts/
│   │   │   └── html.php
│   │   └── passwordResetToken.php
│   ├── messages/
│   │   ├── pt-BR/
│   │   │   ├── backend.php
│   │   │   ├── common.php
│   │   │   └── frontend.php
│   │   └── zh-CN/
│   │       ├── backend.php
│   │       ├── common.php
│   │       └── frontend.php
│   ├── models/
│   │   ├── LoginForm.php
│   │   ├── Nav.php
│   │   ├── NavUrl.php
│   │   ├── Post.php
│   │   ├── PostComment.php
│   │   ├── PostMeta.php
│   │   ├── PostMetaSearch.php
│   │   ├── PostSearch.php
│   │   ├── PostTag.php
│   │   ├── PostTagSearch.php
│   │   ├── RightLink.php
│   │   ├── Search.php
│   │   ├── SearchLog.php
│   │   ├── Session.php
│   │   ├── User.php
│   │   ├── UserInfo.php
│   │   └── UserSearch.php
│   ├── services/
│   │   ├── CommentService.php
│   │   ├── NotificationService.php
│   │   ├── PostService.php
│   │   ├── TopicService.php
│   │   ├── TweetService.php
│   │   └── UserService.php
│   └── widgets/
│       └── JsBlock.php
├── composer.json
├── console/
│   ├── config/
│   │   ├── .gitignore
│   │   ├── bootstrap.php
│   │   ├── main.php
│   │   └── params.php
│   ├── controllers/
│   │   ├── .gitkeep
│   │   ├── InstallController.php
│   │   └── SyncController.php
│   ├── migrations/
│   │   ├── m130524_201442_init.php
│   │   ├── m150104_071047_init_blog.php
│   │   ├── m150104_091352_init_user.php
│   │   ├── m150115_081356_create_user_info.php
│   │   ├── m150201_142415_update_user.php
│   │   ├── m150205_085033_update_post_comment.php
│   │   ├── m150209_015931_setting_init.php
│   │   ├── m150209_090406_create_user_account.php
│   │   ├── m150211_070335_update_user_info.php
│   │   ├── m150212_030127_update_user_info_and_post_meta.php
│   │   ├── m150212_132400_create_topics_table.php
│   │   ├── m150214_070754_update_post_meta.php
│   │   ├── m150412_034147_update_site_setting.php
│   │   ├── m150416_134819_create_notification_table.php
│   │   ├── m150420_060807_update_post_table.php
│   │   ├── m150424_025409_update_table_engine.php
│   │   ├── m150424_031429_update_notification_table.php
│   │   ├── m150424_100155_update_post_meta_table.php
│   │   ├── m150425_031844_create_right_link.php
│   │   ├── m150626_073539_create_nav.php
│   │   ├── m150626_073559_create_nav_url.php
│   │   ├── m150702_130239_create_session_init.php
│   │   ├── m150805_085832_create_search_log_table.php
│   │   ├── m150808_025734_update_table_character.php
│   │   ├── m150829_091943_update_post_table.php
│   │   ├── m160320_093621_create_merit_table.php
│   │   ├── m160321_132724_add_donate_table.php
│   │   ├── m160719_093527_modify_user.php
│   │   ├── m190624_022722_create_spam_table.php
│   │   ├── m190908_053628_init_admin.php
│   │   └── m190908_055507_init_data.php
│   ├── models/
│   │   └── .gitkeep
│   └── runtime/
│       └── .gitignore
├── doc/
│   └── README.md
├── docker-files/
│   ├── docker-compose-example.yml
│   ├── getyii.com.conf
│   └── run.sh
├── environments/
│   ├── dev/
│   │   ├── backend/
│   │   │   ├── config/
│   │   │   │   ├── main-local.php
│   │   │   │   └── params-local.php
│   │   │   └── web/
│   │   │       ├── index-test.php
│   │   │       └── index.php
│   │   ├── common/
│   │   │   └── config/
│   │   │       ├── db.php
│   │   │       ├── main-local.php
│   │   │       └── params-local.php
│   │   ├── console/
│   │   │   └── config/
│   │   │       ├── main-local.php
│   │   │       └── params-local.php
│   │   ├── frontend/
│   │   │   ├── config/
│   │   │   │   ├── main-local.php
│   │   │   │   └── params-local.php
│   │   │   └── web/
│   │   │       ├── index-test.php
│   │   │       └── index.php
│   │   └── yii
│   ├── index.php
│   └── prod/
│       ├── backend/
│       │   ├── config/
│       │   │   ├── main-local.php
│       │   │   └── params-local.php
│       │   └── web/
│       │       └── index.php
│       ├── common/
│       │   └── config/
│       │       ├── db.php
│       │       ├── main-local.php
│       │       └── params-local.php
│       ├── console/
│       │   └── config/
│       │       ├── main-local.php
│       │       └── params-local.php
│       ├── frontend/
│       │   ├── config/
│       │   │   ├── main-local.php
│       │   │   └── params-local.php
│       │   └── web/
│       │       └── index.php
│       └── yii
├── frontend/
│   ├── assets/
│   │   ├── AppAsset.php
│   │   ├── AtJsAsset.php
│   │   ├── BowerAsset.php
│   │   ├── EditorAsset.php
│   │   └── EmojifyAsset.php
│   ├── behaviors/
│   │   └── AfterLoginBehavior.php
│   ├── config/
│   │   ├── .gitignore
│   │   ├── bootstrap.php
│   │   ├── main.php
│   │   ├── params.php
│   │   └── search.ini
│   ├── controllers/
│   │   ├── NotificationController.php
│   │   ├── PostTagController.php
│   │   └── SiteController.php
│   ├── messages/
│   │   └── zh-CN/
│   │       └── app.php
│   ├── models/
│   │   ├── ContactForm.php
│   │   ├── Notification.php
│   │   ├── PasswordResetRequestForm.php
│   │   ├── ResetPasswordForm.php
│   │   └── SignupForm.php
│   ├── modules/
│   │   ├── nav/
│   │   │   ├── Module.php
│   │   │   ├── controllers/
│   │   │   │   └── DefaultController.php
│   │   │   └── views/
│   │   │       └── default/
│   │   │           └── index.php
│   │   ├── topic/
│   │   │   ├── Module.php
│   │   │   ├── controllers/
│   │   │   │   ├── CommentController.php
│   │   │   │   └── DefaultController.php
│   │   │   ├── models/
│   │   │   │   └── Topic.php
│   │   │   └── views/
│   │   │       ├── comment/
│   │   │       │   ├── _form.php
│   │   │       │   ├── _item.php
│   │   │       │   ├── create.php
│   │   │       │   ├── index.php
│   │   │       │   └── update.php
│   │   │       └── default/
│   │   │           ├── _form.php
│   │   │           ├── _item.php
│   │   │           ├── create.php
│   │   │           ├── index.php
│   │   │           ├── update.php
│   │   │           └── view.php
│   │   ├── tweet/
│   │   │   ├── Module.php
│   │   │   ├── controllers/
│   │   │   │   └── DefaultController.php
│   │   │   ├── models/
│   │   │   │   ├── Tweet.php
│   │   │   │   └── TweetSearch.php
│   │   │   └── views/
│   │   │       └── default/
│   │   │           ├── _form.php
│   │   │           ├── _item.php
│   │   │           └── index.php
│   │   └── user/
│   │       ├── Module.php
│   │       ├── controllers/
│   │       │   ├── ActionController.php
│   │       │   ├── DefaultController.php
│   │       │   ├── SecurityController.php
│   │       │   └── SettingController.php
│   │       ├── models/
│   │       │   ├── AccountForm.php
│   │       │   ├── AvatarForm.php
│   │       │   ├── Donate.php
│   │       │   ├── UserAccount.php
│   │       │   └── UserMeta.php
│   │       └── views/
│   │           ├── default/
│   │           │   ├── _view.php
│   │           │   └── show.php
│   │           └── setting/
│   │               ├── _alert.php
│   │               ├── _menu.php
│   │               ├── account.php
│   │               ├── avatar.php
│   │               ├── donate.php
│   │               ├── networks.php
│   │               └── profile.php
│   ├── runtime/
│   │   └── .gitignore
│   ├── views/
│   │   ├── layouts/
│   │   │   └── main.php
│   │   ├── notification/
│   │   │   ├── _item.php
│   │   │   └── index.php
│   │   ├── partials/
│   │   │   ├── markdwon_help.php
│   │   │   └── users.php
│   │   └── site/
│   │       ├── _item.php
│   │       ├── about.php
│   │       ├── contact.php
│   │       ├── contributors.php
│   │       ├── error.php
│   │       ├── getstart.php
│   │       ├── index.php
│   │       ├── login.php
│   │       ├── markdown.php
│   │       ├── requestPasswordResetToken.php
│   │       ├── resetPassword.php
│   │       ├── signup.php
│   │       ├── tags.php
│   │       ├── timeline.php
│   │       └── users.php
│   ├── web/
│   │   ├── .gitignore
│   │   ├── .htaccess
│   │   ├── assets/
│   │   │   └── .gitignore
│   │   ├── css/
│   │   │   ├── global.css
│   │   │   ├── site-ruyi.css
│   │   │   └── site.css
│   │   ├── js/
│   │   │   ├── At.js
│   │   │   ├── editor.js
│   │   │   ├── jquery.pin.js
│   │   │   ├── main.js
│   │   │   ├── nav.js
│   │   │   └── topic.js
│   │   ├── robots.txt
│   │   └── uploads/
│   │       └── .gitignore
│   └── widgets/
│       ├── Alert.php
│       ├── Connect.php
│       ├── Nav.php
│       ├── NewestPost.php
│       ├── Node.php
│       ├── Panel.php
│       ├── TopicSidebar.php
│       └── views/
│           ├── nav.php
│           ├── node.php
│           ├── panel.php
│           └── topicSidebar.php
├── init
├── init.bat
├── requirements.php
├── tests/
│   ├── README.md
│   ├── codeception/
│   │   ├── _output/
│   │   │   └── .gitignore
│   │   ├── backend/
│   │   │   ├── .gitignore
│   │   │   ├── _bootstrap.php
│   │   │   ├── _output/
│   │   │   │   └── .gitignore
│   │   │   ├── acceptance/
│   │   │   │   ├── LoginCept.php
│   │   │   │   └── _bootstrap.php
│   │   │   ├── acceptance.suite.yml
│   │   │   ├── codeception.yml
│   │   │   ├── functional/
│   │   │   │   ├── LoginCept.php
│   │   │   │   └── _bootstrap.php
│   │   │   ├── functional.suite.yml
│   │   │   ├── unit/
│   │   │   │   ├── DbTestCase.php
│   │   │   │   ├── TestCase.php
│   │   │   │   ├── _bootstrap.php
│   │   │   │   └── fixtures/
│   │   │   │       └── data/
│   │   │   │           └── .gitkeep
│   │   │   └── unit.suite.yml
│   │   ├── bin/
│   │   │   ├── _bootstrap.php
│   │   │   ├── yii
│   │   │   └── yii.bat
│   │   ├── common/
│   │   │   ├── .gitignore
│   │   │   ├── _bootstrap.php
│   │   │   ├── _output/
│   │   │   │   └── .gitignore
│   │   │   ├── _pages/
│   │   │   │   └── LoginPage.php
│   │   │   ├── _support/
│   │   │   │   └── FixtureHelper.php
│   │   │   ├── codeception.yml
│   │   │   ├── fixtures/
│   │   │   │   ├── UserFixture.php
│   │   │   │   └── data/
│   │   │   │       └── init_login.php
│   │   │   ├── templates/
│   │   │   │   └── fixtures/
│   │   │   │       └── user.php
│   │   │   ├── unit/
│   │   │   │   ├── DbTestCase.php
│   │   │   │   ├── TestCase.php
│   │   │   │   ├── _bootstrap.php
│   │   │   │   ├── fixtures/
│   │   │   │   │   └── data/
│   │   │   │   │       └── models/
│   │   │   │   │           └── user.php
│   │   │   │   └── models/
│   │   │   │       └── LoginFormTest.php
│   │   │   └── unit.suite.yml
│   │   ├── config/
│   │   │   ├── acceptance.php
│   │   │   ├── backend/
│   │   │   │   ├── acceptance.php
│   │   │   │   ├── config.php
│   │   │   │   ├── functional.php
│   │   │   │   └── unit.php
│   │   │   ├── common/
│   │   │   │   └── unit.php
│   │   │   ├── config.php
│   │   │   ├── console/
│   │   │   │   └── unit.php
│   │   │   ├── frontend/
│   │   │   │   ├── acceptance.php
│   │   │   │   ├── config.php
│   │   │   │   ├── functional.php
│   │   │   │   └── unit.php
│   │   │   ├── functional.php
│   │   │   └── unit.php
│   │   ├── console/
│   │   │   ├── .gitignore
│   │   │   ├── _bootstrap.php
│   │   │   ├── _output/
│   │   │   │   └── .gitignore
│   │   │   ├── codeception.yml
│   │   │   ├── unit/
│   │   │   │   ├── DbTestCase.php
│   │   │   │   ├── TestCase.php
│   │   │   │   ├── _bootstrap.php
│   │   │   │   └── fixtures/
│   │   │   │       └── data/
│   │   │   │           └── .gitkeep
│   │   │   └── unit.suite.yml
│   │   └── frontend/
│   │       ├── .gitignore
│   │       ├── _bootstrap.php
│   │       ├── _output/
│   │       │   └── .gitignore
│   │       ├── _pages/
│   │       │   ├── AboutPage.php
│   │       │   ├── ContactPage.php
│   │       │   └── SignupPage.php
│   │       ├── acceptance/
│   │       │   ├── AboutCept.php
│   │       │   ├── ContactCept.php
│   │       │   ├── HomeCept.php
│   │       │   ├── LoginCept.php
│   │       │   ├── SignupCest.php
│   │       │   └── _bootstrap.php
│   │       ├── acceptance.suite.yml
│   │       ├── codeception.yml
│   │       ├── functional/
│   │       │   ├── AboutCept.php
│   │       │   ├── ContactCept.php
│   │       │   ├── HomeCept.php
│   │       │   ├── LoginCept.php
│   │       │   ├── SignupCest.php
│   │       │   └── _bootstrap.php
│   │       ├── functional.suite.yml
│   │       ├── unit/
│   │       │   ├── DbTestCase.php
│   │       │   ├── TestCase.php
│   │       │   ├── _bootstrap.php
│   │       │   ├── fixtures/
│   │       │   │   └── data/
│   │       │   │       └── models/
│   │       │   │           └── user.php
│   │       │   └── models/
│   │       │       ├── ContactFormTest.php
│   │       │       ├── PasswordResetRequestFormTest.php
│   │       │       ├── ResetPasswordFormTest.php
│   │       │       └── SignupFormTest.php
│   │       └── unit.suite.yml
│   └── codeception.yml
└── yii.bat
Download .txt
SYMBOL INDEX (702 symbols across 155 files)

FILE: backend/assets/AppAsset.php
  class AppAsset (line 16) | class AppAsset extends AssetBundle

FILE: backend/controllers/CenterController.php
  class CenterController (line 10) | class CenterController extends Controller
    method behaviors (line 18) | public function behaviors()
    method actions (line 47) | public function actions()
    method actionIndex (line 58) | public function actionIndex()
    method actionTest (line 63) | public function actionTest()

FILE: backend/controllers/Controller.php
  class Controller (line 14) | class Controller extends \yii\web\Controller
    method behaviors (line 16) | public function behaviors()
    method beforeAction (line 38) | public function beforeAction($action)

FILE: backend/controllers/NavController.php
  class NavController (line 13) | class NavController extends Controller
    method actionIndex (line 19) | public function actionIndex()
    method actionView (line 35) | public function actionView($id)
    method actionCreate (line 47) | public function actionCreate()
    method actionUpdate (line 66) | public function actionUpdate($id)
    method actionDelete (line 85) | public function actionDelete($id)
    method findModel (line 99) | protected function findModel($id)

FILE: backend/controllers/NavUrlController.php
  class NavUrlController (line 13) | class NavUrlController extends Controller
    method actionIndex (line 20) | public function actionIndex()
    method actionView (line 36) | public function actionView($id)
    method actionCreate (line 48) | public function actionCreate()
    method actionUpdate (line 67) | public function actionUpdate($id)
    method actionDelete (line 86) | public function actionDelete($id)
    method findModel (line 100) | protected function findModel($id)

FILE: backend/controllers/PostController.php
  class PostController (line 13) | class PostController extends Controller
    method actionIndex (line 19) | public function actionIndex()
    method actionView (line 35) | public function actionView($id)
    method actionCreate (line 47) | public function actionCreate()
    method actionUpdate (line 67) | public function actionUpdate($id)
    method actionDelete (line 86) | public function actionDelete($id)
    method findModel (line 100) | protected function findModel($id)

FILE: backend/controllers/PostMetaController.php
  class PostMetaController (line 13) | class PostMetaController extends Controller
    method actionIndex (line 19) | public function actionIndex()
    method actionCreate (line 35) | public function actionCreate()
    method actionUpdate (line 54) | public function actionUpdate($id)
    method actionDelete (line 73) | public function actionDelete($id)
    method findModel (line 87) | protected function findModel($id)

FILE: backend/controllers/RightLinkController.php
  class RightLinkController (line 13) | class RightLinkController extends Controller
    method actionIndex (line 19) | public function actionIndex()
    method actionView (line 35) | public function actionView($id)
    method actionCreate (line 47) | public function actionCreate()
    method actionUpdate (line 68) | public function actionUpdate($id)
    method actionDelete (line 87) | public function actionDelete($id)
    method findModel (line 101) | protected function findModel($id)

FILE: backend/controllers/SearchLogController.php
  class SearchLogController (line 13) | class SearchLogController extends Controller
    method actionIndex (line 19) | public function actionIndex()
    method actionDelete (line 36) | public function actionDelete($id)
    method findModel (line 50) | protected function findModel($id)

FILE: backend/controllers/SiteController.php
  class SiteController (line 12) | class SiteController extends Controller
    method behaviors (line 17) | public function behaviors()
    method beforeAction (line 48) | public function beforeAction($action)
    method actions (line 63) | public function actions()
    method actionIndex (line 72) | public function actionIndex()
    method actionLogin (line 77) | public function actionLogin()
    method actionLogout (line 92) | public function actionLogout()

FILE: backend/controllers/UserController.php
  class UserController (line 13) | class UserController extends Controller
    method actionIndex (line 19) | public function actionIndex()
    method actionView (line 35) | public function actionView($id)
    method actionCreate (line 47) | public function actionCreate()
    method actionUpdate (line 66) | public function actionUpdate($id)
    method actionDelete (line 85) | public function actionDelete($id)
    method findModel (line 99) | protected function findModel($id)

FILE: backend/models/PostSearch.php
  class PostSearch (line 13) | class PostSearch extends Post
    method rules (line 21) | public function rules()
    method scenarios (line 32) | public function scenarios()
    method search (line 42) | public function search($params)

FILE: backend/models/RightLinkSearch.php
  class RightLinkSearch (line 13) | class RightLinkSearch extends RightLink
    method rules (line 18) | public function rules()
    method scenarios (line 29) | public function scenarios()
    method search (line 42) | public function search($params)

FILE: backend/models/SearchLogSearch.php
  class SearchLogSearch (line 13) | class SearchLogSearch extends SearchLog
    method rules (line 19) | public function rules()
    method scenarios (line 30) | public function scenarios()
    method search (line 43) | public function search($params)

FILE: backend/models/User.php
  class User (line 21) | class User extends \yii\db\ActiveRecord
    method tableName (line 26) | public static function tableName()
    method rules (line 34) | public function rules()
    method attributeLabels (line 47) | public function attributeLabels()

FILE: common/assets/AtJs.php
  class AtJs (line 9) | class AtJs extends AssetBundle

FILE: common/assets/CaretJs.php
  class CaretJs (line 9) | class CaretJs extends AssetBundle

FILE: common/assets/DropzoneJs.php
  class DropzoneJs (line 9) | class DropzoneJs extends AssetBundle

FILE: common/components/AssetBundle.php
  class AssetBundle (line 4) | class AssetBundle extends \yii\web\AssetBundle

FILE: common/components/ComposerInstaller.php
  class ComposerInstaller (line 12) | class ComposerInstaller extends Installer
    method initProject (line 14) | public static function initProject($event)

FILE: common/components/Config.php
  class Config (line 9) | class Config extends Object
    method init (line 47) | public function init()
    method getData (line 77) | public function getData()
    method setData (line 86) | public function setData($data)
    method set (line 96) | public function set($name, $value)
    method get (line 108) | public function get($name, $defaultValue = null)
    method setCacheKey (line 113) | public function setCacheKey($cacheKey)
    method getCacheKey (line 118) | public function getCacheKey()
    method saveData (line 134) | public function saveData()

FILE: common/components/Controller.php
  class Controller (line 11) | class Controller extends \yii\web\Controller
    method behaviors (line 13) | public function behaviors()
    method beforeAction (line 24) | public function beforeAction($action)
    method afterAction (line 33) | public function afterAction($action, $result)
    method flash (line 48) | public function flash($message, $type = 'info', $url = null)
    method message (line 63) | public function message($message, $type = 'info', $redirect = null, $r...

FILE: common/components/DbAuthManager.php
  class DbAuthManager (line 8) | class DbAuthManager extends DbManager
    method getChildrenListOfType (line 10) | protected function getChildrenListOfType($type)
    method getPermissionsByRole (line 28) | public function getPermissionsByRole($roleName, $recursive = true)

FILE: common/components/FileTarget.php
  class FileTarget (line 13) | class FileTarget extends \yii\log\FileTarget
    method init (line 27) | public function init()

FILE: common/components/GlobalFunctions.php
  function env (line 7) | function env($envName, $default = false)
  function app (line 25) | function app($component = null, $throwException = true)
  function t (line 42) | function t($category, $message, $params = [], $language = null)
  function user (line 55) | function user($attribute = null)
  function request (line 74) | function request($key = null, $default = null)
  function response (line 90) | function response($content = '', $format = Response::FORMAT_HTML, $statu...
  function params (line 114) | function params($key)
  function pr (line 124) | function pr($message, $debug = true)

FILE: common/components/Mailer.php
  class Mailer (line 7) | class Mailer extends Component
    method init (line 22) | public function init()
    method sendWelcomeMessage (line 47) | public function sendWelcomeMessage(User $user, Token $token = null)
    method sendMessage (line 63) | protected function sendMessage($to, $subject, $view, $params = [])
    method sendConfirmationMessage (line 83) | public function sendConfirmationMessage(User $user, Token $token)
    method sendReconfirmationMessage (line 99) | public function sendReconfirmationMessage(User $user, Token $token)
    method sendRecoveryMessage (line 120) | public function sendRecoveryMessage(User $user, Token $token)

FILE: common/components/db/ActiveRecord.php
  class ActiveRecord (line 4) | class ActiveRecord extends \yii\db\ActiveRecord
    method behaviors (line 10) | public function behaviors()

FILE: common/components/db/Command.php
  class Command (line 4) | class Command extends \yii\db\Command
    method batchReplace (line 11) | public function batchReplace($table, $columns, $rows)

FILE: common/components/db/Connection.php
  class Connection (line 4) | class Connection extends \yii\db\Connection
    method createCommand (line 9) | public function createCommand($sql = null, $params = [])

FILE: common/components/db/Migration.php
  class Migration (line 4) | class Migration extends \yii\db\Migration
    method init (line 19) | public function init()

FILE: common/grid/EnumColumn.php
  class EnumColumn (line 16) | class EnumColumn extends DataColumn
    method init (line 30) | public function init()
    method getDataCellValue (line 43) | public function getDataCellValue($model, $key, $index)

FILE: common/helpers/Arr.php
  class Arr (line 13) | class Arr extends ArrayHelper
    method arrayRandomAssoc (line 21) | public static function arrayRandomAssoc(Array $arr, $num = 1)

FILE: common/helpers/Avatar.php
  class Avatar (line 10) | class Avatar
    method __construct (line 15) | public function __construct($email, $size = 50)
    method getAvater (line 21) | public function getAvater()
    method getGravatar (line 34) | private function getGravatar()
    method validateGravatar (line 44) | private function validateGravatar()

FILE: common/helpers/Formatter.php
  class Formatter (line 10) | class Formatter
    method convert (line 16) | public static function convert($dateStr, $type = 'date', $format = null)
    method relative (line 33) | public static function relative($dateStr)

FILE: common/helpers/UploadHelper.php
  class UploadHelper (line 12) | class UploadHelper
    method getCurlValue (line 14) | public static function getCurlValue($filename, $contentType, $postname)

FILE: common/models/LoginForm.php
  class LoginForm (line 10) | class LoginForm extends Model
    method rules (line 20) | public function rules()
    method validatePassword (line 39) | public function validatePassword($attribute, $params)
    method login (line 54) | public function login()
    method attributeLabels (line 66) | public function attributeLabels()
    method getUser (line 81) | public function getUser()
    method updateUserInfo (line 97) | public function updateUserInfo()
    method loginAdmin (line 120) | public function loginAdmin()

FILE: common/models/Nav.php
  class Nav (line 18) | class Nav extends \yii\db\ActiveRecord
    method tableName (line 23) | public static function tableName()
    method rules (line 31) | public function rules()
    method attributeLabels (line 43) | public function attributeLabels()
    method getNavList (line 55) | public static function getNavList()

FILE: common/models/NavUrl.php
  class NavUrl (line 20) | class NavUrl extends \yii\db\ActiveRecord
    method tableName (line 25) | public static function tableName()
    method rules (line 33) | public function rules()
    method attributeLabels (line 46) | public function attributeLabels()

FILE: common/models/Post.php
  class Post (line 38) | class Post extends ActiveRecord
    method tableName (line 74) | public static function tableName()
    method rules (line 82) | public function rules()
    method validateLimitPostTime (line 121) | public function validateLimitPostTime($attribute)
    method limitPostTime (line 132) | public function limitPostTime()
    method limitPostingIntervalTime (line 146) | public function limitPostingIntervalTime()
    method attributeLabels (line 159) | public function attributeLabels()
    method getUser (line 190) | public function getUser()
    method getUserInfo (line 196) | public function getUserInfo()
    method getCategory (line 202) | public function getCategory()
    method isCurrent (line 207) | public function isCurrent()
    method beforeSave (line 212) | public function beforeSave($insert)
    method getStatuses (line 225) | public static function getStatuses($status = false)

FILE: common/models/PostComment.php
  class PostComment (line 32) | class PostComment extends ActiveRecord
    method tableName (line 48) | public static function tableName()
    method rules (line 56) | public function rules()
    method getUser (line 67) | public function getUser()
    method getPost (line 72) | public function getPost()
    method getTopic (line 77) | public function getTopic()
    method getLike (line 82) | public function getLike()
    method findModel (line 95) | public static function findModel($id, $condition = '')
    method findComment (line 117) | public static function findComment($id)
    method findDeletedComment (line 128) | public static function findDeletedComment($id)
    method findCommentList (line 138) | public static function findCommentList($postId)
    method isCurrent (line 147) | public function isCurrent()
    method attributeLabels (line 155) | public function attributeLabels()
    method beforeSave (line 173) | public function beforeSave($insert)
    method afterSave (line 183) | public function afterSave($insert, $changedAttributes)

FILE: common/models/PostMeta.php
  class PostMeta (line 27) | class PostMeta extends ActiveRecord
    method tableName (line 35) | public static function tableName()
    method behaviors (line 43) | public function behaviors()
    method rules (line 53) | public function rules()
    method attributeLabels (line 67) | public function attributeLabels()
    method blogCategory (line 83) | public static function blogCategory()
    method topicCategory (line 89) | public static function topicCategory()
    method noManLandId (line 106) | public static function noManLandId()
    method getChildren (line 116) | public function getChildren()
    method getTypes (line 121) | public function getTypes()
    method getNodesMap (line 133) | public static function getNodesMap($conditions = [])
    method getParents (line 141) | public function getParents()
    method getNodes (line 150) | public static function getNodes()

FILE: common/models/PostMetaSearch.php
  class PostMetaSearch (line 13) | class PostMetaSearch extends PostMeta
    method rules (line 18) | public function rules()
    method scenarios (line 29) | public function scenarios()
    method search (line 42) | public function search($params)

FILE: common/models/PostSearch.php
  class PostSearch (line 13) | class PostSearch extends Post
    method rules (line 18) | public function rules()
    method scenarios (line 29) | public function scenarios()
    method search (line 39) | public function search($params)

FILE: common/models/PostTag.php
  class PostTag (line 17) | class PostTag extends ActiveRecord
    method tableName (line 22) | public static function tableName()
    method rules (line 30) | public function rules()
    method attributeLabels (line 41) | public function attributeLabels()

FILE: common/models/PostTagSearch.php
  class PostTagSearch (line 12) | class PostTagSearch extends PostTag
    method rules (line 17) | public function rules()
    method scenarios (line 28) | public function scenarios()
    method search (line 41) | public function search($params)

FILE: common/models/RightLink.php
  class RightLink (line 21) | class RightLink extends ActiveRecord
    method tableName (line 43) | public static function tableName()
    method rules (line 51) | public function rules()
    method attributeLabels (line 65) | public function attributeLabels()
    method getTypes (line 84) | public function getTypes()

FILE: common/models/Search.php
  class Search (line 15) | class Search extends \hightman\xunsearch\ActiveRecord
    method search (line 17) | public static function search($keyword)

FILE: common/models/SearchLog.php
  class SearchLog (line 15) | class SearchLog extends \yii\db\ActiveRecord
    method tableName (line 20) | public static function tableName()
    method rules (line 28) | public function rules()
    method attributeLabels (line 39) | public function attributeLabels()
    method getUser (line 50) | public function getUser()

FILE: common/models/Session.php
  class Session (line 14) | class Session extends \yii\db\ActiveRecord
    method tableName (line 19) | public static function tableName()
    method rules (line 27) | public function rules()
    method attributeLabels (line 40) | public function attributeLabels()

FILE: common/models/User.php
  class User (line 34) | class User extends ActiveRecord implements IdentityInterface
    method tableName (line 47) | public static function tableName()
    method behaviors (line 55) | public function behaviors()
    method rules (line 69) | public function rules()
    method findIdentity (line 83) | public static function findIdentity($id)
    method findIdentityByAccessToken (line 91) | public static function findIdentityByAccessToken($token, $type = null)
    method findByUsername (line 102) | public static function findByUsername($username)
    method findByEmail (line 113) | public static function findByEmail($email)
    method findByPasswordResetToken (line 124) | public static function findByPasswordResetToken($token)
    method isPasswordResetTokenValid (line 142) | public static function isPasswordResetTokenValid($token)
    method getId (line 156) | public function getId()
    method getAuthKey (line 164) | public function getAuthKey()
    method validateAuthKey (line 172) | public function validateAuthKey($authKey)
    method validatePassword (line 183) | public function validatePassword($password)
    method setPassword (line 193) | public function setPassword($password)
    method generateAuthKey (line 201) | public function generateAuthKey()
    method generatePasswordResetToken (line 209) | public function generatePasswordResetToken()
    method removePasswordResetToken (line 217) | public function removePasswordResetToken()
    method getUserAvatar (line 228) | public function getUserAvatar($size = 50)
    method getUserInfo (line 249) | public function getUserInfo()
    method getMerit (line 254) | public function getMerit()
    method getAccounts (line 262) | public function getAccounts()
    method afterSave (line 276) | public function afterSave($insert, $changedAttributes)
    method isAdmin (line 297) | public static function isAdmin($username)
    method isSuperAdmin (line 306) | public static function isSuperAdmin($username)
    method currUserIsSuperAdmin (line 318) | public static function currUserIsSuperAdmin()
    method getThrones (line 328) | public static function getThrones($username = '')
    method getRole (line 341) | public static function getRole($role)
    method getRoleList (line 360) | public static function getRoleList()
    method getStatus (line 369) | public static function getStatus($status)
    method getStatusList (line 385) | public static function getStatusList()

FILE: common/models/UserInfo.php
  class UserInfo (line 32) | class UserInfo extends ActiveRecord
    method tableName (line 37) | public static function tableName()
    method rules (line 45) | public function rules()
    method attributeLabels (line 61) | public function attributeLabels()

FILE: common/models/UserSearch.php
  class UserSearch (line 13) | class UserSearch extends User
    method rules (line 18) | public function rules()
    method scenarios (line 29) | public function scenarios()
    method search (line 42) | public function search($params)

FILE: common/services/CommentService.php
  class CommentService (line 12) | class CommentService
    method userDoAction (line 15) | public function userDoAction($id, $action)
    method filterSame (line 27) | public function filterSame($content)

FILE: common/services/NotificationService.php
  class NotificationService (line 19) | class NotificationService
    method newReplyNotify (line 30) | public function newReplyNotify(User $fromUser, Topic $topic, PostComme...
    method newPostNotify (line 51) | public function newPostNotify(User $fromUser, Post $post, $users)
    method newActionNotify (line 65) | public function newActionNotify($type, $fromUserId, $toUserId, Post $p...
    method batchNotify (line 96) | public function batchNotify($type, User $fromUser, $users, Post $post,...
    method findUserActionNotify (line 126) | public function findUserActionNotify(UserMeta $meta)
    method getNotifyData (line 144) | public static function getNotifyData($type, $data)

FILE: common/services/PostService.php
  class PostService (line 22) | class PostService
    method delete (line 29) | public static function delete(Post $post)
    method filterContent (line 41) | public function filterContent($content)
    method contentTopic (line 56) | public static function contentTopic($content, $model)
    method contentComment (line 62) | public static function contentComment($content, $model)
    method contentTweet (line 69) | public static function contentTweet($content, $model)
    method contentReplaceFloor (line 81) | public static function contentReplaceFloor($content)
    method contentReplaceAtUser (line 91) | public static function contentReplaceAtUser($content, $model)
    method parseUsername (line 101) | public static function parseUsername($content)
    method contentReplaceTag (line 111) | public static function contentReplaceTag($content)
    method search (line 125) | public static function search($params)

FILE: common/services/TopicService.php
  class TopicService (line 13) | class TopicService extends PostService
    method userDoAction (line 16) | public function userDoAction($id, $action)
    method revoke (line 32) | public static function revoke(Topic $topic)
    method excellent (line 42) | public static function excellent(Topic $topic)

FILE: common/services/TweetService.php
  class TweetService (line 14) | class TweetService extends PostService
    method userDoAction (line 17) | public function userDoAction($id, $action)
    method revoke (line 28) | public static function revoke(Topic $topic)
    method excellent (line 38) | public static function excellent(Topic $topic)

FILE: common/services/UserService.php
  class UserService (line 19) | class UserService
    method findNotifyCount (line 25) | public static function findNotifyCount()
    method clearNotifyCount (line 35) | public static function clearNotifyCount()
    method TopicActionA (line 47) | public static function TopicActionA(User $user, Topic $topic, $action)
    method TopicActionB (line 59) | public static function TopicActionB(User $user, Post $model, $action)
    method CommentAction (line 94) | public static function CommentAction(User $user, PostComment $comment,...
    method toggleType (line 126) | protected static function toggleType(User $user, Post $model, $action)
    method findActiveUser (line 163) | public static function findActiveUser($limit = 12)

FILE: common/widgets/JsBlock.php
  class JsBlock (line 9) | class JsBlock extends Block
    method run (line 25) | public function run()

FILE: console/controllers/InstallController.php
  class InstallController (line 9) | class InstallController extends Controller
    method actionCheck (line 14) | public function actionCheck($path = '@root/requirements.php')
    method actionIndex (line 29) | public function actionIndex()
    method runSteps (line 47) | public function runSteps(array $steps)
    method actionDb (line 69) | public function actionDb()
    method generateDbFile (line 88) | public function generateDbFile($dbFile)
    method actionMigrate (line 148) | public function actionMigrate()

FILE: console/controllers/SyncController.php
  class SyncController (line 17) | class SyncController extends Controller
    method actionUserInfo (line 19) | public function actionUserInfo()
    method actionPost (line 56) | public function actionPost()

FILE: console/migrations/m130524_201442_init.php
  class m130524_201442_init (line 6) | class m130524_201442_init extends Migration
    method up (line 8) | public function up()
    method down (line 24) | public function down()

FILE: console/migrations/m150104_071047_init_blog.php
  class m150104_071047_init_blog (line 6) | class m150104_071047_init_blog extends Migration
    method up (line 8) | public function up()
    method down (line 77) | public function down()

FILE: console/migrations/m150104_091352_init_user.php
  class m150104_091352_init_user (line 6) | class m150104_091352_init_user extends Migration
    method up (line 8) | public function up()
    method down (line 43) | public function down()

FILE: console/migrations/m150115_081356_create_user_info.php
  class m150115_081356_create_user_info (line 6) | class m150115_081356_create_user_info extends Migration
    method up (line 8) | public function up()
    method down (line 24) | public function down()

FILE: console/migrations/m150201_142415_update_user.php
  class m150201_142415_update_user (line 6) | class m150201_142415_update_user extends Migration
    method up (line 8) | public function up()
    method down (line 17) | public function down()

FILE: console/migrations/m150205_085033_update_post_comment.php
  class m150205_085033_update_post_comment (line 6) | class m150205_085033_update_post_comment extends Migration
    method up (line 8) | public function up()
    method down (line 14) | public function down()

FILE: console/migrations/m150209_015931_setting_init.php
  class m150209_015931_setting_init (line 6) | class m150209_015931_setting_init extends Migration
    method up (line 8) | public function up()
    method getSettingSql (line 35) | private function getSettingSql()
    method delSetting (line 62) | private function delSetting()
    method down (line 67) | public function down()

FILE: console/migrations/m150209_090406_create_user_account.php
  class m150209_090406_create_user_account (line 6) | class m150209_090406_create_user_account extends Migration
    method up (line 8) | public function up()
    method delTable (line 25) | private function delTable()
    method down (line 30) | public function down()

FILE: console/migrations/m150211_070335_update_user_info.php
  class m150211_070335_update_user_info (line 6) | class m150211_070335_update_user_info extends Migration
    method up (line 8) | public function up()
    method down (line 17) | public function down()

FILE: console/migrations/m150212_030127_update_user_info_and_post_meta.php
  class m150212_030127_update_user_info_and_post_meta (line 6) | class m150212_030127_update_user_info_and_post_meta extends Migration
    method up (line 8) | public function up()
    method down (line 13) | public function down()

FILE: console/migrations/m150212_132400_create_topics_table.php
  class m150212_132400_create_topics_table (line 6) | class m150212_132400_create_topics_table extends Migration
    method up (line 8) | public function up()
    method down (line 17) | public function down()

FILE: console/migrations/m150214_070754_update_post_meta.php
  class m150214_070754_update_post_meta (line 6) | class m150214_070754_update_post_meta extends Migration
    method up (line 8) | public function up()
    method down (line 14) | public function down()

FILE: console/migrations/m150412_034147_update_site_setting.php
  class m150412_034147_update_site_setting (line 6) | class m150412_034147_update_site_setting extends Migration
    method up (line 8) | public function up()
    method getSettingSql (line 18) | private function getSettingSql()
    method updateSettingSql (line 34) | private function updateSettingSql()
    method delSettingSql (line 39) | private function delSettingSql()

FILE: console/migrations/m150416_134819_create_notification_table.php
  class m150416_134819_create_notification_table (line 6) | class m150416_134819_create_notification_table extends Migration
    method up (line 8) | public function up()
    method down (line 28) | public function down()

FILE: console/migrations/m150420_060807_update_post_table.php
  class m150420_060807_update_post_table (line 6) | class m150420_060807_update_post_table extends Migration
    method up (line 8) | public function up()
    method down (line 13) | public function down()

FILE: console/migrations/m150424_025409_update_table_engine.php
  class m150424_025409_update_table_engine (line 6) | class m150424_025409_update_table_engine extends Migration
    method safeUp (line 8) | public function safeUp()
    method safeDown (line 13) | public function safeDown()
    method changeEngine (line 19) | protected function changeEngine($from, $to)

FILE: console/migrations/m150424_031429_update_notification_table.php
  class m150424_031429_update_notification_table (line 6) | class m150424_031429_update_notification_table extends Migration
    method safeUp (line 8) | public function safeUp()
    method safeDown (line 13) | public function safeDown()

FILE: console/migrations/m150424_100155_update_post_meta_table.php
  class m150424_100155_update_post_meta_table (line 6) | class m150424_100155_update_post_meta_table extends Migration
    method safeUp (line 9) | public function safeUp()
    method safeDown (line 14) | public function safeDown()

FILE: console/migrations/m150425_031844_create_right_link.php
  class m150425_031844_create_right_link (line 5) | class m150425_031844_create_right_link extends \common\components\db\Mig...
    method up (line 7) | public function up()
    method down (line 25) | public function down()

FILE: console/migrations/m150626_073539_create_nav.php
  class m150626_073539_create_nav (line 6) | class m150626_073539_create_nav extends Migration
    method up (line 8) | public function up()
    method down (line 22) | public function down()

FILE: console/migrations/m150626_073559_create_nav_url.php
  class m150626_073559_create_nav_url (line 6) | class m150626_073559_create_nav_url extends Migration
    method up (line 8) | public function up()
    method down (line 25) | public function down()

FILE: console/migrations/m150702_130239_create_session_init.php
  class m150702_130239_create_session_init (line 6) | class m150702_130239_create_session_init extends Migration
    method up (line 10) | public function up()
    method down (line 22) | public function down()

FILE: console/migrations/m150805_085832_create_search_log_table.php
  class m150805_085832_create_search_log_table (line 6) | class m150805_085832_create_search_log_table extends Migration
    method up (line 10) | public function up()
    method down (line 22) | public function down()

FILE: console/migrations/m150808_025734_update_table_character.php
  class m150808_025734_update_table_character (line 6) | class m150808_025734_update_table_character extends Migration
    method safeUp (line 8) | public function safeUp()
    method safeDown (line 13) | public function safeDown()
    method changeCharacter (line 19) | protected function changeCharacter($toA, $toB)

FILE: console/migrations/m150829_091943_update_post_table.php
  class m150829_091943_update_post_table (line 6) | class m150829_091943_update_post_table extends Migration
    method up (line 8) | public function up()
    method down (line 14) | public function down()

FILE: console/migrations/m160320_093621_create_merit_table.php
  class m160320_093621_create_merit_table (line 6) | class m160320_093621_create_merit_table extends Migration
    method init (line 20) | public function init()
    method up (line 30) | public function up()
    method down (line 79) | public function down()
    method delMeritTable (line 91) | private function delMeritTable()

FILE: console/migrations/m160321_132724_add_donate_table.php
  class m160321_132724_add_donate_table (line 5) | class m160321_132724_add_donate_table extends Migration
    method up (line 9) | public function up()
    method down (line 23) | public function down()

FILE: console/migrations/m160719_093527_modify_user.php
  class m160719_093527_modify_user (line 5) | class m160719_093527_modify_user extends Migration
    method up (line 9) | public function up()
    method down (line 14) | public function down()

FILE: console/migrations/m190624_022722_create_spam_table.php
  class m190624_022722_create_spam_table (line 9) | class m190624_022722_create_spam_table extends Migration
    method init (line 23) | public function init()
    method safeUp (line 36) | public function safeUp()
    method safeDown (line 53) | public function safeDown()
    method initData (line 59) | public static function initData()

FILE: console/migrations/m190908_053628_init_admin.php
  class m190908_053628_init_admin (line 6) | class m190908_053628_init_admin extends Migration
    method up (line 8) | public function up()
    method down (line 13) | public function down()
    method createFounder (line 23) | public function createFounder()
    method saveFounderData (line 39) | private function saveFounderData($_model)

FILE: console/migrations/m190908_055507_init_data.php
  class m190908_055507_init_data (line 12) | class m190908_055507_init_data extends Migration
    method up (line 14) | public function up()
    method down (line 21) | public function down()
    method generateFakeData (line 29) | public function generateFakeData($num)

FILE: frontend/assets/AppAsset.php
  class AppAsset (line 16) | class AppAsset extends AssetBundle

FILE: frontend/assets/AtJsAsset.php
  class AtJsAsset (line 13) | class AtJsAsset extends AssetBundle

FILE: frontend/assets/BowerAsset.php
  class BowerAsset (line 9) | class BowerAsset extends AssetBundle

FILE: frontend/assets/EditorAsset.php
  class EditorAsset (line 7) | class EditorAsset extends AssetBundle

FILE: frontend/assets/EmojifyAsset.php
  class EmojifyAsset (line 9) | class EmojifyAsset extends AssetBundle

FILE: frontend/behaviors/AfterLoginBehavior.php
  class AfterLoginBehavior (line 12) | class AfterLoginBehavior extends Behavior
    method events (line 22) | public function events()
    method afterLogin (line 33) | public function afterLogin($event)

FILE: frontend/controllers/NotificationController.php
  class NotificationController (line 19) | class NotificationController extends Controller
    method behaviors (line 21) | public function behaviors()
    method actionIndex (line 45) | public function actionIndex()
    method actionCount (line 66) | public function actionCount()
    method actionDelete (line 78) | public function actionDelete($id)
    method actionClear (line 91) | public function actionClear()
    method findModel (line 105) | protected function findModel($id)

FILE: frontend/controllers/PostTagController.php
  class PostTagController (line 12) | class PostTagController extends Controller
    method actionIndex (line 18) | public function actionIndex()

FILE: frontend/controllers/SiteController.php
  class SiteController (line 36) | class SiteController extends Controller
    method behaviors (line 41) | public function behaviors()
    method actions (line 62) | public function actions()
    method beforeAction (line 82) | public function beforeAction($action)
    method actionIndex (line 90) | public function actionIndex()
    method actionLogin (line 111) | public function actionLogin()
    method actionLogout (line 127) | public function actionLogout()
    method actionContact (line 134) | public function actionContact()
    method actionAbout (line 153) | public function actionAbout()
    method actionTags (line 158) | public function actionTags()
    method actionContributors (line 167) | public function actionContributors()
    method actionGetstart (line 172) | public function actionGetstart()
    method actionUsers (line 177) | public function actionUsers()
    method actionAtUsers (line 187) | public function actionAtUsers()
    method actionBook (line 193) | public function actionBook()
    method actionMarkdown (line 198) | public function actionMarkdown()
    method actionTimeline (line 203) | public function actionTimeline()
    method actionConnect (line 214) | public function actionConnect($account_id)
    method actionSignup (line 245) | public function actionSignup()
    method actionRequestPasswordReset (line 265) | public function actionRequestPasswordReset()
    method actionResetPassword (line 284) | public function actionResetPassword($token)
    method actionUpload (line 308) | public function actionUpload($field)
    method performAjaxValidation (line 347) | protected function performAjaxValidation($model)

FILE: frontend/models/ContactForm.php
  class ContactForm (line 11) | class ContactForm extends Model
    method rules (line 22) | public function rules()
    method attributeLabels (line 37) | public function attributeLabels()
    method sendEmail (line 50) | public function sendEmail($email)

FILE: frontend/models/Notification.php
  class Notification (line 23) | class Notification extends ActiveRecord
    method tableName (line 28) | public static function tableName()
    method rules (line 36) | public function rules()
    method getUser (line 46) | public function getUser()
    method getFromUser (line 51) | public function getFromUser()
    method getPost (line 56) | public function getPost()
    method getLable (line 61) | public function getLable($type)
    method attributeLabels (line 120) | public function attributeLabels()

FILE: frontend/models/PasswordResetRequestForm.php
  class PasswordResetRequestForm (line 12) | class PasswordResetRequestForm extends Model
    method init (line 16) | public function init()
    method rules (line 37) | public function rules()
    method sendEmail (line 56) | public function sendEmail()

FILE: frontend/models/ResetPasswordForm.php
  class ResetPasswordForm (line 12) | class ResetPasswordForm extends Model
    method __construct (line 28) | public function __construct($token, $config = [])
    method rules (line 43) | public function rules()
    method resetPassword (line 56) | public function resetPassword()

FILE: frontend/models/SignupForm.php
  class SignupForm (line 11) | class SignupForm extends Model
    method rules (line 21) | public function rules()
    method attributeLabels (line 46) | public function attributeLabels()
    method signup (line 61) | public function signup()

FILE: frontend/modules/nav/Module.php
  class Module (line 5) | class Module extends \yii\base\Module
    method init (line 9) | public function init()

FILE: frontend/modules/nav/controllers/DefaultController.php
  class DefaultController (line 8) | class DefaultController extends Controller
    method actionIndex (line 10) | public function actionIndex()

FILE: frontend/modules/topic/Module.php
  class Module (line 5) | class Module extends \yii\base\Module
    method init (line 9) | public function init()

FILE: frontend/modules/topic/controllers/CommentController.php
  class CommentController (line 23) | class CommentController extends Controller
    method behaviors (line 25) | public function behaviors()
    method actionCreate (line 51) | public function actionCreate($id)
    method actionUpdate (line 79) | public function actionUpdate($id)
    method actionDelete (line 100) | public function actionDelete($id)

FILE: frontend/modules/topic/controllers/DefaultController.php
  class DefaultController (line 23) | class DefaultController extends Controller
    method behaviors (line 36) | public function behaviors()
    method actionIndex (line 64) | public function actionIndex()
    method actionSearch (line 78) | public function actionSearch()
    method actionView (line 109) | public function actionView($id)
    method actionCreate (line 154) | public function actionCreate()
    method actionUpdate (line 190) | public function actionUpdate($id)
    method actionDelete (line 216) | public function actionDelete($id)
    method actionRevoke (line 241) | public function actionRevoke($id)
    method actionExcellent (line 258) | public function actionExcellent($id)

FILE: frontend/modules/topic/models/Topic.php
  class Topic (line 22) | class Topic extends Post
    method getLike (line 31) | public function getLike()
    method getFollow (line 37) | public function getFollow()
    method getHate (line 43) | public function getHate()
    method getFavorite (line 49) | public function getFavorite()
    method getThanks (line 55) | public function getThanks()
    method getFollower (line 64) | public function getFollower()
    method findModel (line 77) | public static function findModel($id, $condition = '')
    method findTopic (line 100) | public static function findTopic($id)
    method findDeletedTopic (line 111) | public static function findDeletedTopic($id)
    method beforeSave (line 118) | public function beforeSave($insert)
    method afterSave (line 146) | public function afterSave($insert, $changedAttributes)
    method lastCommentToUpdate (line 182) | public function lastCommentToUpdate($username = '')
    method addTags (line 196) | public function addTags(array $tags)

FILE: frontend/modules/tweet/Module.php
  class Module (line 5) | class Module extends \yii\base\Module
    method init (line 9) | public function init()

FILE: frontend/modules/tweet/controllers/DefaultController.php
  class DefaultController (line 16) | class DefaultController extends Controller
    method behaviors (line 18) | public function behaviors()
    method actionIndex (line 45) | public function actionIndex()
    method actionCreate (line 74) | public function actionCreate()
    method actionDelete (line 103) | public function actionDelete($id)

FILE: frontend/modules/tweet/models/Tweet.php
  class Tweet (line 17) | class Tweet extends Post
    method getLike (line 21) | public function getLike()
    method rules (line 30) | public function rules()
    method findModel (line 65) | public static function findModel($id, $condition = '')
    method findTweet (line 88) | public static function findTweet($id)
    method findDeletedTweet (line 99) | public static function findDeletedTweet($id)
    method beforeSave (line 106) | public function beforeSave($insert)
    method afterSave (line 116) | public function afterSave($insert, $changedAttributes)

FILE: frontend/modules/tweet/models/TweetSearch.php
  class TweetSearch (line 13) | class TweetSearch extends Tweet
    method rules (line 18) | public function rules()
    method scenarios (line 29) | public function scenarios()
    method search (line 39) | public function search($params)

FILE: frontend/modules/user/Module.php
  class Module (line 7) | class Module extends BaseModule
    method init (line 15) | public function init()

FILE: frontend/modules/user/controllers/ActionController.php
  class ActionController (line 17) | class ActionController extends Controller
    method beforeAction (line 19) | public function beforeAction($action)
    method actionLike (line 34) | public function actionLike($type, $id)
    method actionHate (line 69) | public function actionHate($type, $id)
    method actionFollow (line 89) | public function actionFollow($type, $id)
    method actionThanks (line 109) | public function actionThanks($type, $id)
    method actionFavorite (line 129) | public function actionFavorite($type, $id)

FILE: frontend/modules/user/controllers/DefaultController.php
  class DefaultController (line 15) | class DefaultController extends Controller
    method actionIndex (line 17) | public function actionIndex()
    method actionShow (line 28) | public function actionShow($username = '')
    method comment (line 45) | protected function comment($userId)
    method actionPost (line 58) | public function actionPost($username = '')
    method actionFavorite (line 81) | public function actionFavorite($username = '')
    method actionPoint (line 91) | public function actionPoint($username = '')
    method actionLike (line 112) | public function actionLike($username)
    method userMeta (line 128) | protected function userMeta($userId, $type, $targetType = 'topic')
    method user (line 140) | protected function user($username = '')

FILE: frontend/modules/user/controllers/SecurityController.php
  class SecurityController (line 19) | class SecurityController extends Controller
    method behaviors (line 24) | public function behaviors()
    method init (line 43) | public function init()
    method actions (line 64) | public function actions()
    method authenticate (line 79) | public function authenticate(ClientInterface $client)

FILE: frontend/modules/user/controllers/SettingController.php
  class SettingController (line 25) | class SettingController extends Controller
    method behaviors (line 31) | public function behaviors()
    method init (line 53) | public function init()
    method actions (line 74) | public function actions()
    method actionProfile (line 88) | public function actionProfile()
    method actionAccount (line 108) | public function actionAccount()
    method actionAvatar (line 129) | public function actionAvatar()
    method actionDonate (line 174) | public function actionDonate()
    method actionNetworks (line 214) | public function actionNetworks()
    method actionDisconnect (line 228) | public function actionDisconnect($id)
    method connect (line 249) | public function connect(ClientInterface $client)
    method performAjaxValidation (line 283) | protected function performAjaxValidation($model)

FILE: frontend/modules/user/models/AccountForm.php
  class AccountForm (line 14) | class AccountForm extends Model
    method getUser (line 41) | public function getUser()
    method __construct (line 51) | public function __construct(Mailer $mailer, $config = [])
    method rules (line 64) | public function rules()
    method attributeLabels (line 86) | public function attributeLabels()
    method formName (line 98) | public function formName()
    method save (line 108) | public function save()

FILE: frontend/modules/user/models/AvatarForm.php
  class AvatarForm (line 16) | class AvatarForm extends Model
    method getUser (line 25) | public function getUser()
    method rules (line 35) | public function rules()
    method attributeLabels (line 44) | public function attributeLabels()
    method save (line 56) | public function save()
    method getImageFile (line 69) | public function getImageFile()
    method getNewUploadedImageFile (line 79) | public function getNewUploadedImageFile()
    method useDefaultImage (line 89) | public function useDefaultImage()
    method uploadImage (line 100) | public function uploadImage()
    method deleteImage (line 124) | public function deleteImage()

FILE: frontend/modules/user/models/Donate.php
  class Donate (line 20) | class Donate extends ActiveRecord
    method tableName (line 28) | public static function tableName()
    method rules (line 36) | public function rules()
    method attributeLabels (line 50) | public function attributeLabels()
    method uploadImage (line 68) | public function uploadImage()
    method deleteImage (line 91) | public function deleteImage()
    method getStatuses (line 111) | public static function getStatuses()

FILE: frontend/modules/user/models/UserAccount.php
  class UserAccount (line 18) | class UserAccount extends \yii\db\ActiveRecord
    method tableName (line 23) | public static function tableName()
    method rules (line 31) | public function rules()
    method getIsConnected (line 42) | public function getIsConnected()
    method getUser (line 50) | public function getUser()
    method attributeLabels (line 58) | public function attributeLabels()

FILE: frontend/modules/user/models/UserMeta.php
  class UserMeta (line 24) | class UserMeta extends ActiveRecord
    method tableName (line 32) | public static function tableName()
    method behaviors (line 37) | public function behaviors()
    method rules (line 52) | public function rules()
    method attributeLabels (line 65) | public function attributeLabels()
    method deleteOne (line 78) | public static function deleteOne($conditions)
    method isUserAction (line 94) | public function isUserAction($type = 0, $do = '', $targetId)
    method saveNewMeta (line 111) | public function saveNewMeta($type, $targetId, $do)
    method getTopic (line 131) | public function getTopic()
    method getTweet (line 136) | public function getTweet()
    method getComment (line 141) | public function getComment()
    method beforeSave (line 146) | public function beforeSave($insert)
    method beforeDelete (line 190) | public function beforeDelete()

FILE: frontend/web/js/main.js
  function notificationsCount (line 2) | function notificationsCount() {
  function localStorage (line 48) | function localStorage() {
  function ABDetected (line 131) | function ABDetected() {
  function docReady (line 150) | function docReady(t) {

FILE: frontend/widgets/Alert.php
  class Alert (line 29) | class Alert extends \yii\bootstrap\Widget
    method init (line 50) | public function init()

FILE: frontend/widgets/Connect.php
  class Connect (line 17) | class Connect extends AuthChoice
    method init (line 32) | public function init()
    method createClientUrl (line 45) | public function createClientUrl($provider)
    method isConnected (line 60) | public function isConnected(ClientInterface $provider)

FILE: frontend/widgets/Nav.php
  class Nav (line 12) | class Nav extends \yii\bootstrap\Widget
    method run (line 15) | public function run()

FILE: frontend/widgets/NewestPost.php
  class NewestPost (line 13) | class NewestPost extends \yii\bootstrap\Widget
    method getPost (line 17) | public function getPost()

FILE: frontend/widgets/Node.php
  class Node (line 12) | class Node extends \yii\bootstrap\Widget
    method run (line 14) | public function run()

FILE: frontend/widgets/Panel.php
  class Panel (line 10) | class Panel extends \yii\bootstrap\Widget
    method run (line 15) | public function run()

FILE: frontend/widgets/TopicSidebar.php
  class TopicSidebar (line 18) | class TopicSidebar extends \yii\bootstrap\Widget
    method init (line 24) | public function init()
    method run (line 29) | public function run()

FILE: tests/codeception/backend/unit/DbTestCase.php
  class DbTestCase (line 5) | class DbTestCase extends \yii\codeception\DbTestCase

FILE: tests/codeception/backend/unit/TestCase.php
  class TestCase (line 5) | class TestCase extends \yii\codeception\TestCase

FILE: tests/codeception/common/_pages/LoginPage.php
  class LoginPage (line 11) | class LoginPage extends BasePage
    method login (line 19) | public function login($username, $password)

FILE: tests/codeception/common/_support/FixtureHelper.php
  class FixtureHelper (line 14) | class FixtureHelper extends Module
    method _beforeSuite (line 35) | public function _beforeSuite($settings = [])
    method _afterSuite (line 43) | public function _afterSuite()
    method fixtures (line 51) | public function fixtures()

FILE: tests/codeception/common/fixtures/UserFixture.php
  class UserFixture (line 10) | class UserFixture extends ActiveFixture

FILE: tests/codeception/common/unit/DbTestCase.php
  class DbTestCase (line 8) | class DbTestCase extends \yii\codeception\DbTestCase

FILE: tests/codeception/common/unit/TestCase.php
  class TestCase (line 8) | class TestCase extends \yii\codeception\TestCase

FILE: tests/codeception/common/unit/models/LoginFormTest.php
  class LoginFormTest (line 14) | class LoginFormTest extends DbTestCase
    method setUp (line 19) | public function setUp()
    method tearDown (line 33) | protected function tearDown()
    method testLoginNoUser (line 39) | public function testLoginNoUser()
    method testLoginWrongPassword (line 52) | public function testLoginWrongPassword()
    method testLoginCorrect (line 66) | public function testLoginCorrect()
    method fixtures (line 84) | public function fixtures()

FILE: tests/codeception/console/unit/DbTestCase.php
  class DbTestCase (line 8) | class DbTestCase extends \yii\codeception\DbTestCase

FILE: tests/codeception/console/unit/TestCase.php
  class TestCase (line 8) | class TestCase extends \yii\codeception\TestCase

FILE: tests/codeception/frontend/_pages/AboutPage.php
  class AboutPage (line 11) | class AboutPage extends BasePage

FILE: tests/codeception/frontend/_pages/ContactPage.php
  class ContactPage (line 11) | class ContactPage extends BasePage
    method submit (line 18) | public function submit(array $contactData)

FILE: tests/codeception/frontend/_pages/SignupPage.php
  class SignupPage (line 11) | class SignupPage extends BasePage
    method submit (line 19) | public function submit(array $signupData)

FILE: tests/codeception/frontend/acceptance/SignupCest.php
  class SignupCest (line 8) | class SignupCest
    method _before (line 15) | public function _before($event)
    method _after (line 23) | public function _after($event)
    method _fail (line 35) | public function _fail($event)
    method testUserSignup (line 43) | public function testUserSignup($I, $scenario)

FILE: tests/codeception/frontend/functional/SignupCest.php
  class SignupCest (line 8) | class SignupCest
    method _before (line 15) | public function _before($event)
    method _after (line 23) | public function _after($event)
    method _fail (line 35) | public function _fail($event)
    method testUserSignup (line 45) | public function testUserSignup($I, $scenario)

FILE: tests/codeception/frontend/unit/DbTestCase.php
  class DbTestCase (line 8) | class DbTestCase extends \yii\codeception\DbTestCase

FILE: tests/codeception/frontend/unit/TestCase.php
  class TestCase (line 8) | class TestCase extends \yii\codeception\TestCase

FILE: tests/codeception/frontend/unit/models/ContactFormTest.php
  class ContactFormTest (line 9) | class ContactFormTest extends TestCase
    method setUp (line 14) | protected function setUp()
    method tearDown (line 22) | protected function tearDown()
    method testContact (line 28) | public function testContact()
    method getMessageFile (line 55) | private function getMessageFile()

FILE: tests/codeception/frontend/unit/models/PasswordResetRequestFormTest.php
  class PasswordResetRequestFormTest (line 12) | class PasswordResetRequestFormTest extends DbTestCase
    method setUp (line 16) | protected function setUp()
    method tearDown (line 25) | protected function tearDown()
    method testSendEmailWrongUser (line 32) | public function testSendEmailWrongUser()
    method testSendEmailCorrectUser (line 53) | public function testSendEmailCorrectUser()
    method fixtures (line 73) | public function fixtures()
    method getMessageFile (line 83) | private function getMessageFile()

FILE: tests/codeception/frontend/unit/models/ResetPasswordFormTest.php
  class ResetPasswordFormTest (line 9) | class ResetPasswordFormTest extends DbTestCase
    method testResetWrongToken (line 15) | public function testResetWrongToken()
    method testResetEmptyToken (line 23) | public function testResetEmptyToken()
    method testResetCorrectToken (line 28) | public function testResetCorrectToken()
    method fixtures (line 34) | public function fixtures()

FILE: tests/codeception/frontend/unit/models/SignupFormTest.php
  class SignupFormTest (line 10) | class SignupFormTest extends DbTestCase
    method testCorrectSignup (line 15) | public function testCorrectSignup()
    method testNotCorrectSignup (line 32) | public function testNotCorrectSignup()
    method fixtures (line 43) | public function fixtures()
Condensed preview — 409 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (640K chars).
[
  {
    "path": ".bowerrc",
    "chars": 37,
    "preview": "{\n    \"directory\" : \"vendor/bower\"\n}\n"
  },
  {
    "path": ".gitignore",
    "chars": 469,
    "preview": "# yii console command\n/yii\n\n# phpstorm 项目文件\n.idea\n\n# netbeans 项目文件\nnbproject\n\n# zend studio for eclipse 项目文件\n.buildpath\n"
  },
  {
    "path": ".travis.yml",
    "chars": 442,
    "preview": "language: php\r\nphp:\r\n  - 5.4\r\n  - 5.5\r\n  - 5.6\r\n\r\ninstall:\r\n  - travis_retry composer self-update && composer --version\r"
  },
  {
    "path": "Dockerfile",
    "chars": 1131,
    "preview": "FROM dcb9/php-fpm:latest\n\nMAINTAINER Bob <bob@phpor.me>\n\nRUN apt-get update \\\n  && apt-get install -y --no-install-recom"
  },
  {
    "path": "LICENSE.md",
    "chars": 1621,
    "preview": "The Yii framework is free software. It is released under the terms of\nthe following BSD License.\n\nCopyright © 2008 by Yi"
  },
  {
    "path": "README.md",
    "chars": 3506,
    "preview": "GetYii\n==================\n\n[![Latest Stable Version](https://poser.pugx.org/iiyii/getyii/v/stable)](https://packagist.or"
  },
  {
    "path": "backend/assets/AppAsset.php",
    "chars": 550,
    "preview": "<?php\n/**\n * @link http://www.yiiframework.com/\n * @copyright Copyright (c) 2008 Yii Software LLC\n * @license http://www"
  },
  {
    "path": "backend/config/.gitignore",
    "chars": 31,
    "preview": "main-local.php\nparams-local.php"
  },
  {
    "path": "backend/config/bootstrap.php",
    "chars": 6,
    "preview": "<?php\n"
  },
  {
    "path": "backend/config/main.php",
    "chars": 1328,
    "preview": "<?php\n$params = array_merge(\n    require(__DIR__ . '/../../common/config/params.php'),\n    require(__DIR__ . '/../../com"
  },
  {
    "path": "backend/config/params.php",
    "chars": 59,
    "preview": "<?php\nreturn [\n    'adminEmail' => 'admin@example.com',\n];\n"
  },
  {
    "path": "backend/controllers/CenterController.php",
    "chars": 1411,
    "preview": "<?php\r\nnamespace backend\\controllers;\r\n\r\nuse Yii;\r\nuse yii\\filters\\AccessControl;\r\nuse yii\\filters\\VerbFilter;\r\n/**\r\n * "
  },
  {
    "path": "backend/controllers/Controller.php",
    "chars": 1194,
    "preview": "<?php\n/**\n * author     : forecho <caizh@chexiu.cn>\n * createTime : 2016/3/10 14:39\n * description:\n */\n\nnamespace backe"
  },
  {
    "path": "backend/controllers/NavController.php",
    "chars": 2674,
    "preview": "<?php\n\nnamespace backend\\controllers;\n\nuse Yii;\nuse common\\models\\Nav;\nuse yii\\data\\ActiveDataProvider;\nuse yii\\web\\NotF"
  },
  {
    "path": "backend/controllers/NavUrlController.php",
    "chars": 2717,
    "preview": "<?php\n\nnamespace backend\\controllers;\n\nuse Yii;\nuse common\\models\\NavUrl;\nuse yii\\data\\ActiveDataProvider;\nuse yii\\web\\N"
  },
  {
    "path": "backend/controllers/PostController.php",
    "chars": 2752,
    "preview": "<?php\n\nnamespace backend\\controllers;\n\nuse Yii;\nuse common\\models\\Post;\nuse backend\\models\\PostSearch;\nuse yii\\web\\NotFo"
  },
  {
    "path": "backend/controllers/PostMetaController.php",
    "chars": 2546,
    "preview": "<?php\n\nnamespace backend\\controllers;\n\nuse Yii;\nuse common\\models\\PostMeta;\nuse common\\models\\PostMetaSearch;\nuse yii\\we"
  },
  {
    "path": "backend/controllers/RightLinkController.php",
    "chars": 2939,
    "preview": "<?php\n\nnamespace backend\\controllers;\n\nuse Yii;\nuse common\\models\\RightLink;\nuse backend\\models\\RightLinkSearch;\nuse yii"
  },
  {
    "path": "backend/controllers/SearchLogController.php",
    "chars": 1524,
    "preview": "<?php\n\nnamespace backend\\controllers;\n\nuse Yii;\nuse common\\models\\SearchLog;\nuse backend\\models\\SearchLogSearch;\nuse yii"
  },
  {
    "path": "backend/controllers/SiteController.php",
    "chars": 2298,
    "preview": "<?php\r\nnamespace backend\\controllers;\r\n\r\nuse Yii;\r\nuse yii\\filters\\AccessControl;\r\nuse common\\models\\LoginForm;\r\nuse yii"
  },
  {
    "path": "backend/controllers/UserController.php",
    "chars": 2750,
    "preview": "<?php\n\nnamespace backend\\controllers;\n\nuse Yii;\nuse common\\models\\User;\nuse common\\models\\UserSearch;\nuse yii\\web\\NotFou"
  },
  {
    "path": "backend/models/.gitkeep",
    "chars": 2,
    "preview": "*\n"
  },
  {
    "path": "backend/models/PostSearch.php",
    "chars": 3117,
    "preview": "<?php\n\nnamespace backend\\models;\n\nuse Yii;\nuse yii\\base\\Model;\nuse yii\\data\\ActiveDataProvider;\nuse common\\models\\Post;\n"
  },
  {
    "path": "backend/models/RightLinkSearch.php",
    "chars": 1710,
    "preview": "<?php\n\nnamespace backend\\models;\n\nuse Yii;\nuse yii\\base\\Model;\nuse yii\\data\\ActiveDataProvider;\nuse common\\models\\RightL"
  },
  {
    "path": "backend/models/SearchLogSearch.php",
    "chars": 1789,
    "preview": "<?php\n\nnamespace backend\\models;\n\nuse Yii;\nuse yii\\base\\Model;\nuse yii\\data\\ActiveDataProvider;\nuse common\\models\\Search"
  },
  {
    "path": "backend/models/User.php",
    "chars": 1723,
    "preview": "<?php\r\n\r\nnamespace app\\models;\r\n\r\nuse Yii;\r\n\r\n/**\r\n * This is the model class for table \"{{%user}}\".\r\n *\r\n * @property i"
  },
  {
    "path": "backend/runtime/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "backend/views/layouts/content.php",
    "chars": 1486,
    "preview": "<?php\nuse yii\\widgets\\Breadcrumbs;\nuse dmstr\\widgets\\Alert;\n\n?>\n<div class=\"content-wrapper\">\n    <section class=\"conten"
  },
  {
    "path": "backend/views/layouts/header.php",
    "chars": 1020,
    "preview": "<?php\nuse yii\\helpers\\Html;\n\n/* @var $this \\yii\\web\\View */\n/* @var $content string */\n?>\n\n<header class=\"main-header\">\n"
  },
  {
    "path": "backend/views/layouts/left.php",
    "chars": 3422,
    "preview": "<aside class=\"main-sidebar\">\n\n    <section class=\"sidebar\">\n\n        <!-- Sidebar user panel -->\n        <div class=\"use"
  },
  {
    "path": "backend/views/layouts/main-login.php",
    "chars": 640,
    "preview": "<?php\nuse backend\\assets\\AppAsset;\nuse yii\\helpers\\Html;\n\n/* @var $this \\yii\\web\\View */\n/* @var $content string */\n\ndms"
  },
  {
    "path": "backend/views/layouts/main.php",
    "chars": 1703,
    "preview": "<?php\nuse yii\\helpers\\Html;\n\n/* @var $this \\yii\\web\\View */\n/* @var $content string */\n\n\nif (Yii::$app->controller->acti"
  },
  {
    "path": "backend/views/nav/_form.php",
    "chars": 703,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Nav"
  },
  {
    "path": "backend/views/nav/create.php",
    "chars": 361,
    "preview": "<?php\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Nav */\n\n$this->title = Yii::t('app', 'Create Nav');\n$t"
  },
  {
    "path": "backend/views/nav/index.php",
    "chars": 722,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\grid\\GridView;\n\n/* @var $this yii\\web\\View */\n/* @var $dataProvider yii\\data\\Active"
  },
  {
    "path": "backend/views/nav/update.php",
    "chars": 535,
    "preview": "<?php\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Nav */\n\n$this->title = Yii::t('app', 'Update {modelCla"
  },
  {
    "path": "backend/views/nav/view.php",
    "chars": 989,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\DetailView;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Nav"
  },
  {
    "path": "backend/views/nav-url/_form.php",
    "chars": 891,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\nuse common\\models\\Nav;\n\n/* @var $this yii\\web\\View */\n/* @var $"
  },
  {
    "path": "backend/views/nav-url/create.php",
    "chars": 376,
    "preview": "<?php\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\NavUrl */\n\n$this->title = Yii::t('app', 'Create Nav Ur"
  },
  {
    "path": "backend/views/nav-url/index.php",
    "chars": 818,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\grid\\GridView;\n\n/* @var $this yii\\web\\View */\n/* @var $dataProvider yii\\data\\Active"
  },
  {
    "path": "backend/views/nav-url/update.php",
    "chars": 552,
    "preview": "<?php\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\NavUrl */\n\n$this->title = Yii::t('app', 'Update {model"
  },
  {
    "path": "backend/views/nav-url/view.php",
    "chars": 1076,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\DetailView;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Nav"
  },
  {
    "path": "backend/views/post/_form.php",
    "chars": 1762,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\Models\\Pos"
  },
  {
    "path": "backend/views/post/_search.php",
    "chars": 1480,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\Models\\Pos"
  },
  {
    "path": "backend/views/post/create.php",
    "chars": 335,
    "preview": "<?php\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\Models\\Post */\n\n$this->title = 'Create Post';\n$this->params['"
  },
  {
    "path": "backend/views/post/index.php",
    "chars": 2527,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\grid\\GridView;\nuse common\\models\\Post;\n\n/* @var $this yii\\web\\View */\n/* @var $sear"
  },
  {
    "path": "backend/views/post/update.php",
    "chars": 455,
    "preview": "<?php\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\Models\\Post */\n\n$this->title = 'Update Post: ' . ' ' . $model"
  },
  {
    "path": "backend/views/post/view.php",
    "chars": 1238,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\DetailView;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\Models\\Pos"
  },
  {
    "path": "backend/views/post-meta/_form.php",
    "chars": 936,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Pos"
  },
  {
    "path": "backend/views/post-meta/_search.php",
    "chars": 632,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Pos"
  },
  {
    "path": "backend/views/post-meta/create.php",
    "chars": 354,
    "preview": "<?php\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\PostMeta */\n\n$this->title = 'Create Post Meta';\n$this-"
  },
  {
    "path": "backend/views/post-meta/index.php",
    "chars": 976,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\grid\\GridView;\n\n/* @var $this yii\\web\\View */\n/* @var $searchModel common\\models\\Po"
  },
  {
    "path": "backend/views/post-meta/update.php",
    "chars": 472,
    "preview": "<?php\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\PostMeta */\n\n$this->title = 'Update Post Meta: ' . ' '"
  },
  {
    "path": "backend/views/post-meta/view.php",
    "chars": 1036,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\DetailView;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Pos"
  },
  {
    "path": "backend/views/right-link/_form.php",
    "chars": 846,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Rig"
  },
  {
    "path": "backend/views/right-link/_search.php",
    "chars": 983,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\n\n/* @var $this yii\\web\\View */\n/* @var $model backend\\models\\Ri"
  },
  {
    "path": "backend/views/right-link/create.php",
    "chars": 357,
    "preview": "<?php\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\RightLink */\n\n$this->title = 'Create Right Link';\n$thi"
  },
  {
    "path": "backend/views/right-link/index.php",
    "chars": 959,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\grid\\GridView;\n\n/* @var $this yii\\web\\View */\n/* @var $searchModel backend\\models\\R"
  },
  {
    "path": "backend/views/right-link/update.php",
    "chars": 477,
    "preview": "<?php\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\RightLink */\n\n$this->title = 'Update Right Link: ' . '"
  },
  {
    "path": "backend/views/right-link/view.php",
    "chars": 1023,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\DetailView;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Rig"
  },
  {
    "path": "backend/views/search-log/_search.php",
    "chars": 727,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\n\n/* @var $this yii\\web\\View */\n/* @var $model backend\\models\\Se"
  },
  {
    "path": "backend/views/search-log/index.php",
    "chars": 1056,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\grid\\GridView;\n\n/* @var $this yii\\web\\View */\n/* @var $searchModel backend\\models\\S"
  },
  {
    "path": "backend/views/site/error.php",
    "chars": 1324,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\n\n/* @var $this yii\\web\\View */\n/* @var $name string */\n/* @var $message string */\n/* @var $"
  },
  {
    "path": "backend/views/site/index.php",
    "chars": 2350,
    "preview": "<?php\n/* @var $this yii\\web\\View */\n\n$this->title = 'My Yii Application';\n?>\n<div class=\"site-index\">\n\n    <div class=\"j"
  },
  {
    "path": "backend/views/site/login.php",
    "chars": 1820,
    "preview": "<?php\nuse yii\\helpers\\Html;\nuse yii\\bootstrap\\ActiveForm;\n\n/* @var $this yii\\web\\View */\n/* @var $form yii\\bootstrap\\Act"
  },
  {
    "path": "backend/views/user/_form.php",
    "chars": 823,
    "preview": "<?php\n\nuse common\\models\\User;\nuse conquer\\select2\\Select2Widget;\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\n\n/* "
  },
  {
    "path": "backend/views/user/_search.php",
    "chars": 1154,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Use"
  },
  {
    "path": "backend/views/user/index.php",
    "chars": 1084,
    "preview": "<?php\n\nuse common\\models\\User;\nuse yii\\grid\\GridView;\n\n/* @var $this yii\\web\\View */\n/* @var $searchModel common\\models\\"
  },
  {
    "path": "backend/views/user/update.php",
    "chars": 449,
    "preview": "<?php\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\User */\n\n$this->title = 'Update User: ' . ' ' . $model"
  },
  {
    "path": "backend/views/user/view.php",
    "chars": 1095,
    "preview": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\DetailView;\n\n/* @var $this yii\\web\\View */\n/* @var $model common\\models\\Use"
  },
  {
    "path": "backend/web/.gitignore",
    "chars": 27,
    "preview": "/index.php\n/index-test.php\n"
  },
  {
    "path": "backend/web/.htaccess",
    "chars": 404,
    "preview": "# use mod_rewrite for pretty URL support\nRewriteEngine on\n# If a directory or a file exists, use the request directly\nRe"
  },
  {
    "path": "backend/web/assets/.gitignore",
    "chars": 14,
    "preview": "*\n!.gitignore\n"
  },
  {
    "path": "backend/web/css/sb-admin-2.css",
    "chars": 5911,
    "preview": "/*!\r\n * Start Bootstrap - SB Admin 2 Bootstrap Admin Theme (http://startbootstrap.com)\r\n * Code licensed under the Apach"
  },
  {
    "path": "backend/web/css/site.css",
    "chars": 1484,
    "preview": "html,\nbody {\n    height: 100%;\n}\n\n.wrap {\n    min-height: 100%;\n    height: auto;\n    margin: 0 auto -60px;\n    padding:"
  },
  {
    "path": "backend/web/js/sb-admin-2.js",
    "chars": 907,
    "preview": "$(function() {\r\n\r\n    $('#side-menu').metisMenu();\r\n\r\n});\r\n\r\n//Loads the correct sidebar on window load,\r\n//collapses th"
  },
  {
    "path": "backend/web/robots.txt",
    "chars": 26,
    "preview": "User-Agent: *\nDisallow: /\n"
  },
  {
    "path": "common/assets/AtJs.php",
    "chars": 315,
    "preview": "<?php\nnamespace common\\assets;\n\nuse yii\\web\\AssetBundle;\n\n/**\n * @author forecho <caizhenghai@gmail.com>\n */\nclass AtJs "
  },
  {
    "path": "common/assets/CaretJs.php",
    "chars": 277,
    "preview": "<?php\nnamespace common\\assets;\n\nuse yii\\web\\AssetBundle;\n\n/**\n * @author forecho <caizhenghai@gmail.com>\n */\nclass Caret"
  },
  {
    "path": "common/assets/DropzoneJs.php",
    "chars": 319,
    "preview": "<?php\nnamespace common\\assets;\n\nuse yii\\web\\AssetBundle;\n\n/**\n * @author forecho <caizhenghai@gmail.com>\n */\nclass Dropz"
  },
  {
    "path": "common/components/AssetBundle.php",
    "chars": 181,
    "preview": "<?php\r\nnamespace common\\components;\r\n\r\nclass AssetBundle extends \\yii\\web\\AssetBundle\r\n{\r\n    public $publishOptions = ["
  },
  {
    "path": "common/components/ComposerInstaller.php",
    "chars": 273,
    "preview": "<?php\n/**\n * author     : forecho <caizhenghai@gmail.com>\n * createTime : 16/8/7 上午10:44\n * description:\n */\n\nnamespace "
  },
  {
    "path": "common/components/Config.php",
    "chars": 15405,
    "preview": "<?php\r\nnamespace common\\components;\r\n\r\nuse Yii;\r\nuse yii\\base\\Object;\r\nuse yii\\base\\InvalidCallException;\r\nuse yii\\base\\"
  },
  {
    "path": "common/components/Controller.php",
    "chars": 2724,
    "preview": "<?php\r\n\r\nnamespace common\\components;\r\n\r\nuse Yii;\r\nuse yii\\helpers\\ArrayHelper;\r\nuse yii\\helpers\\Url;\r\nuse yii\\web\\Respo"
  },
  {
    "path": "common/components/DbAuthManager.php",
    "chars": 1477,
    "preview": "<?php\r\nnamespace common\\components;\r\n\r\nuse yii\\db\\Query;\r\nuse yii\\rbac\\Item;\r\nuse yii\\rbac\\DbManager;\r\n\r\nclass DbAuthMan"
  },
  {
    "path": "common/components/FileTarget.php",
    "chars": 1278,
    "preview": "<?php\n\n/**\n * author     : forecho <caizhenghai@gmail.com>\n * createTime : 2015/12/22 18:13\n * description:\n */\nnamespac"
  },
  {
    "path": "common/components/GlobalFunctions.php",
    "chars": 3121,
    "preview": "<?php\n\nuse yii\\web\\Response;\n\nif (!function_exists('env')) {\n\n    function env($envName, $default = false)\n    {\n       "
  },
  {
    "path": "common/components/Mailer.php",
    "chars": 3538,
    "preview": "<?php\n\nnamespace common\\components;\n\nuse yii\\base\\Component;\n\nclass Mailer extends Component\n{\n    /** @var string */\n  "
  },
  {
    "path": "common/components/db/ActiveRecord.php",
    "chars": 354,
    "preview": "<?php\r\nnamespace common\\components\\db;\r\n\r\nclass ActiveRecord extends \\yii\\db\\ActiveRecord\r\n{\r\n\t/**\r\n     * 自动更新created_a"
  },
  {
    "path": "common/components/db/Command.php",
    "chars": 463,
    "preview": "<?php\r\nnamespace common\\components\\db;\r\n\r\nclass Command extends \\yii\\db\\Command\r\n{\r\n\r\n    /**\r\n     * @param $replace 是否"
  },
  {
    "path": "common/components/db/Connection.php",
    "chars": 431,
    "preview": "<?php\r\nnamespace common\\components\\db;\r\n\r\nclass Connection extends \\yii\\db\\Connection\r\n{\r\n    /**\r\n     * @see \\yii\\db\\C"
  },
  {
    "path": "common/components/db/Migration.php",
    "chars": 597,
    "preview": "<?php\r\nnamespace common\\components\\db;\r\n\r\nclass Migration extends \\yii\\db\\Migration\r\n{\r\n    /**\r\n     * 创建表选项\r\n     * @v"
  },
  {
    "path": "common/config/.gitignore",
    "chars": 39,
    "preview": "main-local.php\nparams-local.php\ndb.php\n"
  },
  {
    "path": "common/config/bootstrap.php",
    "chars": 299,
    "preview": "<?php\nYii::setAlias('common', dirname(__DIR__));\nYii::setAlias('root', dirname(dirname(__DIR__)));\nYii::setAlias('fronte"
  },
  {
    "path": "common/config/main.php",
    "chars": 5895,
    "preview": "<?php\nreturn [\n//    'aliases' => [\n//        '@bower' => '@vendor/bower-asset',\n//        '@npm' => '@vendor/npm-asset'"
  },
  {
    "path": "common/config/params.php",
    "chars": 850,
    "preview": "<?php\nreturn [\n    'adminEmail' => 'caizhenghai@gmail.com',\n    'backupEmail' => 'caizhenghai@qq.com',\n    'supportEmail"
  },
  {
    "path": "common/grid/EnumColumn.php",
    "chars": 987,
    "preview": "<?php\nnamespace common\\grid;\n\nuse yii\\grid\\DataColumn;\nuse yii\\helpers\\ArrayHelper;\n\n/**\n * Class EnumColumn\n * [\n *    "
  },
  {
    "path": "common/helpers/Arr.php",
    "chars": 636,
    "preview": "<?php\n/**\n * author     : forecho <caizhenghai@gmail.com>\n * createTime : 16/3/19 上午9:57\n * description:\n */\n\nnamespace "
  },
  {
    "path": "common/helpers/Avatar.php",
    "chars": 1284,
    "preview": "<?php\n/**\n * author     : forecho <caizhenghai@gmail.com>\n * createTime : 15/5/17 下午4:14\n * description:\n */\n\nnamespace "
  },
  {
    "path": "common/helpers/Formatter.php",
    "chars": 970,
    "preview": "<?php\r\n/**\r\n * author     : forecho <caizhenghai@gmail.com>\r\n * createTime : 2015/8/4 14:19\r\n * description:\r\n */\r\n\r\nnam"
  },
  {
    "path": "common/helpers/UploadHelper.php",
    "chars": 764,
    "preview": "<?php\r\n/**\r\n * Created by PhpStorm.\r\n * User: user\r\n * Date: 2017/1/18\r\n * Time: 17:56\r\n */\r\n\r\nnamespace common\\helpers;"
  },
  {
    "path": "common/mail/backup.php",
    "chars": 15,
    "preview": "\n\n数据库备份成功!!!!\n\n"
  },
  {
    "path": "common/mail/layouts/html.php",
    "chars": 714,
    "preview": "<?php\nuse yii\\helpers\\Html;\n\n/* @var $this \\yii\\web\\View view component instance */\n/* @var $message \\yii\\mail\\MessageIn"
  },
  {
    "path": "common/mail/passwordResetToken.php",
    "chars": 365,
    "preview": "<?php\nuse yii\\helpers\\Html;\n\n/* @var $this yii\\web\\View */\n/* @var $user common\\models\\User */\n\n$resetLink = Yii::$app->"
  },
  {
    "path": "common/messages/pt-BR/backend.php",
    "chars": 1800,
    "preview": "<?php\nreturn [\n    'DELETED' => 'EXCLUÍDO',\n    'ACTIVE' => 'ATIVO',\n    'EXCELLENT' => 'EXCELENTE',\n    'TOP' => 'TOP',"
  },
  {
    "path": "common/messages/pt-BR/common.php",
    "chars": 673,
    "preview": "<?php\nreturn [\n    'DELETED' => 'EXCLUIDO',\n    'ACTIVE' => 'ATIVO',\n    'EXCELLENT' => 'EXCELENTE',\n    'TOP' => 'TOP',"
  },
  {
    "path": "common/messages/pt-BR/frontend.php",
    "chars": 153,
    "preview": "<?php\nreturn [\n    'created_at {datetime}' => 'criado em {datetime}',\n    'reply_at {datetime}' => 'respondido em {datet"
  },
  {
    "path": "common/messages/zh-CN/backend.php",
    "chars": 1772,
    "preview": "<?php\nreturn [\n    'DELETED' => '已删除',\n    'ACTIVE' => '正常',\n    'EXCELLENT' => '推荐',\n    'TOP' => '置顶',\n    'Username' "
  },
  {
    "path": "common/messages/zh-CN/common.php",
    "chars": 553,
    "preview": "<?php\n\nreturn [\n    'DELETED' => '已删除',\n    'ACTIVE' => '正常',\n    'EXCELLENT' => '推荐',\n    'TOP' => '置顶',\n\n    'Username"
  },
  {
    "path": "common/messages/zh-CN/frontend.php",
    "chars": 141,
    "preview": "<?php\n\nreturn [\n    'created_at {datetime}' => '于 {datetime} 发布',\n    'reply_at {datetime}' => '于 {datetime} 回复',\n    'l"
  },
  {
    "path": "common/models/LoginForm.php",
    "chars": 3593,
    "preview": "<?php\nnamespace common\\models;\n\nuse Yii;\nuse yii\\base\\Model;\n\n/**\n * Login form\n */\nclass LoginForm extends Model\n{\n    "
  },
  {
    "path": "common/models/Nav.php",
    "chars": 1299,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse Yii;\nuse yii\\helpers\\ArrayHelper;\n\n/**\n * This is the model class for table \"nav\".\n"
  },
  {
    "path": "common/models/NavUrl.php",
    "chars": 1415,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse Yii;\n\n/**\n * This is the model class for table \"nav_url\".\n *\n * @property integer $"
  },
  {
    "path": "common/models/Post.php",
    "chars": 6023,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse common\\components\\db\\ActiveRecord;\nuse Yii;\nuse yiier\\antiSpam\\SpamValidator;\n\n/**\n"
  },
  {
    "path": "common/models/PostComment.php",
    "chars": 5065,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse common\\components\\db\\ActiveRecord;\nuse common\\services\\NotificationService;\nuse com"
  },
  {
    "path": "common/models/PostMeta.php",
    "chars": 4360,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse DevGroup\\TagDependencyHelper\\CacheableActiveRecord;\nuse DevGroup\\TagDependencyHelpe"
  },
  {
    "path": "common/models/PostMetaSearch.php",
    "chars": 1810,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse Yii;\nuse yii\\base\\Model;\nuse yii\\data\\ActiveDataProvider;\nuse common\\models\\PostMet"
  },
  {
    "path": "common/models/PostSearch.php",
    "chars": 2860,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse Yii;\nuse yii\\base\\Model;\nuse yii\\data\\ActiveDataProvider;\nuse common\\models\\Post;\n\n"
  },
  {
    "path": "common/models/PostTag.php",
    "chars": 925,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse Yii;\nuse common\\components\\db\\ActiveRecord;\n\n/**\n * This is the model class for tab"
  },
  {
    "path": "common/models/PostTagSearch.php",
    "chars": 1503,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse Yii;\nuse yii\\base\\Model;\nuse yii\\data\\ActiveDataProvider;\n\n/**\n * PostTagSearch rep"
  },
  {
    "path": "common/models/RightLink.php",
    "chars": 1858,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse common\\components\\db\\ActiveRecord;\nuse Yii;\n\n/**\n * This is the model class for tab"
  },
  {
    "path": "common/models/Search.php",
    "chars": 567,
    "preview": "<?php\r\n\r\nnamespace common\\models;\r\n\r\n\r\n/**\r\n * This is the model class for table \"topic\".\r\n *\r\n * @property integer $top"
  },
  {
    "path": "common/models/SearchLog.php",
    "chars": 1062,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse Yii;\n\n/**\n * This is the model class for table \"search_log\".\n *\n * @property intege"
  },
  {
    "path": "common/models/Session.php",
    "chars": 849,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse Yii;\n\n/**\n * This is the model class for table \"session\".\n *\n * @property string $i"
  },
  {
    "path": "common/models/User.php",
    "chars": 10003,
    "preview": "<?php\nnamespace common\\models;\n\nuse common\\helpers\\Avatar;\nuse Yii;\nuse yii\\base\\NotSupportedException;\nuse yii\\behavior"
  },
  {
    "path": "common/models/UserInfo.php",
    "chars": 2533,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse Yii;\nuse common\\components\\db\\ActiveRecord;\n\n/**\n * This is the model class for tab"
  },
  {
    "path": "common/models/UserSearch.php",
    "chars": 2083,
    "preview": "<?php\n\nnamespace common\\models;\n\nuse Yii;\nuse yii\\base\\Model;\nuse yii\\data\\ActiveDataProvider;\nuse common\\models\\User;\n\n"
  },
  {
    "path": "common/services/CommentService.php",
    "chars": 954,
    "preview": "<?php\n/**\n * author     : forecho <caizhenghai@gmail.com>\n * createTime : 15/4/19 下午3:20\n * description:\n */\n\nnamespace "
  },
  {
    "path": "common/services/NotificationService.php",
    "chars": 4423,
    "preview": "<?php\r\n/**\r\n * author     : forecho <caizh@snsshop.com>\r\n * createTime : 2015/4/21 16:56\r\n * description:\r\n */\r\n\r\nnamesp"
  },
  {
    "path": "common/services/PostService.php",
    "chars": 4999,
    "preview": "<?php\n/**\n * author     : forecho <caizhenghai@gmail.com>\n * createTime : 15/4/19 下午3:20\n * description:\n */\n\nnamespace "
  },
  {
    "path": "common/services/TopicService.php",
    "chars": 1156,
    "preview": "<?php\n/**\n * author     : forecho <caizhenghai@gmail.com>\n * createTime : 15/4/19 下午3:20\n * description:\n */\n\nnamespace "
  },
  {
    "path": "common/services/TweetService.php",
    "chars": 1012,
    "preview": "<?php\n/**\n * author     : forecho <caizhenghai@gmail.com>\n * createTime : 15/4/19 下午3:20\n * description:\n */\n\nnamespace "
  },
  {
    "path": "common/services/UserService.php",
    "chars": 5770,
    "preview": "<?php\n/**\n * author     : forecho <caizhenghai@gmail.com>\n * createTime : 15/4/19 下午3:20\n * description:\n */\n\nnamespace "
  },
  {
    "path": "common/widgets/JsBlock.php",
    "chars": 1147,
    "preview": "<?php\r\n\r\nnamespace common\\widgets;\r\n\r\nuse yii\\web\\View;\r\nuse yii\\widgets\\Block;\r\n\r\n\r\nclass JsBlock extends Block\r\n{\r\n\r\n "
  },
  {
    "path": "composer.json",
    "chars": 2359,
    "preview": "{\r\n  \"name\": \"iiyii/getyii\",\r\n  \"description\": \"Yii 2 Community\",\r\n  \"keywords\": [\r\n    \"yii2\",\r\n    \"framework\",\r\n    \""
  },
  {
    "path": "console/config/.gitignore",
    "chars": 31,
    "preview": "main-local.php\nparams-local.php"
  },
  {
    "path": "console/config/bootstrap.php",
    "chars": 6,
    "preview": "<?php\n"
  },
  {
    "path": "console/config/main.php",
    "chars": 1032,
    "preview": "<?php\n$params = array_merge(\n    require(__DIR__ . '/../../common/config/params.php'),\n    require(__DIR__ . '/../../com"
  },
  {
    "path": "console/config/params.php",
    "chars": 59,
    "preview": "<?php\nreturn [\n    'adminEmail' => 'admin@example.com',\n];\n"
  },
  {
    "path": "console/controllers/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "console/controllers/InstallController.php",
    "chars": 5228,
    "preview": "<?php\n\nnamespace console\\controllers;\n\nuse Yii;\nuse yii\\console\\Controller;\nuse yii\\helpers\\Console;\n\nclass InstallContr"
  },
  {
    "path": "console/controllers/SyncController.php",
    "chars": 3382,
    "preview": "<?php\n\nnamespace console\\controllers;\n\nuse frontend\\modules\\topic\\models\\Topic;\nuse frontend\\modules\\user\\models\\UserMet"
  },
  {
    "path": "console/migrations/m130524_201442_init.php",
    "chars": 918,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m130524_201442_init extends Migration\n{\n    public "
  },
  {
    "path": "console/migrations/m150104_071047_init_blog.php",
    "chars": 4711,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150104_071047_init_blog extends Migration\n{\n    pu"
  },
  {
    "path": "console/migrations/m150104_091352_init_user.php",
    "chars": 2192,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150104_091352_init_user extends Migration\n{\n    pu"
  },
  {
    "path": "console/migrations/m150115_081356_create_user_info.php",
    "chars": 1154,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150115_081356_create_user_info extends Migration\n{"
  },
  {
    "path": "console/migrations/m150201_142415_update_user.php",
    "chars": 1177,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150201_142415_update_user extends Migration\n{\n    "
  },
  {
    "path": "console/migrations/m150205_085033_update_post_comment.php",
    "chars": 696,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150205_085033_update_post_comment extends Migratio"
  },
  {
    "path": "console/migrations/m150209_015931_setting_init.php",
    "chars": 3136,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150209_015931_setting_init extends Migration\n{\n   "
  },
  {
    "path": "console/migrations/m150209_090406_create_user_account.php",
    "chars": 1148,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150209_090406_create_user_account extends Migratio"
  },
  {
    "path": "console/migrations/m150211_070335_update_user_info.php",
    "chars": 1229,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150211_070335_update_user_info extends Migration\n{"
  },
  {
    "path": "console/migrations/m150212_030127_update_user_info_and_post_meta.php",
    "chars": 493,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m150212_030127_update_user_info_and_post_meta extends Migration\n{"
  },
  {
    "path": "console/migrations/m150212_132400_create_topics_table.php",
    "chars": 751,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150212_132400_create_topics_table extends Migratio"
  },
  {
    "path": "console/migrations/m150214_070754_update_post_meta.php",
    "chars": 520,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m150214_070754_update_post_meta extends Migration\n{\n    public fu"
  },
  {
    "path": "console/migrations/m150412_034147_update_site_setting.php",
    "chars": 1542,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150412_034147_update_site_setting extends Migratio"
  },
  {
    "path": "console/migrations/m150416_134819_create_notification_table.php",
    "chars": 1592,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150416_134819_create_notification_table extends Mi"
  },
  {
    "path": "console/migrations/m150420_060807_update_post_table.php",
    "chars": 496,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150420_060807_update_post_table extends Migration\n"
  },
  {
    "path": "console/migrations/m150424_025409_update_table_engine.php",
    "chars": 816,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m150424_025409_update_table_engine extends Migration\n{\n    public"
  },
  {
    "path": "console/migrations/m150424_031429_update_notification_table.php",
    "chars": 513,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m150424_031429_update_notification_table extends Migration\n{\n    "
  },
  {
    "path": "console/migrations/m150424_100155_update_post_meta_table.php",
    "chars": 486,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m150424_100155_update_post_meta_table extends Migration\n{\n\n    pu"
  },
  {
    "path": "console/migrations/m150425_031844_create_right_link.php",
    "chars": 1201,
    "preview": "<?php\n\nuse yii\\db\\Schema;\n\nclass m150425_031844_create_right_link extends \\common\\components\\db\\Migration\n{\n    public f"
  },
  {
    "path": "console/migrations/m150626_073539_create_nav.php",
    "chars": 1094,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m150626_073539_create_nav extends Migration\n{\n    public function"
  },
  {
    "path": "console/migrations/m150626_073559_create_nav_url.php",
    "chars": 1383,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m150626_073559_create_nav_url extends Migration\n{\n    public func"
  },
  {
    "path": "console/migrations/m150702_130239_create_session_init.php",
    "chars": 866,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150702_130239_create_session_init extends Migratio"
  },
  {
    "path": "console/migrations/m150805_085832_create_search_log_table.php",
    "chars": 923,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse common\\components\\db\\Migration;\n\nclass m150805_085832_create_search_log_table extends Migr"
  },
  {
    "path": "console/migrations/m150808_025734_update_table_character.php",
    "chars": 822,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m150808_025734_update_table_character extends Migration\n{\n    pub"
  },
  {
    "path": "console/migrations/m150829_091943_update_post_table.php",
    "chars": 675,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m150829_091943_update_post_table extends Migration\n{\n    public f"
  },
  {
    "path": "console/migrations/m160320_093621_create_merit_table.php",
    "chars": 4370,
    "preview": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m160320_093621_create_merit_table extends Migration\n{\n    /**\n   "
  },
  {
    "path": "console/migrations/m160321_132724_add_donate_table.php",
    "chars": 839,
    "preview": "<?php\n\nuse common\\components\\db\\Migration;\n\nclass m160321_132724_add_donate_table extends Migration\n{\n    public $tableN"
  },
  {
    "path": "console/migrations/m160719_093527_modify_user.php",
    "chars": 510,
    "preview": "<?php\n\nuse yii\\db\\Migration;\n\nclass m160719_093527_modify_user extends Migration\n{\n    public $userTable = '{{%user}}';\n"
  },
  {
    "path": "console/migrations/m190624_022722_create_spam_table.php",
    "chars": 1608,
    "preview": "<?php\n\nuse yii\\db\\Migration;\nuse yiier\\antiSpam\\models\\Spam;\n\n/**\n * Handles the creation of table `{{%spam}}`.\n */\nclas"
  },
  {
    "path": "console/migrations/m190908_053628_init_admin.php",
    "chars": 1620,
    "preview": "<?php\n\nuse yii\\helpers\\Console;\nuse yii\\db\\Migration;\n\nclass m190908_053628_init_admin extends Migration\n{\n    public fu"
  },
  {
    "path": "console/migrations/m190908_055507_init_data.php",
    "chars": 3932,
    "preview": "<?php\n\nuse yii\\db\\Migration;\nuse yii\\helpers\\Console;\nuse frontend\\modules\\topic\\models\\Topic;\nuse common\\models\\PostCom"
  },
  {
    "path": "console/models/.gitkeep",
    "chars": 2,
    "preview": "*\n"
  },
  {
    "path": "console/runtime/.gitignore",
    "chars": 13,
    "preview": "*\n!.gitignore"
  },
  {
    "path": "doc/README.md",
    "chars": 39,
    "preview": "## 本文件夹是功能详细设计文档\r\n\r\n本文档主要由 @forecho 设计。"
  },
  {
    "path": "docker-files/docker-compose-example.yml",
    "chars": 470,
    "preview": "mysql:\n  image: mysql\n  environment:\n    - MYSQL_DATABASE=getyii\n    - MYSQL_ROOT_PASSWORD=getyii.com\n  ports:\n    - 330"
  },
  {
    "path": "docker-files/getyii.com.conf",
    "chars": 1105,
    "preview": "server {\n        charset utf-8;\n\tclient_max_body_size 128M;\n\n\tlisten 80;\n\tserver_name getyii.com www.getyii.com *.dev.ww"
  },
  {
    "path": "docker-files/run.sh",
    "chars": 736,
    "preview": "#!/bin/bash\n\nset -e -x \n\ncd /app\ncomposer install --prefer-dist --no-interaction --optimize-autoloader\n./init --env=${AP"
  },
  {
    "path": "environments/dev/backend/config/main-local.php",
    "chars": 514,
    "preview": "<?php\n\n$config = [\n    'components' => [\n        'request' => [\n            // !!! insert a secret key in the following "
  },
  {
    "path": "environments/dev/backend/config/params-local.php",
    "chars": 18,
    "preview": "<?php\nreturn [\n];\n"
  },
  {
    "path": "environments/dev/backend/web/index-test.php",
    "chars": 647,
    "preview": "<?php\n\n// NOTE: Make sure this file is not accessible when deployed to production\nif (!in_array(@$_SERVER['REMOTE_ADDR']"
  },
  {
    "path": "environments/dev/backend/web/index.php",
    "chars": 648,
    "preview": "<?php\ndefined('YII_DEBUG') or define('YII_DEBUG', true);\ndefined('YII_ENV') or define('YII_ENV', 'dev');\n\nrequire(__DIR_"
  },
  {
    "path": "environments/dev/common/config/db.php",
    "chars": 578,
    "preview": "<?php\n\n$MYSQL_PORT_3306_TCP_ADDR = env('MYSQL_PORT_3306_TCP_ADDR', 'localhost');\n$MYSQL_DB_NAME = env('MYSQL_INSTANCE_NA"
  },
  {
    "path": "environments/dev/common/config/main-local.php",
    "chars": 18,
    "preview": "<?php\nreturn [\n];\n"
  },
  {
    "path": "environments/dev/common/config/params-local.php",
    "chars": 18,
    "preview": "<?php\nreturn [\n];\n"
  },
  {
    "path": "environments/dev/console/config/main-local.php",
    "chars": 18,
    "preview": "<?php\nreturn [\n];\n"
  },
  {
    "path": "environments/dev/console/config/params-local.php",
    "chars": 18,
    "preview": "<?php\nreturn [\n];\n"
  },
  {
    "path": "environments/dev/frontend/config/main-local.php",
    "chars": 514,
    "preview": "<?php\n\n$config = [\n    'components' => [\n        'request' => [\n            // !!! insert a secret key in the following "
  },
  {
    "path": "environments/dev/frontend/config/params-local.php",
    "chars": 18,
    "preview": "<?php\nreturn [\n];\n"
  },
  {
    "path": "environments/dev/frontend/web/index-test.php",
    "chars": 647,
    "preview": "<?php\n\n// NOTE: Make sure this file is not accessible when deployed to production\nif (!in_array(@$_SERVER['REMOTE_ADDR']"
  },
  {
    "path": "environments/dev/frontend/web/index.php",
    "chars": 648,
    "preview": "<?php\ndefined('YII_DEBUG') or define('YII_DEBUG', true);\ndefined('YII_ENV') or define('YII_ENV', 'dev');\n\nrequire(__DIR_"
  },
  {
    "path": "environments/dev/yii",
    "chars": 1054,
    "preview": "#!/usr/bin/env php\n<?php\n/**\n * Yii console bootstrap file.\n *\n * @link http://www.yiiframework.com/\n * @copyright Copyr"
  },
  {
    "path": "environments/index.php",
    "chars": 1760,
    "preview": "<?php\n/**\n * The manifest of files that are local to specific environment.\n * This file returns a list of environments t"
  },
  {
    "path": "environments/prod/backend/config/main-local.php",
    "chars": 235,
    "preview": "<?php\nreturn [\n    'components' => [\n        'request' => [\n            // !!! insert a secret key in the following (if "
  },
  {
    "path": "environments/prod/backend/config/params-local.php",
    "chars": 18,
    "preview": "<?php\nreturn [\n];\n"
  },
  {
    "path": "environments/prod/backend/web/index.php",
    "chars": 650,
    "preview": "<?php\ndefined('YII_DEBUG') or define('YII_DEBUG', false);\ndefined('YII_ENV') or define('YII_ENV', 'prod');\n\nrequire(__DI"
  },
  {
    "path": "environments/prod/common/config/db.php",
    "chars": 578,
    "preview": "<?php\n\n$MYSQL_PORT_3306_TCP_ADDR = env('MYSQL_PORT_3306_TCP_ADDR', 'localhost');\n$MYSQL_DB_NAME = env('MYSQL_INSTANCE_NA"
  },
  {
    "path": "environments/prod/common/config/main-local.php",
    "chars": 18,
    "preview": "<?php\nreturn [\n];\n"
  },
  {
    "path": "environments/prod/common/config/params-local.php",
    "chars": 18,
    "preview": "<?php\nreturn [\n];\n"
  }
]

// ... and 209 more files (download for full content)

About this extraction

This page contains the full source code of the iiYii/getyii GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 409 files (555.5 KB), approximately 158.5k tokens, and a symbol index with 702 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!