Note that there are some explanatory texts on larger screens.

plurals
  1. POintegrating Wordpress with Symfony
    primarykey
    data
    text
    <p>I have a site built with Symfony 1.2. I'm trying to integrate Wordpress 2.8.4 into it to power my blog. I followed the instructions at <a href="http://www.theodo.fr/blog/2009/03/integrate-wordpress-into-symfony/" rel="nofollow noreferrer">http://www.theodo.fr/blog/2009/03/integrate-wordpress-into-symfony/</a>, including the 2 steps in the comments at <a href="http://www.theodo.fr/blog/2009/03/integrate-wordpress-into-symfony/comment-page-1/#comment-573" rel="nofollow noreferrer">http://www.theodo.fr/blog/2009/03/integrate-wordpress-into-symfony/comment-page-1/#comment-573</a>. My actions.class.php file looks like this:</p> <pre><code> &lt;?php class sfWordpressActions extends sfActions { public function executeIndex(sfWebRequest $request) { // Don't load symfony's I18N $standard_helpers = sfConfig::get('sf_standard_helpers'); $standard_helpers = array_diff($standard_helpers, array('I18N')); sfConfig::set('sf_standard_helpers', $standard_helpers); define('WP_USE_THEMES', true); chdir( dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'wordpress' ); global $wpdb; ob_start(); require_once( 'wp-blog-header.php' ); $this-&gt;blog = ob_get_contents(); if (function_exists('is_feed') &amp;&amp; is_feed()) { ob_end_flush(); throw new sfStopException(); } else { ob_end_clean(); } } } ?&gt; </code></pre> <p>My indexSuccess.php is simply</p> <pre><code>This is a test &lt;?php echo $blog ?&gt; </code></pre> <p>And my wp-blog-header.php is </p> <pre><code>&lt;?php /** * Loads the WordPress environment and template. * * @package WordPress */ if ( !isset($wp_did_header) ) { $wp_did_header = true; require_once( dirname(__FILE__) . '/wp-load.php' ); // @HACK FABRICE // All variables defined here are considered global by Wordpress $local_global_vars = get_defined_vars(); foreach($local_global_vars as $local_name =&gt; $local_value) { $GLOBALS[$local_name] = $local_value; } // Don't create new global variables ourselves, and do not overwrite other global variables, for example $name... unset($local_name, $local_value, $local_global_vars); // @HACK FABRICE wp(); // @HACK Fabrice global $posts; // @HACK Fabrice require_once( ABSPATH . WPINC . '/template-loader.php' ); } </code></pre> <p><strong>Here's my problem:</strong></p> <p>As it is, I get nothing when I go to the page. None of my Symfony headers, no Wordpress content, nothing. When I comment out the line "require_once( 'wp-blog-header.php' );" in actions.class.php, everything works fine but there is no Wordpress content. This leads me to believe that that Symfony is dying somewhere in the process of including the Wordpress stuff. How this might be fixed?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload