| 1 | <?php |
||
| 11 | class Module extends \yii\base\Module |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @inheritdoc |
||
| 15 | */ |
||
| 16 | public $controllerNamespace = 'api\modules\jd\controllers'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @inheritdoc |
||
| 20 | */ |
||
| 21 | public function init() |
||
| 22 | { |
||
| 23 | parent::init(); |
||
| 24 | if (YII_DEBUG) { |
||
| 25 | $tag = Yii::$app->log->targets['debug']->tag; |
||
| 26 | $url = getenv('APP_HOST') . 'api/debug/default/view?tag=' . $tag . '&panel=api'; |
||
| 27 | Yii::$app->response->headers->add('x-debug-tag', $tag); |
||
| 28 | Yii::$app->response->headers->add('x-debug-url', $url); |
||
| 29 | } |
||
| 30 | Yii::$app->response->format = Response::FORMAT_JSON; |
||
| 31 | Yii::$app->response->headers->add('x-author', 'lianluo.com'); |
||
| 32 | if (YII_DEBUG) { |
||
| 44 |