enableDebugger shows no error when logDirectory not present

Notice: This thread is very old.
vkrishn
Member | 9
+
0
-

Nette: 2.0.1
When using example: nette/examples/CD-collection/www/

$configurator->enableDebugger(__DIR__ . '/../logs');

enableDebugger shows no error with logDirectory not present.
Is this ok?

OndrejSlamecka
Member | 41
+
0
-

Throws Nette\DirectoryNotFoundException for me. Please post your app/bootstrap.php file.
And here's the API, it may help you a bit.

Last edited by OndrejSlamecka (2012-03-11 12:48)

vkrishn
Member | 9
+
0
-
  1. Try setting all correctly and then viewing nette/examples/CD-collection/www/ till you see signin page.
  2. Then set,

    $configurator->enableDebugger(__DIR__ . '/../notfound');

    in nette/examples/CD-collection/apps/bootstrap.php

  3. Re-view the page
duke
Member | 650
+
0
-

@vkrishn Followed those steps. Result is a Nette\DirectoryNotFoundException exception.

vkrishn
Member | 9
+
0
-

Found the problem,
I am using knoppix 6.7, which in php.ini had, display_errors = Off
but things were ok in /var/logs and now in browser also :-)
Thanks

Last edited by vkrishn (2012-03-11 17:53)

vkrishn
Member | 9
+
0
-

Would it be possible to generate errors similar to,

$configurator->setTempDirectory(__DIR__ . '/../notfound');

when incorrectly setting,

$configurator->enableDebugger(__DIR__ . '/../notfound');

I mean using bluescreen method?

duke
Member | 650
+
0
-

The blue screen is the debugger you are trying to enable with Configurator::enable method. Logically it can't work before it is enabled.

Last edited by duke (2012-03-13 23:08)

vkrishn
Member | 9
+
0
-

I was wondering if following approach would work,

$configurator->setLogDirectory(__DIR__ . '/../log');
$configurator->enableDebugger(true);

then,

$configurator->createRobotLoader()
	->addDirectory(__DIR__)
	->register();

would also check for setting logdirectory and show errors using blue screen.
Setting of log dir should be seperate from its usage.

duke
Member | 650
+
0
-

Theoretically it could be possible to change Nette so that it first enables the the blue-screen and only later configures the logger, but all we would achieve by this would be that we would be able to blue-screen-display this one particular error. I don't think it's such a big deal that there is a single case that won't get blue-screen-displayed. The change would probably involve splitting Debugger::enable into 2 separate methods: Debugger::enableBlueScreen and Debugger::setupLogger and making Configurator call these in enableDebugger method.

Robot loader has nothing to do with this. Robot loader provides the autoloading of php files, not debugging services.

vkrishn
Member | 9
+
0
-

There could be a general directory create/permission check method.

$configurator->setDirectory(__DIR__ . '/../temp', 'temp'); //second param being the reference label/tag
$configurator->setDirectory(__DIR__ . '/../log' 'log');

This method should check for:

  1. Dir if exist
  2. The required permission is correct.
  3. Else make dir with right permission.

On error setting/displaying message at each level.