Skip to content

Instantly share code, notes, and snippets.

@mikeemoo
Created May 22, 2012 18:56
Show Gist options
  • Save mikeemoo/2770947 to your computer and use it in GitHub Desktop.
Save mikeemoo/2770947 to your computer and use it in GitHub Desktop.
Lowpress boot
<?php
namespace Lowpress\WordpressBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class LowpressWordpressBundle extends Bundle
{
public function boot()
{
$docroot = $this->container->getParameter('kernel.root_dir').'/../web/';
$doctrine = $this->container->get('doctrine');
$conn = $doctrine->getConnection($doctrine->getDefaultConnectionName());
define('DB_NAME', $conn->getDatabase());
define('DB_USER', $conn->getUsername());
define('DB_PASSWORD', $conn->getPassword());
define('DB_HOST', $conn->getHost());
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
define('WP_USE_THEMES', false);
require_once($docroot.'wp-load.php');
parent::boot();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment