Exemple #1
0
 /**
  * Internal method to get the default replacements for the main site URL
  *
  * @param   AngieModelBaseConfiguration $config The configuration model
  *
  * @return  array  Any replacements to add
  */
 private function getDefaultReplacementsForMainSite($config)
 {
     $replacements = array();
     // These values are stored inside the session, after the setup step
     $old_url = $config->get('old_live_site');
     $new_url = $config->get('live_site');
     if ($old_url == $new_url) {
         return $replacements;
     }
     // Replace the absolute URL to the site
     $replacements[$old_url] = $new_url;
     // If the relative path to the site is different, replace it too.
     $oldUri = new AUri($old_url);
     $newUri = new AUri($new_url);
     $oldPath = $oldUri->getPath();
     $newPath = $newUri->getPath();
     if ($oldPath != $newPath) {
         $replacements[$oldPath] = $newPath;
         return $replacements;
     }
     return $replacements;
 }