install/index: php-cs-fixer PSR2 fixes
install.lib: php-cs-fixer PSR2 fixes
install.lib: Fix undesired capitalization
Merge pull request #247 from diegoe/master_install-cleanups

Install cleanups
htaccess: Add install step for a proper .htaccess

Install a new writeHtaccess() function in the install process that takes
/htaccess-dist and replaces {BASE_URL} for the appropiate value used by
RewriteBase to find Chamilo files.

This solves the problem of Chamilo installations that are not hosted on
a web server root. Namely, all the http://domain/chamilo-lms installs.

The method follows similar practice by WordPress where the .htaccess
file is generated by WordPress on demand when the user activates pretty
permalinks.

A follow–up commit enhances the safety of this process by making sure
the site URL is clean enough for RewriteBase.
install: Clean trailing slashes in site URL

This ensures that accidental trailing slashes does not break the site
after installation.

This is important for the automatic generation of the .htaccess file,
since RewriteBase depends on a valid, clean, URL path to work.

When RewriteBase is wrong, many different and obscure errors can pop in
the site, so it's better to be very sure.

Arguably, this might not be the best place for input filtering during
the installation.