2011年11月15日星期二

Community News: Latest PECL Releases for 11.15.2011

Latest PECL Releases:

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

Popular posts from PHPDeveloper.org for the past week:

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.