cvs: pear /Mail_Mbox package.xml /Mail_Mbox/tests mbox_test.php
| From: | Roberto Bert� | Date: | Wed, 06 Oct 2004 20:15:18 +0000 |
| Subject: | cvs: pear /Mail_Mbox package.xml /Mail_Mbox/tests mbox_test.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-24642@lists.php.net to get a copy of this message | ||
darkelder Wed Oct 6 16:15:18 2004 EDT
Added files:
/pear/Mail_Mbox/tests mbox_test.php
Modified files:
/pear/Mail_Mbox package.xml
Log:
added a sample script
http://cvs.php.net/diff.php/pear/Mail_Mbox/package.xml?r1=1.3&r2=1.4&ty=u
Index: pear/Mail_Mbox/package.xml
diff -u pear/Mail_Mbox/package.xml:1.3 pear/Mail_Mbox/package.xml:1.4
--- pear/Mail_Mbox/package.xml:1.3 Mon Dec 30 11:25:19 2002
+++ pear/Mail_Mbox/package.xml Wed Oct 6 16:15:16 2004
@@ -2,6 +2,7 @@
<package version="1.0">
<name>Mail_Mbox</name>
<summary>Mbox PHP class to Unix MBOX parsing and using.</summary>
+ <license>LGPL</license>
<description>It can split messages inside a Mbox, return the number of messages, return,
update or remove an specific message or add a message on the Mbox.</description>
<maintainers>
<maintainer>
@@ -12,17 +13,23 @@
</maintainer>
</maintainers>
<release>
- <version>0.1.5</version>
- <date>2002-12-29</date>
- <license>LGPL</license>
+ <version>0.2.0</version>
+ <date>2004-10-06</date>
<state>alpha</state>
- <notes>o Security fix (changed umask on temp files)
-o Improved stylistcs with new Jon Parise patch
-o Fixed error on license at project.xml (it isnt really PHP license, it is LGPL)</notes>
+ <notes>o fixed mbox::size() bug that have never return 0 (Roger Keays)
+o mbox::remove() now accept arrays on $message param as well (Roger Keays)
+o declarated all vars to skip php warnings on high warning levels (Roger Keays)
+o some minor spelling errors (Roger Keays)
+o fwrite must use '===' false instead of !fwrite (Roger Keays)</notes>
<filelist>
- <file role="php" baseinstalldir="Mail"
md5sum="1b61c6f960c5e616ba11d61bcdabfd77" name="mbox.php"/>
+ <dir name="/" baseinstalldir="Mail">
+ <file role="php" name="mbox.php"
md5sum="747fbb5b793642372e68b608e2a72742" />
+ <dir name="tests" role="test">
+ <file name="mbox_test.php"
md5sum="86931f9b4e844f211f3fea46944d1170" />
+ </dir>
+ </dir>
</filelist>
- </release>
+ </release>
<changelog>
<release>
<version>0.1.5</version>
http://cvs.php.net/co.php/pear/Mail_Mbox/tests/mbox_test.php?r=1.1&p=1
Index: pear/Mail_Mbox/tests/mbox_test.php
+++ pear/Mail_Mbox/tests/mbox_test.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt.
|
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Roberto Berto <darkelder.php.net> |
// +----------------------------------------------------------------------+
//
// $Id: mbox_test.php,v 1.1 2004/10/06 20:15:16 darkelder Exp $
// some random content
$content = <<<EOF
From Foo@example.com Fri Dec 27 14:31:10 2002
Return-Path:
Received: from [unix socket] by campos.terra.com.br (LMTP); Fri, 27 Dec
2002 14:31:10 -0200 (BRST)
Date: Fri, 27 Dec 2002 14:31:21 -0500
Message-Id: <200212271931.gBRJVL012289@example.com>
Received: from pcp128525pcs.medfrd01.nj.comcast.net (
pcp128525pcs.medfrd01.nj.comcast.net [68.45.42.4]) by
serjolen6com.siteprotect.net (v64.19) with ESMTP id
MAILRELAYINZA98-3601058302; Fri, 08 Nov 2002 06:39:05 -0500
From: "Foo@example.com"
To: fool@example.com
Subject: This is A SPAM!!
Content-Type: text/plan
testing foo spam
EOF;
// starting mbox
require_once "mbox.php";
$mbox =& new Mail_Mbox();
// uncomment to see lots of things
$mbox->debug = false;
// opennign file mbox
$mid = $mbox->open("mbox");
if ($mbox->size($mid) == 0) {
print "No message found";
}
// uncomment to see internal vars
# print_r($mbox);
/*
// deleting a message (uncomment to test)
$res1 = $mbox->remove($mid,0);
if (PEAR::isError($res1))
{
print $res1->getMessage();
}
*/
/*
// changing a message (uncomment to test)
$res2 = $mbox->update($mid,0,$content);
if (PEAR::isError($res2))
{
print $res2->getMessage();
}
// adding a message (uncomment to test)
$res3 = $mbox->insert($mid,$content,0);
if (PEAR::isError($res3))
{
print $res3->getMessage();
}
*/
require_once "Mail/mimeDecode.php";
// showing current messages with Mail Mime
for ($x = 0; $x < $mbox->size($mid); $x++)
{
printf("Message: %08d<pre>",$x);
$thisMessage = $mbox->get($mid,$x);
print $thisMessage;
print "<hr>";
$decode = new Mail_mimeDecode($thisMessage, "\r\n");
$structure = $decode->decode();
print_r($structure);
print "</pre><hr><hr><hr>";
}
?>