Why so many settings in Chamilo's configuration.php?

If you install Chamilo 1.11.6, for example, and dive into the details of its configuration, you might get confused by the fact that we have a "settings_current" table in the database at the same time as we have a (large) number of settings to be enabled through the app/config/configuration.php file. This boils down to one rule that we have established in Chamilo: minor versions do not contain database changes.

Major versus Minor versions

So the first question is: what is a "minor" version.

Remove permanent redirect (HTTP 301) cache in Firefox

As a web developer configuring SSL certificates on websites you deliver, as we do, you might be faced, one day, with a small issue about configuring a 301 redirect from HTTP to HTTPS that has to be reverted. It so happens that browsers *really* take it to heart to cache an HTTP 301 (permanent redirect) message seriously and deeply. So much so that it might become very difficult to remove this redirect and ever be able to access the site in HTTP again.

Versions of PHP in Ubuntu

If you have to maintain an open source project written in PHP, like we do with Chamilo at BeezNest, you'll have to test your software on multiple versions of PHP to make sure of how well your code is supported on these versions. Of course, being open source, you can publish it on Github and then benefit from Travis-CI to get tests run automatically, but some stuff might be tricky to do, and maybe you'd like to test one specific thing, quickly, under a specific PHP version. Well, it turns out you can probably do that with Docker.

Benchmark: dirname(__FILE__) vs __DIR__ in PHP

dirname(__FILE__) and __DIR__ give exactly the same result in PHP, although one (__DIR__) is evaluated at compile-time, while the other (dirname(__FILE__)) has at least part of it (the function) evaluated at execution time. Ever wondered what the difference is, in terms of efficiency, between the two? I've written a *very* simple script to try it out:
<?php
$loops = 100000000;
echo 'Testing dirname(__FILE__)' . PHP_EOL;
$start = time();
$dir = '';
for ($i = 0; $i < $loops; $i++) {
 $dir = dirname(__FILE__);
}
echo 'dirname(__FILE__) took ' . (time()-$start) . 's' .

Can't use function return value in write context

Did you ever develop some nice code, then simply wanted to check if a string was only composed of white spaces or tabs, and used something like this:
if (!empty(trim($string))) { ... }
...only to get a bad error appear (only on your PHP 5.4 server) in the middle of your app, like this?:
Fatal error: Can't use function return value in write context
Well, this has a simple explanation... Prior to PHP 5.5, the empty() function did not accept something else than a variable.