2011年11月15日星期二
PHPMaster.com: Getting Started with PHPUnit
On PHPMaster.com today, there's a new tutorial helping you get started with on of the most popular unit testing frameworks for PHP, PHPUnit. In this new article they help you write your first tests, run them and figure out what to do when they fail.
Most people know that testing your websites is a good idea, but after some time testing can become tedious. What if a lot of this testing process could be automated so you don't have to go trough every function manually, time after time, to ensure that it still works after updating your code? This is where unit testing comes in, to automate the testing process.
She starts with a simple, self-contained test - setting and getting a "name" value from a User class. The tests include an example of a setup/tear down and check that the result of the "talk()" method is correct with an assertEquals.
2011年11月14日星期一
PHPMaster.com: Localizing PHP Applications "The Right Way", Part 3
PHPMaster.com has posted its third part of its "Localizing PHP Applications 'The Right Way'" series. In this third part you'll learn more about locales and message domain switching.
In Part 2 you gained more insight into using the gettext library by learning the most important functions of the extension. In this part you'll learn how to best use a fallback locale, switch between locales, and override the currently selected message domain.
They show you how to set up the directory structure to handle a fallback locale, a choice to use when the system can't determine which to use. By using a default, you also avoid having the system translate from the default language to...the default language (like "English" to "English"). Included are also the code bits you'll need to switch between locales (just using a different domain) and using the dgettext function to specify a different domain than the selected one.
2011年11月11日星期五
Site News: Popular Posts for the Week of 11.11.2011
- Kevin Schroeder's Blog: fatal: The remote end hung up unexpectedly
- Anthony Ferrara's Blog: On PSR-0 Being Included In PHP's Core
- Slawek Lukasiewicz's Blog: PHP application diagnostics - Memtrack
- Ulf Wendel's Blog: Using MySQL stored procedures with PHP mysqli
- DZone.com: Using a virtual machine to play with multiple versions of PHP
- Volker Dusch's Blog: An introduction to PHPUnits @covers annotation
- php|architect: Geolocation: Easier Than It Looks
- Community News: EngineYard Hosts "Future of PHP" Live Panel - "PEAR & Pyrus"
- PHPMaster.com: Code Templates, AutoHotKey, and Ditto: Speeding Up Development
- PEAR Blog: PEAR Development on Github
Community News: Zend Framework 2 Development - CLA Not Required!
As is mentioned by Matthew Weier O'Phinney (and expanded on by Robert Basic) beginning immediately, the Zend Framework 2 project will no longer require developers to sign a CLA before submitting their code.
In #zf2 news, effective immediately, we no longer require a CLA for #zf2 contributions. Let the pull requests flow!
Robert gives a bit more detail in his post, pointing out the official git repo, the issues list, section on the wiki and the mailing list/IRC meetings. There's also a blog to follow to get the latest updates for the project.
If you'd like to find out more about this new version of the framework, check out this video from ZendCon by Matthew.
PHPMaster.com: PHP Master: Writing Cutting-Edge Code
On PHPMaster.com today (disclaimer: PHPMaster is a SitePoint website) Timothy Boronczyk has posted a review of SitePoint's latest offering for PHP developers - Writing Cutting-Edge Code (by Lorna Mitchell, Davey Shafik and Matthew Turland).
The book was written explicitly to help you becoming a better PHP programmer and is totally awesome. It not only covers advanced PHP coding topics such as object-oriented programming and design patterns, but also periphery topics that are just as important, such as security, performance profiling, and deployment. If you're ready to hang up your novice hat for good and become a professional-level PHP developer, this book is for you.
He goes through and highlights some of the content in the book, chapters covering relational databases, web services, security topics, caching, automated testing, PEAR/PECL....just to name a few.
Using the Slashdot scale of book ratings, where 1 is fit for lining cages and 10 is destined to be a class, I give PHP Master: Write Cutting-Edge Code a very solid 8.5. The content will grow with you and the book is not something you'll read in a weekend and then donate to the library because you have no need for it.
2011年11月10日星期四
Site News: Blast from the Past - One Year Ago in PHP
- Alison's Blog: Upcoming WordPress Security Book
- NETTUTS.com: A Beginner's Introduction to HTTP and REST
- Web Developer Juice: 14 descriptive reasons why Ruby is better than PHP
- Anna Filina's Blog: Developer Community: Where to Start? - Part 1
- ZendCasts.com: Unit Testing Action Helpers
- CodeIgniter.com: CodeIgniter 2.0 - Now with more Awesome
- Ruslan Yakushev's Blog: PHP 5.3 and PEAR available in WebMatrix Beta 3
- Blancer.com: 10 Compelling Reasons to use the Zend Framework
- Site News: Popular Posts for the Week of 11.12.2010
- Josh Holmes' Blog: ASP.NET and PHP On IIS Together
- Community News: Latest PECL Releases for 11.09.2010
- Matthew Weier O'Phinney's Blog: Introducing the ZF2 Plugin Broker
- Brian Moon's Blog: Monitoring PHP Errors
- Sameer Borate's Blog: Encrypting uploaded files in PHP
- Agile Toolkit News: Selective view rendering in Web Applications