- Joshua Thijssen's Blog: php 5.4 + htrouter: Your personal Apache 2.2 compatible server
- DZone.com: Social Comparison of PHP Frameworks
- Tales of a Coder: What are the Essential PHP/Javascript/Web Development Feeds?
- Leasewebs Labs: Painless (well, less painful) migration to Symfony2
- Smashing Magazine: Create A Christmas Wish List With PHP (For Beginners)
- Nikita Popov's Blog: Don't be STUPID: GRASP SOLID!
- NetTuts.com: Ten New Year's Resolutions Every Web Developer Should Make
- Henrik Bjørnskov' Blog: Symfony2: Quick tip for your security configuration
- Nikita Popov's Blog: Supercolliding a PHP array
- Community News: PHP Advent 2011 is Complete!
2011年12月30日星期五
Site News: Popular Posts for the Week of 12.30.2011
Mark Story's Blog: New errors in PHP 5.4
In this quick new post to his blog Mark Story talks about two new errors he ran across when upgrading his installation to PHP 5.4, both showing up under E_ALL.
I've been running the PHP5.4 RC builds for the last few months, and there are some interesting changes in the upcoming PHP release. On top of all the great new features coming in PHP5.4. After updating to PHP5.4-RC4, a few things that used to not trigger errors and silently do the wrong thing, now trigger notices or warnings.
The two he mentions deal with a new warning on illegal string offsets and the other about string offsets ("Notice: String offset cast occurred"). You can find out about more changes in the PHP 5.4 series in the various Changelogs for each Release Candidate and beta release.
Community News: Conference Call for Papers Reminders!
As the conference season for next year gets closer, several conferences have opened their Call for Papers. A few of them have deadlines coming up soon, so don't forget the following important dates if you'd like to submit!
- php|tek 2012 - ends December 31st, 2011 (tomorrow!)
- Dutch PHP Conference - ends January 31st, 2012
- phpDay Italy - ends February 28th, 2012
Be sure to submit while there's still time! Thanks to Thijs Feryn for the reminder!
2011年12月29日星期四
Site News: Blast from the Past - One Year Ago in PHP
- Zend Developer Zone: Book Report: You Want to Do What with PHP?
- Reddit.com: Less obvious PHP tricks?
- Shameer's Blog: PHP 5.3 : Practical look into Lambda functions and closures
- Community News: DBG Debugger Helper for Google Chrome Released
- PHPBuilder.com: Profiling PHP Code with Xdebug and KCacheGrind
- Sjoerd Massen's Blog: Passing the PHP 5.3 ZCE exam
- php|architect Blog: The NoSQL Hype Curve is Bending
- Query7.com: Book Review: PHP5 CMS Framework Development
- Mike Lively's Blog: Pear Channel set up for Phake
- Leniel Macaferi's Blog: Installing PHP on Mac OS X Snow Leopard 10.6.5
- Zend Developer Zone: Using the Stack Exchange API with PHP (part 1)
- Stas Malyshev' Blog: On PHP features
- Mike Lively's Blog: Introducing Phake Mocking Framework
- Sudheer Satyanarayana's Blog: Zend Date Class Constants Cheat Sheet
- Kenny Katzgrau's Blog: Enable Site-Wide Profiling With CodeIgniter
Dzone.com: Open source PHP projects of 2011
On Dzone.com today Giorgio Sironi has posted what he considers to be some of the most popular Open Source PHP projects of 2011 including Symfony2, Doctrine and HipHop.
This non-scientific analysis of the popular and exciting PHP projects starts from researches on active projects on SourceForge and GitHub; the latter is where most of the collaboration and involvement of PHP developers is today. I've also crowdsourced the question on Twitter to catch projects I wasn't aware of, and I hope to do the same with you.
Other projects included in his list are:
- Symfony2 Components
- Moodle
- Composer and Packagist
- Drupal, Joomla, Wordpress
Have a project you think he missed? Let him know!
PHPMaster.com: Writing Custom Session Handlers
On PHPMaster.com today there's a new post showing you how to write custom session handlers - in their case, a database-based option that can span across multiple servers/services.
Sessions are a tool which helps the web programmer overcome the stateless nature of the internet. You can use them to build shopping carts, monitor visits to a website, and even track how a user navigates through your application. PHP's default session handling behavior can provide all you need in most cases, but there may be times when you want to expand the functionality and store session data differently. This article will show you how the default functionality works and then goes on to show you how override it to provide a custom solution.
They introduce how sessions are stored normally (based on the save path) and what the serialized contents of it would look like. They show you how to take this, normally stored on the local file system, and change it to be written to a "session" table in a MySQL database (via PDO). It includes reading, writing, updating and some garbage collection to clean out old values from the table.
2011年12月28日星期三
PHP.net: PHP 5.4.0RC4 Released!
The latest version of PHP in the 5.4.0 release candidate series has been posted - PHP 5.4.0 RC4, complete with new features and lots of bugfixes.
The PHP development team is proud to announce the 4th release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION! This is the 4th release candidate. The release candidate phase is intended as a period of bug fixing prior to the stable release. No new features should be included before the final version of PHP 5.4.0.
Updates in this release candidate include an update to the max_input_vars directive and a fix for a segfault in the traits code. You can find the full notes for the release in the NEWS file and can download the latest from the PHP.net site - source downloads, Windows binaries.
Nikita Popov's Blog: Don't be STUPID: GRASP SOLID!
Nikita Popov talks about the SOLID coding practices and creates his own acronym for the complete opposite - STUPID (Singleon, Tight coupling, Untestable, Premature optimization, Indescriptive naming, Duplication).
Ever heard of SOLID code? Probably: It is a term describing a collection of design principles for "good code" that was coined by Robert C. Martin (aka "uncle bob"), our beloved evangelist of clean code. [...] So, why not approach the problem from the other side for once? Looking at what makes up bad code.
He goes through each part of his STUPID acronym and talks about how it can hurt your code and a few alternatives to help make your application more flexible and easier to maintain in the long run. He also mentions GRASP (General Responsibility Assignment Software Principles), another set of good practices to follow, some similar to SOLID, that can make your app better.
2011年12月27日星期二
Henrik Bjørnskov' Blog: Symfony2: Quick tip for your security configuration
Henrik Bjørnskov has a quick new post with a security tip for those using the Symfony2 framework in its configuration.
Earlier when playing around with the Security component and SecurityBundle i found that for all paths you can specify a route name and the component will match it when check for the request paths.
Setting this up in your configuration gives you more control over the paths that are matched as well as more flexibility in defining them. He includes a note about a change you might have to make to the SecurityBundle's code to get the "check_path" part working correctly. You can find out more about the SecurityBundle's integration in this blog post from Pablo Bandin.
Joe Devon's Blog: Belated Zendcon 2011 Recap
On his "MySQL Talk" blog Joe Devon has posted a (very) belated wrapup of ZendCon 2011 he attended earlier this year.
I started writing a Zendcon recap post as soon as I got back. And then mis-timed a couple projects. Note to freelancers, make sure your new gig starts AFTER your old gig is over. Or you'll be working an insane schedule. Hence the lateness... First the good part. What made Zendcon special.
He notes that it was a great opportunity to meet people "in real life" that he'd only spoken with online and the overall wonderful experience it was. He mentions some specific people in the PHP community including Juozas Kaziukenas, Daniel Cousineau, some impromptu singing of Queen songs and many more (too many to name here). He also mentions some of the sessions attended including the tutorial on Zend Framework and an uncon talk from Ilia Alshanetsky about optimization.
2011年12月26日星期一
2011年12月23日星期五
Site News: Popular Posts for the Week of 12.23.2011
- PHPMaster.com: Understanding the Factory Method Design Pattern
- Nikic's Blog: How big are PHP arrays (and values) really? (Hint: BIG!)
- Reddit.com: What everyone should know about strip_tags()
- Zend PHP Certification Blog: PHP Sorting Functions
- Brian Smithwick's Blog: Software development and the locked box
- Nelm.io Blog: Composer: Part 2 - Impact
- Sebastian Bergmann's Blog: Using CLANG/scan-build for Static Analysis of the PHP Interpreter
- Robert Basic's Blog: Communicating with Pidgin from PHP via D-Bus
- Phil Sturgeon's Blog: PHP Basher Bashing
- PHPMaster.com: PHP's Quest for Performance: From C to hhvm
Joshua Thijssen's Blog: php 5.4 + htrouter: Your personal Apache 2.2 compatible server
Joshua Thijssen has a new post to his blog today about a feature of the upcoming PHP 5.4 release, the built-in web server, and a handy way to reproduce .htaccess functionality with the help of a simple PHP script - htrouter.
The problem with the new PHP 5.4 internal web-server is that it isn't Apache. Thus it does not know anything about .htaccess. Even when you have defined your .htaccess to do authentication, the internal PHP web-server will ignore it, while in production, the authentication will be needed (if you will be running Apache, of course). Also, you need to reroute everything manually through your app_dev.php, so your URL's don't really match the way they will be on your production.
He introduces the PHP web server quickly, just showing a sample command line call to start it up and to point it at a certain PHP file as a "boostrap". With the help of his htrouter script, though, you can use "modules" similar to those in Apache. He already has the HTTP auth stuff working and more is to come.
DZone.com: Social Comparison of PHP Frameworks
In this post to DZone.com today, John Esposito points out a site that compares popular PHP frameworks socially, a collaborative resource to keep track of things like framework features, popularity and their last update.
There's this wiki-ish comparison of PHP frameworks from socialcompare.com -- presently incomplete, but already containing quite a few frameworks and interesting details of each. You can add comparison criteria (rows; folksonomically) or update existing criteria -- which currently include, among other details, ORM specifics, cache storage, template system, and testing libraries.
Frameworks currently covered include Zend Framework, CakePHP, Fat-Free, Symfony, Yii and Kohana. As it stands now, Yii is the most popular framework with 8 votes and Symfony and Zend Framework are tied for second with 5 points each.
2011年12月22日星期四
Site News: Blast from the Past - One Year Ago in PHP
- PHP North West: Lorenzo Alberton: Profile your PHP application and make it fly
- Joshua Thijssen's Blog: Tutorial: how to manage developers
- Content With Style: buggy behaviour of parent:: in PHP 5.3.3
- Volker Dusch's Blog: Setting up Hudson for PHP Projects in 15 minutes
- Bence Eros' Blog: Life without static in PHP
- Derek Allard's Blog: Modifying the default CodeIgniter Calendar template for fun and profit
- Site News: Popular Posts for the Week of 12.24.2010
- CodeForest.net: Multiple virtual hosts in WAMP
- Zend Developer Zone: Book Report: A Beginner's Guide to Zend Framework
- WebSpeaks.in: Cross Domain Posting using PHP and JavaScript: ITS POSSIBLE!
- Liip Blog: Using the Symfony2 console
- Matthew Weier O'Phinney's Blog: Simple Interfaces and Micro MVCs
- Box UK Labs: Dependency Injection and Reflection library
- Ilia Alshanetsky's Blog: ISP Popularity by Domain Count
- Sameer Borate' Blog: Creating SQL schemas with Doctrine DBAL
Community News: Dutch PHP Conference 2012 Announced (and Call for Papers Opened)
The Dutch PHP Conference has Call for Papers has also been opened!
We're back! And we are glad to announce that we'll be organising another edition of the Dutch PHP Conference, which will be held in Amsterdam from 7th to 9th June 2012. Thursday 7th will be the tutorial day and June 8th and 9th will be the main conference days. Ticket sales will start on February 15th. [...] We're looking for high-quality, technical sessions from speakers who can cover advanced topics and keep our demanding audience inspired
The Call for Papers is open until January 31st, so get those talk ideas in soon. In addition to the normal DPC conference, they're also holding the Dutch Mobile Conference at the same time, a 3-day conference about technologies used for mobile websites and mobile web application development.
Mike Willbanks' Blog: RPM Packaging - Building and Deploying your own PHP
Mike Willbanks has a new post to his blog about a different sort of technique for deploying PHP - building your own RPMs instead of just using the pre-packaged ones. This opens up a whole world of customization options.
In the PHP world, one might ask why not just build it from source? Well, an RPM IS built from source and then distributed to many servers - we can ensure that we have the same packages on each, we can maintain the same versions and if you've read my previous post on Pirum you will know that I also like mirroring PEAR packages.
He walks you through the structure of an RPM package (the spec file, with examples, and the source), the "%prep", "%build" and "%install" containers as well as where the source needs to live for things to work correctly.
2011年12月21日星期三
Phil Sturgeon's Blog: PHP Basher Bashing
In a new post to his blog today Phil Sturgeon responds to some comments made in another post about PHP not "being an acceptable COBOL".
Anyone who has used PHP for a while knows that it has its ugly parts. Recently I've seen a whole swathe of PHP-bashing articles and that would fine if they were they are making a valid point, but some of it has just been - as I tweeted recently - "absolute drivel".
He directly refutes some of the points made in that article, points out a newer post from the same author (which misses some points as well) and finishes it off with a look at why he "still" uses PHP versus something like Closure or NodeJS for his development.
Despite known flaws and imperfections I continue to use PHP as my primary language because during all the time I spend worrying about which technology is the neatest, coolest or shiniest I could have built a new application to sell or finished another client site.
Be sure to check out the comments for some other thoughts about the language (and Phil's responses).
php|architect: A Chat on Zend's phpcloud at ZendCon 2011
On the php|architect site today Keith Casey has posted a recording of an interview with Boaz Ziniman of Zend about one of their latest offerings, phpcloud - a platform-as-a-service to provide easy, scalable PHP application hosting.
At the tail end of ZendCon 2011 in October, I managed to corner Boaz Ziniman to chat on the launch of their new product phpcloud. We covered features, limitations, design & implementation considerations, and how it's different than most of the other options out there.
If you'd like to listen, you can grab the mp3 here. It's about 15 minutes long. You can find out more about Zend's cloud offering on phpcloud.com.
2011年12月20日星期二
PHPMaster.com: PHP's Quest for Performance: From C to hhvm
On PHPMaster.com today there's a new post from Matthew Turland talking about PHP's quest for performance and some of the recent advancements that have made better performing applications even more possible.
While it's sufficient for many users, as PHP sees increased use by large sites like Wikipedia and Facebook, the ability to serve more requests on fewer servers becomes increasingly important. Some efforts have been made in this area in the last few years, both within and outside the PHP internals team. However, understanding exactly what's going on requires a bit of background both in history and concepts.
He goes through some of the origins of the PHP language (from the early days with Rasmus Lerdorf) to the fact that the PHP language itself is interpreted - complete with some of the overhead that comes with that. He also mentions various projects that have tried to compile PHP back down to C to increase performance like Roadsend, HipHop and, most recently, the HipHop virtual machine from Facebook.
Oliver John Tibi's Blog: Mobile-ize Your CakePHP Application
In a new post to his blog, Oliver John Tibi has the first part of a series looking at mobile-izing your CakePHP application, making it mobile friendly when a mobile browser is detected.
I'll be writing a short series of posts on how to create a mobile version of your CakePHP app. I've always been bragging to my peers how awesome CakePHP is, and so now I'm writing a short tutorial on how to create a mobile-friendly version of a CakePHP app. I promise to make this as easy as possible.
In this first part of the series he helps you do two things - set up some custom routes for the mobile version of the site ("/m") and add in browser detection using the RequestHandler's "isMobile()" method.
2011年12月19日星期一
Michaelangelo van Dam' Blog: Configuring Zend Framework apps for Windows Azure
Michelangelo van Dam is back with the second part of his series looking at running PHP applications on Azure (the first part is here). In this new post he focuses more on configuring and building an actual application, one based on the Zend Framework.
Building web applications is nothing new anymore, as we've been doing it since the early days of the internet, but we've always done this on a single system. Even when Zend Framework came round, we kept doing the same thing and build apps for a single environment.
But as I've discussed already in my previous article, developing for the cloud requires another approach. [...] With Zend Framework developing applications running on these separate compontents becomes really easy. It's like having your cloud toolbox right in your pocket.
He walks you through the settings needed to interact with a MySQL database backend, setting up sessions to write to the database, caching information to a memcache server and storing files on a remote destination (in this case cloud storage).
Robert Basic's Blog: Communicating with Pidgin from PHP via D-Bus
Robert Basic has put together a new tutorial on his blog showing how he connected PHP and Pidgin (the popular chat client) with the help of the DBus extension.
Earlier this week I got an idea of trying to communicate with Pidgin, a chat client, via the terminal. [...] Surely I wasn't the first one to come up with this idea and after a bit of a googling found out that Pidgin's libpurple has a nice API for that, exposed via D-Bus. I first planned to write some scripts for this in Python or C, but when I finally sat down over the weekend to hack on this, realized there is a PHP D-Bus extension, thanks to Derick Rethans!
He goes through the whole process you'll need to get it up and working on your system - installing the extension via PECL, creating a DBus proxy to the Pigdin interface and getting a list of the currently connected users. You can find the first versions of this code in his account on github.
2011年12月16日星期五
Site News: Popular Posts for the Week of 12.16.2011
- Nelm.io Blog: Composer: Part 1 - What & Why
- PHPBuilder.com: PHP Arrays: Advanced Iteration and Manipulation
- CodeIgniter.com: PHP Framework Usage Survey
- Devshed: Building a PHP ORM: Deploying a Blog
- WorkingSoftware Blog: Your templating engine sucks & everything you've written is spaghetti code
- Watts Martin's Blog: PHP is not an acceptable COBOL
- DZone.com: Writing Better PHP: Three Guides
- Michaelangelo van Dam' Blog: Windows Azure for PHP developers
- Chris Hartjes' Blog: Better HTTP Request/Response in PHP
- Brian Swan's Blog: Running PHPUnit in Windows Azure
php|architect: CodeWorks East 2011 Recap
On the php|architect site today Keith Casey has written up a summary of the eastern leg of the CodeWorks conference tour that just wrapped up in Orlando, Florida.
While it will still be a few days weeks until I'm finally recovered, I wanted to share a recap of CodeWorks East 2011 while it was still fresh. If you're looking for the core presenters' slides, attendees will receive them via email but they will not be published publicly until after the West Coast Tour is complete in January 2012.
He mentions their sponsor first (Adobe) and then gets into the details of each stop along their way - Madison, Nashville, Baltimore, Raleigh and finally Orlando. Their west coast tour kicks off on January 10th in Seattle (with further stops in Portland, San Francisco, Los Angeles and Austin). You can find out more about the event on the CodeWorks site.
Sebastian Bergmann's Blog: Using CLANG/scan-build for Static Analysis of the PHP Interpreter
In a new post to his blog Sebastian Bergmann takes a quick look at using a static analyzer, clang and scan-build, to analyze the PHP interpreter (specifically during the compile process).
I have been tinkering with CLANG's static analyzer lately. This post summarizes how I installed LLVM and CLANG and performed the analysis of a build of the PHP interpreter.
He includes all the commands (unix-based) to get the clang tools/libraries installed in the correct places as well as what to add to your $PATH to get the "scan-build" command to work with the make and make install parts of the PHP compile process.
2011年12月15日星期四
Site News: Blast from the Past - One Year Ago in PHP
- Ibuildings techPortal: lessphp: PHP implementation of Less CSS
- Webgeekly.com: 20 Tips you need to learn to become a better PHP Programmer
- SitePoint.com: Introduction to Unit Testing in PHP with PHPUnit
- PHPBuilder.com: 10 PHP Tricks for Associative Array Manipulation
- iFadey.com: Get Flickr Images Using SimpleXML
- Francesco Montefoschi's Blog: PHPADD: abandoned docblocks detector
- Chris Hartjes' Blog: Fun with API's - FRAPI and django-tastypie
- Query7.com: An Introduction to Kohana3 PHP Framework
- NetTuts.com: 30+ Awesome CodeIgniter Tutorials for all Skill Levels
- QaFoo.com: Testing file uploads with PHP
- Mayflower Blog: PHP_CodeBrowser goes stable
- Richard McIntyre's Blog: Weaving Lithium #li3 into a legacy PHP application incrementally
- Christoph Dorn's Blog: FirePHP on Magenting
- Community News: ElePHPants - the Next generation
- SitePoint PHP Blog: MySQL Transactions & Why They Can't Be Emulated in PHP
Lineke Kerckhoffs-Willems' Blog: ProTalk update December 2011
Lineke Kerckhoffs-Willems has a new post to her blog today with an update about their in-progress site that wants to share tech knowledge through video, ProTalk:
A lot has happened since my October post announcing ProTalk, the secret project I am working on with my friend, Kim Rowan. So much in fact that now seems the ideal time to update you on our progress! Now, down to business! Since announcing the project in early October we have achieved the [several] project milestones.
The milestones include hosting by Combell (who also host Joind.in), a new domain, a commitment from Ibuildings for a design/logo/wireframe set and a new twitter account.
ProTalk is a "community resource aiming to provide a central point of access to video and audio content with a PHP focus." For more information and to sign up for details when they launch, check out their new site.
PHPClasses.org: Can .NET make PHP run faster than the official PHP implementation?
On the PHPClasses blog today the question is posed "can .NET make PHP run faster than the official PHP implementation?" (relating to the use of the Phalanger tool to compile PHP down to .NET assemblies.
Recently Phalanger 3.0 was released introducing numerous improvements in terms of compatibility with the PHP 5.3, interoperability with .NET platform implementations including Mono on Linux, and probably most importantly performance improvements. [...] What motivated this article was that a PHP developer named Rasmus Schultz went on the php.internals mailing list and proposed to switch the official PHP implementation based on Zend for another based on Phalanger.
The post includes some benchmarking results of requests made to a WordPress instance running on various PHP platforms. The Phalanger version came in around 2 seconds faster (average, obviously) than the PHP FastCGI setup. Also included are two suggestions for future PHP versions (v6 anyone?) that could help the language perform even better: Thread-safety for running with less memory waste and the inclusion of a JIT (Just in time compiler - of which a few are mentioned specifically.
2011年12月14日星期三
Community News: CICONF '12 Speaker List
The CICONF (CodeIgniter conference) group has made a new post about the lineup for their next event including people like Adam Griffiths, Alex Bilbie, Alexis Serneels, Harrow "WanWizard" Verton, Nick Jackson and Tyler Flint.
The chances are if you are using a library, addon, Spark or tutorial for your CodeIgniter projects it will have been written by one of these guys. Adam Griffiths wrote the book, Alex Bilbie has made some amazing OAuth 2 and Mongo code, WanWizard wrote DataMapper ORM - the most popular ORM used with CodeIgniter - and I've [Phil Sturgeon] released a few blogs about CI over the years.
They'll be doing the double-event conferences this year again - this time they'll be in London (February 18th-19th and San Francisco at a yet to be determined date). If you'd like to attend the London sessions, you can already purchase your tickets - a student pass for £35 and a standard ticket for £45.
Chris Hartjes' Blog: Better HTTP Request/Response in PHP
In a recent post to his blog Chris Hartjes looks at the idea of better HTTP Request/Response functionality in PHP, more than just the superglobal handling and PECL HTTP extension it has now.
I think the fact that we have $_POST and $_GET lulls some of us into the false sense that we should have $_PUT and $_DELETE objects, since that would map to the commonly-desired set of HTTP verbs that REST likes to use. But what should be inside those things, or should we be moving towards a more Pythonesque solution where a Request object, as part of core or via a only-really-for-the-brave- PECL extension?
He mentions opinions from other PHP community members (Laura Thompson and Elizabeth Smith) and a bit about what he (and I'm sure other developers) are looking for in a more full-featured request/response handling feature.
2011年12月13日星期二
Bradley Holt's Blog: Boston PHP Northeast Conference
Bradley Holt has a new post to his blog announcing the Boston PHP Northwest Conference happening in August (2012) in Cambridge, Massachusetts:
I'm excited to be able to announce that the first ever Boston PHP Northeast Conference will be taking place on Saturday, August 11th and Sunday, August 12th at Microsoft's NERD Center in Cambridge, MA. This regional event is intended for PHP beginners, enthusiasts, and professionals alike.
The conference will not just cover PHP but also general web development topics with a dash of user experience thrown in. Three regional groups are hosting the event: BostonPHP, Burlington, VT user group and the Atlantic Canadian PHP user group.
ZendCasts.com: RESTful Delete with SLIM, jQuery and JSON
Continuing on with his webcast series looking at using the Slim microframework to create a RESTful web service with JSON Output, John Lebensold takes the code from the previous tutorials (part one, two, three) and adds handling for DELETE to remove values from the data.
This tutorial will show you how to add jQuery RESTful calls for using the DELETE verb when deleting items via a JSON REST interface.
You'll definitely need to check out either the previous tutorials in the series to follow along with the code or grab the current source to see how everything's structured.
2011年12月12日星期一
Community News: Latest PEAR Releases for 12.12.2011
- Net_DNS2 1.2.0
- Validate_ES 0.6.1
- Tree 0.3.5
- Image_Barcode 1.1.2
- Image_Barcode2 0.1.0
- DB_ldap 1.2.1
- Services_Weather 1.4.6
- Services_Blogging 0.2.4
- Text_Highlighter 0.7.2
- Net_FTP 1.4.0a3
- Numbers_Words 0.16.3
- pearweb_qa 1.0.3
- XML_FastCreate 1.0.4
- XML_SVG 1.1.0
- File_Sitemap 0.1.4
- HTML_Progress2 2.4.2
- I18N_UnicodeString 0.3.0
- Validate_AR 0.1.2
- HTTP_WebDAV_Client 1.0.2
- Benchmark 1.2.9
- PHP_DocBlockGenerator 1.1.2
Andrew Johnstone's Blog: Vagrant, Automating PHP/MySQL Installation with bash/slack
Andrew Johnstone has a new post to his blog with a look at using Vagrant for continuous deployment of a PHP-based application.
Vagrant is simply a wrapper around Virtualbox headless that allows for provisioning virtual machines with support for puppet, chef-solo, chef, and bash. This allows you to automate the deployment and sandboxing of development sites. Additional base box images can be found at vagrantbox.es.
He walks you through the full process of setting up a first deployment - getting Vagrant installed, updating the config for a squeeze64.box image, configuring a virtualhost on the Apache web server and setting up a "preinstall" script to configure things like MySQL and install a long list of packages (via apt-get).
Michaelangelo van Dam' Blog: Windows Azure for PHP developers
In a new post to his blog, Michelangelo van Dam starts off a series looking at Windows Azure for PHP developer, an introduction to the service and what sorts of features it has to offer.
I'm a developer and I don't want to fiddle with setting up and maintaining an operating system, basically since I don't have the time for it. [...] I was completely sold when Josh Holmes came to Brussels in 2009 and told us more about what Windows Azure has to offer and how perfectly it is to build applications consuming these cloud services, without having to deal with setting up and maintaining the platform the run on.
He points out just a few of the features of an Azure instance - pre-installed OS (similar to Windows 2008 Server + IIS7), the five types of storage available (including Queue, SQL Azure and Blob storage). He also mentions working with file uploads, sessions, caching, database interaction and a brief comparison of cloud versus non-cloud scaling methods. In the next part of his series, he'll get more practical and show how to set up a Zend Framework application on an Azure instance.
2011年12月9日星期五
Site News: Popular Posts for the Week of 12.09.2011
- Joshua Thijssen's Blog: Compatible code: starting with symfony2
- NetTuts.com: Wrangling with the Facebook Graph API
- Jake Smith's Blog: Callback Filter Iterator in PHP 5.3/5.4
- DZone.com: Codeigniter and Object-Oriented PHP: Two Guides
- PHPClasses.org: Lately in PHP Podcast Episode 18 - The Debate on Remote Work for Web Developers
- DevArticles.com: Singletons in PHP
- Elizabeth Naramore's Blog: PHP Internals, Let's Chat About the Future!
- Reddit.com: Should I be doing just about everything using REST?
- Lukas Smith's Blog: Loose interface coupling
- Community News: PHP Advent 2011
Josh Adell's Blog: Codeworks '11 Raleigh Rundown
Josh Adell recently attended to Raleigh, North Carolina arm of the CodeWorks conference and has posted about some of his experience there (and specifics on each presentation).
I had a great time at CodeWorks 2011 in Raleigh this week, put on by the great folks at php|architect. Here is a rundown of the presentations, with some of my thoughts. [...] To all the conference speakers, organizers and attendees, I want to say thank you for a fun and educational experience.
The sessions for this stop on the tour were:
- "CI:IRL" by Beth Tucker Long
- "How Beer Made Me a Better Developer" by Jason Austin
- "What's new in PHP 5.4" by Cal Evans
- "Refactoring and Other Small Animals" by Marco Tabini
- "jQuery Mobile and Phonegap" by Terry Ryan
- "REST Best Practices" by Keith Casey
VG Tech Blog: Mocking the File System Using PHPUnit and vfsStream
On the VG Tech blog today there's another post related to unit testing (here's one from before) but this time they're talking about mocking the filesystem with vfsStream, a powerful tool that lets you interact with PHP streams as a virtual file system.
This article is about how to mock the file system when writing unit tests, and it will be rather code-heavy. [...] PHPUnit is the de-facto standard for unit testing in PHP projects, and this is what we will be using together with vfsStream in this article.
The include the code for a simple storage driver (VGF_Storage_Driver_Filesystem) to use with vfsStream with "store", "delete" and "get" methods. Also included are examples of using vfsStream to check things like directory existence, if a file exists, or if a file can be read. A few simple assertions are set up in their sample test to check the methods in their "VGF_Storage_Driver_Filesystem" class.
2011年12月8日星期四
Site News: Blast from the Past - One Year Ago in PHP
- PHP North West: PHPNW10: Harrie Verveer: Database version control without pain
- LearnComputer.com: PHP Interview Questions and Tips
- PHP.net: PHP versions 5.2.15 and 5.3.4 Released!
- Jose Anthony's Blog: PHP Code review checklist
- Joshua Thijssen's Blog: Top-5 certifications for every PHP programmer
- Court Ewing's Blog: A Simple Alternative to Global Registry Dependency
- Insidesigns Blog: Create a scalable private messaging application using PHP5
- PHPFreaks.com: An introduction to PHP and Mongodb
- Johannes Schluter's Blog: Upload Progress in PHP trunk
- Community News: Ibuildings announces Dutch PHP Conference 2011
- Joey Rivera's Blog: Facebook Graph API App Easy w/ PHP SDK
- Lorna Mitchell's Blog: Retrieving Data from Google Analytics API using PHP
- PHPBuilder.com: Create a PHP-based Twitter Client with the PEAR Services_Twitter Package
- Mayflower Blog: JavaScript Pitfalls for PHP-Developers
- Rob Allen's Blog: PHP 5.3 is quicker than PHP 5.2
Volker Dusch's Blog: Book Review: PHP Masters
Volker Dusch has posted his review of a recent release from SitePoint Press - "PHP Masters - Write Cutting Edge Code".
The book is solid, well written and covers the most important topics that people need to think about when starting off with PHP. It is one of the few PHP book on the market that you can pass on to your trainees/junior developers without having to "unteach" them half of the taught bad practices afterwards. This is a great achievement in my mind and I'd definitely recommend checking it out and passing it on to your trainees and 'junior developers' ... maybe read it first yourself and rip out a few pages in chapter 4.
His "long version" gets into a more complete list of his thoughts on each of the individual chapters (including "object oriented programming", "APIs", "design patterns" and "security"). Overall, he found the book good, but pointed out a few areas where it was lacking. You can find more detail about the book here (or on Amazon here)
VG Tech Blog: Unit Testing with Streams in PHP
On the VG Tech blog today there's a new post from André Roaldseth about using PHPUnit to test PHP streams, basing the assertions on the data rather than the functionality itself.
Using the memory/temporary stream provided by php:// stream wrapper you can create a stream with read and write access directly to RAM or to a temporary file [using "php://memory"]. This gives you the possibilty to write unit tests that does not rely on a specific file, resource or stream, but rather on data provided by the test itself.
There's no specific code examples here, but you can refer to the stream wrappers section of the PHP manual for more details on this and other handy built-in streams. Once created, it can then be used just as any other stream resource can. This could be useful to provide mocks in your testing, replacing any other stream-able resource with a "memory" or "temp" placeholder.
2011年12月7日星期三
Community News: PHPFog Gifts Free-for-Life Applications
PHPFog, the PHP-centric platform as a service has made a new post to this blog about two new "gifts" they're providing to developers:
I want to thank you for your interest in PHP Fog. Thanks to you and tens of thousands of developers like you, we have grown massively in the last year and a half. As a sign of my gratitude, I'd like to give you two free gifts.
Their gifts to the community are a conversion of the 6 month applications over to a free-for-life product and you can now deploy three of these "free forever" applications instead of just the one. You can signup here for the service with offerings of installed software like PyroCMS, Drupal 7, MediaWiki and Slim. For more information, you can attend this webinar.
Mrinmoy Ghoshal's Blog: Concept of Strings:PHP
If you're new to the PHP language and are looking for the full scoop on working with the string datatype, look no further than this new post from Mrinmoy Ghoshal. It's an excellent (and quite complete) resource for just about everything involving strings in PHP.
A string is series of characters, where a character is the same as a byte. This means that PHP only supports a 256-character set, and hence does not offer native Unicode support. See details of the string type.
The tutorial is broken up into different sections for easier consumption:
- Single quoted
- Double quoted
- Heredoc
- Nowdoc
- Variable parsing
- String access and modification by character
- Useful functions and operators
- Converting to string
- String conversion to numbers
- Details of the String Type
2011年12月6日星期二
Joshua Thijssen's Blog: SPL: Using the iteratorAggregate interface
Joshua Thijssen has a recent post spotlighting a part of the Standard PHP Library (SPL) that implements that Traversable interface, the IteratorAggregate interface.
Together with its more famous brother "Iterator", they are currently the two only implementations of the "Traversable" interface, which is needed for objects so they can be used within a standard foreach() loop. But why and when should we use the iteratorAggregate?
He answers his question with an example - a book that contains chapters. With a normal iterator you'd have to define standard functions (like valid, rewind or key). Using the IteratorAggregate you can push items into an internal array (like chapters in a book) and call a "getIterator" method to get this set. He also takes it one step further and shows implementing the "Count" interface to make it easier to get a total count of the items in the iterator. Sample code is included to help clarify.
DZone.com: Codeigniter and Object-Oriented PHP: Two Guides
On DZone.com today John Esposito points out two CodeIgniter tutorials that can help you on your way to becoming a pro with this popular PHP framework.
As Codeigniter builds on its (already considerable) popularity, now might be a good time to think about using the massively community-supported PHP framework to its maximum potential, if you aren't already. Here are two tutorials to check out, depending on your level of familiarity with object-oriented PHP and frameworks.
Here's the two he mentions:
The second tutorial is a little older, but the functionality of the framework hasn't changed dramatically since then so most of it should still apply.
2011年12月5日星期一
PHPMaster.com: Charting with pChart
On PHPMaster.com today there's a new post highlighting the use of pChart to graph out the data from your PHP application. pChart provides an easy interface to draw graphs with GD, supporting alpha transparency, shadowing, spline/cubic curves and much more.
Created and maintained by Jean-Damien Pogolotti, a systems engineer based in Toulouse, France, pChart is a library that creates anti-aliased charts and graphs using PHP. It's object-oriented code has been recently redesigned and makes it easy to add beautiful, eye-catching data. The library is free for non-profit use and for inclusion in GPL distributed software; licensing plans for other uses start at just 50 Euro. In this article I'll take you through installing pChart and using it to generate a basic chart, line chart and plot graph.
He walks you through the download and installation of the tool as well as showing the code you'll need to include to get started with a first script. Their examples show how to create both single- and three-series charts with some sample data and some screenshots of output.
WebDevRadio: Episode 94: Keith Casey Interview from Zendcon 2011
On the WebDevRadio podcast, Michael Kimsal has posted an interview with Keith Casey from this year's ZendCon 2011 conference.
I got a chance to sit down with (the legend) Keith Casey. Keith's well known in the PHP community with his web2project project (among other things) and is now poised to be a greater force in the worlds of Twilio and the Austin tech scene. Volume is a little quiet here, so turn it up to hear Keith's words of wisdom.
You can listen to the episode either via the in-page player or by downloading the mp3 directly to listen at your leisure.
2011年12月2日星期五
Site News: Popular Posts for the Week of 12.02.2011
- PHPMaster.com: Localizing PHP Applications "The Right Way", Part 5
- AjaxRay.com: The first Kohana book : Kohana 3.0 Beginner's Guide
- Volker Dusch's Blog: Textual code coverage information for PHPUnit
- Richard Miller's Blog: Symfony2: Integrating elasticsearch
- Gonzalo Ayuso's Blog: Playing with the new PHP5.4 features
- DZone.com: Speed Up Your PHP Like Facebook
- Karsten Deubert's Blog: Zend_MVC, Controller Plugins and Annotations
- PHPMaster.com: Introduction to Git, Part 1
- NetTuts.com: Easy Package Management for CodeIgniter with Sparks
- Tom Schlick's Blog: Wrench for FuelPHP
Jake Smith's Blog: Callback Filter Iterator in PHP 5.3/5.4
Jake Smith has a new post to his blog today about a feature included in PHP's Standard PHP Library that you might have overlooked - the FilterIterator's callback functionality.
The Filter Iterator is probably my second favorite iterator, next to Directory Iterator. There are many great use cases for the Filter Iterator, and when you do filter the original data is left untouched. A Filter Iterator is really simple to use, create a class that extends FilterIterator and adjust the accept method to meet your criteria. This is great and all, but having the ability to create filter iterators on the fly, ones that won't be used application wide, without having to create a class is even better.
He includes a bit of code defining a FilterCallbackIterator class with a "callback" parameter passed into the constructor (in his case, a closure). Also included is some sample code of it in use - handling an array (well, ArrayIterator) with a simple true/false check on the current array value. You can find out more about this functionality in the PHP manual.
Joshua Thijssen's Blog: Compatible code: starting with symfony2
In a new post to his blog, Joshua Thijssen documents some of his first steps into the world of the Symfony2 framework (as a developer who has lived mostly in a Zend Framework/CodeIgniter world). His post doesn't compare the frameworks, it's just his discovery along the way.
A friend of mine who is a big supporter of Symfony told me to give Symfony1 a shot. Off course I was skeptical since I knew less about symfony1 than I did on Zend_Tool. That, plus the fact we needed to autoload, bootstrap and get two frameworks up and running simultaneously. What could possibly go wrong! Conclusion: I've got my tool up and running about a 45 minutes later...
He talks about the process he went through to download, setup and configure the framework and start using a "task" to create a simple executable script. He also briefly compares Symfony1 to Symfony2, noting that SF2 is a bit more "out-out-of-the-box friendly" than SF1. The overall experience was a positive one, though. You can find out more about Symfony1 here and Symfony2 here.
2011年12月1日星期四
Site News: Blast from the Past - One Year Ago in PHP
- Dave Marshall's Blog: Notes from porting ruby to php
- CodeIgniter.com: CodeIgniter in 2011: Reactor, Core, & UserVoice
- Christoph Dorn's Blog: FirePHP 1.0 in 5 Steps
- Label Media Blog: Design Patterns in PHP - Strategy Pattern
- Satya Prakash's Blog: PHP is not Java
- Community News: PHP Unconference Europe 2011
- OpenSky Blog: Inheritance in PHP, or why you want to use an Interface or an Abstract class...
- Richard Smaizys' Blog: Improve your code style with simple tips
- PHPBuilder.com: Boost PHP Site Performance with Zend Framework Data Caching
- Bence Eros' Blog: Using Inheritance
- Joshua Thijssen's Blog: Creating a traceroute program in PHP
- Label Media Blog: Test Driven Development with PHPUnit
- Tobias Schlitt's Blog: PHP library release survey
- Till Klampaeckel's Blog: Tracking PHP errors
- NETTUTS.com: Creating a Twitter OAuth Application
PHPMaster.com: Defining and Using Functions in PHP
PHPMaster.com has a new article for those new to the PHP language posted this morning - an introduction to using functions and making your code more reusable.
Let's start by defining the word "function." A function is a self-contained piece of code which carries out a particular task (or function!). A key benefit of using functions is that they are reusable; if you have a task that needs to be performed a number of times, a function is an ideal solution. They can be either defined by you or by PHP (PHP has a rich collection of built-in functions). This article will focus on programmer-defined functions but will touch briefly on PHP's functions to complete the picture.
They include a few code snippets showing the syntax of functions (including their name, arguments and returning a value). They suggest grouping your functions together in your code for easier maintenance and share a handy tip on making a function accept a varying number of arguments.