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

Already on GitHub? Sign in to your account

Error on fixture loading CMF PHPCR (FilesystemCache) #180

Closed
devpro opened this Issue Sep 14, 2012 · 9 comments

Comments

Projects
None yet
5 participants

devpro commented Sep 14, 2012

I created from scratch a project "symfony-cmf/standard-edition" (with composer).
There is a problem at the end of the db init during fixture loading.

$ app/console doctrine:phpcr:fixtures:load

purging database

[ErrorException]

Warning: mkdir(): Invalid argument in ...\vendor\doctrine\common\lib\Doctrine\Common\Cach\FilesystemCache.php line 109

In debug I have been able to find out that the process tries to create a filename :
...\app\cache\dev\doctrine\cache\e14effee7565\3d71ea7d5217\aecd3ee2\nodes[nodes:

There is the ':' character that is not supported by Windows.

Would it be possible that cache mechanism replaces this special character?

Extract from composer.lock:
symfony/symfony: version=2.1.x-dev
doctrine/common: version=2.3.x-dev
doctrine/phpcr-bundle: version=1.0.x-dev

Member

lsmith77 commented Sep 14, 2012

@FabioBatSilva can you look into this issue?

Owner

FabioBatSilva commented Sep 14, 2012

Sure @lsmith77

I think we can fix it using hash to the cache key
you can see any problem using SHA(256/512) ?

Member

lsmith77 commented Sep 14, 2012

dont have much experience there .. but sounds like a workable solution. not sure if there are performance considerations here to factor in ..

Owner

beberlei commented Sep 17, 2012

i am against hashing the keys. very dangerous.

Member

lsmith77 commented Sep 23, 2012

btw havent looked at how the PhpFileCache is different .. but maybe that works better on windows?

Owner

FabioBatSilva commented Sep 23, 2012

@lsmith77 PhpFileCache uses the same approach to create the file name FileCache#getFilename. https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Cache/FileCache.php#L92

I can't think in a solution that does not change the cache keys,
@beberlei do you mean problems with colisions using hash ?

Owner

Ocramius commented Nov 9, 2012

Is there a list of "forbidden" characters out there? What if we simply build something like

sha1($key) . strtr($key, $replacements) ?

Member

lsmith77 commented Aug 18, 2013

ping

Owner

beberlei commented Aug 18, 2013

Thiw was merged several months ago.

@beberlei beberlei closed this Aug 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment