iiyii / getyii Goto Github PK
View Code? Open in Web Editor NEWYii2 community 请访问
Home Page: http://www.getyii.com/
License: Other
Yii2 community 请访问
Home Page: http://www.getyii.com/
License: Other
如题,不知是特性还是Bug呢?
简单研究了下,在贴子数据表存储了回复人当时的用户名信息。倘若用户名修改过,那么显示就有问题了。
修改评论界面,小标题没用做nls处理:如
Update Post Comment: Yii2 如何实现 RESTful?
Update Post Comment不是中文
我能参与修复吗?
看错误是 assetsAutoCompress 这个组件在压缩的过程中抛出了异常。
RuntimeException
Unclosed string at position: 305386
vendor/tedivm/jshrink/src/JShrink/Minifier.php 第 476 行
throw new \RuntimeException('Unclosed string at position: ' . $startpos );
目前 getyii 使用 advanced 的模板,区分 backend frontend,需要为前后台指定不同域名,考虑到虚拟主机以及初级用户的使用习惯,如果能使用 basic 模板的代码结构,做到直接将所有代码上传到服务器web根目录就可以运行。针对此场景,后期可以考虑出打包的版本直接包含 vendor 目录,第一次打开站点出现安装提示,在浏览器界面直接安装。
看安装提示说数据库表格可以设置前缀,然后就设置了tbl
,不过在源代码中发现了并不支持前缀的。
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.
发布和评论都使用一个编辑器 widget
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.
首页请求数据就快1秒了
问题在于 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.
衍生出来,如果未登录状态访问主页 是否限定 不增加访问量
还望多多指教!
http://www.dba-china.com/ 这是个博彩网站
在发布贴子时,如果勾选了 “ 注明版权信息(原创文章欢迎使用)”,生成的用户链接被硬编码成了指向 getyii.com 的用户链接。
修改评论文章评论统计数量也会 +1
"common/components/GlobalFunctions.php"
测试时报错:
frontend\widgets\Node.php 第28行未定义$nodes
解决方法:
在第25行上面定义一个空数组
$nodes=[];
Warning: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct
提示语成功,实际未成功,仍然是旧邮箱。
我想这可能是 Bug,也可能是一个特性吧。
生成测试数据报错提示:
*** 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.'
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.
https://github.com/yiisoft/yii2/blob/master/docs/guide/security-best-practices.md#avoiding-xss
使用 \yii\helpers\HtmlPurifier
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.
当 @username
位于最后一行,且没有多余的空格,这个功能是失效的。我想这应该可以算是 bug。
edited:
经过一番测试:在行尾和最后的末尾都是失效的。
如果用户将上传文件的后缀名修改为jpg或者png,会通过验证上传成功,这样会导致所有用到这个用户头像的地方出现服务器内部错误。
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
刚刚登陆,但是主页还是显示15天前。
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 42 installs, 0 updates, 0 removals
模版中的 isset($nodes)
判断不严谨,到了 foreach
出错了。
原因主要还是 $nodes
的值为 false
。
*** 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}
出了 coding 圈,学术圈,大部分人是不会使用 markdown 的,getyii 默认只有 markdown 编辑器,必然使得程序的用户面会比较窄。
为了新加入的代码不影响原有功能,请考虑加上单元测试或 codeception
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.