summaryrefslogtreecommitdiffstats
path: root/debian/wp-config.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:56:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:56:53 +0000
commita9c818418b81b93680170e1a84d4e221e578ad2f (patch)
tree5b883aa428f1edb12f5d40f9768438ee16a7ed6b /debian/wp-config.php
parentAdding upstream version 6.4.3+dfsg1. (diff)
downloadwordpress-a9c818418b81b93680170e1a84d4e221e578ad2f.tar.xz
wordpress-a9c818418b81b93680170e1a84d4e221e578ad2f.zip
Adding debian version 6.4.3+dfsg1-1.debian/6.4.3+dfsg1-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/wp-config.php')
-rw-r--r--debian/wp-config.php72
1 files changed, 72 insertions, 0 deletions
diff --git a/debian/wp-config.php b/debian/wp-config.php
new file mode 100644
index 0000000..d40472a
--- /dev/null
+++ b/debian/wp-config.php
@@ -0,0 +1,72 @@
+<?php
+/***
+ * WordPress's Debianised default master config file
+ * Please do NOT edit and learn how the configuration works in
+ * /usr/share/doc/wordpress/README.Debian
+ ***/
+
+/* Look up a host-specific config file in
+ * /etc/wordpress/config-<host>.php or /etc/wordpress/config-<domain>.php
+ */
+$debian_server = preg_replace('/:.*/', "", $_SERVER['HTTP_HOST']);
+$debian_server = preg_replace("/[^a-zA-Z0-9.\-]/", "", $debian_server);
+
+/* Check for variable set by admin using SetEnv or SetEnvIf */
+if (isset($_SERVER['WORDPRESS_CONFIG'])
+ && preg_match("/^[a-zA-Z0-9-]+$/", $_SERVER['WORDPRESS_CONFIG'])) {
+ $debian_file = '/etc/wordpress/config-'.$_SERVER['WORDPRESS_CONFIG'].'.php';
+} else {
+ $debian_file = '/etc/wordpress/config-'.strtolower($debian_server).'.php';
+}
+
+/* Main site in case of multisite with subdomains */
+$debian_main_server = preg_replace("/^[^.]*\./", "", $debian_server);
+$debian_main_file = '/etc/wordpress/config-'.strtolower($debian_main_server).'.php';
+
+if (file_exists($debian_file)) {
+ require_once($debian_file);
+ define('DEBIAN_FILE', $debian_file);
+} elseif (file_exists($debian_main_file)) {
+ require_once($debian_main_file);
+ define('DEBIAN_FILE', $debian_main_file);
+} elseif (file_exists("/etc/wordpress/config-default.php")) {
+ require_once("/etc/wordpress/config-default.php");
+ define('DEBIAN_FILE', "/etc/wordpress/config-default.php");
+} else {
+ header("HTTP/1.0 404 Not Found");
+ echo "Neither <b>$debian_file</b> nor <b>$debian_main_file</b> could be found. <br/> Ensure one of them exists, is readable by the webserver and contains the right password/username.";
+ exit(1);
+}
+
+/* Switch off automatic updates (should be done by package update) */
+if (!defined('wp_auto_update_core'))
+ define( 'wp_auto_update_core', false );
+
+/* Default value for some constants if they have not yet been set
+ by the host-specific config files */
+if (!defined('ABSPATH'))
+ define('ABSPATH', '/usr/share/wordpress/');
+if (!defined('WP_AUTO_UPDATE_CORE'))
+ define('WP_AUTO_UPDATE_CORE', false);
+if (!defined('WP_ALLOW_MULTISITE'))
+ define('WP_ALLOW_MULTISITE', true);
+if (!defined('DB_NAME'))
+ define('DB_NAME', 'wordpress');
+if (!defined('DB_USER'))
+ define('DB_USER', 'wordpress');
+if (!defined('DB_HOST'))
+ define('DB_HOST', 'localhost');
+if (!defined('WP_CONTENT_DIR') && !defined('DONT_SET_WP_CONTENT_DIR'))
+ define('WP_CONTENT_DIR', '/var/lib/wordpress/wp-content');
+
+/* Default value for the table_prefix variable so that it doesn't need to
+ be put in every host-specific config file */
+if (!isset($table_prefix)) {
+ $table_prefix = 'wp_';
+}
+
+if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
+ $_SERVER['HTTPS'] = 'on';
+
+require_once(ABSPATH . 'wp-settings.php');
+?>