The digest of interesting news and materials from the world of PHP for the last two weeks №1 (09/21/2012 - 10/05/2012)
Since spring of this year on Habré in the blog of our company are published digests of interesting news from the world of IT in the last week. The digest receives a lot of positive feedback, but many users have repeatedly asked whether a similar selection of news is planned in the subject of programming. And we are finally ready to present a similar digest for everyone. News, one way or another, is related to php, as it is one of the main programming languages in our company.
We are planning to publish the digest once every two weeks, if, of course, Habr's readers will like it. Therefore, we are happy in the comments are ready to listen to your advice, feedback or recommendations. ')
Enjoy reading!
News and Releases
Zend Framework 2.0.2 Release - This release fixes a problem with the “Router” service that affected URL generation.
Release PHPUnit 3.7 - A small set of changes. Reworked reports on the percentage of code covered by tests (PHP_CodeCoverage).
In Codeception 1.1.4, a new class Locator is introduced - The post describes how to combine more than one element for positioning, using both tags and CSS or XPath selectors. It also shows how to use the “tabindex” method to simulate moving around the page elements with the “Tab” key. And besides, there is a small code example showing how to define an element by the value of its “href” attribute.
Ext4Yii 1.1 is available. Along with many improvements and fixes, this version introduces the TreeGrid component.
Php
Introduction to PHP 5.4 - Everything you wanted to know about the new version of PHP in the slides from Ilia Alshanetsky, author of the bestseller php | architect's Guide to PHP Security.
Parsing binary data in PHP - In the post, the author first talks about unpacking the string “in C style” (getting the ASCII value of each character) and shows how it should NOT be done in PHP using ord. Instead, the author uses “unpack”, bit operators and bindec to work with the actual binary data string.
How to add "syntactic sugar" in PHP? - Not the latest, but very entertaining article, in which the author talks about the basic things in the work of Zend Engine and how to expand the language with your own chips.
Why is singleton a “problem” in PHPUnit? - An interesting reflection on the problems of testing components that use one of the most popular design patterns using PHPUnit.
Cloud hosting for PHP - Describes the requirements that, according to the author, should have such a service, and an overview of the most popular solutions.
Study materials
Abstract classes against interfaces - The author gives a detailed answer to probably one of the most frequently asked questions at the interviews. It is told about the difference between these concepts, about when and which of them is better to use, examples are given.
Create your own short link service (URL Shortener) - Create a simple tool for converting URLs into a short and easy to use form (for example, for Twitter). The structure of a simple database for storing links between short and full links is described, PHP code for creating a random hash that corresponds to the link and code for shortening it is presented. Also, of course, PHP code is presented for inverse transformation - from short to full.
Screencast PHPUnit unit testing - If you are new to unit testing then this screencast is a good way to start learning more about it. The author uses the Laravel framework as a base to demonstrate the TDD approach.
Webinar: Working with ZendForm in ZF2 - In ZF2, a completely reworked Form component is introduced that allows you to simplify the processing of forms in web applications. From the webinar, you will learn how using ZendForm to render forms, validate entered data using filters. The configuration of form elements, data filters, error handling and rendering using view helpers is considered.
Namespaces in PHP - PHP 5.4 is already in full swing, and many do not take full advantage of PHP 5.3. Popularly about what namespaces are and how to use them.
Node.js for beginners - The basic principles when working with Node.js, its pros and cons. And also about the difference between Node.js and traditional server languages (PHP, Python, Ruby).
Layout in CodeIgniter - The author’s blog recently published this post in which he describes how to use a common layout for pages.
Using the IMAP library in the examplesand continued - The first part describes the functions required for connecting to the mail server and reading messages. The second part is a continuation of working with e-mails and tells you how to delete messages, download attachments, etc.