yiiframework.com website source code

Yii 官方网站源代码。「Source code for official Yii website」

Github星跟蹤圖

This project contains the source code for the yiiframework.com Website.

If you want to contribute please get in touch with us using the issue tracker.

Build Status

INSTALLATION

Before you start, make sure you have installed composer and Node.js.
If you are on Debian or Ubuntu you might also want to install the libnotify-bin package,
which is used by Gulp to inform you about its status.

If you intend to use the Pageres client to generate screen shots for testing purposes, you need to install the pageres.cli tool globally:

npm install --global pageres-cli

And then you can use the script run_pageres.sh at the root of the source directory to generate screen shots.

Installation instructions

# clone the project
git clone https://github.com/yiisoft-contrib/yiiframework.com.git

cd yiiframework.com

# install the dependent composer packages
composer install

# install gulp globally if you haven't done so before
yarn global add gulp-cli

# install dependent NPM modules
yarn install

# initialize the application, choose "development"
./init

Configure database connection in config/params-local.php. You may copy-paste and adjust components.db from
config/params.php. Make sure to configure the following properties:

'api.baseUrl' => '/doc/api',
'guide.baseUrl' => '/doc/guide',
'components.db' => [
    // copy from params.php and adjust to your environment
],
'components.elasticsearch' => [
    // copy from params.php and adjust to your environment
],
// only if you want to test github auth:
'authclients' => [
    'github' => [
        'class' => 'yii\authclient\clients\GitHub',
        'clientId' => '...', // register an oauth app on github and enter details here
        'clientSecret' => '...',
        'scope' => 'user:email',
    ],
],
'siteAbsoluteUrl' => 'http://yiiframework.local',

/**
 * @see https://apps.twitter.com/app/new
 *
 * After creating an app you need to fill accessToken and accessTokenSecret:
 *
 * Open App -> Keys and Access Tokens -> You Access Token -> Create my access token
 */
'twitter.consumerKey' => '',
'twitter.consumerSecret' => '',
'twitter.accessToken' => '',
'twitter.accessTokenSecret' => ''

Continue with the following commands:

# 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

# build js/css files
gulp build

# 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

# populate the search index by running
./yii search/rebuild

Web Server Setup

Define a host name yiiframework.local that points to localhost.

Define a virtual host yiiframework.local which uses yiiframework.com/web as its document root.

If you are using Apache, add the following configuration for the yiiframework.com/web folder to hide the
entry script:

RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php

Data Import

For importing data from the old website, the following steps are necessary:

  • import data by running ./yii import command
  • rebuild user badges by running ./yii badge/rebuild
  • calculate user ranking ./yii user/ranking.

If you don't have that data, you can work with dummy content:

  • To fill the database with dummy content, you may run the command ./yii fake-data.
    You may run it multiple times to generate more data.
  • rebuild user badges by running ./yii badge/rebuild.
  • calculate user ranking ./yii user/ranking.

To assign users extra permissions use ./yii rbac/assign.

Cron jobs

The following commands need to be set up to run on a regular basis:

主要指標

概覽
名稱與所有者yiisoft-contrib/yiiframework.com
主編程語言HTML
編程語言JavaScript (語言數: 9)
平台BSD, Linux, Mac, Solaris, Windows
許可證Other
所有者活动
創建於2014-11-07 16:47:33
推送於2025-05-28 21:01:08
最后一次提交2025-05-29 00:01:08
發布數0
用户参与
星數263
關注者數26
派生數104
提交數1.9k
已啟用問題?
問題數609
打開的問題數100
拉請求數449
打開的拉請求數1
關閉的拉請求數113
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?