News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

Larry Garfield's Blog:
Drupal 7 gets introspective code registry
0 comments :: posted Thursday May 08, 2008 @ 12:53:14
voice your opinion now!

Larry Garfield talks about a new feature of Drupal 7 in a new post to his blog - the new introspective code registry that's been introduced in this latest version.

As a GHOP Task , Cornil did a performance analysis of Drupal and found its two largest performance drains were the bootstrap process and the theming layer. Quite simply, Drupal spends too much time including code. [...] Fortunately, Drupal 7's self-learning code registry system has just landed, which should obliterate most of the wasted bootstrap cost.

Larry describes the "heart of it all", the token_get_all call, that parses through an entire PHP file, splitting out things like classes included and functions called. This is passed through a function_exists call to the current script and, if it's already there, the file isn't included repetitively.

tagged with: drupal cms code registry tokengetall system functionexists


Community News:
Web-based Frontend for XDebuxg - Webgrind
0 comments :: posted Friday May 02, 2008 @ 16:07:14
voice your opinion now!

Joakim passed along a note today about a new web-based frontend for XDebug:

My about page has mentioned a web based frontend for Xdebug for some time. The project has a name now: The idea for Webgrind, a spin on Valgrind, came from lack of profiling tools for PHP, particularly on OSX. Though it is possible to install kcachegrind on osx it seems overkill for many uses and is definitely not as easy as unzipping a folder to the webroot.

He and Jacob Oettinger have started up the project and have posted some initial code over on the Google Code page for Webgrind. You can check out a screenshot of it in action here too.

tagged with: webgrind xdebug google code download project valgrind

Debuggable Blog:
Code Coverage Analysis soon in CakePHP - Test How Well You Test
0 comments :: posted Thursday May 01, 2008 @ 11:19:54
voice your opinion now!

In a new post to the Debuggable blog, Tim Koschutzki talks some about the work he's been doing on the code coverage analysis for the upcoming CakePHP release:

There are several different kinds of criteria to code coverage. The two most important ones are line coverage (or statement coverage as wikipedia puts it) and path coverage. [...] So how is it going to work? Pretty simple actually. Whenever you run a CakePHP test case Cake assembles information in the background about which lines of your subject-under-test are called.

He includes a few screenshots of the code coverage being run and the end result of the runner with the percent covered.

tagged with: code coverage cakephp framework test unittest

Developer Tutorials Blog:
RSS feeds in PHP 3 simple steps to PHP RSS generation
0 comments :: posted Thursday April 17, 2008 @ 08:47:50
voice your opinion now!

On the Developer Tutorials blog today, there's a new post talking about the "three easy steps" to making an RSS feed for your blog:

Adding an RSS feed to your site is quick and painless, and can be done with pure PHP (and some kind of data source). After the jump, 3 simple steps to building an RSS feed in php.

The steps are pretty simple - figure out what content you want to serve, set up the basic RSS XML structure, and loop through your data to push it in to the template and echoed out. Some simple example code is included.

tagged with: rss feed generate tutorial steps example code content

Richard Heyes' Blog:
Reading a specific line in a file
0 comments :: posted Monday April 07, 2008 @ 12:56:08
voice your opinion now!

Richard Heyes has thrown together some code for a simple thing that he's seen developers request over and over again - moving to/reading from a specific line in a file.

After reading something on the php-general list I decided that a) I'm bored, and b) I'll write something which handles it. So here it is.

His code is simple - looping through the lines of the file until it locates your desired target (with some error checking along the way). Plus, if it's already fetched, it keeps it in a cached array for future retrieval.

tagged with: reading specific file line example code class

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

Rob Allen's Blog:
Simple Zend_Form File Upload Example
0 comments :: posted Monday April 07, 2008 @ 09:30:30
voice your opinion now!

Rob Allen has posted an example (a simple one to get you started) of creating a file upload form in the Zend Framework.

Zend Framework 1.5's Zend_Form component is missing support for the file input element as it is waiting on a file upload component to build upon. We're busy people, so we'll fake it...

His example gives a screenshot of the end result and includes all of the code needed to make it all work - the form, the custom file form element, a ValidFile validation class to ensure you're getting exactly what you want and the controller to define the form and execute it once the user submits.

tagged with: zendform validate example code zendframework

Sebastian Bergmann's Blog:
Generating Code from Tests
0 comments :: posted Thursday March 13, 2008 @ 08:43:50
voice your opinion now!

Sebastian Bergmann has posted a quick example of how to use the PHPUnit unit testing suite for PHP to create code for you (assuming you're using the test first method of development.

His example builds the class off of a set of test for a "BowlingGame" that ends up with roll() and score() methods based off of the naming conventions used in the test:

Following the convention that the tests for a class BowlingGame (see below) are written in a class named BowlingGameTest (see above), the test case class' source is searched for variables that reference objects of the BowlingGame class and analyzing what methods are called on these objects.
tagged with: phpunit generate code unittest testfirst programming

David Goodwin's Blog:
Book Review Object-Orientated Programming with PHP5 (Hasin Hayder, Packt)
0 comments :: posted Thursday March 06, 2008 @ 10:28:00
voice your opinion now!

David Goodwin has posted a book review of a book put out by Packt Publishing, "Object Oriented Programming with PHP5" (from Hasin Hayder).

After an email out of the blue from someone at Packt publishing, here's a review of "Object-Orientated Programming with PHP5" I don't think I've done a book review before, so apologies in advance if it's not structured in any logical manner.

He's broken it up into a few lists to make it very straight forward and easy to see if it's the book for you - the pros, the cons, the contents of the book and a random code sample (this one showing the Decorator pattern in action).

tagged with: object oriented programming php5 hasinhayder pro con summary code example

Developer Tutorials:
Easy PDF Generation in PHP
0 comments :: posted Tuesday March 04, 2008 @ 09:57:00
voice your opinion now!

On the Developer Tutorials website, they're posted this new article talking about a simple way to create PDFs with PHP:

[PDFs] also serve as a perfect way of allowing your users to download or email a page from your website. In this tutorial, I'll show you how to generate PDF files in pure PHP and distribute your content in a single, consistent format.

They look at the why behind creating PDFs in PHP, what options you have and an example creating a basic "hello world" PDF.

tagged with: pdf generate tutorial introduction example code


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

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