Joomla Portability
Once Joomla is installed on 3.5-Apollo, it becomes a fixed installation running on the drive letter you selected for UniServer (default drive W). |
There are a number of solution to make Joomla portable the first I considered was using a separate batch file however a solution already inherently exists in the form of Uniform Server's batch files.
Drive letter
The only element that prevents portability is the fixed drive letter that Joomla uses in its configuration file. During installation the configuration file is created and absolute paths assigned. After installation these are never changed by the program this we use to our advantage.
Uniform Server stores its drive letter in an environment variable named “Disk” it is this that provides an elegant solution.
Solution
Using php, we can access the environment variable “Disk” for example:
<? $jo_dsk = getenv('Disk'); ?>
This gets the environment variable Disk using getenv and assigns it to our variable $jo_dsk.
In Joomla's configuration file, wherever we see a fixed drive letter we replace it with our variable.
Implementation
Edit the configuration file configuration.php located in folder *\Uniform Server\udrive\www\joomla with a suitable text editor.
Follow these three steps:
Step | Action | Result after modification |
---|---|---|
1 |
Just below <?php add the line: |
<?php |
2 |
Locate the line: |
$mosConfig_lang = 'english'; |
3 |
locate the line: |
$mosConfig_caching = '0'; |
A quick explanation for line: $mosConfig_absolute_path = $jo_dsk . ':/www/joomla';
The variable $jo_dsk contains a string character of the drive letter in use.
The string defined by a single quote either end of it :/www/joomla is concatenated (added to) our variable $jo_dsk this creates the full path.
The result is assigned to variable $mosConfig_absolute_path.
Whatever drive letter you use to run Uniform Server on is picked up by this code and sets Joomla accordingly.
Conclusion
The above shows how to make Joomla portable, only minor changes are required to gain this flexibility.
Check out this page for complete atep-by-step guide installing Joomla
Ric |