News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

Ibuildings Blog:
Implementing Iterators
August 20, 2008 @ 15:02:59

On the Ibuildings blog Ruud Alberts takes a look at iterators - what they are and how they're used (including the objects the SPL makes available).

Let's kickstart this blogpost by defining what an iterator actually is. According to wikipedia, an iterator is. A collection can pretty much be anything. The most obvious sources would be arrays, but other than that, iterations can be done over database resultsets, strings, datetime intervals, directories, file content and XML listings, to name a few.

He looks at the iterator interface that comes bundled in the SPL and how you can create a custom one to loop through your own data collection. He includes an example - a colorful string iterator that "pretties up" an HTML string with various colors.

0 comments voice your opinion now!
iterator standard library spl custom color string tutorial



Stefan Priebsch's Blog:
Custom Coding Standards with PHP_CodeSniffer
July 03, 2008 @ 12:02:36

Stefan Priebsch recently posted about his struggles with creating a custom coding started with the PHP_CodeSniffer package:

In CodeSniffer, a coding standard is basically represented by an empty class that extends PHP_CodeSniffer_Standards_CodingStandard. I could not get the CodeSniffer to find my coding standard, though, and found the documentation lacking about where to put it, how to name it, and how to refer to it in the --standard switch.

After an email to Greg Sherwood (developer of the package) Stefan figured out his issue and has shared the solution in this post (step by step).

0 comments voice your opinion now!
coding standard custom phpcodesniffer gregsherwood package


Daniel O'Connor's Blog:
How to customise PHP_CodeSniffer
June 13, 2008 @ 11:11:36

Daniel O'Connor has posted a quick guide to customizing your installation of the PHP_CodeSniffer PEAR package to match the coding standard you'd like.

PHP_CodeSniffer is a PEAR package which detects potential coding problems and enforces your style guide. The default is the PEAR coding standard, but you can easily change that.

His method requires the creation of a custom "FooCodingStandard.php" (named whatever you'd like, of course) that contains a class/method defining the "sniffs" you'd like to use for your standard. Use "pfm" to make it into a package and install it to your system - you'll be all set.

0 comments voice your opinion now!
customize pear package phpcodesniffer sniff standard


Make Me Pulse Blog:
PHP6, Unicode and TextIterator features
March 14, 2008 @ 09:32:34

On the Make Me Pulse blog, there's a look at PHP6's support of Unicode in the SPL (Standard PHP Library) TextIterator handler.

I've just install the last version of PHP6 dev and I've decided to test the famous new feature, the PHP Unicode Support. I will not explain new things about PHP6 or Unicode or TextIterator, it's just my discoveries test on this features.

He steps through the process he followed - enabling Unicode support, testing various output methods (including just an echo and using the TextIterator) as well as some of the manipulation methods (next/first/current) that can be used to get certain characters out of a string.

0 comments voice your opinion now!
php6 unicode textiterator spl standard php library enable


Paul Jones' Blog:
Line Length, Volume, and Density
March 11, 2008 @ 09:33:00

In a new blog post, Paul Jones looks at three aspects of coding style - line length, volume and density - and how different people have different assumptions as to what's "right".

When it comes to coding style, there are are various ideas about how you should write the individual lines of code. The usual argument is about "how long should a line of code be"? There's more to it than that, though. Developers should also take into account line volume ("number of lines") and line density ("instructions per line").

He mentions the PEAR style guide when talking about line length, reading code like and sentence in line volume/density and how the "shorter is better" concept can be pushed to its extreme limits taking code into the unreadable zone.

0 comments voice your opinion now!
coding standard style volume length density


Raphael Stolt's Blog:
Zend Framework coding standards on one page
February 12, 2008 @ 07:59:00

Raphael Stolt, in working on his component for the Zend Framework (based on the PHP_CodeSniffer PEAR package), pulled together all of the information Zend provides about their coding standards into one place.

Before jumping into the development of a Zend Framework coding standard for the PHP_CodeSniffer Pear package, I spent some time revisiting and compiling the available Zend Framework coding standards into a handy one-paged Pdf document.

You can download the file here or, if you want something a bit more "spread out", check out the coding standards on the Zend Framework website.

0 comments voice your opinion now!
zendframework coding standard pdf single resource


Make Me Pulse Blog:
Tips RecursiveArrayIterator on mulitdimensional Array
February 11, 2008 @ 13:07:00

On the Make Me Pulse blog, Antoine Ughetto shares a method he came up with to recurse through an array using the SPL method - the RecursiveArrayIterator method.

When we have a multidimensional array we have to make some recursives function to parse it. A simple way to get the keys and the value of this type of array is to use the SPL library of PHP.

A code example is included, parsing through a recursive array to output each of the key/value pairs it contains (and using only about five or six lines of code to do it).

0 comments voice your opinion now!
spl library standard recursiveiteratoriterator multidimensional array


PHP-Coding-Practices.com:
PHP Code-Beautifier Tool
May 03, 2007 @ 07:54:00

On PHP-Coding-Practices.com, there's a new post pointing out a code beautification tool Tim dug up the (aptly named) "PHP Code Beautifier".

Today I discovered a good tool for beautifying existing PHP Code. It works via a web interface. You can either upload a script or directly input it. The code is beautified according to the PHP PEAR Standard Requirements. It does not change or debug your code in any way.

He lists the things it can do for you and your code including setting indents to four spaces, uses the "one true brace" style for function definitions, and removes spaces between things like function calls, parenthesis and beginning of argument list.

You can check out the application and get information on more of the updates it will make on the project's homepage.

2 comments voice your opinion now!
code beautifier download pear standard code beautifier download pear standard


Edin Kadribasic's Blog:
PHP 5.2.2 RC2 Windows build available
April 27, 2007 @ 09:13:00

Edin Kadribasic has announced the release today of multiple versions of the Windows installations for the latest PHP - version 5.2.2 RC2.

The downloads are broken up into two categories:
Standard build

FastCGI build

All other unix-based developers can download their verions from the official PHP QA website for testing.

0 comments voice your opinion now!
widnows build releasecandidate standard fastcgi widnows build releasecandidate standard fastcgi


PHP-GTK Community Site:
Playing with GtkStyle
March 21, 2007 @ 10:36:00

Marc Quinton has posted a pointer on the PHP-GTK Community Site about his article on how to use the GtkStyle Events inside of a PHP-GTK application.

Here you will find how GtkWidget standards buttons are built and can be drawn. Here we use ready to use methods from GtkStyle class to draw buttons, checkboxes and handles. You can use theses classes to override standard buttons features. It's also useful to understand how GtkWidgets work. This class study started when I was trying to display a handle and did not found any one.

It's less of a tutorial and more of a code dump, but it gives you a good idea of how all of the functionality can work together.

0 comments voice your opinion now!
phpgtk gtkstyle gtkeventbox standard button phpgtk gtkstyle gtkeventbox standard button



Community Events











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


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

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