when I played around with the i18n features (works great!) I tried to set the locale in the configuration (readonly attribute).
The strange thing is that I didn’t get any Exception. I tried to debug (using NB6.5 beta with xdebug) and found that the system assembled the Exception that the locale is readonly but it didn’t manage to display anything. I tried to find out why but at the end of YiiBase::t() the degubber jumps back and the webpage seems to be running again whatever I try
Its not a severe bug but perhaps one of you can try it on his system?
<?php
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'testApplication',
'language'=>'de',
'sourceLanguage'=>'en',
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
// uncomment the following to set up database
/*
'db'=>array(
'connectionString'=>'Your DSN',
),
*/
),
);
I wasn't using any IDE. The exception should appear normally as when you set 'locale' in app config, it will attempt to do $app->locale="something", which should trigger the exception in the __set method of CComponent.
Hi, I had the display_errors switched Off. Switched it on now but don't get any errors displayed on the screen. I have an uncaught Exception in the php-error.log
[16-Oct-2008 08:33:29] PHP Fatal error: Uncaught exception 'CException' with message 'Property "CWebApplication.locale" is read only.' in F:workSourcenYiiframeworkcoreCComponent.php:138
Stack trace:
#0 F:workSourcenYiiframeworkcollectionsCConfiguration.php(102): CComponent->__set('locale', 'de')
#1 F:workSourcenYiiframeworkcoreCApplication.php(749): CConfiguration->applyTo(Object(CWebApplication))
#2 F:workSourcenYiiframeworkcoreCApplication.php(107): CApplication->configure('F:worktheMach...')
#3 F:workSourcenYiiframeworkYiiBase.php(74): CApplication->__construct('F:worktheMach...')
#4 F:worktheMachinerywebsitetrunkwebrootindex.php(11): YiiBase::createWebApplication('F:worktheMach...')
#5 {main}
thrown in F:workSourcenYiiframeworkcoreCComponent.php on line 138
I inserted the follwoing into the CComponent:set() method:
So your PHP error log already says about the error. I think you probably need to configure your server in some way in order to display the exception on screen. I'm not sure how to do it in your case though. There's nothing we can do inside the framework.
Normally I rely on display_errors=On and the framework ability to display beautiful error messages but this time it didn’t work.
What do you think about
public function __construct($config=null)
{
Yii::setApplication($this);
$this->registerCoreComponents();
$this->initSystemHandlers();
$this->configure($config);
$this->init();
}
an taking the initialization of the system_handlers out of the init() method?