2023-10-31 13:09:01 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
|
|
|
|
|
|
use SPC\builder\Extension;
|
|
|
|
|
use SPC\exception\WrongUsageException;
|
|
|
|
|
use SPC\util\CustomExt;
|
|
|
|
|
|
|
|
|
|
#[CustomExt('imap')]
|
|
|
|
|
class imap extends Extension
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @throws WrongUsageException
|
|
|
|
|
*/
|
2024-05-16 13:01:11 +08:00
|
|
|
public function validate(): void
|
2023-10-31 13:09:01 +01:00
|
|
|
{
|
|
|
|
|
if ($this->builder->getOption('enable-zts')) {
|
|
|
|
|
throw new WrongUsageException('ext-imap is not thread safe, do not build it with ZTS builds');
|
|
|
|
|
}
|
2024-05-16 13:01:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getUnixConfigureArg(): string
|
|
|
|
|
{
|
2023-10-31 13:09:01 +01:00
|
|
|
$arg = '--with-imap=' . BUILD_ROOT_PATH;
|
|
|
|
|
if ($this->builder->getLib('openssl') !== null) {
|
|
|
|
|
$arg .= ' --with-imap-ssl=' . BUILD_ROOT_PATH;
|
|
|
|
|
}
|
|
|
|
|
return $arg;
|
|
|
|
|
}
|
|
|
|
|
}
|