mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Revert "Used ternary operator instead of "or" for constant definition"
This reverts commit 2bb6f13505e212d68841a7e6609806fb30d04002.
This commit is contained in:
@ -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') ?: define('YII_DEBUG', false);
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', false);
|
||||
```
|
||||
|
||||
During development, you can change this to `true`:
|
||||
|
||||
```php
|
||||
define('YII_DEBUG', true); // Development only
|
||||
defined('YII_DEBUG') ?: define('YII_DEBUG', false);
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', false);
|
||||
```
|
||||
|
||||
Configuring the application instance
|
||||
|
@ -40,11 +40,11 @@ code like the following:
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
defined('YII_DEBUG') ?: define('YII_DEBUG', true);
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
|
||||
// fcgi doesn't have STDIN and STDOUT defined by default
|
||||
defined('STDIN') ?: define('STDIN', fopen('php://stdin', 'r'));
|
||||
defined('STDOUT') ?: define('STDOUT', fopen('php://stdout', 'w'));
|
||||
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
|
||||
defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
|
||||
|
||||
require(__DIR__ . '/vendor/autoload.php');
|
||||
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
|
||||
|
@ -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') ?: define('YII_DEBUG', true);
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
```
|
||||
|
||||
> Note: Make sure to disable debug mode on production since it may have significan performance effect and expose sensible
|
||||
|
@ -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') ?: define('YII_DEBUG', false);
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', false);
|
||||
```
|
||||
|
||||
Debug mode is very useful during development stage, but it would impact performance
|
||||
|
Reference in New Issue
Block a user