News Feed
Jobs Feed
Sections



Recent Jobs

News Archive
Lars Strojny's Blog:
PHP Segfaulting with PECL/UUID and PECL/IMAGICK
September 08, 2010 @ 14:17:13

If you've been using (or will be using) the uuid and imagick extensions for PHP, you might be able to save yourself a lot of headache by reading this new post from Lars Strojny about his segfault woes.

Ran into a bug yesterday, where http://pecl.php.net/uuid in combination with http://pecl.php.net/imagick yielded a segfault when using uuid_create().

After trying to trace it down with a backtrace and cachegrind results, he (and Mikko & Pierre) found that both extensions were built against the libuuid.so.1 file. While that wasn't the issue directly, they did find a work-around that helped the issue - renaming some ini files so uuid was loaded first.

0 comments voice your opinion now!
uuid imagick pecl extension segfault debug libuuid



Till Klampaeckel's Blog:
Selenium vs. Saucelenium
September 08, 2010 @ 13:48:03

In this new post to his blog Till Klampaeckel talks about two tools for front-end interface testing - Selenium and Saucelenium - and how he used the latter in his application testing.

Selenium and Saucelenium have the same root - in fact Saucelenium is a Selenium fork. While the Selenium project seems to focus on 2.x currently, stable 1.x development seems to really happen at Saucelabs. That is if you call a commit from January 22nd of this year active development.

He talks about the installation process (guided by the README from his fork) and the tool he had to install to get it to work for him - xserver-xorg. He includes a sample test to give you an idea of what can be done with the testing tool. It loads the page imitating Chrome and looks for certain text on two different pages as well as check one of the links.

0 comments voice your opinion now!
selenium saucelenium unittest interface frontend install readme


Mike Bernat's Blog:
The Problem with Wordpress and Drupal
September 08, 2010 @ 12:51:43

Mike Bernat has a new post to his blog today talking about what he considers the problem to be with both WordPress and Drupal - despite doing what they do well, they're not good examples for developers.

If a young developer said to you 'I want to learn by looking at existing code from a successful PHP project. Can you point me in the right direction?' Would you ever feel comfortable sitting them down in front of Drupal or WordPress code? What if they responded by saying: 'But they are the most well-known free, and open, products that use PHP. They're obviously doing something right, so why shouldn't I try to learn from their example?'

In his opinion, developers should set their sights elsewhere if they're looking for good examples. Both tools use what he calls the "old way architecture" that could hold developers back from some of the wonderful new enhancements that the language has to offer and best practices that might not be found in their codebase.

While some of the techniques used in WordPress/Drupal are undoubtedly solid and still state-of-the-art, the majority of the frameworks are ancient in web-development terms. PHP is growing as a language, and I for one want to see it regain some of the respect its lost.
0 comments voice your opinion now!
wordpress drupal opinion problem developer example


Rob Allen's Blog:
On Exceptions
September 08, 2010 @ 11:06:03

Rob Allen caught an interesting feature of the proposed exception handling in the Zend Framework v2 - the ability to throw an exception and catch it at the interface level, not just the class.

I've been reading the Proposal for Exceptions in ZF2 and like it. One thing that caught my attention was that it suggests that you can catch an interface. I hadn't heard of that ability before, so I pulled out my trusty text editor to have a play.

He creates a basic bit of code - an interface for the exceptions, an SPL exception class and a normal exceptions class - as well as a basic generic class that throws exceptions based on each. The result is that catching exceptions for the class types works as well as catching it on the "ExceptionInterface" level too.

We now have the ability with ZF2 to be able to use different exception classes to represent different error types rather than using string comparison and, at the same time, we can have a single catch() for when we don't need that level of granularity.
0 comments voice your opinion now!
exception handling interface throw class


Chris Hartjes' Blog:
Twitter Asks Continuous Integration Landscape for PHP Developers
September 08, 2010 @ 10:42:42

After asking for topics to blog about on Twitter, Chris Hartjes has posted the first response to the suggestions - a look at continuous integration (CI) in PHP environments.

For those not familiar with the concept of Continuous Integration, I can sum it up with one very glib phrase: it lets you break your code before you buy it. [...] If I were to design a Continuous Integration (hereafter referred to as CI) system, what would it look like?

His requirements include version control integration, easy unit test execution, a web interface and be able to automate it all at a moment's notice. He talks about the importance of unit testing in CI and the tools that are available for the job like phpUnderControl, Xinc and Hudson. He also looks at the build process, from check-in through a successful build result and how he handles bugs when they do pop up.

0 comments voice your opinion now!
continuous integration developers hudson phpundercontrol xinc


Zend Developer Zone:
PHP, Flex and Mobile
September 08, 2010 @ 09:08:48

On the Zend Developer Zone today there's a new post from Cal Evans about an article from the minds of Ryan Stewart (Adobe) and Kevin Schroeder (Zend) about the powerful combination of Flex and PHP.

These two have gotten together again to show how you can use Flex (Flash, ActionScript, AIR, you know the drill) and Zend Framework (Winner of a BOSSie) Their new article "Flex and PHP" from the most recent issue of Flash & Flex magazine, talks about using the same controllers and actions for returning both HTML and JSON. This concept of programming for multiple destinations is important in a web where your API may be more important than your HTML.

You can get the full article as a PDF from the DevZone site. It's an extended tutorial on getting Flex and PHP to work together via multiple formats (similar to what Kevin presented on his blog recently.

0 comments voice your opinion now!
flex mobile ryanstewart kevinschroeder zendframework json html


Stanislav Malyshev's Blog:
Adding new extensions to Zend Studio
September 08, 2010 @ 08:32:31

In a new post to his blog Stanislav Malyshev talks about how Zend Studio users can get the tool to recognize new extensions by adding in stubs with PHPDocumentor markup.

If you have some extension, create stub file with PHPDOC descriptions [...] for each extension function, Studio will know to pick it up. You can put this file into Studio's prototypes directory - easiest way to find it is just write something like chdir() anywhere, select the name and press F3, the directory of the file that you'll get is the one you need.

Not wanting to have to generate all of the stubs himself, he created the Reflector script that will, when pointed at an extension, create the stub file with definitions for each method it can use. There's also the generator script that's a part of Zend Studio that works similarly.

0 comments voice your opinion now!
zendstudio extension reflection docblock



Luc de Brouwer's Blog:
Stop waiting, start array dereferencing in PHP now!
September 07, 2010 @ 13:37:09

In this recent post to his blog Luc de Brouwer makes a recommendation about dereferencing your arrays - start thinking about it now even before the feature's added to the stable release!

Ever since I started programming object oriented PHP I've been using function chaining and function dereferencing. But there is another thing I'd like to be able to do that was added to the PHP trunk over 8 months ago that still hasn't made it to the current release. The function I'm referring to is array dereferencing.

The trick of dereferencing arrays is that you can pull out a value from a returned array without having to use another line of code (i.e. "foo()['a']"). His suggestion is that you start thinking that way now, but use a sort of hack function to pull it off - one that takes the array and a key and returns that value. There's other suggestions in the comments on how to do things differently though.

0 comments voice your opinion now!
array dereference function example


Project:
Aleksey Martynov's lexa-xml-serialization Tool for PHP 5.3
September 07, 2010 @ 12:40:37

Aleksey Martynov has submitted a project that can come in quite handy of you do a lot of work with XML in your application - a XML serialization tool for PHP 5.3 that lets you easily translate objects into valid XML.

lexa-xml-serialization is a lightweight library for serializing PHP objects to XML like it's done in .NET. My xml serializer requires that you mark serializable properties of your classes with doc-comment annotations. The properties are not required to be public. The lettercase of annotations doesn't matter. Whitespaces are not essential. Parameters are optional: type defaults to string, xmlName defaults to the property name. Parameter values must not be enclosed in quotes. Empty brackets may be omitted.

The page on the Google Code site gives some examples of it in use as well as as "first look" tutorial about building a large, more complex XML file. If you want to try it out, head over to the download page to grab the latest.

0 comments voice your opinion now!
xml serialization object convert docblock comment



Community Events

phpnw10 PHP Conference 09/10/2010




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


developer zendframework codeigniter opinion wordpress azure plugin introduction framework phpunit unittest example book tool database application suggestion screencast development conference

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