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
eda171e1
Commit
eda171e1
authored
Jul 31, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more YII_ENV constants.
parent
5d9c23c6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
10 deletions
+22
-10
web.php
apps/basic/config/web.php
+1
-1
SiteController.php
apps/basic/controllers/SiteController.php
+1
-1
YiiBase.php
framework/yii/YiiBase.php
+15
-2
ErrorHandler.php
framework/yii/base/ErrorHandler.php
+1
-1
IDataProvider.php
framework/yii/data/IDataProvider.php
+2
-3
Logger.php
framework/yii/log/Logger.php
+1
-1
User.php
framework/yii/web/User.php
+1
-1
No files found.
apps/basic/config/web.php
View file @
eda171e1
...
@@ -7,7 +7,7 @@ return array(
...
@@ -7,7 +7,7 @@ return array(
'modules'
=>
array
(
'modules'
=>
array
(
'debug'
=>
array
(
'debug'
=>
array
(
'class'
=>
'yii\debug\Module'
,
'class'
=>
'yii\debug\Module'
,
'enabled'
=>
YII_DEBUG
&&
YII_ENV
===
'dev'
,
'enabled'
=>
YII_DEBUG
&&
YII_ENV
_DEV
,
),
),
),
),
'components'
=>
array
(
'components'
=>
array
(
...
...
apps/basic/controllers/SiteController.php
View file @
eda171e1
...
@@ -14,7 +14,7 @@ class SiteController extends Controller
...
@@ -14,7 +14,7 @@ class SiteController extends Controller
return
array
(
return
array
(
'captcha'
=>
array
(
'captcha'
=>
array
(
'class'
=>
'yii\web\CaptchaAction'
,
'class'
=>
'yii\web\CaptchaAction'
,
'fixedVerifyCode'
=>
YII_ENV
===
'test'
?
'testme'
:
null
,
'fixedVerifyCode'
=>
YII_ENV
_DEV
?
'testme'
:
null
,
),
),
);
);
}
}
...
...
framework/yii/YiiBase.php
View file @
eda171e1
...
@@ -17,6 +17,10 @@ use yii\log\Logger;
...
@@ -17,6 +17,10 @@ use yii\log\Logger;
*/
*/
defined
(
'YII_BEGIN_TIME'
)
or
define
(
'YII_BEGIN_TIME'
,
microtime
(
true
));
defined
(
'YII_BEGIN_TIME'
)
or
define
(
'YII_BEGIN_TIME'
,
microtime
(
true
));
/**
/**
* This constant defines the framework installation directory.
*/
defined
(
'YII_PATH'
)
or
define
(
'YII_PATH'
,
__DIR__
);
/**
* This constant defines whether the application should be in debug mode or not. Defaults to false.
* This constant defines whether the application should be in debug mode or not. Defaults to false.
*/
*/
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
...
@@ -26,9 +30,18 @@ defined('YII_DEBUG') or define('YII_DEBUG', false);
...
@@ -26,9 +30,18 @@ defined('YII_DEBUG') or define('YII_DEBUG', false);
*/
*/
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'prod'
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'prod'
);
/**
/**
*
This constant defines the framework installation directory.
*
Whether the the application is running in production environment
*/
*/
defined
(
'YII_PATH'
)
or
define
(
'YII_PATH'
,
__DIR__
);
defined
(
'YII_ENV_PROD'
)
or
define
(
'YII_ENV_PROD'
,
YII_ENV
===
'prod'
);
/**
* Whether the the application is running in development environment
*/
defined
(
'YII_ENV_DEV'
)
or
define
(
'YII_ENV_DEV'
,
YII_ENV
===
'dev'
);
/**
* Whether the the application is running in testing environment
*/
defined
(
'YII_ENV_TEST'
)
or
define
(
'YII_ENV_TEST'
,
YII_ENV
===
'test'
);
/**
/**
* This constant defines whether error handling should be enabled. Defaults to true.
* This constant defines whether error handling should be enabled. Defaults to true.
*/
*/
...
...
framework/yii/base/ErrorHandler.php
View file @
eda171e1
...
@@ -82,7 +82,7 @@ class ErrorHandler extends Component
...
@@ -82,7 +82,7 @@ class ErrorHandler extends Component
*/
*/
protected
function
renderException
(
$exception
)
protected
function
renderException
(
$exception
)
{
{
if
(
Yii
::
$app
instanceof
\yii\console\Application
||
YII_ENV
===
'test'
)
{
if
(
Yii
::
$app
instanceof
\yii\console\Application
||
YII_ENV
_TEST
)
{
echo
Yii
::
$app
->
renderException
(
$exception
);
echo
Yii
::
$app
->
renderException
(
$exception
);
return
;
return
;
}
}
...
...
framework/yii/data/IDataProvider.php
View file @
eda171e1
...
@@ -10,9 +10,8 @@ namespace yii\data;
...
@@ -10,9 +10,8 @@ namespace yii\data;
/**
/**
* IDataProvider is the interface that must be implemented by data provider classes.
* IDataProvider is the interface that must be implemented by data provider classes.
*
*
* Data providers are components that can provide data that are sorted and paginated.
* Data providers are components that sort and paginate data, and provide them to widgets
* Data providers are often used with widgets, such as [[GridView]], [[ListView]]
* such as [[GridView]], [[ListView]].
* that display data and support sorting and pagination.
*
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
* @since 2.0
...
...
framework/yii/log/Logger.php
View file @
eda171e1
...
@@ -150,7 +150,7 @@ class Logger extends Component
...
@@ -150,7 +150,7 @@ class Logger extends Component
{
{
parent
::
init
();
parent
::
init
();
if
(
$this
->
traceLevel
===
null
)
{
if
(
$this
->
traceLevel
===
null
)
{
$this
->
traceLevel
=
YII_ENV
===
'dev'
?
3
:
0
;
$this
->
traceLevel
=
YII_ENV
_DEV
?
3
:
0
;
}
}
foreach
(
$this
->
targets
as
$name
=>
$target
)
{
foreach
(
$this
->
targets
as
$name
=>
$target
)
{
if
(
!
$target
instanceof
Target
)
{
if
(
!
$target
instanceof
Target
)
{
...
...
framework/yii/web/User.php
View file @
eda171e1
...
@@ -416,7 +416,7 @@ class User extends Component
...
@@ -416,7 +416,7 @@ class User extends Component
public
function
switchIdentity
(
$identity
,
$duration
=
0
)
public
function
switchIdentity
(
$identity
,
$duration
=
0
)
{
{
$session
=
Yii
::
$app
->
getSession
();
$session
=
Yii
::
$app
->
getSession
();
if
(
YII_ENV
!==
'test'
)
{
if
(
!
YII_ENV_TEST
)
{
$session
->
regenerateID
(
true
);
$session
->
regenerateID
(
true
);
}
}
$this
->
setIdentity
(
$identity
);
$this
->
setIdentity
(
$identity
);
...
...
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