Skip to content

Instantly share code, notes, and snippets.

@mikeemoo
Created May 22, 2012 19:05
Show Gist options
  • Save mikeemoo/2770986 to your computer and use it in GitHub Desktop.
Save mikeemoo/2770986 to your computer and use it in GitHub Desktop.
Wordpress connection
<?php
namespace Lowpress\WordpressBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class LowpressWordpressBundle extends Bundle
{
public function boot()
{
//...
define('WP_USE_THEMES', false);
require_once($docroot.'wp-load.php');
foreach(get_defined_vars() as $key => $val)
$GLOBALS[$key] = $val;
parent::boot();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment