Merge pull request #2144 from dnephin/remove_router_php

Remove unnecessary router.php from wordpress example.
This commit is contained in:
Aanand Prasad 2015-10-06 17:25:00 +01:00
commit 807ab89750
1 changed files with 1 additions and 20 deletions

View File

@ -55,7 +55,7 @@ and a separate MySQL instance:
environment:
MYSQL_DATABASE: wordpress
Two supporting files are needed to get this working - first, `wp-config.php` is
A supporting file is needed to get this working. `wp-config.php` is
the standard WordPress config file with a single change to point the database
configuration at the `db` container:
@ -85,25 +85,6 @@ configuration at the `db` container:
require_once(ABSPATH . 'wp-settings.php');
Second, `router.php` tells PHP's built-in web server how to run WordPress:
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
chdir($root);
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/');
set_include_path(get_include_path().':'.__DIR__);
if(file_exists($root.$path))
{
if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/')
$path = rtrim($path,'/').'/index.php';
if(strpos($path,'.php') === false) return false;
else {
chdir(dirname($root.$path));
require_once $root.$path;
}
}else include_once 'index.php';
### Build the project
With those four files in place, run `docker-compose up` inside your WordPress