Browse Source

Added db component. Added configuration section to readme.

tags/2.0.0-beta
Alexander Makarov 12 years ago
parent
commit
8325f7a890
  1. 12
      apps/advanced/README.md
  2. 1
      apps/advanced/backstage/config/main.php
  3. 7
      apps/advanced/common/config/params.php
  4. 1
      apps/advanced/console/config/main.php
  5. 1
      apps/advanced/frontend/config/main.php

12
apps/advanced/README.md

@ -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.

1
apps/advanced/backstage/config/main.php

@ -16,6 +16,7 @@ return array(
'modules' => array(
),
'components' => array(
'db' => $params['components.db'],
'cache' => $params['components.cache'],
'user' => array(
'class' => 'yii\web\User',

7
apps/advanced/common/config/params.php

@ -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' => '',
),
);

1
apps/advanced/console/config/main.php

@ -16,6 +16,7 @@ return array(
'modules' => array(
),
'components' => array(
'db' => $params['components.db'],
'cache' => $params['components.cache'],
'log' => array(
'class' => 'yii\logging\Router',

1
apps/advanced/frontend/config/main.php

@ -16,6 +16,7 @@ return array(
'modules' => array(
),
'components' => array(
'db' => $params['components.db'],
'cache' => $params['components.cache'],
'user' => array(
'class' => 'yii\web\User',

Loading…
Cancel
Save