Merge pull request #258 from richard67/master-delete-autoload-psr4-on-j4

Delete autoload_psr4.php when applying or reverting patches on Joomla 4 and later.
This commit is contained in:
Roland Dalmulder 2020-03-22 10:10:02 +01:00 committed by GitHub
commit 0dcf7c45c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 0 deletions

View File

@ -337,6 +337,12 @@ class PullModel extends AbstractModel
// Write or create patch chain for correct order of patching
$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'))
{
File::delete(JPATH_LIBRARIES . '/autoload_psr4.php');
}
// Change the media version
$version = new Version;
$version->refreshMediaVersion();
@ -506,6 +512,12 @@ 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'))
{
File::delete(JPATH_LIBRARIES . '/autoload_psr4.php');
}
// Change the media version
$version = new Version;
$version->refreshMediaVersion();
@ -713,6 +725,12 @@ 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'))
{
File::delete(JPATH_LIBRARIES . '/autoload_psr4.php');
}
// Change the media version
$version = new Version;
$version->refreshMediaVersion();
@ -822,6 +840,12 @@ 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'))
{
File::delete(JPATH_LIBRARIES . '/autoload_psr4.php');
}
// Change the media version
$version = new Version;
$version->refreshMediaVersion();