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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
13d6c1fd
Commit
13d6c1fd
authored
Jan 03, 2014
by
Luciano Baraglia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic app: DB configuration in separated file
parent
08ee8b18
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 @
13d6c1fd
...
...
@@ -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 @
13d6c1fd
<?php
return
[
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2basic'
,
'username'
=>
'root'
,
'password'
=>
''
,
'charset'
=>
'utf8'
,
];
apps/basic/config/web.php
View file @
13d6c1fd
<?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