Skip to content

Commit

Permalink
Remove manifest files and use existing XML info
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed May 29, 2017
1 parent 3b4b063 commit b5b9fb3
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 755 deletions.
8 changes: 3 additions & 5 deletions libraries/src/CMS/Installer/Adapter/LibraryAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,6 @@ public function uninstall($id)
// Because libraries may not have their own folders we cannot use the standard method of finding an installation manifest
if (file_exists($manifestFile))
{
$manifest = new LibraryManifest($manifestFile);

// Set the library root path
$this->parent->setPath('extension_root', JPATH_PLATFORM . '/' . $manifest->libraryname);

$xml = simplexml_load_file($manifestFile);

// If we cannot load the XML file return null
Expand All @@ -413,6 +408,9 @@ public function uninstall($id)
return false;
}

// Set the library root path
$this->parent->setPath('extension_root', JPATH_PLATFORM . '/' . (string) $xml->libraryname);

// Check for a valid XML root tag.
if ($xml->getName() != 'extension')
{
Expand Down
12 changes: 5 additions & 7 deletions libraries/src/CMS/Installer/Adapter/PackageAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ protected function triggerManifestScript($method)
public function uninstall($id)
{
$row = null;
$retval = true;

$row = Table::getInstance('extension');
$row->load($id);
Expand All @@ -553,10 +552,6 @@ public function uninstall($id)
}

$manifestFile = JPATH_MANIFESTS . '/packages/' . $row->get('element') . '.xml';
$manifest = new PackageManifest($manifestFile);

// Set the package root path
$this->parent->setPath('extension_root', JPATH_MANIFESTS . '/packages/' . $manifest->packagename);

// Because packages may not have their own folders we cannot use the standard method of finding an installation manifest
if (!file_exists($manifestFile))
Expand All @@ -577,6 +572,9 @@ public function uninstall($id)
return false;
}

// Set the package root path
$this->parent->setPath('extension_root', JPATH_MANIFESTS . '/packages/' . $xml->packagename);

// Check for a valid XML root tag.
if ($xml->getName() != 'extension')
{
Expand All @@ -586,7 +584,7 @@ public function uninstall($id)
}

// If there is an manifest class file, let's load it
$manifestScript = (string) $manifest->scriptfile;
$manifestScript = (string) $xml->scriptfile;

if ($manifestScript)
{
Expand Down Expand Up @@ -670,7 +668,7 @@ public function uninstall($id)
}

// Return the result up the line
return $retval;
return true;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/CMS/Installer/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ public function discover_install($eid = null)
*
* Asks each adapter to find extensions
*
* @return InstallerExtension[]
* @return Extension[]
*
* @since 3.1
*/
Expand Down
14 changes: 12 additions & 2 deletions libraries/src/CMS/Installer/InstallerAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,19 @@ protected function canUninstallPackageChild($packageId)
return true;
}

$manifest = new PackageManifest($manifestFile);
$blockChildUninstall = false;

return $manifest->blockChildUninstall === false;
if (isset($xml->blockChildUninstall))
{
$value = (string) $xml->blockChildUninstall;

if ($value === '1' || $value === 'true')
{
$blockChildUninstall = true;
}
}

return $blockChildUninstall === false;
}

/**
Expand Down
154 changes: 0 additions & 154 deletions libraries/src/CMS/Installer/InstallerExtension.php

This file was deleted.

140 changes: 0 additions & 140 deletions libraries/src/CMS/Installer/Manifest.php

This file was deleted.

0 comments on commit b5b9fb3

Please sign in to comment.