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
a4c8617f
Commit
a4c8617f
authored
Jan 22, 2014
by
Alexander Kochetov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaner environments for yii2-advanced-app
parent
4fe0eeb1
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
75 additions
and
76 deletions
+75
-76
main.php
apps/advanced/backend/config/main.php
+6
-15
main.php
apps/advanced/common/config/main.php
+20
-0
params.php
apps/advanced/common/config/params.php
+0
-15
main.php
apps/advanced/console/config/main.php
+7
-17
index.php
apps/advanced/environments/dev/backend/web/index.php
+2
-0
main-local.php
apps/advanced/environments/dev/common/config/main-local.php
+12
-0
params-local.php
.../advanced/environments/dev/common/config/params-local.php
+0
-7
index.php
apps/advanced/environments/dev/frontend/web/index.php
+2
-0
yii
apps/advanced/environments/dev/yii
+2
-0
index.php
apps/advanced/environments/prod/backend/web/index.php
+2
-0
main-local.php
apps/advanced/environments/prod/common/config/main-local.php
+12
-0
params-local.php
...advanced/environments/prod/common/config/params-local.php
+0
-7
index.php
apps/advanced/environments/prod/frontend/web/index.php
+2
-0
yii
apps/advanced/environments/prod/yii
+2
-0
main.php
apps/advanced/frontend/config/main.php
+6
-15
No files found.
apps/advanced/backend/config/main.php
View file @
a4c8617f
<?php
$rootDir
=
dirname
(
dirname
(
__DIR__
));
$params
=
array_merge
(
require
(
$rootDir
.
'/common/config/params.php'
),
require
(
$rootDir
.
'/common/config/params-local.php'
),
require
(
__DIR__
.
'/params.php'
),
require
(
__DIR__
.
'/params-local.php'
)
);
return
[
'id'
=>
'app-backend'
,
'basePath'
=>
dirname
(
__DIR__
),
'vendorPath'
=>
$rootDir
.
'/vendor'
,
'preload'
=>
[
'log'
],
'controllerNamespace'
=>
'backend\controllers'
,
'modules'
=>
[],
'extensions'
=>
require
(
$rootDir
.
'/vendor/yiisoft/extensions.php'
),
'components'
=>
[
'db'
=>
$params
[
'components.db'
],
'cache'
=>
$params
[
'components.cache'
],
'mail'
=>
$params
[
'components.mail'
],
'user'
=>
[
'identityClass'
=>
'common\models\User'
,
'enableAutoLogin'
=>
true
,
...
...
@@ -37,5 +23,10 @@ return [
'errorAction'
=>
'site/error'
,
],
],
'params'
=>
$params
,
'params'
=>
array_merge
(
require
(
__DIR__
.
'/../../common/config/params.php'
),
require
(
__DIR__
.
'/../../common/config/params-local.php'
),
require
(
__DIR__
.
'/params.php'
),
require
(
__DIR__
.
'/params-local.php'
)
),
];
apps/advanced/common/config/main.php
0 → 100644
View file @
a4c8617f
<?php
Yii
::
setAlias
(
'common'
,
dirname
(
__DIR__
));
Yii
::
setAlias
(
'frontend'
,
dirname
(
dirname
(
__DIR__
))
.
'/frontend'
);
Yii
::
setAlias
(
'backend'
,
dirname
(
dirname
(
__DIR__
))
.
'/backend'
);
Yii
::
setAlias
(
'console'
,
dirname
(
dirname
(
__DIR__
))
.
'/console'
);
return
[
'vendorPath'
=>
dirname
(
dirname
(
__DIR__
))
.
'/vendor'
,
'extensions'
=>
require
(
__DIR__
.
'/../../vendor/yiisoft/extensions.php'
),
'components'
=>
[
'cache'
=>
[
'class'
=>
'yii\caching\FileCache'
,
],
'mail'
=>
[
'class'
=>
'yii\swiftmailer\Mailer'
,
'viewPath'
=>
'@common/mails'
,
],
],
];
apps/advanced/common/config/params.php
View file @
a4c8617f
<?php
Yii
::
setAlias
(
'common'
,
dirname
(
__DIR__
));
Yii
::
setAlias
(
'frontend'
,
dirname
(
dirname
(
__DIR__
))
.
'/frontend'
);
Yii
::
setAlias
(
'backend'
,
dirname
(
dirname
(
__DIR__
))
.
'/backend'
);
Yii
::
setAlias
(
'console'
,
dirname
(
dirname
(
__DIR__
))
.
'/console'
);
return
[
'adminEmail'
=>
'admin@example.com'
,
'supportEmail'
=>
'support@example.com'
,
'components.cache'
=>
[
'class'
=>
'yii\caching\FileCache'
,
],
'components.mail'
=>
[
'class'
=>
'yii\swiftmailer\Mailer'
,
'viewPath'
=>
'@common/mails'
,
],
];
apps/advanced/console/config/main.php
View file @
a4c8617f
<?php
$rootDir
=
__DIR__
.
'/../..'
;
$params
=
array_merge
(
require
(
$rootDir
.
'/common/config/params.php'
),
require
(
$rootDir
.
'/common/config/params-local.php'
),
require
(
__DIR__
.
'/params.php'
),
require
(
__DIR__
.
'/params-local.php'
)
);
return
[
'id'
=>
'app-console'
,
'basePath'
=>
dirname
(
__DIR__
),
'vendorPath'
=>
dirname
(
dirname
(
__DIR__
))
.
'/vendor'
,
'controllerNamespace'
=>
'console\controllers'
,
'modules'
=>
[
],
'extensions'
=>
require
(
__DIR__
.
'/../../vendor/yiisoft/extensions.php'
),
'modules'
=>
[],
'components'
=>
[
'db'
=>
$params
[
'components.db'
],
'cache'
=>
$params
[
'components.cache'
],
'mail'
=>
$params
[
'components.mail'
],
'log'
=>
[
'targets'
=>
[
[
...
...
@@ -29,5 +14,10 @@ return [
],
],
],
'params'
=>
$params
,
'params'
=>
array_merge
(
require
(
__DIR__
.
'/../../common/config/params.php'
),
require
(
__DIR__
.
'/../../common/config/params-local.php'
),
require
(
__DIR__
.
'/params.php'
),
require
(
__DIR__
.
'/params-local.php'
)
),
];
apps/advanced/environments/dev/backend/web/index.php
View file @
a4c8617f
...
...
@@ -6,6 +6,8 @@ require(__DIR__ . '/../../vendor/autoload.php');
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
$config
=
yii\helpers\ArrayHelper
::
merge
(
require
(
__DIR__
.
'/../../common/config/main.php'
),
require
(
__DIR__
.
'/../../common/config/main-local.php'
),
require
(
__DIR__
.
'/../config/main.php'
),
require
(
__DIR__
.
'/../config/main-local.php'
)
);
...
...
apps/advanced/environments/dev/common/config/main-local.php
0 → 100644
View file @
a4c8617f
<?php
return
[
'components'
=>
[
'db'
=>
[
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2advanced'
,
'username'
=>
'root'
,
'password'
=>
''
,
'charset'
=>
'utf8'
,
],
],
];
apps/advanced/environments/dev/common/config/params-local.php
View file @
a4c8617f
<?php
return
[
'components.db'
=>
[
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2advanced'
,
'username'
=>
'root'
,
'password'
=>
''
,
'charset'
=>
'utf8'
,
],
];
apps/advanced/environments/dev/frontend/web/index.php
View file @
a4c8617f
...
...
@@ -6,6 +6,8 @@ require(__DIR__ . '/../../vendor/autoload.php');
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
$config
=
yii\helpers\ArrayHelper
::
merge
(
require
(
__DIR__
.
'/../../common/config/main.php'
),
require
(
__DIR__
.
'/../../common/config/main-local.php'
),
require
(
__DIR__
.
'/../config/main.php'
),
require
(
__DIR__
.
'/../config/main-local.php'
)
);
...
...
apps/advanced/environments/dev/yii
View file @
a4c8617f
...
...
@@ -19,6 +19,8 @@ require(__DIR__ . '/vendor/autoload.php');
require
(
__DIR__
.
'/vendor/yiisoft/yii2/Yii.php'
);
$config
=
yii\helpers\ArrayHelper
::
merge
(
require
(
__DIR__
.
'/common/config/main.php'
),
require
(
__DIR__
.
'/common/config/main-local.php'
),
require
(
__DIR__
.
'/console/config/main.php'
),
require
(
__DIR__
.
'/console/config/main-local.php'
)
);
...
...
apps/advanced/environments/prod/backend/web/index.php
View file @
a4c8617f
...
...
@@ -6,6 +6,8 @@ require(__DIR__ . '/../../vendor/autoload.php');
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
$config
=
yii\helpers\ArrayHelper
::
merge
(
require
(
__DIR__
.
'/../../common/config/main.php'
),
require
(
__DIR__
.
'/../../common/config/main-local.php'
),
require
(
__DIR__
.
'/../config/main.php'
),
require
(
__DIR__
.
'/../config/main-local.php'
)
);
...
...
apps/advanced/environments/prod/common/config/main-local.php
0 → 100644
View file @
a4c8617f
<?php
return
[
'components'
=>
[
'db'
=>
[
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2advanced'
,
'username'
=>
'root'
,
'password'
=>
''
,
'charset'
=>
'utf8'
,
],
],
];
apps/advanced/environments/prod/common/config/params-local.php
View file @
a4c8617f
<?php
return
[
'components.db'
=>
[
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'mysql:host=localhost;dbname=yii2advanced'
,
'username'
=>
'root'
,
'password'
=>
''
,
'charset'
=>
'utf8'
,
],
];
apps/advanced/environments/prod/frontend/web/index.php
View file @
a4c8617f
...
...
@@ -6,6 +6,8 @@ require(__DIR__ . '/../../vendor/autoload.php');
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
$config
=
yii\helpers\ArrayHelper
::
merge
(
require
(
__DIR__
.
'/../../common/config/main.php'
),
require
(
__DIR__
.
'/../../common/config/main-local.php'
),
require
(
__DIR__
.
'/../config/main.php'
),
require
(
__DIR__
.
'/../config/main-local.php'
)
);
...
...
apps/advanced/environments/prod/yii
View file @
a4c8617f
...
...
@@ -19,6 +19,8 @@ require(__DIR__ . '/vendor/autoload.php');
require
(
__DIR__
.
'/vendor/yiisoft/yii2/Yii.php'
);
$config
=
yii\helpers\ArrayHelper
::
merge
(
require
(
__DIR__
.
'/common/config/main.php'
),
require
(
__DIR__
.
'/common/config/main-local.php'
),
require
(
__DIR__
.
'/console/config/main.php'
),
require
(
__DIR__
.
'/console/config/main-local.php'
)
);
...
...
apps/advanced/frontend/config/main.php
View file @
a4c8617f
<?php
$rootDir
=
__DIR__
.
'/../..'
;
$params
=
array_merge
(
require
(
$rootDir
.
'/common/config/params.php'
),
require
(
$rootDir
.
'/common/config/params-local.php'
),
require
(
__DIR__
.
'/params.php'
),
require
(
__DIR__
.
'/params-local.php'
)
);
return
[
'id'
=>
'app-frontend'
,
'basePath'
=>
dirname
(
__DIR__
),
'vendorPath'
=>
$rootDir
.
'/vendor'
,
'controllerNamespace'
=>
'frontend\controllers'
,
'extensions'
=>
require
(
$rootDir
.
'/vendor/yiisoft/extensions.php'
),
'components'
=>
[
'db'
=>
$params
[
'components.db'
],
'cache'
=>
$params
[
'components.cache'
],
'mail'
=>
$params
[
'components.mail'
],
'user'
=>
[
'identityClass'
=>
'common\models\User'
,
'enableAutoLogin'
=>
true
,
...
...
@@ -35,5 +21,10 @@ return [
'errorAction'
=>
'site/error'
,
],
],
'params'
=>
$params
,
'params'
=>
array_merge
(
require
(
__DIR__
.
'/../../common/config/params.php'
),
require
(
__DIR__
.
'/../../common/config/params-local.php'
),
require
(
__DIR__
.
'/params.php'
),
require
(
__DIR__
.
'/params-local.php'
)
),
];
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