├── composer.json ├── README.md └── symfony-bridge.php /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "outlandish/symfony-bridge", 3 | "type": "wordpress-plugin", 4 | "require": { 5 | "composer/installers": "~1.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Symfony 2 Event Bridge for WordPress 2 | 3 | This is a small WordPress plugin which translates WordPress's `init` hook to a Symfony event so that bundles 4 | can modify WP admin pages. 5 | 6 | It is likely to only be of use in combination with the 7 | [Symfony WordPress Edition](https://github.com/outlandishideas/symfony-wordpress-edition). 8 | -------------------------------------------------------------------------------- /symfony-bridge.php: -------------------------------------------------------------------------------- 1 | boot(); 17 | $container = $kernel->getContainer(); 18 | 19 | //need to switch to request scope in order to make all services available 20 | $container->enterScope('request'); 21 | $container->set('request', new Request(), 'request'); 22 | 23 | //no event data to pass so use generic event class 24 | $event = new Event(); 25 | 26 | $container->get('event_dispatcher')->dispatch('outlandish_routemaster.wp_init', $event); 27 | }); 28 | } --------------------------------------------------------------------------------