umpirsky / Twig-Gettext-Extractor

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.
MIT License
113 stars 32 forks source link

Temporary directory location #44

Closed cheplv closed 8 years ago

cheplv commented 8 years ago

When you have no permissions to write into /tmp you will have an exception:

Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to create the cache directory (/tmp/cache/579886ff4a9e3/0e/96).' in /home/user/web/vendor/twig/twig/lib/Twig/Environment.php on line 1238

RuntimeException: Unable to create the cache directory (/tmp/cache/579886ff4a9e3/0e/96). in /home/user/web/vendor/twig/twig/lib/Twig/Environment.php on line 1238

umpirsky commented 8 years ago

@cheplv Is your twig environment set to use /tmp? See https://github.com/umpirsky/Twig-Gettext-Extractor/blob/master/Twig/Gettext/Extractor.php#L57 and https://github.com/umpirsky/Twig-Gettext-Extractor/blob/master/Twig/Gettext/Extractor.php#L93. If yes, then it must have permissions to write them.

cheplv commented 8 years ago

Problem is here: https://github.com/umpirsky/Twig-Gettext-Extractor/blob/master/twig-gettext-extractor#L26

I'v created pull request with appropriate changes to allow specify TMPDIR in environment

umpirsky commented 8 years ago

@cheplv Right, I added comment to your PR. Thanks!

cheplv commented 8 years ago

Moment - changed all things to simple sys_get_temp_dir() function which is preferable

cheplv commented 8 years ago

Now it's ok - ready to be merged :)

umpirsky commented 8 years ago

@cheplv Fair enough, thanks! :)

BTW, what's your sys_get_temp_dir() value?

cheplv commented 8 years ago

Currently ~/tmp (in homefolder)

P.S. When to wait for new release. Need ASAP :)

cheplv commented 8 years ago

Thanks for v1.2.1, maybe need to remove "v" prefix as other tag namings

umpirsky commented 8 years ago

@cheplv Right, thanks!

cheplv commented 8 years ago

Nice work. Thx!

umpirsky commented 8 years ago

Thank you!