PHP » News
Till Klampaeckel's Blog: Selenium vs. SauceleniumWed, 08 Sep 2010 13:48:03 -0500
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.
Lars Strojny's Blog: PHP Segfaulting with PECL/UUID and PECL/IMAGICK
Wed, 08 Sep 2010 14:17:13 -0500
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.
Zend Developer Zone: Five tips for speeding up Eclipse PDT and Zend Studio
Thu, 09 Sep 2010 09:47:00 -0500
On the Zend Developer Zone there's a new post giving you five tips you can use to help speed up Eclipse PDT and Zend Studio if you happen to use one of those IDEs. Eclipse Helios (3.6) includes an improved version of Eclipse PDT, labeled 2.2. It is also included in the current Zend Studio (7.1 and above). Among other enhancements, it dramatically improved the performance of code lookup-related tasks like searching references, creating a type hierarchy and even code completion. Some of the recommendations have more to do with the system the IDE is running on, but they're helpful none the less: Disable virus scanners Use a fast storage device Keep your JVM up to date Delete the database if your experience problems Do not backup the database
PHPBuilder.com: Write an Ajax-driven Login Application in PHP Using SSL/TLS
Thu, 09 Sep 2010 10:29:03 -0500
On the PHPBuilder.com site today there's a new tutorial posted from Octavia Anghel about creating a login for your site that's powered by Ajax and uses a bit more security than normal. It includes hooks to use the Ajax Server Secure Layer or an OpenSSL connection. In this article you will learn how to write a login application in PHP using Ajax and SSL/TLS in two ways either using aSSL (Ajax Server Secure Layer), a library that implements a technology similar to SSL without HTTPS or a simple Ajax and OpenSSL, an open source implementation of the SSL and TLS protocols. They start with the aSSL method and link you to a download of the tool as well as some sample code to help you get started passing data to it via the session. The second example shows the OpenSSL method, mostly consisting of checking on the server side of the certificate that's passed along with the request.
NETTUTS.com: Understanding and Applying Polymorphism in PHP
Thu, 09 Sep 2010 11:13:37 -0500
On the NETTUTS.com site today there's a new tutorial by Steve Guidetti about understanding and handling polymorphism in PHP - making interfaces to multiple objects that all work the same way. In this tutorial he gets more in depth and includes some code to illustrate. In object oriented programming, polymorphism is a powerful and fundamental tool. It can be used to create a more organic flow in your application. This tutorial will describe the general concept of polymorphism, and how it can easily be deployed in PHP. He explains to concept of polymorphism for those that haven't seen it before - common interfaces to multiple objects - and how to can help make using the parts of your application much simpler. In his code examples he uses interfaces and abstract classes to make the connections. The interfaces define the structure to follow and the abstract classes are the multiple objects that must follow it.
Sameer Borate's Blog: Templating with Haml
Thu, 09 Sep 2010 12:51:40 -0500
Sameer Borate has posted about an alternative templating system that's currently being used in multiple languages - Haml (HTML Abstraction Markup Language). As Sameer points out, there's also a PHP port of it. It has been a while since I've used a template engine during development, the last one I used was Smarty. Now there are a plethora of template systems, but most are a rehash of Smarty. Readers may beg to differ, but Smarty gets the work done, which is all that matters. The one that I found really interesting is Haml. He includes some markup examples of how it's structured - the main structure of the site, tables, divs, etc - and what it comes out like on the other side of the parser. The phphaml and phamlp libraries let you run the template through with variable values set and display it. There are some downsides he mentions, though, like the rules on indentation and that the markup has to be all in one file (or combined before sending to be rendered).
Ibuildings techPortal: DPCRadio: Web services for consumer devices
Tue, 07 Sep 2010 07:18:36 -0500
On the Ibuildings techPortal there's a new post with the latest episode in their DPCRadio series (as recorded at this past Dutch PHP Conference) - Melanie Rhianna Lewis' talk on web services and consumer devices. A web service is an API provided by a site that allows a remote application to access data and use functionality without having to 'act like a web browser'. [...] The talk will describe how a web service targeted at consumer devices can be implemented. It will look at the different methods of calling remote functionality such as SOAP, XML-RPC, JSON and restful services. It will also consider the limitations of consumer devices, memory restrictions, communications bandwidth restrictions, and so on that have to be considered when designing a web service aimed at consumer devices. Finally it will have a brief look at how to make a service secure. You can find the slides for the session here and you can either listen to the episode through the in-page player or buy downloading the mp3 directly.
CakeFest 2010: Thats a wrap
Tue, 07 Sep 2010 08:46:27 -0500
For those that didn't get to attend this year's CakeFest 2010, The Bakery has put together this summary of some of the things that happened and the presentations that were given. CakeFest 2010 has come to a close. After 4 days of jam-packed talks, workshops, lightning talks and social outings, we're sad to see it finish. I'd like to thank the community for their ongoing and ever increasing support. Both for the community and for the CakeFest conference itself. Without the passionate community around CakePHP, we couldn't achieve events like CakeFest 2010. They mention some of the sponsors that made the event possible - like Microsoft, GitHub and ActiveState - as well as some photos from the event and links to twelve of the presentations that were given over the four day event.
Derick Rethans' Blog: Collecting Garbage: Cleaning Up
Tue, 07 Sep 2010 09:56:25 -0500
Derick Rethans has continued his series on garbage collection in the PHP internals with this second post of the series with a special look at circular references. You can find the first part here. In this second part of the three part column on the new garbage collecting mechanism in PHP 5.3, we'll dive into a solution to the problem with circular references. If we look quickly back, we found that by using code like the [first example], an in-request memory leak is created. He goes on to briefly describe the synchronous algorithm (including a few more helpful graphs to show the flow) and how that has worked its way into the PHP garbage collection methods. He also points out that this collection can be turned off and on via the gc_enable and gc_disable functions. Keep an eye out for the next part of the series where he gets into more detail on how this is all integrated into PHP.
Padraic Brady's Blog: Zend Framework Proposal: ZendHtmlFilter (HTML Sanitisation And Manipulation)
Tue, 07 Sep 2010 10:13:17 -0500
Padraic Brady has a new post on his blog talking about a new proposal he's made for the Zend Framework about filtering and sanitizing HTML content. For a while now, I've been keen to build a HTML Sanitisation solution for PHP. Where else would I end up putting it other than in Zend Framework? As I've explored in past articles [1] [2], HTML Sanitisation in PHP is a very inconsistent practice. [...] Isn't it possible to create a sanitiser that is both secure by default and performs well? He talks about his Wibble tool that's become the base of his idea for a filtering feature built into the framework. It mainly uses the PHP DOM functionality and HTML Tidy for speed and parsing and was benchmarked as performing better than the HTMLPurifier tool. If you're interested, check out his proposal for its inclusion in the Zend Framework 2.0.
ZendCasts.com: Creating RSS & Atom Feeds with Zend_Feed
Tue, 07 Sep 2010 11:27:55 -0500
New on ZendCasts.com this screencast helps you use the Zend Framework's Zend_Feed component to create simple RSS and Atom feeds for your application. The screencast shows you how to create a basic controller with information for a sample blog post (title, date creates, content, etc) and a simple method to create default posts. A second controller is made to handle the feed creation and two actions are created - one for RSS and the other for Atom. The posts are then parsed and pushed out to views for displaying as feeds. The site has more great screencasts where this came from so check out their screencasts section for ones on other topics like ZendX_JQuery, working with Zend_Log, and validation with Zend_Validate.
Community News: Latest PEAR Releases for 09.06.2010
Mon, 06 Sep 2010 07:03:36 -0500
Latest PEAR Releases: Mail_mimeDecode 1.5.2 PHP_CodeSniffer 1.3.0RC1 Mail_mimeDecode 1.5.3
Kevin Schroeder's Blog: Zend_Server
Mon, 06 Sep 2010 09:47:22 -0500
In a new post to his blog Kevin Schroeder shows how to use the Zend_Server component of the Zend Framework to make a script that automatically makes the server you need based off of the request type. I've been doing some work with Adobe on some articles and one of them was on working with mobile clients with Flash. Well, me being the masochist I did more. What I did was write an example that worked as a full website, an Ajax website, a Flash service and an XML-RPC service. [...] In a plugin, which I will show you in a bit, I attached an instance of Zend_Server_Interface. Then in the controller I simple told it to do its thing, with the exception of handing the Service Mapping Description for JSON-RPC ($smd). That's it. Because of how the XML-RPC, JSON and AMF servers are handled, they extend the main Zend_Server_Interface, making it easy to create them on the fly. He includes the code for both the sample controller and the plugin mentioned above. It checks for Ajax, AMF, XML and JSON request types and sets the service handler correctly. If there's not one, it falls back on the mapping.
Chris Roane's Blog: Should PHP web programmers go to college?
Mon, 06 Sep 2010 12:09:38 -0500
Chris Roane has a new post to his blog asking an interesting question - should PHP programmers/developers spend the time to go to college? A common debate in our field is whether or not a college education is worth it when becoming a PHP programmer. People will throw statistics in how much more money you can make with a college degree. But is the cost of college (time + tuition) for a four year degree better than the benefits of having four years of experience in the web programming field? He qualifies it with the fact that not all college educations are created equal and that it depends on the student as to what they get out of it. He breaks it up into a few different sections with reasoning in each: The Benefits of Going to College The Cost of Going to College The Benefits of a PHP Programmer Not Going to College The Negative Aspects of a PHP Programmer Skipping College
Site News: Popular Posts for the Week of 09.03.2010
Fri, 03 Sep 2010 07:09:11 -0500
Popular posts from PHPDeveloper.org for the past week:Developer.com: Quercus: Bring Java's Power to Your PHP Development (and Vice Versa) Jani Hartikainen's Blog: Now you can write PHP code...without writing any code NerdMom Blog: Kohana 3 & CodeIgniter 2 Ahmed Shreef's Blog: iconv misunderstands UTF-16 strings with no BOM Klaus Graefensteiner's Blog: Climbing the CodeIgniter PHP MVC framework learning curve Web Builder Zone: NetBeans vs. Vim for PHP development Site News: Job Postings for the week of 08.22.2010 SeeIT Consult Blog: PHP mail() with Ubuntu Desktop and Gmail Gonzalo Ayuso's Blog: Using CouchDb as filesystem with PHP PHPBuilder.com: Downloading and Parsing Gmail Messages in PHP
NETTUTS.com: Creating a Web Poll with PHP
Fri, 03 Sep 2010 08:26:42 -0500
On NETTUTS.com today there's an intermediate tutorial showing you how to create a simple polling system for your site - complete with a database backend and a CSS styled results view. Polls are nearly ubiquitous on the web today, and there are plenty of services that will provide a drop-in poll for you. But what if you want to write one yourself? This tutorial will take you through the steps to create a simple PHP-based poll, including database setup, vote processing, and displaying the poll. They include all of the code and markup you'll need ready for cut & paste - the SQL for the database backend (they chose SQLite), the HTML for the question and answer sides and the CSS to style them both. No javascript is needed to make the example work. There's even some process flows to help you understand the paths the application can take.
SitePoint.com: OAuth for PHP Twitter Apps, Part I
Fri, 03 Sep 2010 10:53:45 -0500
On the SitePoint blogs today there's a new tutorial posted, the first part of a series, from Raj Deut about making the move away from the basic authorization for connecting to the Twitter API and towards their new OAuth method for Twitter Apps. As of August 31, Twitter's HTTP Basic Authenticated API service has been disabled entirely. Now, any interface with the API will be required to use a token-based authentication method known an OAuth. [...] At first glance, the task of implementing OAuth can appear daunting, and OAuth's token exchange system can be confusing if you're unfamiliar with it. Fortunately, there are some rather clever individuals who've done the groundwork for us. They show you how to register your application with Twitter and use the TwitterOAuth library to make a sample connection to their servers. They also show how to generate the tokens for the URL and the ones for accessing the site as a user. With tokens in hand, the script can then connect to the system and make a sample tweet (complete code included).
Brian Swan's Blog: Accessing OData for SQL Azure with AppFabric Access Control and PHP
Fri, 03 Sep 2010 13:42:15 -0500
Brian Swan has a new post to his blog today about consuming protected feeds of OData coming from SQL Azure in a PHP application. I did write a post a few weeks ago that described how to enable anonymous access to SQL Azure OData feeds (Consuming SQL Azure Data with the OData SDK for PHP), but I had a few things to learn about AppFabric access control before I felt comfortable writing about authenticated access to these feeds. He starts from the Azure side, creating a sample OData feed and adding permissions to only allow access to a specific (database) user for the feed. You'll use a set of data to connect to the feed - a username, a secret key, an issuer name and the OData endpoint address. Then, using the OData SDK he shows how to generate the needed classes with the automatic tool and use them to connect to the endpoint and retrieve data from the feed. He also includes a little snippet for those that might not want to use the SDK - an example using curl to connect and authorize the session.
Chris Tankersley's Blog: Getting Started with Reflection
Fri, 03 Sep 2010 14:12:13 -0500
Chris Tankersley has a new post to how blog looking at a powerful but sometimes seldom used feature of PHP - Reflection. His post introduces you to some of the basics you can use to have your code find out more about itself. Reflection is a metaprogramming construct that allows a program to look into itself and do a multitude of different things - gain meaning, watch execution, call code, or even provide feedback. [...] With PHP 5, PHP gained a robust reflection class that allows a developer to gain access to just about every aspect of an object and interact with it. The key is figuring out what is available, and then exploiting it to gain additional benefits. He gives examples from his project where it uses the ReflectionClass feature to pull in the values of a class including properties and methods in a class (a set of ReflectionMethods). Some code is provided to make the examples a bit more clear.
Developer.com: Getting Started with Memcached Distributed Memory Caching
Thu, 02 Sep 2010 09:40:02 -0500
On Developer.com today there's a new article talking about memcache and how you can implement it in your application to provide a performance boost for applications in a distributed environment. As distributed system is part of the Memcached definition, you can install Memcached on various servers to make a larger caching server. In this way, Memcached helps reduce database loads to a minimum, resulting in faster and more responsive Web applications They take some time to explain what memcache is - a simple to use caching system that reduces the dependency on other data sources - and how to get it installed (via the package manager of your choice). They suggest times on when and when not to use it as well as some of the security implications you'll need to worry about when implementing it. There's also a bit of sample code to help you get started in your application. You'll need the memcached extension to make it all work, though.



