News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Migrating to ZF2:
Integrating Composer and DoctrineORMModule
November 14, 2013 @ 12:23:52

Zend Framework v2 has been out for a good while now, but there's still applications out there running on the v1 of the popular framework. Since there was such a fundamental change in structure and functionality between v1 and v2, simply upgrading isn't possible - you have to migrate. Fortunately, there's guides like this one from Chris Strosser that shows you how to get there gradually.

Due to the vast nuances of Zend Framework 2, migrating an application from Zend Framework 1 can be very tedious. To make this process a little less painful, there is a way to slowly implement modules from ZF2 without making the application unusable. The methodology illustrated, which implements DoctrineModule and DoctrineORMModule into a Zend Framework 1 project, can be applied to a variety of ZF2 modules, making it an invaluable technique in the migration process.

Using these two ZF1 modules, they show how to integrate them into a typical ZF2 structure. There's a few steps in the process:

  • Add init_autoloader.php to application root directory
  • Update ZF1′s index.php for Composer compatibility
  • Setup ZF2 configuration files
  • Setup ZF2 "Application" module
  • Relocate existing entities and repositories to ZF2
  • Make ZendMvcApplication available in ZF1

It's not an overly complex process, it just requires the right configuration settings and component placement to get the ZF1 module to cooperate in the world of ZF2.

0 comments voice your opinion now!
zendframework1 zendframework2 module migrate gradual composer

Link: http://webjawns.com/2013/11/migrating-to-zf2-integrating-composer-and-doctrineormmodule/

Systems Architect Blog:
Apache2 vs Nginx for PHP application
March 29, 2013 @ 10:41:38

On the Systems Architect blog there's a recent post from Lukasz Kujawa about comparing Apache2 and Nginx for PHP applications, specifically when using the PHP-FPM module. His tests are based on the results from three different application types - a large Zend Framework 1 app, a small PHP script and a WordPress installation.

If you've ever been trying to squeeze more out of hardware you must have come across Nginx (engine x). Nginx usually appears in context of PHP-FPM (FastCGI Process Manager) and APC (Alternative PHP Cache). This setup is often pitched to be the ultimate combo for a web server but what that really means? How much faster a PHP application is going to be on a different web server? I had to check it and the answer as often is - that depends.

He ran the tests on an Amazone EC2 instance and optimized the server to ensure that there was a little interference as possible. The used the Zend Optimizer Plus opcode cache and PHP 5.4 and set the logs to go to memory instead of disk. Graphs included in the post show the results of the benchmarking of each application, with the differences (in most cases) not being that wide of a gap.

There isn't big difference between Apache2 and Nginx in PHP context. Yes, Nginx can be much faster when delivering static content but it won't speed up PHP execution. Running a PHP script seams to be so CPU challenging task that it completely eclipse any gain from a web server.
0 comments voice your opinion now!
apache2 nginx performance benchmark zendframework1 wordpress native


Zend Framework Blog:
Zend Framework 1 is Migrating to Git!
March 28, 2013 @ 09:29:23

The Zend Framework project has announced a major move for the framework's development - the Zend Framework v1 repositories will be moving from Subversion to Git over the next year or so.

Since its inception, Zend Framework 1 has used Subversion for versioning. However, as we approach its end-of-life (which will occur 12-18 months from the time this post is written), and as our experience with ZF2 processes becomes more familiar, we -- the Zend team and the Community Review team -- feel that we can better support ZF1 via GitHub. As such, we will be migrating the ZF1 Subversion repository to GitHub this week. Please read on for details!

The post details the steps that'll be taken during the process including the changing of the location of the "master" branch (and how to change svn to point to it) and the updates to the integration of the Dojo libraries. They also talk some about the "extras" repository and how things will work with the Issue Tracker and pull requests in the future.

The repository and issues migration is the first step in a series of planned migrations. We also plan to eventually migrate our wiki to GitHub; this will allow us to offload functionality from the main ZF website, and also consolidate all development-related functionality (other than the mailing list) in a central location.
0 comments voice your opinion now!
zendframework1 git migration subversion github


PHPMaster.com:
Setting Custom Error Messages for Zend_Form_Element
October 11, 2012 @ 08:58:37

On PHPMaster.com today there's a new post for all the Zend Framework (v1) users out there. In it, Aurelio De Rosa shows you how to set custom error messages for elements in a Zend_Form.

In this article I'll show the solution to a common problem which arises when a developer has to create a non-English website or application that is based on the Zend Framework. How do we mark a field of a Zend_Form which is a Zend_Form_Element as invalid, showing one or more custom error messages? The problem is mainly caused by the native counter-intuitive methods of the Zend_Form_Element class which I'll explain in more details.

He's included a basic example showing the creation of a form and the setup of a text element and some validators to match. He makes a controller and view to handle the output and submission then shows how to use "setErrors" (and "setErrorMessages") of the Zend_Form elements to setup that custom error. This only lets you set one message, though, regardless of the point of failure. To stop things when there's an error, you have to set the "breakChainOnFailure" parameter on the validator to false - then the message will make more sense.

0 comments voice your opinion now!
zendframework1 zendform custom error message element tutorial



Community Events





Don't see your event here?
Let us know!


tool podcast library security community interview symfony conference laravel introduction voicesoftheelephpant framework artisanfiles release composer version list language opinion series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework