mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Added db component. Added configuration section to readme.
This commit is contained in:
@ -84,3 +84,15 @@ assuming `yii-advanced` is directly under the document root of your Web server.
|
||||
### Install from an Archive File
|
||||
|
||||
This is not currently available. We will provide it when Yii 2 is formally released.
|
||||
|
||||
GETTING STARTED
|
||||
---------------
|
||||
|
||||
After template application and its dependencies are downloaded you need to initialize it and set some config values to
|
||||
match your application requirements.
|
||||
|
||||
1. Execute `install` command selecting `dev` as environment.
|
||||
2. Set `id` value in `console/config/main.php`, `frontend/config/main.php`, `backstage/config/main.php`.
|
||||
3. Create new database. It is assumed that MySQL InnoDB is used. If not, adjust `console/migrations/m130524_201442_init.php`.
|
||||
4. In `common/config/params.php` set your database details in `components.db` values.
|
||||
|
||||
|
@ -16,6 +16,7 @@ return array(
|
||||
'modules' => array(
|
||||
),
|
||||
'components' => array(
|
||||
'db' => $params['components.db'],
|
||||
'cache' => $params['components.cache'],
|
||||
'user' => array(
|
||||
'class' => 'yii\web\User',
|
||||
|
@ -6,4 +6,11 @@ return array(
|
||||
'components.cache' => array(
|
||||
'class' => 'yii\caching\FileCache',
|
||||
),
|
||||
|
||||
'components.db' => array(
|
||||
'class' => 'yii\db\Connection',
|
||||
'dsn' => 'mysql:host=localhost;dbname=yii2advanced',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
),
|
||||
);
|
@ -16,6 +16,7 @@ return array(
|
||||
'modules' => array(
|
||||
),
|
||||
'components' => array(
|
||||
'db' => $params['components.db'],
|
||||
'cache' => $params['components.cache'],
|
||||
'log' => array(
|
||||
'class' => 'yii\logging\Router',
|
||||
|
@ -16,6 +16,7 @@ return array(
|
||||
'modules' => array(
|
||||
),
|
||||
'components' => array(
|
||||
'db' => $params['components.db'],
|
||||
'cache' => $params['components.cache'],
|
||||
'user' => array(
|
||||
'class' => 'yii\web\User',
|
||||
|
Reference in New Issue
Block a user