Joomla Portability: Difference between revisions

From The Uniform Server Wiki
Jump to navigation Jump to search
No edit summary
m (Reverted edits by Upazixorys (Talk); changed back to last version by Ric)
 
Line 1: Line 1:
=[http://ynejynezex.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
<span id="top"></span>
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;
<div style="padding:0;margin:0; border-bottom:3px inset #000000">
&lt;div style=&quot;padding:0;margin:0; border-bottom:3px inset #000000&quot;&gt;
{|  
{|  
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||
Joomla (Version 1.0.13 ) portability on Uniform Server 3.5-Apollo.  
Joomla (Version 1.0.13 ) portability on Uniform Server 3.5-Apollo.  
|}
|}
&lt;/div&gt;
</div>
{| cellpadding=&quot;2&quot;
{| cellpadding="2"
|
|
__TOC__
__TOC__
Line 23: Line 22:
Using php, we can access the environment variable “Disk” for example:
Using php, we can access the environment variable “Disk” for example:


'''&lt;nowiki&gt;&lt;? $jo_dsk = getenv('Disk'); ?&gt;&lt;/nowiki&gt;'''
'''<nowiki><? $jo_dsk = getenv('Disk'); ?></nowiki>'''


This gets the environment variable '''Disk''' using '''getenv''' and assigns it to our variable '''$jo_dsk'''.
This gets the environment variable '''Disk''' using '''getenv''' and assigns it to our variable '''$jo_dsk'''.
Line 31: Line 30:
'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
== Implementation ==
== Implementation ==
Edit the configuration file '''configuration.php''' located in folder '''&lt;nowiki&gt;*\Uniform Server\udrive\www\joomla&lt;/nowiki&gt;''' with a suitable text editor.
Edit the configuration file '''configuration.php''' located in folder '''<nowiki>*\Uniform Server\udrive\www\joomla</nowiki>''' with a suitable text editor.


Follow these three steps:
Follow these three steps:


{|cellpadding=&quot;4&quot;
{|cellpadding="4"
|-style=&quot;background:#f0f0f0&quot;
|-style="background:#f0f0f0"
!Step
!Step
!Action
!Action
!Result after modification
!Result after modification
|-style=&quot;background:#f8f8f8&quot;
|-style="background:#f8f8f8"
|valign=&quot;top&quot;|
|valign="top"|
&amp;nbsp;&amp;nbsp;1
&nbsp;&nbsp;1
|valign=&quot;top&quot;|
|valign="top"|
Just below &lt;?php add the line:&lt;br&gt;
Just below <?php add the line:<br>
$jo_dsk = getenv('Disk');
$jo_dsk = getenv('Disk');
|valign=&quot;top&quot;|
|valign="top"|
&lt;nowiki&gt;&lt;?php&lt;/nowiki&gt;&lt;br&gt;
<nowiki><?php</nowiki><br>
'''$jo_dsk = getenv('Disk');'''&lt;br&gt;
'''$jo_dsk = getenv('Disk');'''<br>
$mosConfig_offline = '0';
$mosConfig_offline = '0';
|-style=&quot;background:#f8f8f8&quot;
|-style="background:#f8f8f8"
|valign=&quot;top&quot;|
|valign="top"|
&amp;nbsp;&amp;nbsp;2
&nbsp;&nbsp;2
|valign=&quot;top&quot;|
|valign="top"|
Locate the line:&lt;br&gt;
Locate the line:<br>
$mosConfig_absolute_path = 'W:/www/joomla';&lt;br&gt;
$mosConfig_absolute_path = 'W:/www/joomla';<br>
Either comment out the line or delete it and replace with:&lt;br&gt;
Either comment out the line or delete it and replace with:<br>
$mosConfig_absolute_path = $jo_dsk . ':/www/joomla';
$mosConfig_absolute_path = $jo_dsk . ':/www/joomla';
|valign=&quot;top&quot;|
|valign="top"|
$mosConfig_lang = 'english';&lt;br&gt;
$mosConfig_lang = 'english';<br>
'''&lt;nowiki&gt;#&lt;/nowiki&gt;'''$mosConfig_absolute_path = 'W:/www/joomla';&lt;br&gt;
'''<nowiki>#</nowiki>'''$mosConfig_absolute_path = 'W:/www/joomla';<br>
'''$mosConfig_absolute_path = $jo_dsk . ':/www/joomla';'''&lt;br&gt;
'''$mosConfig_absolute_path = $jo_dsk . ':/www/joomla';'''<br>
$mosConfig_live_site = 'http://localhost/joomla';
$mosConfig_live_site = 'http://localhost/joomla';
|-style=&quot;background:#f8f8f8&quot;
|-style="background:#f8f8f8"
|valign=&quot;top&quot;|
|valign="top"|
&amp;nbsp;&amp;nbsp;3
&nbsp;&nbsp;3
|valign=&quot;top&quot;|
|valign="top"|
locate the line:&lt;br&gt;
locate the line:<br>
$mosConfig_cachepath = 'W:/www/joomla/cache';&lt;br&gt;
$mosConfig_cachepath = 'W:/www/joomla/cache';<br>
Either comment out the line or delete it and replace with:&lt;br&gt;
Either comment out the line or delete it and replace with:<br>
$mosConfig_cachepath = $jo_dsk . ':/www/joomla/cache';
$mosConfig_cachepath = $jo_dsk . ':/www/joomla/cache';
|valign=&quot;top&quot;|
|valign="top"|
$mosConfig_caching = '0';&lt;br&gt;
$mosConfig_caching = '0';<br>
'''&lt;nowiki&gt;#&lt;/nowiki&gt;'''$mosConfig_cachepath = 'W:/www/joomla/cache';&lt;br&gt;
'''<nowiki>#</nowiki>'''$mosConfig_cachepath = 'W:/www/joomla/cache';<br>
'''$mosConfig_cachepath = $jo_dsk . ':/www/joomla/cache';'''&lt;br&gt;
'''$mosConfig_cachepath = $jo_dsk . ':/www/joomla/cache';'''<br>
$mosConfig_cachetime = '900';
$mosConfig_cachetime = '900';
|}
|}
Line 80: Line 79:
A quick explanation for line: $mosConfig_absolute_path = $jo_dsk . ':/www/joomla';
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.&lt;br&gt;
The variable '''$jo_dsk''' contains a string character of the drive letter in use.<br>
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'''.&lt;br&gt;
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'''.<br>
The result is assigned to variable '''$mosConfig_absolute_path'''.
The result is assigned to variable '''$mosConfig_absolute_path'''.



Latest revision as of 08:33, 24 November 2010

MPG UniCenter

Joomla (Version 1.0.13 ) portability on Uniform Server 3.5-Apollo.

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.

Top

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:
$jo_dsk = getenv('Disk');

<?php
$jo_dsk = getenv('Disk');
$mosConfig_offline = '0';

  2

Locate the line:
$mosConfig_absolute_path = 'W:/www/joomla';
Either comment out the line or delete it and replace with:
$mosConfig_absolute_path = $jo_dsk . ':/www/joomla';

$mosConfig_lang = 'english';
#$mosConfig_absolute_path = 'W:/www/joomla';
$mosConfig_absolute_path = $jo_dsk . ':/www/joomla';
$mosConfig_live_site = 'http://localhost/joomla';

  3

locate the line:
$mosConfig_cachepath = 'W:/www/joomla/cache';
Either comment out the line or delete it and replace with:
$mosConfig_cachepath = $jo_dsk . ':/www/joomla/cache';

$mosConfig_caching = '0';
#$mosConfig_cachepath = 'W:/www/joomla/cache';
$mosConfig_cachepath = $jo_dsk . ':/www/joomla/cache';
$mosConfig_cachetime = '900';

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


Top


Ric