Why using partial strings for translations is not a good idea

This article is clearly at level "piece of cake" for those of you working day to day with UTF-8 and unicode headaches, but I have plenty of problems with my own team to explain why they should never put a string like this:
$SomeString = "This value must not be inferior to";
in the Dokeos translations system, but they never learn :-) This would later appear in the code as something close to:
echo get_lang('SomeString');
and this would make it available in all the supported languages (if translated by a good will in his own language). So here i

PclZip and gzopen64()

I have updated my system early to Ubuntu 9.10 (Karmic Koala) and, to my surprise, there is a little change that could cause dramatic problems in Zlib (library dealing with compressed data). The gzopen() function has been changed to gzopen64(). This means that all calls to gzopen() in the PHP bindings for that library should probably be modified to use gzopen64(). In Dokeos, we use PclZip 2.6, which doesn't use gzopen(), apart from a check to see if the zlib extension is installed or not.

Don't use true filenames on your server

In a recent meeting with the Dokeos 2.0 team, I realized that sometimes things are not quite evident. One of these cases that can only be understood with experience is that there's no use in allowing a user to upload files and keep the true filenames on the server's disk. In fact, it is quite a bigger problem to do that instead of changing the filenames and storing files as hashes.

Reason 1: Avoid security issues

When uploading a file to the server, you will have filters in place (won't you?).

Fixes for Gallery 2 French translation in module 'core'

After years using G2, I finally fixed the fr.po for core module and submitted it to latest registered French translator of Gallery2 several weeks again. After review, he encoded the following tracker on SF.net for everybody to benefit from it, even if no G2 update is ever published again:
https://sourceforge.net/tracker/?func=detail&aid=2846783&group_id=7130&atid=582564

As G2 is using gettext, updating it it fairly easy.

Enjoy!

Users' mail: configuring SMTP account to send mails with Doke0s

Note: as of 2010, BeezNest has moved away from supporting Dokeos and launched the Chamilo project. This article was written in 2009, when BeezNest's team members were still the main developers for the Doke0s software, under the responsibility of the Doke0s company. Chamilo has since then reached double the size of the Doke0s project and is much more transparent in terms of code publication and community support. This article surprisingly still holds true for Chamilo up to version 1.11, but this might change in Chamilo 2.0 with a new system for e-mail sending.

PHP 5.3 and the Internationalization extension

In this article, Stas Malyshev describes the internationalization extension and mentions it's been included in the PHP 5.3 core. It is an extensive article with plenty of examples to explain every component of Internationalization: Locale, Collator, Number formatter, Date formatter, Message formatter, Normalizer, Grapheme and Internation Domain Names. Pretty useful. Storing it for later (when Dokeos will require 5.3 by default, or the installation of the extension in 5.2)

Get current PHP API

One method to know if the script being executed has been started through cli, apache or any other API is to use PHP_SAPI:
if (PHP_SAPI != 'cli') { ... }
will ensure that the script is executed in a command-line context before doing what's inside the brackets.