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
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
Show 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 @@
...
@@ -3,6 +3,8 @@
Yii
::
setAlias
(
'@tests'
,
dirname
(
__DIR__
)
.
'/tests'
);
Yii
::
setAlias
(
'@tests'
,
dirname
(
__DIR__
)
.
'/tests'
);
$params
=
require
(
__DIR__
.
'/params.php'
);
$params
=
require
(
__DIR__
.
'/params.php'
);
$db
=
require
(
__DIR__
.
'/db.php'
);
return
[
return
[
'id'
=>
'basic-console'
,
'id'
=>
'basic-console'
,
'basePath'
=>
dirname
(
__DIR__
),
'basePath'
=>
dirname
(
__DIR__
),
...
@@ -22,13 +24,7 @@ return [
...
@@ -22,13 +24,7 @@ return [
],
],
],
],
],
],
'db'
=>
[
'db'
=>
$db
,
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2basic'
,
'username'
=>
'root'
,
'password'
=>
''
,
'charset'
=>
'utf8'
,
],
'fixture'
=>
[
'fixture'
=>
[
'class'
=>
'yii\test\DbFixtureManager'
,
'class'
=>
'yii\test\DbFixtureManager'
,
'basePath'
=>
'@tests/unit/fixtures'
,
'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
<?php
$params
=
require
(
__DIR__
.
'/params.php'
);
$params
=
require
(
__DIR__
.
'/params.php'
);
$db
=
require
(
__DIR__
.
'/db.php'
);
$config
=
[
$config
=
[
'id'
=>
'basic'
,
'id'
=>
'basic'
,
...
@@ -29,13 +30,7 @@ $config = [
...
@@ -29,13 +30,7 @@ $config = [
],
],
],
],
],
],
'db'
=>
[
'db'
=>
$db
,
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2basic'
,
'username'
=>
'root'
,
'password'
=>
''
,
'charset'
=>
'utf8'
,
],
],
],
'params'
=>
$params
,
'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