Permalink
Browse files

Merge pull request #1842 from phproberto/manifest

[fix] findmanifest should prioritize main folder manifests
  • Loading branch information...
2 parents beca683 + 2bbbc57 commit 887601e81406c5c0b4e683395f0c7bca018e73ac @dongilbert dongilbert committed Mar 18, 2013
Showing with 8 additions and 2 deletions.
  1. +8 −2 libraries/legacy/installer/installer.php
@@ -1836,8 +1836,14 @@ public function copyManifest($cid = 1)
*/
public function findManifest()
{
- // Get an array of all the XML files from the installation directory
- $xmlfiles = JFolder::files($this->getPath('source'), '.xml$', 1, true);
+ // Main folder manifests (higher priority)
+ $parentXmlfiles = JFolder::files($this->getPath('source'), '.xml$', false, true);
+
+ // Search for children manifests (lower priority)
+ $allXmlFiles = JFolder::files($this->getPath('source'), '.xml$', 1, true);
+
+ // Create an unique array of files ordered by priority
+ $xmlfiles = array_unique(array_merge($parentXmlfiles, $allXmlFiles));
// If at least one XML file exists
if (!empty($xmlfiles))

0 comments on commit 887601e

Please sign in to comment.