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
2bb6f135
Commit
2bb6f135
authored
Mar 04, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used ternary operator instead of "or" for constant definition
parent
b0ef4c90
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
105 additions
and
105 deletions
+105
-105
_bootstrap.php
apps/advanced/backend/tests/_bootstrap.php
+4
-4
_console.php
apps/advanced/backend/tests/_console.php
+4
-4
yii
apps/advanced/backend/tests/acceptance/yii
+2
-2
yii
apps/advanced/backend/tests/functional/yii
+2
-2
yii
apps/advanced/backend/tests/unit/yii
+2
-2
_bootstrap.php
apps/advanced/common/tests/_bootstrap.php
+4
-4
_console.php
apps/advanced/common/tests/_console.php
+4
-4
yii
apps/advanced/common/tests/unit/yii
+2
-2
_bootstrap.php
apps/advanced/console/tests/_bootstrap.php
+4
-4
_console.php
apps/advanced/console/tests/_console.php
+4
-4
yii
apps/advanced/console/tests/unit/yii
+2
-2
index-test.php
apps/advanced/environments/dev/backend/web/index-test.php
+2
-2
index.php
apps/advanced/environments/dev/backend/web/index.php
+2
-2
index-test.php
apps/advanced/environments/dev/frontend/web/index-test.php
+2
-2
index.php
apps/advanced/environments/dev/frontend/web/index.php
+2
-2
yii
apps/advanced/environments/dev/yii
+4
-4
index.php
apps/advanced/environments/prod/backend/web/index.php
+2
-2
index.php
apps/advanced/environments/prod/frontend/web/index.php
+2
-2
yii
apps/advanced/environments/prod/yii
+4
-4
_bootstrap.php
apps/advanced/frontend/tests/_bootstrap.php
+4
-4
_console.php
apps/advanced/frontend/tests/_console.php
+4
-4
yii
apps/advanced/frontend/tests/acceptance/yii
+2
-2
yii
apps/advanced/frontend/tests/functional/yii
+2
-2
yii
apps/advanced/frontend/tests/unit/yii
+2
-2
_bootstrap.php
apps/basic/tests/_bootstrap.php
+4
-4
_console_bootstrap.php
apps/basic/tests/_console_bootstrap.php
+4
-4
index-test.php
apps/basic/web/index-test.php
+2
-2
index.php
apps/basic/web/index.php
+2
-2
yii
apps/basic/yii
+3
-3
index.php
apps/benchmark/index.php
+1
-1
build
build/build
+2
-2
configuration.md
docs/guide/configuration.md
+2
-2
console.md
docs/guide/console.md
+3
-3
module-debug.md
docs/guide/module-debug.md
+1
-1
performance.md
docs/guide/performance.md
+1
-1
apidoc
extensions/apidoc/apidoc
+1
-1
BaseYii.php
framework/BaseYii.php
+8
-8
yii
framework/yii
+3
-3
No files found.
apps/advanced/backend/tests/_bootstrap.php
View file @
2bb6f135
...
...
@@ -2,14 +2,14 @@
// the entry script URL (without host info) for functional and acceptance tests
// PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL
defined
(
'TEST_ENTRY_URL'
)
or
define
(
'TEST_ENTRY_URL'
,
'/backend/web/index-test.php'
);
defined
(
'TEST_ENTRY_URL'
)
?:
define
(
'TEST_ENTRY_URL'
,
'/backend/web/index-test.php'
);
// the entry script file path for functional and acceptance tests
defined
(
'TEST_ENTRY_FILE'
)
or
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/web/index-test.php'
);
defined
(
'TEST_ENTRY_FILE'
)
?:
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/web/index-test.php'
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
require_once
(
__DIR__
.
'/../../vendor/autoload.php'
);
...
...
apps/advanced/backend/tests/_console.php
View file @
2bb6f135
...
...
@@ -8,12 +8,12 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../../vendor/autoload.php'
);
require_once
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
require_once
(
__DIR__
.
'/../../common/config/aliases.php'
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
apps/advanced/backend/tests/acceptance/yii
View file @
2bb6f135
...
...
@@ -9,8 +9,8 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../_console.php'
);
...
...
apps/advanced/backend/tests/functional/yii
View file @
2bb6f135
...
...
@@ -9,8 +9,8 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../_console.php'
);
...
...
apps/advanced/backend/tests/unit/yii
View file @
2bb6f135
...
...
@@ -9,8 +9,8 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../_console.php'
);
...
...
apps/advanced/common/tests/_bootstrap.php
View file @
2bb6f135
...
...
@@ -2,14 +2,14 @@
// the entry script URL (without host info) for functional and acceptance tests
// PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL
defined
(
'TEST_ENTRY_URL'
)
or
define
(
'TEST_ENTRY_URL'
,
'/index-test.php'
);
defined
(
'TEST_ENTRY_URL'
)
?:
define
(
'TEST_ENTRY_URL'
,
'/index-test.php'
);
// the entry script file path for functional and acceptance tests
defined
(
'TEST_ENTRY_FILE'
)
or
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/index-test.php'
);
defined
(
'TEST_ENTRY_FILE'
)
?:
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/index-test.php'
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
require_once
(
__DIR__
.
'/../../vendor/autoload.php'
);
...
...
apps/advanced/common/tests/_console.php
View file @
2bb6f135
...
...
@@ -8,12 +8,12 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../../vendor/autoload.php'
);
require_once
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
require_once
(
__DIR__
.
'/../../common/config/aliases.php'
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
apps/advanced/common/tests/unit/yii
View file @
2bb6f135
...
...
@@ -9,8 +9,8 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../_console.php'
);
...
...
apps/advanced/console/tests/_bootstrap.php
View file @
2bb6f135
...
...
@@ -2,14 +2,14 @@
// the entry script URL (without host info) for functional and acceptance tests
// PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL
defined
(
'TEST_ENTRY_URL'
)
or
define
(
'TEST_ENTRY_URL'
,
'/index-test.php'
);
defined
(
'TEST_ENTRY_URL'
)
?:
define
(
'TEST_ENTRY_URL'
,
'/index-test.php'
);
// the entry script file path for functional and acceptance tests
defined
(
'TEST_ENTRY_FILE'
)
or
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/index-test.php'
);
defined
(
'TEST_ENTRY_FILE'
)
?:
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/index-test.php'
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
require_once
(
__DIR__
.
'/../../vendor/autoload.php'
);
...
...
apps/advanced/console/tests/_console.php
View file @
2bb6f135
...
...
@@ -8,12 +8,12 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../../vendor/autoload.php'
);
require_once
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
require_once
(
__DIR__
.
'/../../common/config/aliases.php'
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
apps/advanced/console/tests/unit/yii
View file @
2bb6f135
...
...
@@ -9,8 +9,8 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../_console.php'
);
...
...
apps/advanced/environments/dev/backend/web/index-test.php
View file @
2bb6f135
...
...
@@ -5,8 +5,8 @@ if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) {
die
(
'You are not allowed to access this file.'
);
}
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
...
...
apps/advanced/environments/dev/backend/web/index.php
View file @
2bb6f135
<?php
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'dev'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'dev'
);
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
...
...
apps/advanced/environments/dev/frontend/web/index-test.php
View file @
2bb6f135
...
...
@@ -5,8 +5,8 @@ if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) {
die
(
'You are not allowed to access this file.'
);
}
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
...
...
apps/advanced/environments/dev/frontend/web/index.php
View file @
2bb6f135
<?php
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'dev'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'dev'
);
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
...
...
apps/advanced/environments/dev/yii
View file @
2bb6f135
...
...
@@ -8,12 +8,12 @@
* @license http://www.yiiframework.com/license/
*/
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'dev'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'dev'
);
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require
(
__DIR__
.
'/vendor/autoload.php'
);
require
(
__DIR__
.
'/vendor/yiisoft/yii2/Yii.php'
);
...
...
apps/advanced/environments/prod/backend/web/index.php
View file @
2bb6f135
<?php
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'prod'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'prod'
);
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
...
...
apps/advanced/environments/prod/frontend/web/index.php
View file @
2bb6f135
<?php
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'prod'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'prod'
);
require
(
__DIR__
.
'/../../vendor/autoload.php'
);
require
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
...
...
apps/advanced/environments/prod/yii
View file @
2bb6f135
...
...
@@ -8,12 +8,12 @@
* @license http://www.yiiframework.com/license/
*/
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'prod'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'prod'
);
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require
(
__DIR__
.
'/vendor/autoload.php'
);
require
(
__DIR__
.
'/vendor/yiisoft/yii2/Yii.php'
);
...
...
apps/advanced/frontend/tests/_bootstrap.php
View file @
2bb6f135
...
...
@@ -2,14 +2,14 @@
// the entry script URL (without host info) for functional and acceptance tests
// PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL
defined
(
'TEST_ENTRY_URL'
)
or
define
(
'TEST_ENTRY_URL'
,
'/frontend/web/index-test.php'
);
defined
(
'TEST_ENTRY_URL'
)
?:
define
(
'TEST_ENTRY_URL'
,
'/frontend/web/index-test.php'
);
// the entry script file path for functional and acceptance tests
defined
(
'TEST_ENTRY_FILE'
)
or
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/web/index-test.php'
);
defined
(
'TEST_ENTRY_FILE'
)
?:
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/web/index-test.php'
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
require_once
(
__DIR__
.
'/../../vendor/autoload.php'
);
...
...
apps/advanced/frontend/tests/_console.php
View file @
2bb6f135
...
...
@@ -8,12 +8,12 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../../vendor/autoload.php'
);
require_once
(
__DIR__
.
'/../../vendor/yiisoft/yii2/Yii.php'
);
require_once
(
__DIR__
.
'/../../common/config/aliases.php'
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
apps/advanced/frontend/tests/acceptance/yii
View file @
2bb6f135
...
...
@@ -9,8 +9,8 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../_console.php'
);
...
...
apps/advanced/frontend/tests/functional/yii
View file @
2bb6f135
...
...
@@ -9,8 +9,8 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../_console.php'
);
...
...
apps/advanced/frontend/tests/unit/yii
View file @
2bb6f135
...
...
@@ -9,8 +9,8 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require_once
(
__DIR__
.
'/../_console.php'
);
...
...
apps/basic/tests/_bootstrap.php
View file @
2bb6f135
...
...
@@ -2,14 +2,14 @@
// the entry script URL (without host info) for functional and acceptance tests
// PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL
defined
(
'TEST_ENTRY_URL'
)
or
define
(
'TEST_ENTRY_URL'
,
'/basic/web/index-test.php'
);
defined
(
'TEST_ENTRY_URL'
)
?:
define
(
'TEST_ENTRY_URL'
,
'/basic/web/index-test.php'
);
// the entry script file path for functional and acceptance tests
defined
(
'TEST_ENTRY_FILE'
)
or
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/web/index-test.php'
);
defined
(
'TEST_ENTRY_FILE'
)
?:
define
(
'TEST_ENTRY_FILE'
,
dirname
(
__DIR__
)
.
'/web/index-test.php'
);
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
require_once
(
__DIR__
.
'/../vendor/autoload.php'
);
...
...
apps/basic/tests/_console_bootstrap.php
View file @
2bb6f135
<?php
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require
(
__DIR__
.
'/../vendor/autoload.php'
);
require
(
__DIR__
.
'/../vendor/yiisoft/yii2/Yii.php'
);
apps/basic/web/index-test.php
View file @
2bb6f135
...
...
@@ -5,8 +5,8 @@ if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) {
die
(
'You are not allowed to access this file.'
);
}
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'test'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'test'
);
require
(
__DIR__
.
'/../vendor/autoload.php'
);
require
(
__DIR__
.
'/../vendor/yiisoft/yii2/Yii.php'
);
...
...
apps/basic/web/index.php
View file @
2bb6f135
<?php
// comment out the following two lines when deployed to production
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'dev'
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'dev'
);
require
(
__DIR__
.
'/../vendor/autoload.php'
);
require
(
__DIR__
.
'/../vendor/yiisoft/yii2/Yii.php'
);
...
...
apps/basic/yii
View file @
2bb6f135
...
...
@@ -8,11 +8,11 @@
* @license http://www.yiiframework.com/license/
*/
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require
(
__DIR__
.
'/vendor/autoload.php'
);
require
(
__DIR__
.
'/vendor/yiisoft/yii2/Yii.php'
);
...
...
apps/benchmark/index.php
View file @
2bb6f135
<?php
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
false
);
require
(
__DIR__
.
'/protected/vendor/yiisoft/yii2/Yii.php'
);
...
...
build/build
View file @
2bb6f135
...
...
@@ -9,8 +9,8 @@
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
define
(
'YII_DEBUG'
,
true
);
...
...
docs/guide/configuration.md
View file @
2bb6f135
...
...
@@ -24,14 +24,14 @@ Like any resource in your Yii application, the bootstrap file can be edited to f
The default bootstrap structure sets
`YII_DEBUG`
to
`false`
if not defined:
```
php
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
false
);
```
During development, you can change this to
`true`
:
```
php
define
(
'YII_DEBUG'
,
true
);
// Development only
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
false
);
```
Configuring the application instance
...
...
docs/guide/console.md
View file @
2bb6f135
...
...
@@ -40,11 +40,11 @@ code like the following:
* @license http://www.yiiframework.com/license/
*/
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require
(
__DIR__
.
'/vendor/autoload.php'
);
require
(
__DIR__
.
'/vendor/yiisoft/yii2/Yii.php'
);
...
...
docs/guide/module-debug.md
View file @
2bb6f135
...
...
@@ -76,7 +76,7 @@ return [
By default it's automatically set to
`3`
if Yii is run in debug mode i.e. your
`index.php`
file contains the following:
```
php
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
```
> Note: Make sure to disable debug mode on production since it may have significan performance effect and expose sensible
...
...
docs/guide/performance.md
View file @
2bb6f135
...
...
@@ -28,7 +28,7 @@ is to disable debug mode. A Yii application runs in debug mode if the constant
should be in your
`index.php`
:
```
php
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
false
);
```
Debug mode is very useful during development stage, but it would impact performance
...
...
extensions/apidoc/apidoc
View file @
2bb6f135
...
...
@@ -8,7 +8,7 @@
* @license http://www.yiiframework.com/license/
*/
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
false
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
false
);
$composerAutoload
=
[
__DIR__
.
'/vendor/autoload.php'
,
// standalone with "composer install" run
...
...
framework/BaseYii.php
View file @
2bb6f135
...
...
@@ -14,37 +14,37 @@ use yii\log\Logger;
/**
* Gets the application start timestamp.
*/
defined
(
'YII_BEGIN_TIME'
)
or
define
(
'YII_BEGIN_TIME'
,
microtime
(
true
));
defined
(
'YII_BEGIN_TIME'
)
?:
define
(
'YII_BEGIN_TIME'
,
microtime
(
true
));
/**
* This constant defines the framework installation directory.
*/
defined
(
'YII_PATH'
)
or
define
(
'YII_PATH'
,
__DIR__
);
defined
(
'YII_PATH'
)
?:
define
(
'YII_PATH'
,
__DIR__
);
/**
* 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'
)
?:
define
(
'YII_DEBUG'
,
false
);
/**
* This constant defines in which environment the application is running. Defaults to 'prod', meaning production environment.
* You may define this constant in the bootstrap script. The value could be 'prod' (production), 'dev' (development), 'test', 'staging', etc.
*/
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'prod'
);
defined
(
'YII_ENV'
)
?:
define
(
'YII_ENV'
,
'prod'
);
/**
* Whether the the application is running in production environment
*/
defined
(
'YII_ENV_PROD'
)
or
define
(
'YII_ENV_PROD'
,
YII_ENV
===
'prod'
);
defined
(
'YII_ENV_PROD'
)
?:
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'
);
defined
(
'YII_ENV_DEV'
)
?:
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'
);
defined
(
'YII_ENV_TEST'
)
?:
define
(
'YII_ENV_TEST'
,
YII_ENV
===
'test'
);
/**
* This constant defines whether error handling should be enabled. Defaults to true.
*/
defined
(
'YII_ENABLE_ERROR_HANDLER'
)
or
define
(
'YII_ENABLE_ERROR_HANDLER'
,
true
);
defined
(
'YII_ENABLE_ERROR_HANDLER'
)
?:
define
(
'YII_ENABLE_ERROR_HANDLER'
,
true
);
/**
...
...
framework/yii
View file @
2bb6f135
...
...
@@ -8,11 +8,11 @@
* @license http://www.yiiframework.com/license/
*/
defined
(
'YII_DEBUG'
)
or
define
(
'YII_DEBUG'
,
true
);
defined
(
'YII_DEBUG'
)
?:
define
(
'YII_DEBUG'
,
true
);
// fcgi doesn't have STDIN and STDOUT defined by default
defined
(
'STDIN'
)
or
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
or
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
defined
(
'STDIN'
)
?:
define
(
'STDIN'
,
fopen
(
'php://stdin'
,
'r'
));
defined
(
'STDOUT'
)
?:
define
(
'STDOUT'
,
fopen
(
'php://stdout'
,
'w'
));
require
(
__DIR__
.
'/Yii.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