28 lines
618 B
PHP
Raw Normal View History

2025-05-20 07:46:07 +07:00
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
2025-05-20 08:24:28 +07:00
use SPC\builder\linux\LinuxBuilder;
2025-05-20 07:46:07 +07:00
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('phar')]
class phar extends Extension
{
public function patchBeforeSharedBuild(): bool
{
2025-05-20 08:24:28 +07:00
if (!$this->builder instanceof LinuxBuilder) {
return false;
}
2025-05-20 07:46:07 +07:00
FileSystem::replaceFileStr(
$this->source_dir . '/config.m4',
['$ext_dir/phar.1', '$ext_dir/phar.phar.1'],
['${ext_dir}phar.1', '${ext_dir}phar.phar.1']
);
return true;
}
}