-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from yeskn-studio/2.0-dev
3.0 dev
- Loading branch information
Showing
42 changed files
with
1,608 additions
and
973 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# 安装手册 | ||
|
||
cd /path/to/webroot/path | ||
> 以下文档中 `webuser`均指运行的web server的用户,如果不用`sudo -u <webuser>`执行命令的话, | ||
> 会导致某些runtime目录的权限不对,导致网页打不开。 | ||
> | ||
> 在vmoex的根目录下,执行`php bin/console` 命令时建议都带上`sudo -u <webuser>` 前缀 | ||
cd /path/to/webroot/path | ||
git clone [email protected]:yeskn-studio/vmoex-framework.git && cd vmoex-framework | ||
|
||
**或者指定版本,比如:** | ||
|
||
git clone --branch v2.1.1 [email protected]:yeskn-studio/vmoex-framework.git && cd vmoex-framework | ||
|
||
**修改runtime目录权限** | ||
|
||
chown -R [webuser] var (各类日志缓存存放目录) | ||
|
@@ -17,39 +17,36 @@ | |
**修改配置文件** | ||
|
||
vim app/config/parameters.yml.dist | ||
|
||
请按照文件中的注释修改成自己服务器的配置。 | ||
|
||
**安装php依赖** | ||
|
||
composer install (期间会提示配置,检查无误可一路回车) | ||
composer install (期间会提示配置,检查无误可一路回车,可能耗时比较长,请耐心等待,如果失败,建议修改composer的源) | ||
|
||
**安装前端依赖** | ||
|
||
yarn install | ||
yarn install (耐心等待...) | ||
|
||
**创建数据库** | ||
|
||
php bin/console doctrine:database:create (如果你已经手动创建了数据库,可跳过) | ||
sudo -u [webuser] php bin/console doctrine:database:create (如果你已经手动创建了数据库,可跳过) | ||
|
||
**导入数据** | ||
|
||
php bin/console doctrine:database:init | ||
|
||
**载入翻译数据** | ||
|
||
php bin/console translation:persist | ||
sudo -u [webuser] php bin/console doctrine:database:init | ||
|
||
**修改管理员密码** | ||
|
||
php bin/console change-password -u admin -p [password] | ||
sudo -u [webuser] php bin/console change-password -u admin -p [password] | ||
|
||
**清理缓存** | ||
|
||
chown -R [webuser] var (上面已经执行过,这里再执行一次) | ||
sudo -u [webuser] php bin/console cache:clear --env=dev | ||
|
||
**创建静态资源文件** | ||
|
||
php bin/console assetic:dump --env=dev | ||
sudo -u [webuser] php bin/console assetic:dump --env=dev | ||
|
||
**启动websocket** | ||
|
||
|
@@ -99,14 +96,13 @@ server { | |
|
||
**清理prod模式下的缓存** | ||
|
||
chown -R [webuser] var | ||
sudo -u [webuser] php bin/console cache:clear --env=prod | ||
|
||
**生成prod模式下的静态资源文件** | ||
|
||
php bin/console assetic:dump --env=prod | ||
sudo -u [webuser] php bin/console assetic:dump --env=prod | ||
|
||
## 注意!! | ||
|
||
app/config/parameters.yml.dist并不是真正生效的配置文件,真正生效的是自动生成的app/config/parameters.yml, | ||
需修改配置时请修改此文件,修改完后,需要重新清理缓存或者生成静态资源文件。 | ||
**app/config/parameters.yml.dist**并不是真正生效的配置文件,真正生效的是自动生成的**app/config/parameters.yml**, | ||
需修改配置时请修改此文件,修改完后,**需要重新清理缓存**或者生成静态资源文件。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# UPGRADE FROM 2.X to 3.0 | ||
|
||
此文档用于提供向2.x升级到3.0的向导。 | ||
|
||
|
||
> 以下文档中 `webuser`均指运行的web server的用户,如果不用`sudo -u <webuser>`执行命令的话, | ||
> 会导致某些runtime目录的权限不对,导致网页打不开。 | ||
> | ||
> 在vmoex的根目录下,执行`php bin/console` 命令时建议都带上`sudo -u <webuser>` 前缀 | ||
## 清理缓存 | ||
|
||
任何时候,都应当清理缓存: | ||
|
||
```bash | ||
sudo -u <webuser> php bin/console cache:clear --env=prod | ||
``` | ||
|
||
> 大多数情况下,如果你遇到了问题,不妨执行以上命令。 | ||
## 拉取代码 | ||
|
||
如果你修改或者增加过翻译词条,请直接看如下的**翻译文件**,如果没有,直接执行如下命令即可: | ||
|
||
``` | ||
git pull origin master | ||
``` | ||
|
||
## 翻译文件 | ||
|
||
> 如果你修改过翻译文件,用 `git statsu`命令会发现 `app/Resources/translations`目录下有修改的文件,这时`git pull`可能会失败, | ||
这时,需要使用 `git stash`命令暂存起来,再执行`git pull origin master`,然后执行`git stash pop`将暂存的修改拿出来合并到新增的词条中。 | ||
|
||
将新增的翻译载入到数据库中: | ||
|
||
``` | ||
sudo -u <webuser> php bin/console translation:persist | ||
``` | ||
|
||
## 前端更新 | ||
|
||
由于bower已经不再维护了,因此vmoex也由bower切换到目前比较流行的前端包管理工具**yarn**,安装yarn: | ||
|
||
``` | ||
npm install yarn -g | ||
``` | ||
|
||
yarn的使用方式也类似: | ||
|
||
```bash | ||
yarn install | ||
``` | ||
|
||
即可。 | ||
|
||
## 生成资源文件 | ||
|
||
``` | ||
sudo -u <webuser> php bin/console assetic:dump --env=prod | ||
``` | ||
|
||
|
||
## 数据库结构更新 | ||
|
||
由于vmoex使用了redis的查询缓存,因此需要先执行如下命令去掉缓存: | ||
|
||
```bash | ||
sudo -u <webuser> php bin/console doctrine:cache:clear-metadata --env=prod | ||
``` | ||
|
||
再更新数据库结构: | ||
|
||
```bash | ||
php bin/console doctrine:schema:update --dump-sql --force --env=prod | ||
``` | ||
|
||
以上命令在更新数据库的同时也会显示执行了哪些sql。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% block form_row %} | ||
{% filter spaceless %} | ||
<div class="form-group" style="width: 33.3%"> | ||
{{ form_label(form, '', {label_attr: {class: 'col-sm-3'}}) }} | ||
<div class="col-sm-9"> | ||
{{ form_widget(form) }} | ||
{% if attr['help'] is defined %} | ||
<span class="help-block small-font">{{ attr['help'] }}</span> | ||
{% endif %} | ||
</div> | ||
{{ form_errors(form) }} | ||
</div> | ||
{% endfilter %} | ||
{% endblock form_row %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.