MR~TNT File Manager
Current Path:
/opt/alt/tests/alt-php80-pecl-mailparse_3.1.8-1.el8/tests
opt
/
alt
/
tests
/
alt-php80-pecl-mailparse_3.1.8-1.el8
/
tests
/
ðŸ“
..
📄
001.phpt
(328 B)
📄
002.phpt
(571 B)
📄
003.phpt
(597 B)
📄
004.phpt
(765 B)
📄
005.phpt
(948 B)
📄
006.phpt
(2.26 KB)
📄
007.phpt
(1.15 KB)
📄
008.phpt
(354 B)
📄
009.phpt
(896 B)
📄
010.phpt
(1.27 KB)
📄
011.phpt
(678 B)
📄
012-stream.phpt
(476 B)
📄
012-var.phpt
(465 B)
📄
012.phpt
(435 B)
📄
013.phpt
(354 B)
📄
bug001.phpt
(685 B)
📄
bug73110.phpt
(909 B)
📄
bug74223.phpt
(705 B)
📄
bug75825.phpt
(2.1 KB)
📄
bug81403.phpt
(542 B)
📄
bug81422.phpt
(424 B)
📄
gh19.phpt
(935 B)
📄
gh21.phpt
(1.6 KB)
📄
gh22.phpt
(1.76 KB)
📄
gh24.phpt
(710 B)
📄
gh29.phpt
(598 B)
📄
gh30.phpt
(837 B)
📄
parse_test_messages.phpt
(4.66 KB)
ðŸ“
testdata
Editing: 006.phpt
--TEST-- Check extract_part_file --SKIPIF-- <?php /* vim600: sw=4 ts=4 fdm=marker syn=php */ if (!extension_loaded("mailparse")) @dl("mailparse.so"); if (!extension_loaded("mailparse")) print "skip"; ?> --POST-- --GET-- --FILE-- <?php if (!extension_loaded("mailparse")) @dl("mailparse.so"); $text = <<<EOD To: fred@bloggs.com Mime-Version: 1.0 Content-Type: text/plain Subject: A simple MIME message hello, this is some text hello. blah blah blah. EOD; $fp = tmpfile(); fwrite($fp, $text); rewind($fp); $mime = mailparse_msg_create(); mailparse_msg_parse($mime, $text); echo "Extract to output\n"; mailparse_msg_extract_part_file($mime, $fp); echo "Extract and return as string\n"; $result = mailparse_msg_extract_part_file($mime, $fp, null); echo "-->\n"; echo $result; echo "\nExtract to open file\n"; $fpdest = tmpfile(); mailparse_msg_extract_part_file($mime, $fp, $fpdest); echo "\nrewinding\n"; rewind($fpdest); fpassthru($fpdest); echo "\nExtract via user function\n"; $cbdata = ""; function callbackfunc($data) { $GLOBALS["cbdata"] .= $data; } mailparse_msg_extract_part_file($mime, $fp, "callbackfunc"); echo "callback data is:\n"; var_dump($cbdata); echo "\nExtract via Closure\n"; $cbdata = ""; $callbackfunc = function ($data) { $GLOBALS["cbdata"] .= $data; }; mailparse_msg_extract_part_file($mime, $fp, $callbackfunc); echo "callback data is:\n"; var_dump($cbdata); echo "\nExtract whole part to output\n"; mailparse_msg_extract_whole_part_file($mime, $fp); echo "\nExtract part from string to output\n"; mailparse_msg_extract_part($mime, $text); fclose($fpdest); fclose($fp); ?> --EXPECT-- Extract to output hello, this is some text hello. blah blah blah. Extract and return as string --> hello, this is some text hello. blah blah blah. Extract to open file rewinding hello, this is some text hello. blah blah blah. Extract via user function callback data is: string(48) "hello, this is some text hello. blah blah blah. " Extract via Closure callback data is: string(48) "hello, this is some text hello. blah blah blah. " Extract whole part to output To: fred@bloggs.com Mime-Version: 1.0 Content-Type: text/plain Subject: A simple MIME message hello, this is some text hello. blah blah blah. Extract part from string to output hello, this is some text hello. blah blah blah.
Upload File
Create Folder