Forum


Replies: 3   Views: 3963
Unreliable odfconverter path determinition
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by afoeder  · 21-07-2014 - 10:00

The method \TransformDocAdv::transformDocument contains, in line #114, a comparison for PHP_OS == 'Linux' for where I wonder it works anywhere at all. See also http://stackoverflow.com/questions/738823/possible-values-for-php-os, checking for 'Linux' is very racy. Additionally, this construct totally excludes Mac OS where I work on. I changed the check to if (DIRECTORY_SEPARATOR === '/') { and it works nicely that way (i.e. also on Mac OS). The Windows derivate of that check is just simply in the else-Block.

Posted by admin  · 22-07-2014 - 11:19

Hello, MacOS is not supported by OdfConverter, so you'll need to set odfconverter as false when you do the transformation. Regards.

Posted by afoeder  · 23-07-2014 - 10:40

That's not the point. Out there in the wild the PHP_OS constant may have lots of other values than "Linux", even if the OS is considered Linux. Doesn't have to do anything with Mac OS, it's just a not sane check here in the code.

Posted by admin  · 24-07-2014 - 10:50

Hello, As we just need to get if it is a Linux or Windows ser ver, MacOs doesnt support odfconverter, the check is enough and safety. Of course as the pati versions are open source you can change it to suit your needs. Regards.