Skip to content

Commit

Permalink
#39 issue : documentation : avoid problem with some Wordpress plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Draeli committed Sep 7, 2014
1 parent 2929362 commit dcdc597
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions README.md
Expand Up @@ -79,7 +79,33 @@ security:
entity: { class: Ekino\WordpressBundle\Entity\User, property: login }
```

### 3) Update your Wordpress index.php file to load Symfony libraries
### 3) Wrap code inside web/app.php and web/app_dev.php

To avoid problem with some Wordpress plugin, you need to wrap code inside a function like this :
```php
<?php
use Symfony\Component\HttpFoundation\Request;

// change for app_dev.php
function run(){
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';

require_once __DIR__.'/../app/AppKernel.php';

$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
}
run();
```

And now do the same for app.php

### 4) Update your Wordpress index.php file to load Symfony libraries

```php
<?php
Expand Down Expand Up @@ -134,7 +160,7 @@ $sfResponse->send();
$sfKernel->terminate($sfRequest, $sfResponse);
```

### 4) Edit .htaccess file on your Wordpress root project directory
### 5) Edit .htaccess file on your Wordpress root project directory

Put the following rules:

Expand Down

0 comments on commit dcdc597

Please sign in to comment.