cvs: pear /Net_DIME/test dime_message_test.php dime_record_test.php
| From: | Jan Schneider | Date: | Mon, 05 Mar 2007 14:53:14 +0000 |
| Subject: | cvs: pear /Net_DIME/test dime_message_test.php dime_record_test.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-44984@lists.php.net to get a copy of this message | ||
yunosh Mon Mar 5 14:53:14 2007 UTC
Modified files:
/pear/Net_DIME/test dime_message_test.php dime_record_test.php
Log:
Style
http://cvs.php.net/viewvc.cgi/pear/Net_DIME/test/dime_message_test.php?r1=1.4&r2=1.5&diff_format=u
Index: pear/Net_DIME/test/dime_message_test.php
diff -u pear/Net_DIME/test/dime_message_test.php:1.4 pear/Net_DIME/test/dime_message_test.php:1.5
--- pear/Net_DIME/test/dime_message_test.php:1.4 Mon Jul 8 00:36:12 2002
+++ pear/Net_DIME/test/dime_message_test.php Mon Mar 5 14:53:14 2007
@@ -1,5 +1,9 @@
<?php
-include 'Net/DIME.php';
+/**
+ * @package Net_DIME
+ */
+
+require 'Net/DIME.php';
$test='--=_a2cbb051424cc43e72d3c8c8d0b8f70e
Content-Type: text/xml; charset="UTF-8"
@@ -545,27 +549,23 @@
Ow0KI3ByaW50X3IoJHJlc3ApOw0KcHJpbnQgJGNsaWVudC0+d2lyZTsNCj8+
--=_a2cbb051424cc43e72d3c8c8d0b8f70e--
';
-$debug = FALSE;
-$data = NULL;
-$f = fopen('/tmp/dime.data','wb+');
-$dime = new Net_DIME_Message($f,4096,$debug);
+
+$f = fopen('/tmp/dime.data', 'wb+');
+$dime = new Net_DIME_Message($f);
$dime->sendData($test);
-#$dime->sendData($test);
$dime->sendEndMessage();
$size = ftell($f);
-print "filesize: $size, datasize: ".strlen($test)."\n";
+print "filesize: $size, datasize: " . strlen($test) . "\n";
rewind($f);
-$dime = new Net_DIME_Message($f,4096,$debug);
+$dime = new Net_DIME_Message($f);
$err = $dime->read();
if (PEAR::isError($err)) {
- print $err->getMessage()."\n";
+ echo $err->getMessage() . "\n";
} else {
- if (strcmp($dime->parts[0]['data'],$test)==0) {
+ if (strcmp($dime->parts[0]['data'], $test) == 0) {
echo "encode/decode success\n";
} else {
echo "encode/decode failure\n";
}
}
-
-?>
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/pear/Net_DIME/test/dime_record_test.php?r1=1.4&r2=1.5&diff_format=u
Index: pear/Net_DIME/test/dime_record_test.php
diff -u pear/Net_DIME/test/dime_record_test.php:1.4 pear/Net_DIME/test/dime_record_test.php:1.5
--- pear/Net_DIME/test/dime_record_test.php:1.4 Mon Jan 22 15:56:12 2007
+++ pear/Net_DIME/test/dime_record_test.php Mon Mar 5 14:53:14 2007
@@ -1,5 +1,9 @@
<?php
-include 'Net/DIME.php';
+/**
+ * @package Net_DIME
+ */
+
+require 'Net/DIME.php';
$test='--=_a2cbb051424cc43e72d3c8c8d0b8f70e
Content-Type: text/xml; charset="UTF-8"
@@ -37,16 +41,13 @@
--=_a2cbb051424cc43e72d3c8c8d0b8f70e--
';
-$data = NULL;
-$dime = new Net_DIME_Record($data);
-#$dime->setMB();
+$dime = new Net_DIME_Record();
$dime->generateID();
$dime->setType('text/plain');
$dime->setData($test);
print_r($dime->Elements);
$enc = $dime->encode();
-print bin2hex(substr($enc,0,8))."\n";
-print chunk_split(bin2hex(substr($enc,8)),72)."\n";
+echo bin2hex(substr($enc, 0, 8)) . "\n";
+echo chunk_split(bin2hex(substr($enc, 8)), 72) . "\n";
$dime->decode($enc);
print_r($dime->Elements);
-?>
\ No newline at end of file