How to transfer Zend Framework from 1 to 3

Someone, please, describe how the Zend architecture has changed from Ver 1 to 3. Recently, zend has released ZF3, but there is no information on how to transfer from zf1 to zf3. I have an application that was developed in zf1, now it is looking for an upgrade to using PHP 7 with ZF3. Do I have to rewrite all the code or how much effort needs to be moved to the latest version.

In addition, ZF3 claimed to be 4 times faster in PHP7. This is actually PHP7 itself, which is faster, not ZF3. I'm not sure how much they improved compared to the Laravel base, which is one of the best frameworks in the last few years.

If someone used ZF3, share your experience.

+4
source share
2 answers

If you are dealing with a large application, there will be no quick and painless way to upgrade to ZF3. From routing to services, both the practical and theoretical basis, which is under Zend Framework 2/3, is completely opposite to the one that was in the first iteration.

When ZF2 was first released, I completed the migration of ZF1-ZF2 (as well as ZF2-ZF3) in a very large project. As a result, we used an incremental approach, requiring minor deviations from the main ZF1 library (i.e., we edited several Zend classes), which worked very well for us. Since ZF1 got into EOL in September, that is, there will no longer be any corrections or updates of any errors, this should not be a significant problem for you.

, , , ZF1/ZF2. ZF2 ZF3 , , , ( ) ZF1 ZF3.

Zend Framework 1 2

, . ZF1-to-ZF2, Zend. - Zend Framework. 3.0 (, zend-mvc, zend-servicemanager ..), , , ZF2/3.

+3

, , , .

  • , ZF2, ZF3.

  • , PHP7, PHP7 , ( ) .

...

ZF2

https://framework.zend.com/manual/2.1/en/migration/overview.html

  • .
  • Zend Framework 2 Zend Framework 1.
  • Zend Framework 2 Zend Framework 1.
  • , , MVC.
  • MVC.
  • .

ZF3:

Zend Framework v2 - v3 . v2, .

. , , , , . , , , , !

https://docs.zendframework.com/tutorials/migration/to-v3/overview/

, , ZF ZF2.

ZF1 ZF2 :

https://framework.zend.com/manual/2.4/en/migration/zf1_zf2_parallel.html

ZF2 ZF1, - , ZF2 , ZF1 - . ZF1 ZF2 , ZF1 ZF2. , , ZF2, ZF1.

, ZF1 ZF3 , , , .

PHP7

, PHP7 .

- , PHP- PHP7:

find . -name "*.php" -print0 | xargs -P 8 -n 1 -0 sh -c '/usr/local/Cellar/php70/7.0.0/bin/php -l $0 || true' | grep -v 'No syntax'

Mac, PHP, brew.

brew install brew-php-switcher

httpd.conf:

#LoadModule php5_module libexec/apache2/libphp5.so

:

brew install php71

httpd.conf:

<FilesMatch .php$>
    SetHandler application/x-httpd-php
</FilesMatch>

:

brew-php-switcher 71
+2

Source: https://habr.com/ru/post/1658568/


All Articles