sergmoro1/yii2-blog-tools
Composer 安装命令:
composer require sergmoro1/yii2-blog-tools
包简介
Blog tools. Posts, Authors, Users, Tags, Rubrics, Comments backend SBAdmin-panel management.
README 文档
README
Ordinary management system for posts. Can be used as a base for any app.
Advantages
- Posts, nested set rubrics, tags, users, authors;
- Comments management, update, reply;
- Imperavi redactor;
- Files & images uploading, photos chain for carousel slider;
- User registration with email confirmation or by network account;
- RBAC.
Installation
- Install package
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist sergmoro1/yii2-blog-tools
or add
"sergmoro1/yii2-blog-tools": "^1.1"
to the require section of your composer.json.
- Git init
git init
- Configuring migrations
Add information about migration folders with namespace to console\config\main.php in controllerMap section.
'controllerMap' => [ 'migrate' => [ 'class' => 'yii\console\controllers\MigrateController', 'migrationNamespaces' => [ 'sergmoro1\uploader\migrations', 'sergmoro1\lookup\migrations', 'sergmoro1\user\migrations', 'sergmoro1\blog\migrations', 'sergmoro1\comment\migrations', ], ], ],
- Run migrations
php yii migrate
php yii migrate --migrationPath=@vendor/notgosu/yii2-meta-tag-module/src/migrations
- Init blog
Copy predefined files to appropriate folders by batch file initblog.
To get it make a command in app directory.
cp ./vendor/sergmoro1/yii2-blog-tools/src/initblog ./
And run a batch file.
php initblog
Set the folder as writable to store the uploaded files.
chmod -R 777 ./frontend/web/files
Configuration
Set up in backend/config/main.php.
return [ 'defaultRoute' => '/blog/site/index', 'layoutPath' => '@vendor/sergmoro1/yii2-blog-tools/src/views/layouts', 'modules' => [ 'uploader' => ['class' => 'sergmoro1\uploader\Module'], ], 'components' => [ 'authManager' => [ 'class' => 'yii\rbac\PhpManager', 'defaultRoles' => ['commentator', 'author', 'admin'], 'itemFile' => __DIR__ . '/../../console/rbac/items.php', 'ruleFile' => __DIR__ . '/../../console/rbac/rules.php', ], 'user' => [ 'class' => 'yii\web\User', 'identityClass' => 'common\models\User', 'enableAutoLogin' => true, 'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true], ], 'urlManager' => [ 'class' => 'yii\web\UrlManager', 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => false, ], 'errorHandler' => [ 'errorAction' => '/blog/site/error', ], ], ];
Set up in common/config/main.php.
return [ 'language' => 'ru-RU', // 'en-US', 'bootstrap' => [ 'blog', 'comment', ], 'modules' => [ 'lookup' => ['class' => 'sergmoro1\lookup\Module'], 'blog' => ['class' => 'sergmoro1\blog\Module'], 'comment' => ['class' => 'sergmoro1\comment\Module'], 'user' => ['class' => 'sergmoro1\user\Module'], 'seo' => ['class' => 'notgosu\yii2\modules\metaTag\Module'], ], 'components' => [ 'authManager' => [ 'class' => 'yii\rbac\PhpManager', ], 'user' => [ 'class' => 'yii\web\User', ], 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'useFileTransport' => false, 'viewPath' => '@vendor/sergmoro1/yii2-user/src/mail', /* Definition of Yandex post office for your domain (example). 'transport' => [ 'class' => 'Swift_SmtpTransport', 'host' => 'smtp.yandex.ru', 'username' => 'admin@your-site.ru', 'password' => 'your-password', 'port' => '465', 'encryption' => 'ssl', ], */ ], 'i18n' => [ 'translations' => [ 'app*' => [ 'class' => 'yii\i18n\PhpMessageSource', 'basePath' => '@app/../messages', 'sourceLanguage' => 'en-US', 'fileMap' => [ 'app' => 'app.php', 'app/error' => 'error.php', ], ], 'metaTag' => [ 'class' => 'yii\i18n\PhpMessageSource', ], // sergmoro1/user/models/LoginForm is used in frontend/controllers/SiteController, so // it is not used within the Module then translation should be defined twice // here and in a sergmoro1/user/Module::registerTranslations() 'sergmoro1/user/*' => [ 'class' => 'yii\i18n\PhpMessageSource', 'sourceLanguage' => 'en-US', 'basePath' => '@vendor/sergmoro1/yii2-user/src/messages', 'fileMap' => [ 'sergmoro1/user/core' => 'core.php', ], ], ], ], ], ];
Set up in common/config/params-local.php.
return [ // localhost or real host 'frontend' => 'http://localhost', ];
Don't forget add .htaccess file to backend/web and frontend/web.
Start
Enter http://your-app/backend/web and Login.
Name: Admin
Password: 123456
sergmoro1/yii2-blog-tools 适用场景与选型建议
sergmoro1/yii2-blog-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 192 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 01 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「comment」 「blog」 「tag」 「yii2」 「rubric」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sergmoro1/yii2-blog-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sergmoro1/yii2-blog-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sergmoro1/yii2-blog-tools 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A simple tool for checking that your PHP classes and methods use PHPDocs (PHP DocBlocks Checker fork).
Laravel package for opinionated blog implementation
This Bundle provides threaded comment functionality for Symfony applications
The tag extension for the yii framework
Provides support for tag aware cache for Yii1 application
This package provides your visitors the possibility to comment stuff and discuss together.
统计信息
- 总下载量: 192
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-11