News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

DevShed:
Using Timers to Benchmark PHP Applications
0 comments :: posted Wednesday April 30, 2008 @ 14:31:08
voice your opinion now!

DevShed has posted the second article in their series looking at benchmarking your PHP scripts. This time they look at the use of "timers" to check on script execution length.

Since you already know how to create timer functions and classes, in this tutorial, I'll create some concrete examples that show where these timing mechanisms can be applied in order to evaluate the performance of certain PHP applications.

They create a few classes that connect to a database and pull out rows (handing it off to a Result class). They use these classes in two examples - one with compression (output buffering) and one without using their Timer class to evaluate the differences.

tagged with: timer benchmark application tutorial class mysql row output buffering


Michael Girouard's Blog:
Rolling Your Own MVC The View
0 comments :: posted Monday April 28, 2008 @ 09:39:45
voice your opinion now!

Michael is back with part three of his series stepping you through the creation of your own MVC framework (Part 1 and Part 2) with a look at the part that interfaces with the user - the View.

Using the view as a starting point may seem odd at first considering the view-related actions are some of the last steps in the page load scenario, but since our views don't have any external dependencies, unit tests are very easy to write and so is the accompanying code.

He explains how views work along with the rest of the framework and some of the basic rules surrounding how they get their data. Code comes along with the explanations for different views like XML, HTML and JSON methods of output.

tagged with: modelviewcontroller mvc view tutorial output xml html json

ThinkPHP Blog:
Put out the age of a date in words
0 comments :: posted Friday April 11, 2008 @ 10:37:53
voice your opinion now!

On the ThinkPHP blog today, Annika Rabea shares a method for outputting dates in words rather than in the usual numbers most applications use.

Recently, I have to output the age of a date in words and didn't have a framework to work with. The first steps were to parse the given date into an array and create a timestamp with the individual parts. The difference between the timestamp of now and the created timestamp yielded the age in seconds. The result can be used to compare with seconds of a day, week, etc.

The code snippet in the post outputs the difference between two timestamps (then and now) it a bit more friendly way (ex. 4 months, 2 weeks, 2 days).

tagged with: date format timestamp week month day output

Community News:
New Yahoo! Pipes PHP serialized output renderer
0 comments :: posted Monday April 07, 2008 @ 12:05:17
voice your opinion now!

As mentioned on the Zend Developer Zone and by John Herren, Yahoo! has added a new feature to its Pipes functionality - serialized PHP results.

Until now JSON output has been the only way to obtain all the data flowing through a Pipe. Starting today we've added a second way of getting all the data - serialized PHP Pipe output. [...] It's then up to you on how you want to display or use the Pipe data. The possibilities are endless.

If you haven't messed with Yahoo's Pipes system, you owe to it to yourself to at least go and play with it for a little bit.

tagged with: yahoo pipes serialized output code addition johnherren

Sebastian Bergmann's Blog:
ANSI Colors in PHPUnit Output
0 comments :: posted Thursday March 20, 2008 @ 10:26:51
voice your opinion now!

Sebastian Bergmann shows off a new feature of the latest PHPUnit release - the addition of ANSI colors to the runner's output.

Check out the screenshots here and here.

PHPunit is a member of the xUnit family of testing frameworks and provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyse their results.

tagged with: phpunit output unittest runner ansi color

DevX.com:
Add the Graphics Power of SVG to PHP
0 comments :: posted Tuesday February 26, 2008 @ 10:44:00
voice your opinion now!

In this DevX tutorial, Octavia Anghel shows how use PHP to create images based on the SVG libraries available to any browser.

Scalable Vector Graphics (SVG) is an XML specification for producing vector-based graphic content that you can create, modify, and manipulate dynamically from programming languages. Here, you'll explore the most important techniques and libraries for integrating SVG with PHP to create diverse graphic contentâ€"from simple shapes to complex graphs.

They show a few different ways to get the job done including a straight 'echo' call with the output, sending a converted SVG document over with a PHP header or including another (or multiple) SVG documents into another and outputting them. They also talk about tools like the phpHtmlLib library, the PEAR::XML_SVG package and the PEAR::Image_Canvas package.

tagged with: svg graphic tutorial echo output include dynamic

Rob Allen's Blog:
A View Stream with Zend_View
0 comments :: posted Thursday February 07, 2008 @ 07:58:17
voice your opinion now!

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).

tagged with: zendframework stream zendview escape custom output view

Pierre-Alain Joye's Blog:
Debugging symfony (or any php script) with vim and Xdebug
0 comments :: posted Friday January 25, 2008 @ 12:12:00
voice your opinion now!

Pierre-Alain Joye has posted an example of one way to use the XDebug software - to debug the symfony framework or any other script (with the help of vim).

Xdebug is one of the best debugger and profiler for php (maybe the only good one in open source :). The only problem is its lack of dedicated client. The only problem is its lack of dedicated client, however there is many plugins for many IDE or editors like Eclipse PDT or weaverslave and even for my favourite editor, Vim.

He quickyl runs through the installation of XDebug in your installation and the script needed to set up the debugging in vim. All that's left is to add the "XDEBUG_SESSION_START=1" flag to the end of your script name and letting the information flow in.

tagged with: vim xdebug symfony debug script output xdebugsessionstart

Ed Finkler's Blog:
Inspekt 0.3 now available
0 comments :: posted Monday January 21, 2008 @ 14:38:00
voice your opinion now!

Ed Finkler has released the latest version of his Inspekt input filtering/output validation library for PHP5:

I've uploaded the 0.3 release of Inspekt, the input filtering and validation library for PHP4 and 5. With this release, Inspekt completes the goals of the original specification for the OWASP SpoC007 project. I believe it is ready for "real-world" use.

Along with the new code being released there's also more documentation, API docs, a PEAR channel and a mailing list.

tagged with: inspekt filter input validate output library release

Nick Halstead's Blog:
Programming Tips #9 "debug_backtrace"
0 comments :: posted Wednesday December 19, 2007 @ 08:42:00
voice your opinion now!

Nick Halstead has posted the latest programming tip to his blog today (as written by LArry Garfield) concerning the use of debug_backtrace.

Despite the proliferation of debugging tools, especially real-time debuggers, "debugging by print statement" remains the most common form of debugging in most programming languages. [...] Fortunately, PHP offers another debugging tool: debug_backtrace(). It returns an array that is a complete function stack up to the point it is called.

Larry includes a basic example of the function in use - a debug() function that takes in a message, label and a "stealth" setting and outputs a formatted result of the debug_backtrace output.

tagged with: programming tip debugbacktrace output example programming tip debugbacktrace output example


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

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