8.4 download imap separately, compatible with 8.1-8.3

This commit is contained in:
crazywhalecc
2024-11-02 21:47:39 +08:00
committed by Jerry Ma
parent 73e3480bdf
commit 1fa5514c57
4 changed files with 228 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ class SourcePatcher
FileSystem::addSourceExtractHook('pdo_sqlsrv', [SourcePatcher::class, 'patchSQLSRVWin32']);
FileSystem::addSourceExtractHook('yaml', [SourcePatcher::class, 'patchYamlWin32']);
FileSystem::addSourceExtractHook('libyaml', [SourcePatcher::class, 'patchLibYaml']);
FileSystem::addSourceExtractHook('php-src', [SourcePatcher::class, 'patchImapLicense']);
}
/**
@@ -370,6 +371,18 @@ class SourcePatcher
return true;
}
/**
* Patch imap license file for PHP < 8.4
*/
public static function patchImapLicense(): bool
{
if (!file_exists(SOURCE_PATH . '/php-src/ext/imap/LICENSE') && is_dir(SOURCE_PATH . '/php-src/ext/imap')) {
file_put_contents(SOURCE_PATH . '/php-src/ext/imap/LICENSE', file_get_contents(ROOT_DIR . '/src/globals/extra/Apache_LICENSE'));
return true;
}
return false;
}
/**
* Patch cli SAPI Makefile for Windows.
*