Skip to content

Commit 17813eb

Browse files
author
Jaggle
authored
Merge pull request #13 from yeskn-studio/2.0-dev
3.0 dev
2 parents 74b7678 + f12a918 commit 17813eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1608
-973
lines changed

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

INSTALL.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# 安装手册
22

3-
cd /path/to/webroot/path
3+
> 以下文档中 `webuser`均指运行的web server的用户,如果不用`sudo -u <webuser>`执行命令的话,
4+
> 会导致某些runtime目录的权限不对,导致网页打不开。
5+
>
6+
> 在vmoex的根目录下,执行`php bin/console` 命令时建议都带上`sudo -u <webuser>` 前缀
47
8+
cd /path/to/webroot/path
59
git clone git@github.com:yeskn-studio/vmoex-framework.git && cd vmoex-framework
610

7-
**或者指定版本,比如:**
8-
9-
git clone --branch v2.1.1 git@github.com:yeskn-studio/vmoex-framework.git && cd vmoex-framework
10-
1111
**修改runtime目录权限**
1212

1313
chown -R [webuser] var (各类日志缓存存放目录)
@@ -17,39 +17,36 @@
1717
**修改配置文件**
1818

1919
vim app/config/parameters.yml.dist
20+
21+
请按照文件中的注释修改成自己服务器的配置。
2022

2123
**安装php依赖**
2224

23-
composer install (期间会提示配置,检查无误可一路回车)
25+
composer install (期间会提示配置,检查无误可一路回车,可能耗时比较长,请耐心等待,如果失败,建议修改composer的源
2426

2527
**安装前端依赖**
2628

27-
yarn install
29+
yarn install (耐心等待...)
2830

2931
**创建数据库**
3032

31-
php bin/console doctrine:database:create (如果你已经手动创建了数据库,可跳过)
33+
sudo -u [webuser] php bin/console doctrine:database:create (如果你已经手动创建了数据库,可跳过)
3234

3335
**导入数据**
3436

35-
php bin/console doctrine:database:init
36-
37-
**载入翻译数据**
38-
39-
php bin/console translation:persist
37+
sudo -u [webuser] php bin/console doctrine:database:init
4038

4139
**修改管理员密码**
4240

43-
php bin/console change-password -u admin -p [password]
41+
sudo -u [webuser] php bin/console change-password -u admin -p [password]
4442

4543
**清理缓存**
4644

47-
chown -R [webuser] var (上面已经执行过,这里再执行一次)
4845
sudo -u [webuser] php bin/console cache:clear --env=dev
4946

5047
**创建静态资源文件**
5148

52-
php bin/console assetic:dump --env=dev
49+
sudo -u [webuser] php bin/console assetic:dump --env=dev
5350

5451
**启动websocket**
5552

@@ -99,14 +96,13 @@ server {
9996

10097
**清理prod模式下的缓存**
10198

102-
chown -R [webuser] var
10399
sudo -u [webuser] php bin/console cache:clear --env=prod
104100

105101
**生成prod模式下的静态资源文件**
106102

107-
php bin/console assetic:dump --env=prod
103+
sudo -u [webuser] php bin/console assetic:dump --env=prod
108104

109105
## 注意!!
110106

111-
app/config/parameters.yml.dist并不是真正生效的配置文件,真正生效的是自动生成的app/config/parameters.yml,
112-
需修改配置时请修改此文件,修改完后,需要重新清理缓存或者生成静态资源文件
107+
**app/config/parameters.yml.dist**并不是真正生效的配置文件,真正生效的是自动生成的**app/config/parameters.yml**
108+
需修改配置时请修改此文件,修改完后,**需要重新清理缓存**或者生成静态资源文件

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
<a href="LICENSE" target="_blank">
44
<img alt="Software License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square">
55
</a>
6-
<a href="https://travis-ci.org/yeskn-studio/vmoex-framework">
7-
<img src="https://travis-ci.org/yeskn-studio/vmoex-framework.svg?branch=master">
8-
</a>
9-
<a href="https://codecov.io/gh/yeskn-studio/vmoex-framework">
10-
<img src="https://codecov.io/gh/yeskn-studio/vmoex-framework/branch/master/graph/badge.svg" />
11-
</a>
126
</p>
137

148
<p align="center">

UPGRADE-3.0.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# UPGRADE FROM 2.X to 3.0
2+
3+
此文档用于提供向2.x升级到3.0的向导。
4+
5+
6+
> 以下文档中 `webuser`均指运行的web server的用户,如果不用`sudo -u <webuser>`执行命令的话,
7+
> 会导致某些runtime目录的权限不对,导致网页打不开。
8+
>
9+
> 在vmoex的根目录下,执行`php bin/console` 命令时建议都带上`sudo -u <webuser>` 前缀
10+
11+
## 清理缓存
12+
13+
任何时候,都应当清理缓存:
14+
15+
```bash
16+
sudo -u <webuser> php bin/console cache:clear --env=prod
17+
```
18+
19+
> 大多数情况下,如果你遇到了问题,不妨执行以上命令。
20+
21+
## 拉取代码
22+
23+
如果你修改或者增加过翻译词条,请直接看如下的**翻译文件**,如果没有,直接执行如下命令即可:
24+
25+
```
26+
git pull origin master
27+
```
28+
29+
## 翻译文件
30+
31+
> 如果你修改过翻译文件,用 `git statsu`命令会发现 `app/Resources/translations`目录下有修改的文件,这时`git pull`可能会失败,
32+
这时,需要使用 `git stash`命令暂存起来,再执行`git pull origin master`,然后执行`git stash pop`将暂存的修改拿出来合并到新增的词条中。
33+
34+
将新增的翻译载入到数据库中:
35+
36+
```
37+
sudo -u <webuser> php bin/console translation:persist
38+
```
39+
40+
## 前端更新
41+
42+
由于bower已经不再维护了,因此vmoex也由bower切换到目前比较流行的前端包管理工具**yarn**,安装yarn:
43+
44+
```
45+
npm install yarn -g
46+
```
47+
48+
yarn的使用方式也类似:
49+
50+
```bash
51+
yarn install
52+
```
53+
54+
即可。
55+
56+
## 生成资源文件
57+
58+
```
59+
sudo -u <webuser> php bin/console assetic:dump --env=prod
60+
```
61+
62+
63+
## 数据库结构更新
64+
65+
由于vmoex使用了redis的查询缓存,因此需要先执行如下命令去掉缓存:
66+
67+
```bash
68+
sudo -u <webuser> php bin/console doctrine:cache:clear-metadata --env=prod
69+
```
70+
71+
再更新数据库结构:
72+
73+
```bash
74+
php bin/console doctrine:schema:update --dump-sql --force --env=prod
75+
```
76+
77+
以上命令在更新数据库的同时也会显示执行了哪些sql。
78+
79+

app/AppKernel.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public function getCacheDir()
4848
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
4949
}
5050

51+
protected function getKernelParameters()
52+
{
53+
$params = parent::getKernelParameters();
54+
$params['kernel.config_dir'] = $this->getRootDir() . '/config';
55+
return $params;
56+
}
57+
5158
public function getLogDir()
5259
{
5360
return dirname(__DIR__).'/var/logs';

app/Resources/translations/messages.en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,4 @@ no_enough_gold: 'Shortage of gold coins'
183183
comment_not_exist: 'Comments do not exist'
184184
cant_modify_current_user_in_admin: 'cant modify current user in admin'
185185
hours: h
186+
access_denied: 'access denied'

app/Resources/translations/messages.jp.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,4 @@ no_enough_gold: 金貨が足りない
183183
comment_not_exist: コメントは存在しません
184184
cant_modify_current_user_in_admin: null
185185
hours: 時間
186+
access_denied: 访问被拒绝

app/Resources/translations/messages.zh_CN.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,4 @@ cant_modify_current_user_in_admin: 不能在管理端修改当前个人信息,
185185
user_not_exist: 用户不存在
186186
locale_invalid: 非法的语言
187187
hours: 小时
188+
access_denied: 访问被拒绝

app/Resources/translations/messages.zh_TW.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,4 @@ no_enough_gold: 金幣不足
183183
comment_not_exist: 評論不存在
184184
cant_modify_current_user_in_admin: null
185185
hours: 小時
186+
access_denied: 访问被拒绝

app/Resources/views/form/image-input-filed-type.html.twig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
</div>
1010
{% endif %}
1111
{{ form_widget(form, {attr: {class: 'form-control'}}) }}
12-
{% if attr['help'] is defined %}
13-
<span class="help-block small-font">{{ attr['help'] }}</span>
14-
{% endif %}
1512
{{ form_errors(form) }}
1613
{% endfilter %}
1714
{% endblock image_input_widget %}

0 commit comments

Comments
 (0)