31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-06-03 14:10:47 +00:00

Remove Joomla 4 check as this only runs on Joomla 4 Fixes #232

This commit is contained in:
Roland Dalmulder 2020-03-22 10:41:28 +01:00
parent 96fe1e3143
commit 702712a62e
No known key found for this signature in database
GPG Key ID: FD49814C56AE3AF9

View File

@ -89,7 +89,7 @@ class PullModel extends AbstractModel
$params = ComponentHelper::getParams('com_patchtester');
// Decide based on repository settings whether patch will be applied through Github or CIServer
if (version_compare(JVERSION, '4', 'ge') && (bool) $params->get('ci_switch', 1))
if ((bool) $params->get('ci_switch', 1))
{
return $this->applyWithCIServer($id);
}
@ -266,7 +266,7 @@ class PullModel extends AbstractModel
$this->appendPatchChain($lastInserted, $id);
// On Joomla 4 or later, remove the autoloader file
if (version_compare(JVERSION, '4', 'ge') && file_exists(JPATH_LIBRARIES . '/autoload_psr4.php'))
if (file_exists(JPATH_LIBRARIES . '/autoload_psr4.php'))
{
File::delete(JPATH_LIBRARIES . '/autoload_psr4.php');
}
@ -591,7 +591,7 @@ class PullModel extends AbstractModel
$this->saveAppliedPatch($pull->number, $parsedFiles, $pull->head->sha);
// On Joomla 4 or later, remove the autoloader file
if (version_compare(JVERSION, '4', 'ge') && file_exists(JPATH_LIBRARIES . '/autoload_psr4.php'))
if (file_exists(JPATH_LIBRARIES . '/autoload_psr4.php'))
{
File::delete(JPATH_LIBRARIES . '/autoload_psr4.php');
}
@ -689,9 +689,7 @@ class PullModel extends AbstractModel
$params = ComponentHelper::getParams('com_patchtester');
// Decide based on repository settings whether patch will be applied through Github or CIServer
if (version_compare(JVERSION, '4', 'ge') && ((bool) $params->get('ci_switch', 1)
|| $id === $this->getPatchChain($id)->insert_id)
)
if (((bool) $params->get('ci_switch', 1) || $id === $this->getPatchChain($id)->insert_id))
{
return $this->revertWithCIServer($id);
}
@ -832,8 +830,8 @@ class PullModel extends AbstractModel
Folder::delete($backupsPath);
// On Joomla 4 or later, remove the autoloader file
if (version_compare(JVERSION, '4', 'ge') && file_exists(JPATH_LIBRARIES . '/autoload_psr4.php'))
// Remove the autoloader file
if (file_exists(JPATH_LIBRARIES . '/autoload_psr4.php'))
{
File::delete(JPATH_LIBRARIES . '/autoload_psr4.php');
}
@ -1029,8 +1027,8 @@ class PullModel extends AbstractModel
}
}
// On Joomla 4 or later, remove the autoloader file
if (version_compare(JVERSION, '4', 'ge') && file_exists(JPATH_LIBRARIES . '/autoload_psr4.php'))
// Remove the autoloader file
if (file_exists(JPATH_LIBRARIES . '/autoload_psr4.php'))
{
File::delete(JPATH_LIBRARIES . '/autoload_psr4.php');
}