The digest of interesting news and materials from the world of PHP for the last two weeks No. 12 (02/25/2013 - 03/11/2013)



    We bring to your attention the next selection with links to news and materials.

    Enjoy reading!


    News and Releases


    • Optimizer + will be included in PHP 5.5 - Over the past two weeks there have been a number of events related to the inclusion of Zend Optimizer + in PHP. A vote was launched, which, recall, suggested 3 scenarios: 1) Include in 5.5, even if it delays the release a little; 2) If integration requires delaying release 5.5, then include it in 5.6; 3) Do not include in PHP, provide only from PECL. First, the package became available from PECL , and then according to the resultsZeev Surasky in php-internals announced the decision to include Optimizer + as zend_extension in the default delivery of PHP, and in version 5.6 it is planned to integrate into the kernel. This message has generated a lot of discussion, as some believe that such a decision requires 2/3 of the vote. But still, the inclusion of the optimizer does not affect the language syntax, and by default the corresponding option in php.ini will probably be set to Off. Well, rest in peace with the predictable PHP release process: another alpha, and beta is delayed again. But for the sake of such results, I would like to get the caching of the opcode out of the box a year earlier.
    • Release PHP 5.5.0 Alpha6 - The release itself contains only a few bug fixes found in the previous alpha, but is notable for delaying the release of the beta, which will already include Optimizer +.
    • Symfony 2.2 - The long-awaited release work, which was carried out for 6 months, was released. Read more about the new features in the post .
    • First beta of Phalcon 1.0.0 - A year after the birth of this unusual PHP framework, it survived to the first version.
    • 12th issue of Web & PHP magazine - In the anniversary issue (the magazine has been published for a year), the following topics are revealed: the use of recursion in PHP; use of PECL; bug fixes in production using APM and many others.
    • About PHP-FIG - Matthew Weier O'Phinney, architect and project leader of the Zend Framework, has announced that he is leaving PHP-FIG , a group that accepts PSR standards. In a post, he gives reasons that forced him to make such a decision. In short, there are more important things that the author would like to spend time on than arguing about how to use tabs or spaces, where to put curly braces, etc.


    Php


    • How foreach actually works - The most detailed answer to StackOverflow that you may come across. Core PHP developer Nikita Popov puts all the points on the work of the foreach cycle.
    • The next big thing in PHP - Having described their vision of the current state of affairs in PHP, the authors of the post argue that if everything continues in the same vein, then PHP will die soon. Yes, he will live 5, maybe 10 years and die. In their opinion, in order to prevent this, PHP 6 should make drastic changes aimed at performance, and they generally call to forget about backward compatibility. In addition to such radical statements, the authors make a really important proposal: to create the opportunity for ordinary PHP users to participate in the development of the language. One of the authors even created the corresponding RFC , which proposed adding open polls to php.net in order to get feedback from users.
    • About the predictable release cycle for PHP - A short post in which the author, in connection with recent news about Optimizer +, expresses the view that a stable and predictable release process is very important for developers. A hasty inclusion of ZO + in the language in the form of zend_extension does not essentially mean anything: on shared hosting it will not be there in a year, and those who are able to use the latest versions of PHP on the server can simply install Optimizer + from PECL.

    Learning Materials


    • Functional programming in PHP - More recently, the topic has already slipped into the digest and, nevertheless, is a good post in which the basic principles of functional programming and their application in PHP are disclosed.
    • Bloom filter in PHP - PHP implementation of a probabilistic data structure that allows you to compactly store many elements and verify that a given element belongs to the set. For example, an author applies a filter to check for the existence of a word or phrase in a dictionary> 10,000,000 words.
    • Unit testing in PHPUnit , 2 , 3 , 4 - A complete guide to unit testing for beginners, which in four parts covers all aspects of using PHPUnit, from installation to advanced use techniques.
    • Measures to be taken if your PHP site has been hacked - If in a previous post the author considered diagnostics: how to find out that your site was hacked, this time the “treatment” is considered: the steps are listed that will help get rid of the malicious code. In addition, recommendations are given to prevent re-hacking and infection.
    • Integrating OAuth with Opauth - A small tutorial on using a multi-provider framework for authentication through OAuth in PHP applications. The post reviewed an example of integration with CodeIgniter, but there are implementations for all popular frameworks. The list of providers supported out of the box is impressive.
    • Compliance with PCI and PHP standards developers - The article briefly describes what PCI standards are, the main myths surrounding them are examined, and an overview of the main points is given. In more detail, the author dwells on points directly related to the backend development of web applications.
    • Install XHGui - A small tutorial on installing and using a great tool for profiling code. A little more detailed tutorial was already here .
    • Contributing to Paratest - A short article in which the author talks about the benefits of using the Paratest tool to run tests in parallel, as well as about new improvements that have been proposed by third-party developers and encourages all kinds of help and participation in the development of the project.
    • Scaling applications on Silex. Using RouteCollection - In this post, the author improves on his sample application from the previous article on scaling Silex applications , and this time uses RouteCollection to determine routes instead of the DI container from Symfony. All code is available on GitHub .
    • Behavior Driven Development - A small overview of the concept of BDD in general and Behat in particular.
    • D means documentation - In a post, the author considers the last principle from the LUCID set - documentation. By analogy with TDD, the author offers his own approach to programming - Documentation Driven Development. This approach assumes that the developer first writes documentation and comments on the code, then tests, and only after that proceeds directly to the code. The post also provides a small example illustrating this approach (without tests).
    • Problems, effectiveness and attitude of the PHP-FIG group - The news that one of the key figures leaves PHP-FIG certainly had a resonance. The author of the post, although not a member of PHP-FIG, nevertheless, sets out practical considerations regarding the fate of the group. In addition to the post itself, we recommend paying attention to the comments, which also set out interesting thoughts on the topic.
    • Creating an ePub with PHP and Markdown - A good tutorial that shows how to create an ePub book from Markdown documents using the md2epub and RainTPL libraries .
    • Valitron The Simple Validation Library That Doesn't Suck - The author tried to find a simple and convenient library for validating user data, which would not be bulky and had no dependencies. Not finding this, the author wrote his Valitron library, which has all of the above features. More usage examples can be found on GitHub .
    • Rock On, Refactor, or Re-roll? - Surely you met a situation where when developing something for yourself, you suddenly for some reason have to postpone development for some time, and returning to business, you find that you look at many sections of the code differently and would like to do it differently / it's better. In this case, you have a choice: continue what you started, refactor or rewrite everything from scratch. Just about such situations, this post. The author describes his experience and gives recommendations for making decisions.
    • Let's make conferences better - The author of the post loves PHP conferences and often makes presentations at a variety of them. In the post, he shares several ideas on how to make conferences more useful, and therefore more interesting for a wide range of developers.
    • Export of favorite Habr to FB2 - high-speed PHP version - The author of the post created a useful application in PHP for creating books from your favorite posts. For analysis of articles the phpQuery library was used .
    • Preventing code degradation over time with unit testing - This article discusses what code decay is . Of course, the code itself does not change over time, but the environment can change greatly, and this can lead to unpredictable results. The authors provide a number of recommendations and examples for testing code in order to avoid this.
    • Complete Laravel Command Guide - A large and detailed tutorial on Artisan - Laravel command line utilities and writing custom commands.
    • Why you should not use .htaccess (AllowOverride All) - in production The author has already published on his blog the results of a small study Why is FastCGI with Nginx so much faster than Apache with mod_php? , in which I discovered that the bottleneck when using Apache is the AllowOverride All directive. This time, the author published a slightly more detailed study, and also provided an example httpd.conf configuration for Magento .
    • RESTful APIs on ZF2, Part 3 - Continuation of a series of articles on building RESTful interfaces. The author continues to describe the general concepts of REST, and this time deals with documenting your API.
    • Overloading: creating class methods on the fly - In most programming languages, overloading means the ability to describe several methods with the same name and a different number of arguments. Overloading in PHP means the ability to dynamically "create" properties and methods. In his post, the author illustrates the use of "overload" using an example. The database access class and retrieval of records using the getBy methods (for example, by id or username - getById () and getByUsername (), respectively) implemented through the magic __call () are described.
    • Confoo: Testing, Performance, Metrics and APIs - Slides of several useful reports from the Confoo conference in Montreal .
    • PHP has reached its limit - The author switched from PHP to Ruby, and in the post compares the solutions to typical problems in Rails and TYPO3, naturally demonstrating the superiority of the first. Enough already?
    • Code quality - The author believes that code quality is only 30% of talent and 70% of the correct settings for the environment and processes. In a post, the author describes the tools and techniques that he uses to maintain the desired quality.
    • Tracking the process of completing tasks in PHP - The author wrote a simple library designed to track the progress of large-scale tasks, for example, batch processing. In addition to time, the library allows you to track used memory.
    • Getting Acquainted with Aspect-Oriented Programming in PHP - Some time ago, the author published a habrapost about AOP in PHP . This time we have a more detailed and in-depth review of the concepts of aspect-oriented programming. PHP examples using the Go! Library are attached.
    • PHP C frameworks - The post discusses the pros and cons of using PHP frameworks delivered as language extensions. By the way, the author counted two such: Phalcon and Yaf . Are there any others?


    Link to the previous issue.
    Material prepared by pronskiy


    Also popular now: