This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
magento:same-copy-multiple-dbs [2010/02/06 13:39] unirgy |
magento:same-copy-multiple-dbs [2010/02/08 10:15] (current) unirgy |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== How to use the same Magento copy with multiple DBs and configurations ====== | ||
| + | ===== Article Updates ===== | ||
| + | Updated Magento patch to allow Cache Refresh --- // | ||
| + | |||
| + | ===== Procedure ===== | ||
| + | |||
| + | ==== Prepare original Magento copy for fast deployment of new copies ==== | ||
| + | |||
| + | * Unpack Magento into ''/ | ||
| + | * Apply [[# | ||
| + | * Install ALL extensions and themes that will be used in ALL copies, using PEAR or direct file copy | ||
| + | * (Optional) Proceed with configuration of Magento in this copy, if required for extension installations. | ||
| + | * Symlink ''/ | ||
| + | * Create ''/ | ||
| + | < | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | ==== Update / | ||
| + | |||
| + | * Make sure that '' | ||
| + | * Replace Mage::run() with: | ||
| + | <code php> | ||
| + | $dir = dirname(__FILE__); | ||
| + | Mage:: | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | )); | ||
| + | </ | ||
| + | |||
| + | ==== Create a new copy of skeleton template ==== | ||
| + | |||
| + | * Copy / | ||
| + | * Update / | ||
| + | * (Optional) Create a new DB for this copy | ||
| + | * If you do not have local.xml, proceed with Magento installation wizard | ||
| + | * Enable/ | ||
| + | * Navigate to this copy's URL and wait for completion of DB install/ | ||
| + | |||
| + | ===== Conclusion ===== | ||
| + | |||
| + | Now you have 1 copy of Magento core files, for unlimited number of installations and DBs, each with it's own DB, configuration, | ||
| + | |||
| + | Upgrade of Magento or extensions needs to be done only once. | ||
| + | |||
| + | ===== Applications ===== | ||
| + | |||
| + | * Development: | ||
| + | * Running multiple stores with ease of maintenance | ||
| + | ===== Configurable Dirs Patch for Magento 1.3.2.4 ===== | ||
| + | Click on file name to download as file: | ||
| + | <file diff samecopy.patch> | ||
| + | diff -rupbB magento/ | ||
| + | --- magento/ | ||
| + | +++ magento-1.3.2.4/ | ||
| + | @@ -68,7 +68,7 @@ class Mage_Core_Model_Config_Options ext | ||
| + | |||
| + | | ||
| + | { | ||
| + | - $this-> | ||
| + | + # | ||
| + | | ||
| + | $dir = $this-> | ||
| + | if (!$dir) { | ||
| + | diff -rupbB magento/ | ||
| + | --- magento/ | ||
| + | +++ magento-1.3.2.4/ | ||
| + | @@ -213,7 +213,7 @@ class Mage_Core_Model_Config extends Mag | ||
| + | |||
| + | | ||
| + | |||
| + | - if (Mage:: | ||
| + | + if (Mage:: | ||
| + | if ($this-> | ||
| + | | ||
| + | | ||
| + | @@ -286,6 +286,9 @@ class Mage_Core_Model_Config extends Mag | ||
| + | { | ||
| + | | ||
| + | | ||
| + | + if (!$options) { | ||
| + | + $options = Mage:: | ||
| + | + } | ||
| + | | ||
| + | } | ||
| + | |||
| + | diff -rupbB magento/ | ||
| + | --- magento/ | ||
| + | +++ magento-1.3.2.4/ | ||
| + | @@ -62,16 +62,19 @@ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | + < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | + < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | + < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | diff -rupbB magento/ | ||
| + | --- magento/ | ||
| + | +++ magento-1.3.2.4/ | ||
| + | @@ -66,7 +66,8 @@ class Mage_Install_Model_Installer_Files | ||
| + | | ||
| + | | ||
| + | | ||
| + | - $checkRes = $this-> | ||
| + | + $path = isset($item[' | ||
| + | + $checkRes = $this-> | ||
| + | $res = $res && $checkRes; | ||
| + | } | ||
| + | } | ||
| + | @@ -85,7 +86,11 @@ class Mage_Install_Model_Installer_Files | ||
| + | | ||
| + | { | ||
| + | $res = true; | ||
| + | + if ($path[0]=='/' | ||
| + | + $fullPath = $path; | ||
| + | + } else { | ||
| + | | ||
| + | + } | ||
| + | if ($mode == self:: | ||
| + | | ||
| + | if ($existence) { | ||
| + | diff -rupbB magento/ | ||
| + | --- magento/ | ||
| + | +++ magento-1.3.2.4/ | ||
| + | @@ -452,6 +452,8 @@ final class Mage { | ||
| + | | ||
| + | |||
| + | | ||
| + | + | ||
| + | + self:: | ||
| + | | ||
| + | | ||
| + | |||
| + | @@ -518,10 +518,13 @@ final class Mage { | ||
| + | if (!empty($options[' | ||
| + | | ||
| + | } | ||
| + | + if ($etcDir[0]=='/' | ||
| + | + $localConfigFile = $etcDir . DS . ' | ||
| + | + } else { | ||
| + | | ||
| + | + } | ||
| + | |||
| + | | ||
| + | - | ||
| + | if (is_readable($localConfigFile)) { | ||
| + | | ||
| + | | ||
| + | </ | ||