add library, extension patches in separate classes

This commit is contained in:
crazywhalecc
2023-07-28 23:47:22 +08:00
committed by Jerry Ma
parent e909dd15b0
commit 51ce2befd8
12 changed files with 316 additions and 12 deletions

View File

@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\exception\FileSystemException;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('ssh2')]
class ssh2 extends Extension
{
/**
* @throws FileSystemException
*/
public function patchBeforeConfigure(): bool
{
FileSystem::replaceFile(
SOURCE_PATH . '/php-src/configure',
REPLACE_FILE_PREG,
'/-lssh2/',
$this->getLibFilesString()
);
return true;
}
}