Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
timnolte committed Sep 30, 2023
1 parent 6455829 commit 2a5a722
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 16 deletions.
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,16 @@ cache
node_modules
vendor
dist
tools/local-env/*

# WordPress Development environment directories to ignore.
tools/local-env/wp
tools/local-env/wp-content/db.php
tools/local-env/wp-content/.litespeed_conf.dat
tools/local-env/wp-content/cache/*
tools/local-env/wp-content/ewww/*
tools/local-env/wp-content/litespeed/*
tools/local-env/wp-content/mu-plugins/*
tools/local-env/wp-content/plugins/*
tools/local-env/wp-content/themes/*
tools/local-env/wp-content/uploads/*
tools/local-env/wp-content/upgrade/*
13 changes: 12 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,18 @@
"analyze": "@phpstan analyze"
},
"extra": {
"wordpress-install-dir": "tools/local-env",
"wordpress-install-dir": "tools/local-env/wp",
"installer-paths": {
"tools/local-env/plugins/{$name}": [
"type:wordpress-plugin"
],
"tools/local-env/mu-plugins/{$name}": [
"type:wordpress-muplugin"
],
"tools/local-env/themes/{$name}": [
"type:wordpress-theme"
]
},
"phpcodesniffer-search-depth": 5
}
}
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ services:
volumes:
- ../:/workspaces:cached
- .:/workspaces/openid-connect-generic:cache
- ./tools/wp-config.php:/workspaces/openid-connect-generic/tools/local-env/wp-config.php:ro,cached
- ./tools/local-env:/app:ro,cached
- ~/.composer:/root/.composer:cached
- ~/.npm:/root/.npm:cached
Expand All @@ -45,8 +44,6 @@ services:
- ./tools/local-env:/app:cached
- ./tools/apache/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro,cached
- .:/app/wp-content/plugins/daggerhart-openid-connect-generic:ro,cached
- ./tools/wp-config.php:/app/wp-config.php:ro,cached
- ./tools/mu-plugins:/app/wp-content/mu-plugins:ro,cached
networks:
- oidcwp-net

Expand Down
16 changes: 12 additions & 4 deletions tools/apache/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,6 @@ ServerAdmin [email protected]
#
DocumentRoot "/app"

# This is to forward all PHP to php-fpm.
<FilesMatch \.php$>
SetHandler "proxy:fcgi://app:9000"
</FilesMatch>
<Directory "/app">
#
# Possible values for the Options directive are "None", "All",
Expand Down Expand Up @@ -296,6 +292,18 @@ DocumentRoot "/app"
Require all granted

DirectoryIndex index.php

# If the php file doesn't exist, disable the proxy handler.
# This will allow .htaccess rewrite rules to work and
# the client will see the default 404 page of Apache
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f
RewriteRule (.*) - [H=text/html]

# This is to forward all PHP to php-fpm.
<FilesMatch \.php$>
SetHandler "proxy:fcgi://app:9000"
</FilesMatch>
</Directory>

#
Expand Down
Empty file removed tools/local-env/.gitkeep
Empty file.
13 changes: 6 additions & 7 deletions tools/wp-config.php → tools/local-env/wp-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,10 @@ function getenv_docker($env, $default) {
*
* @link https://wordpress.org/support/article/debugging-in-wordpress/
*/
define( 'WP_PHP_BINARY', 'php' );
define( 'WP_TESTS_EMAIL', '[email protected]' );
define( 'WP_TESTS_TITLE', 'Test Blog' );
define( 'WP_SITEURL', 'http://localhost:8888/' );
define( 'WP_HOME', 'http://localhost:8888/' );
define( 'WP_DEBUG', true );
defined( 'WP_SITEURL' ) || define( 'WP_SITEURL', rtrim( WP_HOME, '/' ) . '/wp' );

// If we're behind a proxy server and using HTTPS, we need to alert WordPress of that fact
// see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy
Expand All @@ -123,18 +121,19 @@ function getenv_docker($env, $default) {
define( 'WP_LOCAL_DEV', true );
define( 'PHP_INI_MEMORY_LIMIT', '512M' );
define( 'WP_MEMORY_LIMIT', '512M' );

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'SCRIPT_DEBUG', true );

define( 'SMTP_HOST', 'mailhog' );
define( 'SMTP_PORT', 1025 );
define( 'WP_TESTS_DOMAIN', 'http://localhost:8888/' );

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
defined( 'ABSPATH' ) || define( 'ABSPATH', __DIR__ . '/wp/' );

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
File renamed without changes.

0 comments on commit 2a5a722

Please sign in to comment.