liip/LiipHyphenatorBundle

Possible permission issue

Closed this issue · 9 comments

stof commented

The Hyphenator library needs to be able to write some files on the disk in the place where it is installed. This should be documented as the vendor dir may not be writable (a clean solution would be to patch the library to make the path configurable and then use the Symfony2 cache folder)

Yep. Definitely an issue.

I'll see into that soon!

great! also now you know that there is Symfony2 support for your lib :)

stof commented

Note that we will probably need a factory in the bundle to handle the retrieving of the hyphenator as the DIC does not allow doing some static calls before using the factory method (and the current design of Org_Heigl_Hyphenator means that a setCacheDir method would need to be static).

Btw, such a factory could be helpful to handle #3 as well, to create the hyphenator for the good language depending of what is requested.

"Use Org_Heigl_Hyphenator::setDefaultParseFileDir() to set a directory where the Parsed files are stored. Default is from now on a subfolder in the systems default temporary folder. For more information have a look at the packages documentation"

stof commented

I see 2 way to do this static method call:

  • easy way: doing it in the boot method of the bundle. Drawback: it is done for every requests not using the hyphenator
  • cleaner (but harder) way: add a factory to create the hyphenator

Note that the first way can be used as a quick implementation and then the clean way can be used when implementing #3 for which a factory is needed IMO.

see #13

@heiglandreas Org_Heigl_Hyphenator::setDefaultParseFileDir() doesn't seem to exist anymore .. from reading the code I am not sure if the directory into which files are written can be separated from the directory from where the ini files are read .. can you give me a hint here?

ah it seems like you simply now provide the files pre-parsed and so this issue is solved without any further input: heiglandreas/Org_Heigl_Hyphenator@4404fd2