NYCPHP Meetup

NYPHP.org

[nycphp-talk] making a manual http POST using a PHP client (USPSwebservices)

Chris Snyder csnyder at chxo.com
Tue Jul 13 01:30:10 EDT 2004


Hans Zaunere wrote:

> Yeah, but sockets are cool. And yes, streams are very cool, but unless 
> I'm writing in PHP 5, I wouldn't make extensive use of them in my code.


But... sockets *are* streams. ?!?

I use fsockopen because you can set timeouts, both for the initial 
connect and for data on the wire. file_get_contents() is great until the 
other guy's site goes down.


>From hans not junk at nyphp.com  Tue Jul 13 10:35:52 2004
Return-Path: <hans not junk at nyphp.com>
Received: from smtp11.intermedia.net (smtp11.intermedia.net [64.78.21.10])
	by virtu.nyphp.org (Postfix) with ESMTP id A97EBA86BF
	for <talk at lists.nyphp.org>; Tue, 13 Jul 2004 10:35:52 -0400 (EDT)
Received: from ehost011-1.exch011.intermedia.net ([64.78.21.3]) by
	smtp11.intermedia.net with Microsoft SMTPSVC(6.0.3790.0); 
	Tue, 13 Jul 2004 07:27:16 -0700
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] making a manual http POST using a
	PHPclient	(USPSwebservices)
Date: Tue, 13 Jul 2004 07:35:48 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F870306CC93 at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] making a manual http POST using a
	PHPclient	(USPSwebservices)
Thread-Index: AcRomm3AiN48Kx8hT1uos3wBvPnY7QASd1SQ
From: "Hans Zaunere" <hans not junk at nyphp.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
X-OriginalArrivalTime: 13 Jul 2004 14:27:16.0180 (UTC)
	FILETIME=[7F107140:01C468E5]
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk <talk at lists.nyphp.org>
List-Id: NYPHP Talk <talk.lists.nyphp.org>
List-Unsubscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=unsubscribe>
List-Archive: <http://lists.nyphp.org/pipermail/talk>
List-Post: <mailto:talk at lists.nyphp.org>
List-Help: <mailto:talk-request at lists.nyphp.org?subject=help>
List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Jul 2004 14:35:53 -0000


> > Yeah, but sockets are cool. And yes, streams are very cool, but
unless
> > I'm writing in PHP 5, I wouldn't make extensive use of them in my
code.
>=20
>=20
> But... sockets *are* streams. ?!?

Right... and a "tomato" is the same as a "tomatoe"...

That's a question that can be answered 100 different ways depending on
who you ask:   BSD vs ATT vs Windows vs TCP vs UDP vs PHP vs C vs Kernel
land vs User land.... they are some overused terms to put it frankly.

Anyway, in PHP they are quite similar.  What "streams" are now in late
PHP 4 and PHP 5, was a rewrite/extension of the original socket/stream
niceness of earlier PHP versions.

So what does this really mean?  Today's streams are enhanced sockets...
but with a twist.  Generally a socket is considered related to network
or intra-process connectivity somehow.  Streams, in PHP anyway, can also
be used for disk-based "communication".  So a PHP stream is extremely
powerful, and can be used for essentially any type of communication, and
in fact, the line between network and disk communication becomes blurred
in PHP.  Thus, there is a single API that allows almost transparent
communication, regardless of whether it's going out on a network wire,
or a disk-controller wire.

> I use fsockopen because you can set timeouts, both for the initial
> connect and for data on the wire. file_get_contents() is great until
the
> other guy's site goes down.

Yes, but this is where PHP streams come in, and especially in PHP 5.  In
5, the full power of filters/contexts/wrappers/etc is available, which
allows you to control timeouts and so forth in powerful and dynamic new
ways.

And there's http://php.net/stream_set_timeout which is even available in
4, and the only way to AFAIK in 5 to change the timeout of a "socket".

So yeah, sockets and streams are the same  :)

H

>From hans not junk at nyphp.com  Tue Jul 13 10:39:21 2004
Return-Path: <hans not junk at nyphp.com>
Received: from smtp11.intermedia.net (smtp11.intermedia.net [64.78.21.10])
	by virtu.nyphp.org (Postfix) with ESMTP id AA25AA86BF
	for <talk at lists.nyphp.org>; Tue, 13 Jul 2004 10:39:21 -0400 (EDT)
Received: from ehost011-1.exch011.intermedia.net ([64.78.21.3]) by
	smtp11.intermedia.net with Microsoft SMTPSVC(6.0.3790.0); 
	Tue, 13 Jul 2004 07:30:45 -0700
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] PHP5 SOAP Extension with Attachments
Date: Tue, 13 Jul 2004 07:39:17 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F870306CC9B at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] PHP5 SOAP Extension with Attachments
Thread-Index: AcRoaLwo5X5AwthzRA2xFxSjH4l/GwAfhrRA
From: "Hans Zaunere" <hans not junk at nyphp.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
X-OriginalArrivalTime: 13 Jul 2004 14:30:45.0433 (UTC)
	FILETIME=[FBC9EA90:01C468E5]
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk <talk at lists.nyphp.org>
List-Id: NYPHP Talk <talk.lists.nyphp.org>
List-Unsubscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=unsubscribe>
List-Archive: <http://lists.nyphp.org/pipermail/talk>
List-Post: <mailto:talk at lists.nyphp.org>
List-Help: <mailto:talk-request at lists.nyphp.org?subject=help>
List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Jul 2004 14:39:22 -0000


> maybe, but the name SOAP (rhymes with NOPE) is far more brandable than
> "pee myme"   ;-)

Yes, pMIME needs a new image  :)

By the way, if anyone wants the code, a practically perfect copy is at:

http://cvs.nyphp.org/cvsweb.cgi/pmail/

I say practically because I never finished the parseField() method

H


>From hans not junk at nyphp.com  Tue Jul 13 10:54:55 2004
Return-Path: <hans not junk at nyphp.com>
Received: from smtp11.intermedia.net (smtp11.intermedia.net [64.78.21.10])
	by virtu.nyphp.org (Postfix) with ESMTP id EA7A6A86BF
	for <talk at lists.nyphp.org>; Tue, 13 Jul 2004 10:54:54 -0400 (EDT)
Received: from ehost011-1.exch011.intermedia.net ([64.78.21.3]) by
	smtp11.intermedia.net with Microsoft SMTPSVC(6.0.3790.0); 
	Tue, 13 Jul 2004 07:46:18 -0700
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] SDK/IDE - Lightbulb
Date: Tue, 13 Jul 2004 07:54:49 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F870306CCB4 at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] SDK/IDE - Lightbulb
Thread-Index: AcRmBipXSamRHz8hSPSqta07mSTafQC4Xy6w
From: "Hans Zaunere" <hans not junk at nyphp.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
X-OriginalArrivalTime: 13 Jul 2004 14:46:18.0637 (UTC)
	FILETIME=[28058BD0:01C468E8]
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk <talk at lists.nyphp.org>
List-Id: NYPHP Talk <talk.lists.nyphp.org>
List-Unsubscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=unsubscribe>
List-Archive: <http://lists.nyphp.org/pipermail/talk>
List-Post: <mailto:talk at lists.nyphp.org>
List-Help: <mailto:talk-request at lists.nyphp.org?subject=help>
List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Jul 2004 14:54:55 -0000


> I'm not sure if I remembered to send this to the list, but this is
from
> chromatic at O'Reilly.
>=20
> --- chromatic <chromatic at oreilly.com> wrote:
> > Hi Chris,
> >
> > Know anyone in the PHP community who might be interested?
> >
> > Best,
> > -- c
> >
> > -----Forwarded Message-----
> >
> > Ok; as a caveat, I'm a biz-dev guy and we're bootstrapping our young
> > company...

On June 30th, New York PHP announced
(http://lists.nyphp.org/pipermail/announce/2004-June/000106.html) that
the NYPHP Charter had been revised to prevent the use of the NYPHP
mailing lists "to promote any commercial activities unless that posting
has received prior board approval."

Although we're all supportive of PHP's growth, success and adoption, we
want to be sure NYPHP-Talk isn't subjected to unsolicited commercial
mailings, and in keeping with its history of high technical content and
community support.

This message has been reviewed and determined that it violates that
prohibition.  Since, however, this is the first violation of a new
policy which may have been incompletely understood or even overlooked by
users of NYPHP-Talk, I am taking this opportunity to simply publicize
the policy further.

I do urge everyone to review http://nyphp.org/charter and specifically
the section "Appropriate Use of Mailing Lists".

The proper way to handle posting this information would have been to use
the form at http://nyphp.org/contact.php to ask the Board whether the
posting would be permitted.  Please follow this procedure whenever you
are contemplating submitting a post with this kind of commercial slant.


Thank you everyone.

---
Hans Zaunere
President
New York PHP
http://nyphp.org




> > we've developed some very interesting technology; PHP
> > Architect Magazine ran their second story/review on us in their
April
> > '04 issue.
> >
> > We're trying to get the word out about our unique SDK/IDE called
> > "Lightbulb", and would greatly appreciate any suggestions you might
> > have as to working with the groups that you do, or with publishers
so
> > that we might compete for awards and have our solutions reviewed.
> >  Here's a link, and I'll be happy to put you in touch with our
engineers
> > if you'd like to take a look.





More information about the talk mailing list