Problems with Apache FOP when calling through PHP’s exec

Posted by Eric Bartels

I’m currently using the latest version of Apache’s FOP (0.95). To create the pdf-file from the transformed fo-file I simply call the fop-binary via PHP’s exec. The command is built dynamically. // Some static command here $cmd = ‘/path/to/fop -c config.yml -fo input.fo -pdf outfile.pdf’; exec($cmd); So quiet This doesn’t work! There is no pdf-file. [...]

Problems with default values in Propel

Posted by Eric Bartels

Default values rule! I’m using Propel 1.2 (an upgrade will be done soon) but for other people out there … Consider the following declaration-fragment for the “Foo-entity”. Nothing special here. <column name="name" type="VARCHAR" size="32" required="true" /> <column name="culture" type="CHAR" size="5" required="true" default="de_DE" /> Now if we create the new object and show the state (var_dump) [...]

Translating the sfAssetLibraryPlugin using gettext instead of XLIFF

Posted by Eric Bartels

I’m using the sfAssetLibraryPlugin in one of my active projects. This project uses gettext for interface translation. The plugin ships with XLIFF-files for interface translation. In order to get gettext working simply create the required directories inside the plugin-directory (plugins/sfAssetLibraryPlugin/modules/sfAsset/i18n) and create a new catalog for each language (de, en, fr, …). The important thing [...]

SQL-Join with multiple conditions when using Propel

Posted by Eric Bartels

Propels (Creole) “criteria infrastructure” is a great speed-up for the development process and makes it easy to “write” queries. However if you are forced to create a SQL-Join which requires multiple join-conditions the criteria-api is not a helper anymore. In order to make use of the criteria-api even in this case a “hack” can be [...]

Geocoding über HTTP mit dem Google-Maps Geocoding-Service

Posted by Eric Bartels

Der Google-Maps-Service ermöglicht Geocoding mittels HTTP-Anfragen. Eine feine Sache und dank JSON als Rückgabeformat und json_decode sehr einfach zu nutzen. Problem mit dem Encoding und json_decode Der folgende Code liefert nicht das erwartete Ergebnis. Die Funktion json_decode liefert für die Antwort ein “leeres Ergebnis”. Eine Analyse von $reponse zeigt einen fehlerhaft codierten String. Das ß [...]