News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

Lorna Mitchell's Blog:
Accessing Incoming PUT Data from PHP
July 31, 2008 @ 12:05:35

For a recent REST web service project, Lorna Mitchell had to put together a server for the remote clients to use. She started with a GET request then moved to handling a POST request then to a PUT request - that's where the difficulty came in:

PHP doesn't have a built-in way to do this, and at first I was a little confused as to how I could reach this information. It turns out that this can be read from the incoming stream to PHP, php://input.

Pulling from that stream gave her the raw data she needed (nicely urlencoded too) that she could parse out and use. She includes a simple example that has a check for the REQUEST_TYPE in the _SERVER superglobal to see how the request should be handled (PUT versus GET).

0 comments voice your opinion now!
put get data incoming rest webservice stream input



P3 Podcast:
2008.07.24 Live Podcast Announcement
July 24, 2008 @ 12:44:08

A new announcement has been posted to the P3 podcast website - a special live broadcast of the show will be happening in July 29th:

Please join us on Tuesday, July 29, 2008 for a special live edition of php|architect's P3 Podcast. It will be special not only because we will be be broadcasting video via Yahoo!Live, but it will also be Sean's last P3 podcast.

If you want to join in, show up at Paul's Yahoo!Live feed at around 9PM Eastern (America/Montreal) to be a part of the show.

Sean will be no longer hosting the podcast and will be leaving php|architect and will be joining the ranks of OmniTI as a part of their PHP + Security group.

0 comments voice your opinion now!
live podcast announcement yahoolive stream phparchitect podcast


Rob Allen's Blog:
A View Stream with Zend_View
February 07, 2008 @ 07:58:17

Rob Allen has posted about a small modification that he made to his Zend Framework setup that allows for a little safer echoing of information out to the View later of an application.

One of my biggest issues with using PHP as the templating engine in View scripts is that the easiest way to echo a variable is the least secure. [...] So, I decided to leverage a post by Mike Naberezny from a while ago about streams. The idea is all his; I just modified it to work with Zend Framework's Zend_View the way I wanted it to.

His method uses a slightly different output format - instead of using a normal echo statement to push out the escaped output, it uses a special syntax using the "@" sign as a shortcut to the call to escape(). He includes the code you'll need to make it work in your ZF install and explain it a bit (including where the real key lies - in stream_popen).

0 comments voice your opinion now!
zendframework stream zendview escape custom output view


Nick Halstead's Blog:
Tweetmeme - building stuff fast in PHP
January 29, 2008 @ 07:52:00

Nick Halstead has pointed out a website, written in PHP he's created to help make a little bit of sense out of the links that go flying past in your twitter client - tweetmeme.

What is it? It tracks the public timeline from twitter and picks up any links that get posted. It then follows each link to find final destination and then categorizes the content into blogs / video / images / audio. This project really shows what is possible using PHP if you know what you are doing.

Most of the work was done by another developer, Stuart Dallas as one of four that worked on the project together. It's written in PHP5 and uses only about 20 PHP files to get the job done. You can also check out the launch post over on tweetmeme's blog for more information on the service.

0 comments voice your opinion now!
fast tweetmeme twitter links stream category


Nessa's Blog:
Common PHP Errors
December 10, 2007 @ 12:05:00

Nessa has set up a post in an effort to help budding PHP developers out there with some of the most common problems they might come across in their work and how to handle them a bit more gracefully with error handling:

I'm going back to the basics here, you know, when you wrote your first PHP script and saw an ugly-ass error message pop up on your screen? Error messages are the best tool a programmer has.

She talks about how to set up the error reporting first, making sure that you're getting things up and useful. From there she describes some of the common errors that you might see including:

  • Parse errors
  • MySQL Result source errors
  • Stream errors
  • Max Execution Time errors

Check out the rest of the post for more types.

0 comments voice your opinion now!
error handling parse mysql resource stream execution time error handling parse mysql resource stream execution time


DevShed:
Creating Image Streams from Existing Graphics with the GD Library in PHP
August 20, 2007 @ 11:04:00

DevShed continues its look at using the GD graphics library in PHP with the second part of the tutorial series, this time focusing on the creation of images from existing images (and their streams).

As I stated at the end of the previous article of this series, the GD extension comes packaged with many other useful functions, which indeed deserve a close and detailed look. Thus, in this second tutorial I'll show you how to create different types of image streams from existing graphics, but in this case limiting the process to building GIF, JPG and PNG images.

They work through each of the types (GIF, JPG and PNG) creating an new one from a previous "clouds" image of the same type (a GIF out of a GIF, a JPG from a JPG, etc).

0 comments voice your opinion now!
tutorial gd graphic create stream png jpg gif existing tutorial gd graphic create stream png jpg gif existing


Devshed:
A Close Look at the GD Library in PHP
August 16, 2007 @ 07:39:19

In a new article today, DevShed takes a closer look at the most popular graphics library for PHP - GD:

The GD library comes bundled with both PHP 4 and PHP 5. While it is a popular library that has been around for a while, many web developers do not take full advantage of its capabilities. In this five-part series, we will take a close look at what the GB library can do for you, especially in the area of dynamically-generated graphics.

This first in the five part series introduces the library showing how to make images from scratch in two ways - the more "normal" method and an alternate method using streams (which they use to create a dynanmic GIF image).

1 comment voice your opinion now!
graphics library gd tutorial image stream dynamic graphics library gd tutorial image stream dynamic


Dotvoid.com:
Generating Excel files with PHP
July 10, 2007 @ 07:46:47

Danne Lundqvist has posted about the process he went through when developing a solution to create Excel files in PHP:

I'm on this project at work where we need to create an excel file and send it via email or ftp to a recipient. The normal answer to this is to create a comma separated file and name it .xls and excel will work it out. However, that only works if you open it directly through an http request and are able to set the http headers correctly.

To get around these limitations, he found two solutions (thanks Google!) in PEAR's Spreadsheet_Excel_Writer and an MS-Excel Stream Handler class. He includes code that gives an example of another solution, one that packs data into a binary string and returns it as a part of the Excel document.

2 comments voice your opinion now!
excel file pear spreadsheet msexcel stream handler excel file pear spreadsheet msexcel stream handler


Elizabeth Smith's Blog:
Php User Streams - why doesn't anyone use them?
May 07, 2007 @ 08:04:00

In a new post today, Elizabeth Smith takes a look at one of the lesser used (well, overall) features that PHP has to offer these days - PHP user streams.

PHP user streams are amazing - they're powerful, fun, and make things like a templating system with filters and multiple back ends quick and easy.

Here's a little "test script" that shows you how to implement contexts for your streams. What are contexts? They're resources that hold additional information. Built in php streams, such as the ftp streams, already have contexts you can set. But they're also great to use in your own user land streams.

In the test script, she shows how to open a stream to a few different resources (including passing parameters and user information), grabbing the contents of each.

1 comment voice your opinion now!
user stream example code path fopen user stream example code path fopen


Northclick Blog:
The real power of PHP stream wrappers
November 20, 2006 @ 10:06:00

In this new post on the Northclick blog, Soenke talks about the stream wrappers included in PHP and some of the magic that can happen when they're applied correctly. In this case, it's an application of the ssh2 library (by Sara Golemon).

The new system must be very stable with a strict error checking and has to support several ways of file transports (FTP, SCP/SFTP). SCP is faster then FTP and secure by nature. It's going to be the standard way for deployment.

After finding and loading the extension, things flowed along swimmingly - the code shows a simple transfer method of transfer over a secure ftp connection, complete with a few performance stats at the end.

0 comments voice your opinion now!
power stream wrappers secure ftp code transfer spl power stream wrappers secure ftp code transfer spl



Community Events











Don't see your event here?
Let us know!


PEAR PHP5 book database releases application job example ajax code security zend framework package mysql developer conference cakephp release zendframework

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework