Git Product home page Git Product logo

getyii's Introduction

GetYii

Latest Stable Version Total Downloads Latest Unstable Version License

community for Yii2

说明

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

全新的 GetYii 只专注于社区,现在基本功能已经 OK 了,以后我们会不断完善的。分享我们的 trello 项目管理地址

项目搭建

原始安装方法(推荐)

1、首先你要安装 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,然后你需要手动去新建一个数据库,比方说新建 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,即为前台管理员,目前可以给帖子加精华,不能登录后台。
  2. 把 user 表中的某用户值 role 字段值改为30,即为超级管理员,可登录后台。

文档和手册

  1. Yii2手册
  2. 中文 Composer 手册

安装遇到问题怎么办?

建议在官网的社区版块新手提问下面提问,我会抽空亲自回答。请最大可能的把问题描述清楚,以免浪费我们彼此的时间。

交流群

  • Yii2 **交流群:343188481
  • Get√Yii 开发者群:321493381

捐赠

微信支付 支付宝支付

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

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

捐赠人 金额 时间 说明
张** 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

感谢

  • 感谢 Ruby-China 的开源代码。
  • 感谢 PHPHub 的开源代码。
  • 感谢 huajuan 的开源代码。
  • 最后再感谢一下女朋友的支持 <(▰˘◡˘▰)>。

PS:

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

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

getyii's People

Contributors

104260033 avatar asjmtz avatar dcb9 avatar dependabot[bot] avatar fancyecommerce avatar forecho avatar grutabow avatar gugoan avatar icehillsx avatar lichunqiang avatar onyony avatar qiansen1386 avatar ruyi1024 avatar successgo avatar zhenghaicaidd01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

getyii's Issues

3 Nov pakage installation error

after import database and click a topic show the following error :
PHP Strict Warning – yii\base\ErrorException

Non-static method frontend\modules\topic\models\Topic::findModel() should not be called statically

优化建议:点击图片,图片的放大功能

想法来源:

看技术贴子时,如果上传的图片很较大,放在一个较小的区块里,图片内的内容展示看得不清楚。

添加一个放大功能或许不错。

通常我是 Open image in new tab

本地安装生成测试数据报错

生成测试数据报错提示:
*** applying m190908_055507_init_data
是否生成测试问题数据? (yes|no) [yes]:
[> ] 0% (0/100) ETA: n/a > execute SQL: INSERT INTO {{%merit_template}} (id, type, title, unique_id, method, event, action_type, rule_key, rule_value, increment, status, created_at, updated_at) VALUES
(1, 1, '登录', 'site/login', 2, 0, 2, 1, 1, 2, 1, 1458657160, 1458823425),
(2, 1, '发帖', 'topic/default/create', 2, 0, 2, 0, NULL, 6, 1, 1458657218, 1458657218),
(3, 1, '回复', 'topic/comment/create', 2, 0, 2, 0, NULL, 4, 1, 1458657251, 1458657251),
(4, 1, '发动弹', 'tweet/default/create', 2, 0, 2, 0, NULL, 4, 1, 1458657296, 1468647701);
... done (time: 0.001s)
Exception 'yii\base\InvalidConfigException' with message 'Please configure UrlManager::hostInfo correctly as you are running a console application.'

发现一个bug

namespace frontend\modules\topic\controllers;
=>DefaultController=>actionView
//登录才能访问的节点内容
if (\Yii::$app->user->isGuest && in_array($model->category->alias, params('loginNode'))) {
$this->flash('查看本主题需要登录!', 'warning');
//return $this->redirect('/login'); 应该改为return $this->redirect(['/login']);
}

不然在一些没做url rewrite的服务器上会出404.

采用 basic 结构的模板,打包 vendor 发布,增加安装程序

目前 getyii 使用 advanced 的模板,区分 backend frontend,需要为前后台指定不同域名,考虑到虚拟主机以及初级用户的使用习惯,如果能使用 basic 模板的代码结构,做到直接将所有代码上传到服务器web根目录就可以运行。针对此场景,后期可以考虑出打包的版本直接包含 vendor 目录,第一次打开站点出现安装提示,在浏览器界面直接安装。

增加可选的富文本编辑器

出了 coding 圈,学术圈,大部分人是不会使用 markdown 的,getyii 默认只有 markdown 编辑器,必然使得程序的用户面会比较窄。

用户头像设置的问题

用户自定义头像

如果用户将上传文件的后缀名修改为jpg或者png,会通过验证上传成功,这样会导致所有用到这个用户头像的地方出现服务器内部错误。

发现一个bug

namespace frontend\modules\topic\controllers;
=>DefaultController=>actionView
//登录才能访问的节点内容
if (\Yii::$app->user->isGuest && in_array($model->category->alias, params('loginNode'))) {
$this->flash('查看本主题需要登录!', 'warning');
//return $this->redirect('/login'); 应该改为return $this->redirect(['/login']);
}

不然在一些没做url rewrite的服务器上会出404.

安装完成之后访问首页会出现 RuntimeException

看错误是 assetsAutoCompress 这个组件在压缩的过程中抛出了异常。
RuntimeException
Unclosed string at position: 305386

vendor/tedivm/jshrink/src/JShrink/Minifier.php 第 476 行
throw new \RuntimeException('Unclosed string at position: ' . $startpos );

@username 功能失效

@username 位于最后一行,且没有多余的空格,这个功能是失效的。我想这应该可以算是 bug。

edited:
经过一番测试:在行尾和最后的末尾都是失效的。

编辑器单独出来写成一个 widget

发布和评论都使用一个编辑器 widget

  • 上传图片功能
  • @ 某人功能
  • : emoji 标签功能
  • 考虑不使用 AceEditor
  • 单独写成 Widget,发帖、回复和动弹统一使用

composer update warning

Deprecation warning: require.bower-asset/PACE is invalid, it should not contain uppercase characters. Please use bower-asset/pace instead. Make sure you fix this as Composer 2.0 will error.
Deprecation warning: require.bower-asset/At.js is invalid, it should not contain uppercase characters. Please use bower-asset/at.js instead. Make sure you fix this as Composer 2.0 will error.

未定义$nodes

测试时报错:
frontend\widgets\Node.php 第28行未定义$nodes
解决方法:
在第25行上面定义一个空数组
$nodes=[];

php yii install 最后一步生成测试数据的时候报错

*** applying m190908_055507_init_data
是否生成测试问题数据? (yes|no) [yes]:
[>                                                                                                                ] 0% (0/100) ETA: n/a    > execute SQL: INSERT INTO {{%merit_template}} (`id`, `type`, `title`, `unique_id`, `method`, `event`, `action_type`, `rule_key`, `rule_value`, `increment`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, '登录', 'site/login', 2, 0, 2, 1, 1, 2, 1, 1458657160, 1458823425),
(2, 1, '发帖', 'topic/default/create', 2, 0, 2, 0, NULL, 6, 1, 1458657218, 1458657218),
(3, 1, '回复', 'topic/comment/create', 2, 0, 2, 0, NULL, 4, 1, 1458657251, 1458657251),
(4, 1, '发动弹', 'tweet/default/create', 2, 0, 2, 0, NULL, 4, 1, 1458657296, 1468647701);
 ... done (time: 0.001s)
Exception 'yii\base\InvalidConfigException' with message 'Please configure UrlManager::hostInfo correctly as you are running a console application.'

in /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/web/UrlManager.php:633

Stack trace:
#0 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/helpers/BaseUrl.php(228): yii\web\UrlManager->getHostInfo()
#1 /data/coding/php/do-test/getyii/frontend/modules/topic/models/Topic.php(128): yii\helpers\BaseUrl::to('/member/admin', true)
#2 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/db/ActiveRecord.php(596): frontend\modules\topic\models\Topic->beforeSave(true)
#3 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/db/ActiveRecord.php(566): yii\db\ActiveRecord->insertInternal(NULL)
#4 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/db/BaseActiveRecord.php(678): yii\db\ActiveRecord->insert(true, NULL)
#5 /data/coding/php/do-test/getyii/console/migrations/m190908_055507_init_data.php(71): yii\db\BaseActiveRecord->save()
#6 /data/coding/php/do-test/getyii/console/migrations/m190908_055507_init_data.php(17): m190908_055507_init_data->generateFakeData(64)
#7 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(725): m190908_055507_init_data->up()
#8 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(199): yii\console\controllers\BaseMigrateController->migrateUp('m190908_055507_...')
#9 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#10 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#11 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#12 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('up', Array)
#13 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('up', Array)
#14 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/up', Array)
#15 /data/coding/php/do-test/getyii/console/controllers/InstallController.php(163): yii\console\Application->runAction('migrate/up', Array)
#16 [internal function]: console\controllers\InstallController->actionMigrate()
#17 /data/coding/php/do-test/getyii/console/controllers/InstallController.php(55): call_user_func_array(Array, Array)
#18 /data/coding/php/do-test/getyii/console/controllers/InstallController.php(34): console\controllers\InstallController->runSteps(Array)
#19 [internal function]: console\controllers\InstallController->actionIndex()
#20 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#21 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#22 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#23 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('', Array)
#24 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('install', Array)
#25 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('install', Array)
#26 /data/coding/php/do-test/getyii/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#27 /data/coding/php/do-test/getyii/yii(31): yii\base\Application->run()
#28 {main}

composer install 出现问题

E:\project_me\php\getyii>composer install

[RuntimeException]
require.bower-asset/PACE is invalid, it should not contain uppercase characters. Please use bower-asset/pace instead.

创建一个 Bot

  • 管理员操作话题(比如:加精华)的时候 Bot 自动插入一条记录

【求助】composet install exceptin

问题在于 unson86/yii2-setting

[RuntimeException]
  Failed to clone https://github.com/funson86/yii2-setting.git via https, ssh protocols, aborting.

  - https://github.com/funson86/yii2-setting.git
    Cloning into '/path/to/getyii/vendor/funson86/yii2-setting'...
    remote: Invalid username or password.
    fatal: Authentication failed for 'https://github.com/funson86/yii2-setting.git/'

  - [email protected]:funson86/yii2-setting.git
    Cloning into '/path/to/getyii/vendor/funson86/yii2-setting'...
    ERROR: Repository not found.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.