Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
58c40818
Commit
58c40818
authored
Jan 03, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1761 from lucianobaraglia/master
Basic app: DB configuration in separated file
parents
0c288358
13d6c1fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
console.php
apps/basic/config/console.php
+3
-7
db.php
apps/basic/config/db.php
+9
-0
web.php
apps/basic/config/web.php
+2
-7
No files found.
apps/basic/config/console.php
View file @
58c40818
...
...
@@ -3,6 +3,8 @@
Yii
::
setAlias
(
'@tests'
,
dirname
(
__DIR__
)
.
'/tests'
);
$params
=
require
(
__DIR__
.
'/params.php'
);
$db
=
require
(
__DIR__
.
'/db.php'
);
return
[
'id'
=>
'basic-console'
,
'basePath'
=>
dirname
(
__DIR__
),
...
...
@@ -22,13 +24,7 @@ return [
],
],
],
'db'
=>
[
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2basic'
,
'username'
=>
'root'
,
'password'
=>
''
,
'charset'
=>
'utf8'
,
],
'db'
=>
$db
,
'fixture'
=>
[
'class'
=>
'yii\test\DbFixtureManager'
,
'basePath'
=>
'@tests/unit/fixtures'
,
...
...
apps/basic/config/db.php
0 → 100644
View file @
58c40818
<?php
return
[
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2basic'
,
'username'
=>
'root'
,
'password'
=>
''
,
'charset'
=>
'utf8'
,
];
apps/basic/config/web.php
View file @
58c40818
<?php
$params
=
require
(
__DIR__
.
'/params.php'
);
$db
=
require
(
__DIR__
.
'/db.php'
);
$config
=
[
'id'
=>
'basic'
,
...
...
@@ -29,13 +30,7 @@ $config = [
],
],
],
'db'
=>
[
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2basic'
,
'username'
=>
'root'
,
'password'
=>
''
,
'charset'
=>
'utf8'
,
],
'db'
=>
$db
,
],
'params'
=>
$params
,
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment