mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
36 lines
1000 B
PHP
36 lines
1000 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace SPC\builder\extension;
|
||
|
|
|
||
|
|
use SPC\builder\Extension;
|
||
|
|
use SPC\store\FileSystem;
|
||
|
|
use SPC\util\CustomExt;
|
||
|
|
|
||
|
|
#[CustomExt('amqp')]
|
||
|
|
class amqp extends Extension
|
||
|
|
{
|
||
|
|
public function patchBeforeMake(): bool
|
||
|
|
{
|
||
|
|
if (PHP_OS_FAMILY === 'Windows') {
|
||
|
|
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp.h', '/^#warning.*/m', '');
|
||
|
|
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp_framing.h', '/^#warning.*/m', '');
|
||
|
|
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp_ssl_socket.h', '/^#warning.*/m', '');
|
||
|
|
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp_tcp_socket.h', '/^#warning.*/m', '');
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getUnixConfigureArg(): string
|
||
|
|
{
|
||
|
|
return '--with-amqp --with-librabbitmq-dir=' . BUILD_ROOT_PATH;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getWindowsConfigureArg(): string
|
||
|
|
{
|
||
|
|
return '--with-amqp';
|
||
|
|
}
|
||
|
|
}
|