Hello All,
i still have this issue and investigated a bit more.
I try to run
symfony\1.1\test\functional\sfTestBrowserTest.php
I put a var_dump($logger) into
symfony\1.1\lib\log\sfAggregateLogger.class.php line 85.
doing so i can see how many loggers are created. My output shows:
object(sfFileLogger)#40 (5) {
["type:protected"]=>
string(7) "symfony"
["format:protected"]=>
string(41) "%time% %type% [%priority%] %message%%EOL%"
["timeFormat:protected"]=>
string(14) "%b %d %H:%M:%S"
["fp:protected"]=>
resource(66) of type (stream)
["level:protected"]=>
int(6)
}
okay so far so good.
I put a var_dump($this->fp) into symfony\1.1\lib\log\sfFileLogger.class.php
line 95.
then i can see multiple:
resource(66) of type (stream)
great. also fine.
Last but not least i put a var_dump($this->fp) into
symfony\1.1\lib\log\sfFileLogger.class.php line 125.
now its getting strange.
This var dump is executed 10 times!. an each time with a different resource
number.
And even more important: it NEVER closes the ressource i observed in
creation.
I was assuming that the multiple shutdown calls are coming from:
http://trac.symfony-project.com/ticket/3612
Which wouldn't be too bad, but it seems the initial filepointer gets lost.
So in that way the real initial file doesnt get closed. And thats why the
unlink fails.
Does anybody have a clue why $this->fp gets modified. As far as I can see
its all the same single instance of the sfFileLogger class.
But more interestingly, even if i unset $this->fp its there the next call to
shutdown. so perhaps there are different classes? I tried to monitor
__construct and __clone, but they are not invoked (construct only once at
start)
So I am really lost why the file remains open. I would like to open a
ticket/fix this, but this is still too strange. As you can see of the length
of this mail.
.: Fabian
On Tue, May 20, 2008 at 4:16 PM, Fabian Lange <
[EMAIL PROTECTED]> wrote:
> Hi,
> There is an issue with log file permissions that causes functional tests to
> return dubious here on my work windows PC.
>
> The problem is that sfToolkitCleanDirectory tries to unlink my
> frontend_test.log file.
> I assume that the file was not "closed" properly. on *ix based systems this
> works fine. In windows it throws a warning:
>
> "Warning:
> unlink(D:\projects\sf1.1\lib\plugins\sfCompat10Plugin\test\functional\fixtures\log\frontend_test.log):
> Permissi
> on denied in D:\projects\sf1.1\lib\util\sfToolkit.class.php on line 87"
>
> This warning is output by the //remove all cache line in the code below. I
> assume the logfile was created by the ProjectConfiguration and is now open.
> The warning itself is not that critical, but the shutdown handler has the
> same problem.
> It treas the warning different and throws:
> PHP Fatal error: Exception thrown without a stack frame in Unknown on line
> 0
>
> I think the first warning is easier to resolve. just move the "clean-call"
> before the getAppConfig line.
> The second is interesting. although the Logger->shutdown fires before the
> test-cleanup, so the resource IS closed before, the code still has a
> permission denied error.
>
> Is this a php windows bug? or did i miss that somebody still holds a handle
> to that file?
>
> .: Fabian
>
> ---- Test Code Bootstrap---
>
> require_once $root_dir.'/config/ProjectConfiguration.class.php';
> $configuration = ProjectConfiguration::getApplicationConfiguration($app,
> 'test', isset($debug) ? $debug : true);
> sfContext::createInstance($configuration);
>
> // remove all cache
> sf_functional_test_shutdown();
>
> register_shutdown_function('sf_functional_test_shutdown');
>
> function sf_functional_test_shutdown()
> {
> sfToolkit::clearDirectory(sfConfig::get('sf_cache_dir'));
> sfToolkit::clearDirectory(sfConfig::get('sf_log_dir'));
> }
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---