Files
kulakpos_web/vendor/thecodingmachine/safe/generated/8.1/mailparse.php

93 lines
2.0 KiB
PHP
Raw Normal View History

2026-03-30 14:54:57 +07:00
<?php
namespace Safe;
use Safe\Exceptions\MailparseException;
/**
2026-04-18 20:32:18 +07:00
* @param resource $mimemail
* @param mixed $filename
* @param callable $callbackfunc
* @return string
2026-03-30 14:54:57 +07:00
* @throws MailparseException
*
*/
function mailparse_msg_extract_part_file($mimemail, $filename, ?callable $callbackfunc = null): string
{
error_clear_last();
if ($callbackfunc !== null) {
$safeResult = \mailparse_msg_extract_part_file($mimemail, $filename, $callbackfunc);
} else {
$safeResult = \mailparse_msg_extract_part_file($mimemail, $filename);
}
if ($safeResult === false) {
throw MailparseException::createFromPhpError();
}
return $safeResult;
}
/**
2026-04-18 20:32:18 +07:00
* @param resource $mimemail
2026-03-30 14:54:57 +07:00
* @throws MailparseException
*
*/
function mailparse_msg_free($mimemail): void
{
error_clear_last();
$safeResult = \mailparse_msg_free($mimemail);
if ($safeResult === false) {
throw MailparseException::createFromPhpError();
}
}
/**
2026-04-18 20:32:18 +07:00
* @param string $filename
* @return resource
2026-03-30 14:54:57 +07:00
* @throws MailparseException
*
*/
function mailparse_msg_parse_file(string $filename)
{
error_clear_last();
$safeResult = \mailparse_msg_parse_file($filename);
if ($safeResult === false) {
throw MailparseException::createFromPhpError();
}
return $safeResult;
}
/**
2026-04-18 20:32:18 +07:00
* @param resource $mimemail
* @param string $data
2026-03-30 14:54:57 +07:00
* @throws MailparseException
*
*/
function mailparse_msg_parse($mimemail, string $data): void
{
error_clear_last();
$safeResult = \mailparse_msg_parse($mimemail, $data);
if ($safeResult === false) {
throw MailparseException::createFromPhpError();
}
}
/**
2026-04-18 20:32:18 +07:00
* @param resource $sourcefp
* @param resource $destfp
* @param string $encoding
2026-03-30 14:54:57 +07:00
* @throws MailparseException
*
*/
function mailparse_stream_encode($sourcefp, $destfp, string $encoding): void
{
error_clear_last();
$safeResult = \mailparse_stream_encode($sourcefp, $destfp, $encoding);
if ($safeResult === false) {
throw MailparseException::createFromPhpError();
}
}