Remove unnecessary router.php from wordpress example.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2015-10-06 11:37:36 -04:00
parent 13d5efcd8b
commit 97dc4895ac
1 changed files with 1 additions and 20 deletions

View File

@ -55,7 +55,7 @@ and a separate MySQL instance:
environment: environment:
MYSQL_DATABASE: wordpress 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 the standard WordPress config file with a single change to point the database
configuration at the `db` container: configuration at the `db` container:
@ -85,25 +85,6 @@ configuration at the `db` container:
require_once(ABSPATH . 'wp-settings.php'); 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 ### Build the project
With those four files in place, run `docker-compose up` inside your WordPress With those four files in place, run `docker-compose up` inside your WordPress