The digest of interesting news and materials from the world of PHP over the past two weeks, number 10 (01/26/2013 - 02.11.2013)
We bring to your attention another collection with links to news and materials.
Enjoy reading! ')
News and Releases
Zend Optimizer + may be included in PHP 5.5 - Unexpected news that an opcode caching extension may be included in the upcoming PHP release. Similar proposals were heard more than once, and APC was considered a natural candidate. But Rasmus Lerdorf and other core developers have repeatedly said that APC has not yet reached the stable stage and contains too many errors to be included in PHP. And Zeev Suraski, answering a question in php-internals , talks about the possibility of opening the source code of Zend Optimizer + and including it in PHP 5.5. However, according to the current plan, releases of alpha versions were not planned, and therefore no new features were expected, but the community accepted this news not without enthusiasm and there are chances that the expansion will nevertheless fall into 5.5. The published RFC document, among other things, contains a comparison of Optimizer + with APC. Presumably, three possible scenarios will be submitted for voting: 1. Integrate Optimizer + into PHP 5.5.0 with a delay of release of up to 2 months; 2. Integrate Optimizer + in PHP, without delaying release 5.5; 3. Do not integrate Optimizer + into PHP, providing it as an optional component available from PECL.
The Zend Framework 2.0.7, 2.1.0 and 2.1.1 were released right away. If version 2.0.7 is an impressive set of fixes , then release 2.1.0 contains many new features, including new components for working with push notifications for iOS and Android devices. Well, 2.1.1 makes a number of corrections.
Announced stable release of MySQL 5.6 - Since the release of the previous version 2 years have passed, and this long-awaited release contains many innovations and improvements, especially regarding performance. It is noteworthy that a little earlier, Fedora and openSUSE announced their intention to replace MySQL with MariaDB in the default installation.
11th issue of the Web & PHP magazine - The following topics are covered in the latest issue of the magazine: PHP in the cloud; Agile thinking development; Indexing databases; other.
PHP 6 Pissing in the Wind - Excellent post in which the author expresses his point of view about the current situation in the PHP community. He gives an example of problems in the language that are constantly reproached by PHP-haters, namely: inconsistency of parameters, the absence of scalar objects and unicode support. First, the author cites an obvious, in his opinion, decision, and then writes about why, after all, no changes are made. He believes that among core-developers there are too many conservative-minded individuals, and voting for any major changes most often fail, as was the case, for example, with accessors . The author calls for progressive changes, and those who do not want to work on such changes, calls for retirement. No less interesting were the comments to the post, for example, a detailed response from Zeev Suraski.
PHP is growing and growing - The results of research on PHP usage data for the last 10 years have been published. The title of the post as it hints. In addition to describing the metrics used and the evaluation features, the post also contains a brief history of the PHP language.
Functional PHP programming - In the last issue, the original was mentioned in which the current state of the implementation of the functional paradigm in PHP was described in detail, an example was given of using the calculation of the total cost of the shopping cart in a functional style. At this time, your attention habraperevod.
Types in PHP: good or bad? - Types are of course treits. It is about them translation of the article, which discusses the advantages and disadvantages of the new features of the language PHP.
Study materials
Tips for Zend certification , 2 - Interviews with one of the creators of PHPBenelux - Michelangelo van Dam and simply famous blogger Lorna Jane Mitchell, in which they share helpful tips and recommendations for passing Zend certifications, answering questions: is it worth it? how to prepare? what to pay attention to? and many others.
We test serialization for PHP - The task of data serialization occurs very often, for example, when implementing caching. And, obviously, information coding takes some time. In the article, the author described the test results using the built-in serialize / unserialize methods, using the igbinary extension, as well as encoding into a JSON string.
Laravel 4: Creating a RESTful API - Although Laravel 4 is still in beta, there are already a lot of materials on this framework. This tutorial describes building a RESTful API using the example of creating a simple delayed reading service. And in the first part, the following steps are considered: installation of the framework, configuration, use of migrations, use of ORM, authentication, setting up routes (including taking into account the versioning API), creating a controller that implements create, update, and get resource list operations.
How to perform asynchronous requests for PHP - Excellent post in which the author describes 3 ways to make asynchronous calls from PHP. These three methods do not involve the use of any external dependencies such as the queue server, all in pure PHP: opening a socket and closing without waiting for a response; writing to the log file (pseudo-sequence); fork of the curl process. For each method, a small example is given and the advantages / disadvantages of each are considered.
Parallel PHPUnit - A small post about parallel use of PHPUnit to run multiple test suites at the same time. The author mentions possible problems with the race condition and recommends using the Paratest tool.
Doctrine and SOLID - In his post, the author says that it is impossible to follow the principles of SOLID when using Doctrine 2, in particular, preserving the only responsibility is difficult. The author gives a couple of recommendations for improving the code.
Logged according to PSR-3 for reuse - A good and detailed tutorial on creating a simple logger for your application following a recently adopted standard.
How to write code that is ready for change - An excellent post, which provides an overview of all the principles of software design and coding, designed to make the code easy to change and maintain. Good text is supplemented with simple and clear PHP examples.
Manage PHP applications builds. Help Phing - A good starting point if you decide to automate the deployment of your PHP applications. The article provides basic information on the use of an Ant-based tool - Phing. Considered installation of PEAR, the basic configuration for the project, a sample configuration for running tests on PHPUnit.
Custom config loader for symfony 2 - In the post, the author describes how to solve symfony 2 configuration tasks when the framework is far from being the only component in the system. The described approach assumes the use of INI files instead of YAML.
Zend Framework 2 ServiceManager - The last article in the Zend Framework 2 introduction series. In previous posts, Dependency Injection , Modules and ModuleManager and EventManager have already been reviewed. This time, the author relates to the ServiceManager component, writes about how to configure it, how to use and simplify development, gives examples.
Setting up a PHP environment for VPS development - The author encountered a number of problems and inconveniences when developing on a local machine and decided to use a full-fledged VPS for this purpose. He detailed his experience in a post.
Dependency Injection with Pimple - When developing applications, we try to create independent modules and components so that they can be reused. But creating completely independent components is a difficult task, and the resulting dependencies can create many problems if they are not under proper control. In this case, dependency injection is a great solution. The post discusses the use of a simple library that implements dependency injection - Pimple from one of the Symfony developers.
Accelerate the autoloading of classes using Composer - In the post, the author shows a non-standard solution that allows you to increase the speed of class loading using Composer by creating symbolic links to files beforehand.
Sign in via social network: SSO module - The author describes in detail the creation of an authorization module through social networks for the Kohana framework.
Composer Stability Flags - The author talks about how “stability flags” work in omposer and problems related to version stability when using omposer, besides, the author calls developers of modules / extensions to tag their project and designate the stability of their code in the repositories with the appropriate branches.
Automated refactoring in a big project - Khabrapost, which demonstrated a method of automatic refactoring. The example of phpBB shows how to “refactor” calls to SQL queries so that they use input escaping.
Catching fatal PHP errors - A brief tutorial on how to intercept Fatal Error and make them beautiful.
Beware of mass assignment - A little about how important it is to filter the data coming from the user, what the essence of the problem is and what might be fraught with it.