8000 [Console] Clear Cache Bug in Windows · Issue #5008 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] Clear Cache Bug in Windows #5008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nexik opened this issue Jul 21, 2012 · 2 comments
Closed

[Console] Clear Cache Bug in Windows #5008

nexik opened this issue Jul 21, 2012 · 2 comments

Comments

@nexik
Copy link
nexik commented Jul 21, 2012

Hi

Clear Cache in windows throw ErrorException because of Access Denied of cache folders.

CacheClearCommand use php method rename, which one not work properly in windows.

From Comments at http://php.net/manual/en/function.rename.php:

rename() is working on Linux/UNIX but not working on Windows on a directory containing a file 
formerly opened within the  same script. The problem persists even after properly closing the 
file and flushing the buffer.

Strangely it seem that the rename command is  executed BEFORE the handle closing on Windows.
Inserting a sleep() command before the renaming cures the problem."

I added sleep(1) before every rename() and everythings now works perfectly fine.

My question: Does the Symfony support Windows OS? If yes I could add Pull Request.

@Seldaek
Copy link
Member
Seldaek commented Jul 21, 2012

Maybe usleep(100) or something smaller than sleep(1) would be enough?

@nexik
Copy link
Author
nexik commented Jul 22, 2012

I done more tests and it depends on actual state of system. Sometimes it works on usleep(500). In most cases sleep(1) is good for my OS, but found that some user on other windows need to increase it to 3 or even 5.

At this point I don't see any good workaround for this PHP bug for Symfony2. It seems it can only be fixed in PHP level. In next days (if found some free time) I'll send bug report to PHP.

I think the best solution for now is to add information about this bug in some FAQ or Known Issues page/wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0