How to integrate Zend Framework into my old non-centralized PHP site?

We are developing a new site in the Zend Framework, while we maintain and improve our old version (plain old PHP files).

In some cases, this means a waiting time for programming, which we could use to some extent for our new versions.

We have full server control and complex 301 rewrites on Apache, so we could rewrite o symlink as needed. Our goal would be to include Zend in a subdirectory of our site so that we can at least use its libraries for any PHP programming, and even better so that the database models and as much code as possible can be reused on our exclusively zf site when it is finished.

Would it be worth the hassle? Can anyone point out a tutorial or best practices to do this?

Many thanks.

+3
source share
2 answers

You can completely write ZF-based pages one at a time with new functionality or replace old parts of a site.

You pretty much write new pages as needed, but instead of feeding through index.php, as usual, you mod_rewrite to direct specific URLs to a new zf-based page:

RewriteEngine on
RewriteBase /
# Not if there is a file or directory that matches
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d

# a new, clean URL can go to an old page
RewriteRule ^online /online_now.php

# other pages go to a ZF-frontcontroller, in zf.php
RewriteRule ^about/ /zf.php           [L]
RewriteRule ^account /zf.php          [L]
RewriteRule ^data /zf.php             [L]
RewriteRule ^faq /zf.php             [L]
+2
source

, - Zend Framework. .htaccess( , ), - , Zend.

, , .

, , , .

, , , , . ( 10 ), Zend Framework , .

. , Zend Framework, , , . , .

+1

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


All Articles