 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Kevin Schroeder's Blog: You want to do WHAT with PHP? Chapter 4
by Chris Cornutt September 02, 2010 @ 13:49:23
Kevin Schroeder has another new post to his blog today with an excerpt from his "You Want to Do WHAT with PHP?" book. This new post is a section from the fourth chapter looking at stream handling.
Communication is key to building applications now and for the future. While it is not something that I think that everyone should do, I have not seem many applications that make good use of streams in PHP. Streams can be immensely useful in the right situations, but a lot of developers are not really aware of how streams can be used. [...] While I don't think you will end up basing your application around streams it is a really good idea to know how streams work.
The sample code (and description) talk about changing the properties of a stream on the fly. He shows how, with a fgets loop checking the input, he can catch a command from the already running script and change the compression setting on the currently open stream. The compression changes the stream's data from plain text to a binary format as handled by the streams functionality.
voice your opinion now!
book excerpt kevinschroeder streams
Davey Shafik's Blog: Avoiding EVAL()
by Chris Cornutt February 02, 2009 @ 11:15:24
Davey Shafik has a helpful hint for avoiding one of the worst functions to use in PHP - eval.
There are a shed-load of ways to "eval()" code without actually calling the eval() function '" usually done simply to avoid the use of the dreaded "evil()" function, but often times because the system has eval() disabled using "disable_functions" in php.ini. Here is another simple way to avoid eval() without writing out files to the filesystem
His example uses the streams wrapper to natively execute the code from a string variable as a data element, base64 decoded. It's more of a proof-of-concept than anything else, but its an interesting solution to a tough problem to solve at times.
voice your opinion now!
eval evil avoid streams wrapper data base64 execute
Matthew Turland's Blog: Benchmarking PHP HTTP Clients
by Chris Cornutt November 24, 2008 @ 07:56:30
Matthew Turland has this new blog post looking at some benchmarks he's generated for a group of mainstream PHP HTTP clients:
One of the interesting bits of research that I've done is benchmarking various mainstream PHP HTTP clients. Of course, we all know that there are lies, damned lies, statistics, and benchmarks, so take these with a grain of salt.
He ran them on his Sony Viao on Ubuntu with a stock PHP5 package. The tested packages were the pecl_http extension, the streams http wrapper, curl integration into PHP 5, PEAR::HTTP Client class and the Zend_Http_Client component. He includes the code he used for both a basic request and for something slightly more complex (posting form data). He used the XDebug and KCachegrind combination to produce the results.
voice your opinion now!
benchmark http client pecl pear zendframework streams curl
Davey Shafik's Blog: PHP Streams Book (Coming soon!)
by Chris Cornutt April 25, 2008 @ 12:04:09
We can expect big things from Davey Shafik in the coming months - he's been working on a book for php|architect about one of the more powerful bits of functionality in PHP - streams.
For about 6 months now, I've been itching to write a book on the PHP Streams Layer - one of my favorite features of PHP; and also one of the least known considering it's powerful abilities.
He describes his goal simply as this: to create the definitive resource for working with the streams later in PHP. It should be out sometime in the third quarter of 2008, so keep your eye out for it then.
voice your opinion now!
streams layer book phparchitect publish definitive guide
PHPClasses.org: A PHP killer feature - Streams abstraction
by Chris Cornutt February 01, 2008 @ 15:36:24
On the PHPClasses.org website there's a new entry covering, among other things, one handy feature PHP includes to let developers read and write their data more flexibly - streams.
This article explains what are stream handlers and how they simplify PHP developers lives by allowing PHP applications to easily read and write data from containers, like remote Web pages or e-mail messages, as if they were files. [...] The article also presents more examples of cool stream handlers classes submitted to the PHPClasses site by several authors.
He describes the abstraction that the streams interface allows, how they can make your life easier, a real-life example of streams in action (working with POP3) and some of the classes that have been contributed to PHPClasses.org that use them.
voice your opinion now!
streams abstraction class example pop3 handler streams abstraction class example pop3 handler
|
Community Events
Don't see your event here? Let us know!
|