Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 353 Vote(s) - 3.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Zend Framework and Wordpress Integration

#1
We have an existing Zend Framework site hosted at ourdomain.com and a wordpress blog at blog.ourdomain.com

We want to migrate the blog into the site at ourdomain.com/blog - but I seemed to have googled to the end of the earth and cannot find out how. I have tried various .htaccess stuff, setting up a blog controller and including some wordpress files, etc - but to no avail.

Does anyone have any ideas?

Virtual host setup:

<VirtualHost *:80>

ServerAdmin [email protected]
DocumentRoot "/Users/bradyeager/Sites/TWPZend/public"
ServerName twps
ErrorLog "logs/twps-error-log"
CustomLog "logs/twps-access_log" common



<Directory "/Users/bradyeager/Sites/TWPZend/public">
Options Indexes FollowSymLinks

AllowOverride All

Order allow,deny
Allow from all

</Directory>
</VirtualHost>

Reply

#2
One of the best articles about migrating a non-ZF site into ZF is from [Chris Abernethy](

[To see links please register here]

).

Like you, he sets up a special controller for those non-ZF handled script. However, he (eventually) sets up ZF-routes corresponding to those non-ZF pages, rather than playing around with external .htaccess.

Might not apply directly to your case, since your example involves a _subdomain_ while his involves pages on the _same_ domain. But there are some good ideas in there that might be helpful.

Reply

#3
The most efficient and easiest way to accomplish this by modifying your .htaccess file to NOT send anything that starts with `/blog` to the ZF app -- just pass it through to Wordpress. Wordpress would have to be installed inside your document root, of course, for this to work, exactly how you would normally install it.

An example:

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

RewriteRule ^blog - [NC,L]

RewriteRule ^.*$ index.php [NC,L]


All this nonsense about creating custom controllers, actions and routes in your ZF app, then passing off to Wordpress via your app is absolutely ridiculous. You'd be executing a full dispatch cycle of your application's engine, just to forward off to another app?
Reply

#4
I often use this configuration actually , here's what I do:

/application
/library
/Zend
/wordpress ( symlink to my wordpress folder )
/public
index.php ( i add wordpress & the zend folder to my include path )

Admittedly a bit of a brutal solution , considering all the unnecessary stuff that's included in the process...

Edit:

<pre>
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
realpath(APPLICATION_PATH . '/../library/wordpress'),
get_include_path(),
)));

//Get the wordpress environment
define('WP_USE_THEMES', false);
require_once 'wp-blog-header.php';

/** Zend_Application */
require_once 'Zend/Application.php';



// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
</pre>


Reply

#5
See the correct answer provided by Jason. Just make sure your wordpress .htacess file is rewriting to the correct index.php By default, it will rewrite back to the base index.php - which belongs to Zend. My solutions was to change Wordpress' .htaccess RewriteBase to /blog instead of /
Reply

#6
I wrote an open source library that might solve your problem called Vulnero that allows you to run your Zend Framework application inside WordPress. Your routes get handled by your app, everything else goes to WordPress. Can even render your views in your WordPress template if you like. Integrates authentication, database connections, all that. Source is on GitHub or you can read the documentation at

[To see links please register here]

.
Reply

#7
For migrating Wordpress into ZF you can use [**wploader**][1].
This works for me when i use wordpress as multiple site enabled.
You can use all ZF controller objects inside your wordpress files.
You don't need any hack in your wordpress , so you can upgrade or update your wordpress version easily.


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through