2amigos / yiinitializr

Library that will help boost your application installation with ease and also to run Yii applications from its bootstrap files on a much cleaner way that the framework currently proposes.
Other
44 stars 17 forks source link

DEBUG constants doesn't work #6

Closed ifdattic closed 11 years ago

ifdattic commented 11 years ago
    // yii config
defined('YII_DEBUG') or define('YII_DEBUG', isset($params['yii.debug']) ? $params['yii.debug'] : false);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', isset($params['yii.traceLevel']) ? $params['yii.traceLevel'] : 0);
defined('YII_ENABLE_ERROR_HANDLER') or define('YII_ENABLE_ERROR_HANDLER', isset($params['yii.handleErrors']) ? $params['yii.handleErrors'] : true);
defined('YII_ENABLE_EXCEPTION_HANDLER') or define('YII_ENABLE_EXCEPTION_HANDLER', YII_ENABLE_ERROR_HANDLER);

This block of code doesn't work. For example if we take 'yiinitializr-intermediate' back-end index.php file, that code of block is processed after Yii framework is included, but the line require('./../../common/lib/vendor/yiisoft/yii/framework/yii.php'); which includes Yii framework sets debug constants if they are not already set. This leads to using default debug constants and not the ones set from configuration.

tonydspaniard commented 11 years ago

That behavior has been changed, now on the templates we do not include yii.php at its index.php was a very bad pitfall but is fixed: https://github.com/tonydspaniard/yiinitializr-basic/blob/master/www/index.php

Apologies for that bug as the inclusion of yii.php .

ifdattic commented 11 years ago

Great, will have to update my application to fix this.

Just started using Yiinitializr for a new project, so if I find something that might be a bug I just add an issue.

Great library :)