Skip to content

Commit

Permalink
add command to checkout version: ./yii walle
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuiyong committed Jan 17, 2016
1 parent 86d2bf1 commit bb7f7a6
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 41 deletions.
30 changes: 14 additions & 16 deletions config/console.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
<?php
// Merged web + local configuration is available in $web
$params = [
'version' => 'v1.0.0',
'buildTime' => '2016-01-16',
];
return [
'id' => 'console',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'id' => 'console',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'app\console',
'extensions' => $web['extensions'],
'components' => [
'db' => $web['components']['db'],
'mongodb' => [
'class' => 'yii\mongodb\Connection',
'dsn' => 'mongodb://localhost:27017/local',
],
'log' => [
'extensions' => $web['extensions'],
'defaultRoute' => 'walle/index',
'components' => [
'db' => $web['components']['db'],
'log' => [
'targets' => [
[
'class' => 'yii\log\FileTarget',
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'example' => [
'class' => 'console\controllers\ExampleController',
],
],
'params' => $web['params'],
'params' => array_merge($web['params'], $params),
];
18 changes: 13 additions & 5 deletions console/RunController.php → console/WalleController.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<?php

/* *****************************************************************
* @Author: wushuiyong
* @Created Time : 日 1/17 09:22:10 2016
*
* @File Name: WalleController.php
* @Description: walle脚手架
* *****************************************************************/

namespace app\console;

use yii;
use yii\console\Controller;
use yii\helpers\Console;

/**
* run controller
*/
class RunController extends Controller {
class WalleController extends Controller {

public $writablePaths = [
'@app/runtime',
Expand All @@ -20,6 +24,10 @@ class RunController extends Controller {
'@app/yii',
];

public function actionIndex() {
echo sprintf("walle-web %s (built: %s)\nCopyright (c) 2015-2016 The walle-web Group.\nGet Help from [email protected]. Enjoy It.\n",
Yii::$app->params['version'], Yii::$app->params['buildTime']);
}
/**
* init walle 初始化项目
*
Expand Down
28 changes: 14 additions & 14 deletions docs/README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ git clone [email protected]:meolu/walle-web.git
cd walle-web
vi config/web.php # 设置mysql连接
composer install # 如果缺少bower-asset的话, 先安装:composer global require "fxp/composer-asset-plugin:*"
./yii run/setup # 初始化项目
./yii walle/setup # 初始化项目
配置nginx/apache的webroot指向walle-web/web,简单范例详见页面底部常见问题和解决办法。
```

Expand Down Expand Up @@ -74,22 +74,22 @@ composer install # 如果缺少bower-asset的话, 先安装:composer global

* 配置企业邮箱smtp
```php
vi config/web.php +25
vi config/local.php +20

# 配置mail smtp模块
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.huamanshu.com', # smtp 发件地址
'username' => '[email protected]', # smtp 发件用户名
'password' => 'password', # smtp 发件人的密码
'port' => 25, # smtp 端口
'encryption' => 'tls', # smtp 协议
'transport' => [
'host' => 'smtp.huamanshu.com', # smtp 发件地址
'username' => '[email protected]', # smtp 发件用户名
'password' => 'K84erUuxg1bHqrfD', # smtp 发件人的密码
'port' => 25, # smtp 端口
'encryption' => 'tls', # smtp 协议
],
'messageConfig' => [
'charset' => 'UTF-8',
'from' => ['[email protected]' => '花满树出品'], # smtp 发件用户名(须与mail.transport.username一致)
],


vi config/params.php

'support.email' => '[email protected]', // 与config/web.php 中mail模块的username一致
```

* 配置日志路径
```php
vi config/params.php
Expand All @@ -99,7 +99,7 @@ composer install # 如果缺少bower-asset的话, 先安装:composer global

* 指定语言
```php
vi config/web.php +73
vi config/local.php +36

'language' => 'zh', # zh => 中文, en => english
```
Expand Down
10 changes: 4 additions & 6 deletions yii
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));

// Include local configuration first so we can set the YII_* constants there
$local = require(__DIR__.'/config/local.php');

require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');

$web = yii\helpers\ArrayHelper::merge(
require(__DIR__.'/config/web.php'),
require(__DIR__.'/config/local.php')
);
// Build web configuration
$web = require(__DIR__.'/config/web.php');
$web = yii\helpers\ArrayHelper::merge($web, $local);

$config = require(__DIR__.'/config/console.php');

if(file_exists(__DIR__.'/config/console-local.php')) {
Expand Down

0 comments on commit bb7f7a6

Please sign in to comment.