%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /platform/misc/
Upload File :
Create Path :
Current File : //platform/misc/prepend-web.php

<?php

// Prevent loading this file *again* manually by plugins like AIO Security and Firewalls.
if (defined('WP_WPAAS_PREPENDED')) {
	return;
}

define('WP_WPAAS_PREPENDED', true);

// Cleans up the environment accounting for the chroot, also defines Pagely constants

// detect chroot and if so fix DOCUMENT_ROOT
if (__DIR__ == '/pagely' || __DIR__ == '/godaddy' || __DIR__ == '/platform/misc') {
    if (is_link('/httpdocs')) {
        // In this scenario we are always double symlinked and the final symlink is absolute, so realpath is better than readlink
        $httpdocsReal = realpath('/httpdocs');
        if ($httpdocsReal !== false) {
            $_SERVER['DOCUMENT_ROOT'] = $httpdocsReal . '/';
        }
    } else {
        $_SERVER['DOCUMENT_ROOT'] = '/httpdocs/';
    }
}

if (is_dir('/configs')) {
    define('PAGELYBIN', '/configs');
} else {
    define('PAGELYBIN', '/pagely');
}

// fix is_ssl detection
if (isset($_SERVER['HTTP_HTTPS'])) {
    $_SERVER['HTTPS'] = $_SERVER['HTTP_HTTPS'];
}

// wordpress config
define('DISABLE_WP_CRON', true);
define('AUTOSAVE_INTERVAL', 300);

if (!defined('WP_CRON_LOCK_TIMEOUT')) {
    define('WP_CRON_LOCK_TIMEOUT', 120);
}

// force disable timthumb webshot
define('WEBSHOT_ENABLED', false);

// PHP basic auth compat
if (!empty($_SERVER['REMOTE_AUTHORIZATION'])) {
    $d = base64_decode($_SERVER['REMOTE_AUTHORIZATION']);
    if ($d !== false) {
        [$_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']] = explode(':', $d);
    }
}

// Authorization header compat
if (empty($_SERVER['HTTP_AUTHORIZATION']) && !empty($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
    $_SERVER['HTTP_AUTHORIZATION'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
}

// Set file permissions using umask
define('FS_CHMOD_DIR', (0777 & ~umask()));
define('FS_CHMOD_FILE', (0666 & ~umask()));

// Remove cruft headers that confuse some plugins like ithemes better security
// REMOTE_ADDR has the correct ip
unset($_SERVER['HTTP_X_CLUSTER_CLIENT']);
unset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']);
unset($_SERVER['HTTP_X_FORWARDED_FOR']);

// fix the problem with returning the free disk space for the whole ceph storage
// it breaks some of the major WP migration plugins because the value is too large
if (version_compare(phpversion(), '8.0.0', '>=')) {
    // php version is high enough
    if (!function_exists('disk_free_space')) {
        function disk_free_space($directory)
        {
            // always return 30GB
            return 32212254720;
        }
    }
    // do the same thing for the alias function
    if (!function_exists('diskfreespace')) {
        function diskfreespace($directory)
        {
            return disk_free_space($directory);
        }
    }
}

// Before we include anything from the user, include our creds
if (file_exists(PAGELYBIN . '/config.php')) {
    include_once PAGELYBIN . '/config.php';
}

$user_setup = '/user/setup.php';
if (file_exists($user_setup)) {
    include_once $user_setup;
}

// Prepend logic related to htaccess file support in nginx-unit
if (getenv('HTACCESS_MERGE_CONFIG_DIR') !== false) {
    // The htaccess golang program in mgmt/golang/pkg/htaccess writes out a prepend file by name prepend-rewrites.php
    define('HTACCESS_PREPEND_FILE', getenv('HTACCESS_MERGE_CONFIG_DIR') . '/prepend-rewrites.php');
    if (file_exists(HTACCESS_PREPEND_FILE)) {
        include_once HTACCESS_PREPEND_FILE;
    }
}

Zerion Mini Shell 1.0
September 2018 - GMH Consulting Group LLC Skip to content

GMH CONSULTING GROUP LLC

  • Home
  • Services
  • Customer Success Stories
  • Contact Us
×
  • Home
  • Services
  • Customer Success Stories
  • Contact Us
  • Home
  • Services
  • Customer Success Stories
  • Contact Us
  • Home
  • Services
  • Customer Success Stories
  • Contact Us

GMH CONSULTING GROUP LLC

Archive for September 2018

SAP Cloud Integration Platform

By pwsadmin |
A picture of the sap logo on a computer screen.

Browse Projects Accomplished by Our Consulting Team

Read More

Recent Posts

  • Advantages of mRNA Vaccines
  • Digitalization of Vaccines Enabled by S/4 HANA
  • SAP Cloud Integration Platform

Recent Comments

No comments to show.
SITE LINKS
  • Home
  • Services
  • Customer Success Stories
  • Contact Us
CONNECT WITH US
CONTACT INFORMATION

Phone: (813) 808-5570

Email: gustavohidalgo@gmhconsultinggroup.com 

 

A logo of the gmh consulting group
SITE LINKS
  • Home
  • Services
  • Customer Success Stories
  • Contact Us
CONNECT WITH US
CONTACT INFORMATION

Phone: (813) 808-5570

Email: gustavohidalgo@gmhcgroup.com

A logo of the gmh consulting group

© 2026 GMH Consulting Group LLC. All Rights Reserved.

Scroll To Top