Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Prevent error because of too long paths#15547
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
javiereguiluz commentedAug 14, 2015
This is really a nice catch! A bit of related information:
Just a question: this solution works for your case, but what if DoctrineCacheBundle still generate too long paths even for the original |
stof commentedAug 14, 2015
@javiereguiluz AFAIK, the solution is to use PHP 5.6+ as I think they switched to the new API allowing longer path names |
wouterj commentedAug 14, 2015
@stof it's not only a limit on the PHP side, there also is a limit in the Windows system itself IIRC (had the same problem some time ago with NPM packages). |
stof commentedAug 14, 2015
@wouterj see what is quoted by@javiereguiluz: the limit depends on the API you use. AFAIK, node.js does not use the new API allowing longer paths to implement their IO functions, which is why they suffer from the limit too. I think PHP changed this (I'm not sure though) |
sstok commentedAug 14, 2015
@stof Does this work for all Windows versions since Vista/7 or only Windows 8/10 ? |
fabpot commentedSep 14, 2015
@wouterj Can you rebase and push to get the tests running on Windows, also the current tests on Travis seem to be broken by this patch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This will break if the real cache dir is already suffixed with_. So we need to make sure it's really different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
you can move this to anelse below to save one substr call in theif case
fabpot commentedOct 1, 2015
@wouterj Can you have a look at the failing tests? |
Tobion commentedDec 3, 2015
@wouterj could u rebase the PR please to see if tests pass? There is currently a strange failure |
Tobion commentedDec 4, 2015
Ok I've found the problem: The warmup dir and the old cache dir are now the same, so it doesn't work. |
Tobion commentedDec 4, 2015
Closing in favour of#16829 |
…ths (Tobion)This PR was merged into the 2.3 branch.Discussion----------[FrameworkBundle] prevent cache:clear creating too long paths| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#15547#16783| License | MIT| Doc PR | -Commits-------6e279c5 [FrameworkBundle] prevent cache:clear creating too long paths
On Windows, there is a maximum number of characters in a path. In a project on my PC, the DoctrineCacheBundle just didn't reach this maximum number in the
devdirectory. However, when clearing the cache, the directory was renamed todev_old(4 characters longer). This means the command was unable to remove the directory (I had to rename the dir to something shorter and then remove it myself).This PR introduces a new name for the oldCacheDir, making sure it has the same length as the realCacheDir.