yiiframework.com
1.0.0
該項目包含yiiframework.com網站的源代碼。
如果您想貢獻,請使用問題跟踪器與我們聯繫。
安裝Docker和Docker組成。
docker-compose build
docker-compose up
該網站將在http:// localhost:81。
您可以在源目錄的根部使用腳本run_pageres.sh來生成屏幕截圖。
如果需要,請調整本地配置文件:
config/console-local.php 。config/params-local.php 。config/web-local.php 。生成個人github令牌(來自您的github個人資料設置部分)。將其粘貼到稱為github.token (一行,無線破壞)的data目錄(@app/data)中的文件中。
繼續以下命令:
# run migrations
./yii migrate
# fill RBAC
./yii rbac/up
# build contributors page (this may take some time as it downloads a lot of user avatars from github)
./yii contributors/generate
# If you're on Windows you have to manually symlink or copy
# %appdata%/npm/node_modules/browser-sync to your app's node_modules
# The next step is for building the API documentation and the Guide files.
# It is optional for the site to be working but you will have no API docs and Guide.
# This step includes cloning the Yii 1 and Yii 2 repositories and a lot of computation,
# so you might want to skip it on the first install.
#
# This also requires an instance of elasticsearch to be configured and running
# (if you do not have it, it will still run, but the site search will not work).
# It also assumes you have pdflatex installed for building PDF guide docs.
#
# You may also build only parts of the docs, run make help for the available commands.
make docs
# If you are using Docker image, you need to additionally pass VENDOR_DIR:
make docs VENDOR_DIR= $VENDOR_DIR
# Yii 1.0 API docs generation. They are already included in VCS. Run this only if layout has changed.
docker build -f Dockerfile.yii-1.0 -t yiiframeworkcom-yii-1.0 .
docker run -it -v $PWD /data/api-1.0:/code/data/api-1.0 yiiframeworkcom-yii-1.0
# populate the search index by running
./yii search/rebuild
/code/vendor/bin/apidoc guide data/yii-2.0/docs/guide-ru data/docs-offline/yii-docs-2.0-ru --interactive=0
./yii guide " 2.0 " --interactive=0對於從舊網站導入數據,需要以下步驟:
./yii import命令導入數據./yii badge/rebuild來重建用戶徽章./yii user/ranking 。如果您沒有這些數據,則可以使用虛擬內容:
./yii fake-data 。您可以多次運行它以生成更多數據。./yii badge/rebuild來重建用戶徽章。./yii user/ranking 。為用戶分配額外的權限使用./yii rbac/assign 。
需要設置以下命令以定期運行:
| 命令 | 間隔 | 目的 |
|---|---|---|
| yii站點地圖/生成 | 日常的 | 再生sitemap.xml |
| yii貢獻者/生成 | 每週 | 更新團隊頁面上的貢獻者列表 |
| YII徽章/更新 | 小時 | 更新Badge_queue用戶的徽章 |
| yii cron/update-cackagist | 小時 | 更新Packagist擴展數據 |
| yii用戶/排名 | 日常的 | 更新用戶排名 |
| yii github-progress | 小時 | 更新GitHub進度數據 |
此外, queue/listen應作為守護程序或queue/run作為cronjob運行。
本節涵蓋了在服務器上部署的註釋,您可能不需要Dev Env。 OS被認為是Debian的“ Bullseye”。
apt-get install texlive-full python3-pygments git nodejs make貢獻者列表和頭像縮略圖由控制台命令生成:
./yii contributors/generate它將通過API連接到GitHub,並獲取貢獻者的列表,生成data/contributors.json data/avatars中用戶頭像的json和縮略圖圖像,並最終調用Gulp來生成Sprite Image和SASS代碼。
最好偶爾運行一個cron工作是一個好主意 - 也許每月一次。
commands/ contains console commands (controllers)
config/ contains application configurations
controllers/ contains Web controller classes
data/ contains important data generated by different commands
env/ contains environment-dependent files
assets/
src/
fonts/ contains fonts
scss/ contains Sass source files
js/ contains JS source files
mail/ contains view files for e-mails
models/ contains model classes
node_modules/ contains installed NPM packages
runtime/ contains files generated during runtime
scripts/ contains shell scripts
vendor/ contains dependent 3rd-party packages
views/ contains view files for the Web application
web/ contains the entry script and Web resources
gulp觀察視圖,SASS和JS文件更改,並自動構建目標CSS/JS文件。該命令還將啟動連接到瀏覽器的瀏覽器窗口。gulp build從源SASS/JS文件手動重建目標CSS/JS文件。gulp watchproduction標誌: gulp build --production或運行npm run buildassets/src/scss下放置,並在assets/src/scss/all.scss中列出。GuideController具有名為_guide.scss的SASS文件。all.scss外,所有SASS源文件都應在名稱中具有領先的下劃線。 SASS將忽略以下劃線開頭的文件,以便僅生產一個CSS文件(ALL.CSS)。all.scss 。assets/src/js下,並在config.yml中列出。GuideController具有一個名為guide.js的JS文件。