Add extension dio support (#590)

* Add extension dio support

* cs-fix
This commit is contained in:
Jerry Ma
2025-01-25 18:43:12 +09:00
committed by GitHub
parent 36b4ef306e
commit f19e90afd7
5 changed files with 52 additions and 6 deletions

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('dio')]
class dio extends Extension
{
public function patchBeforeBuildconf(): bool
{
if (!file_exists(SOURCE_PATH . '/php-src/ext/dio/php_dio.h')) {
FileSystem::writeFile(SOURCE_PATH . '/php-src/ext/dio/php_dio.h', FileSystem::readFile(SOURCE_PATH . '/php-src/ext/dio/src/php_dio.h'));
return true;
}
return false;
}
}