Viewing File: /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/enduser/hooks/pre_upgrade.php

<?php

include_once('/opt/hc_php/unversioned/SoftaculousPHPSwitcher.php');

if(!defined('SOFTACULOUS')){
	die('Hacking Attempt');
}

const HC_PHP_SWITCHER_LIBRARY = '/opt/hc_php/unversioned/SoftaculousPHPSwitcher.php';
if(file_exists(HC_PHP_SWITCHER_LIBRARY)){
  include_once(HC_PHP_SWITCHER_LIBRARY);
  define("USE_HC_PHP_SWITCHER", 1);
}

/**
 * This function will be called whenever an installation is upgraded.
 * $software will have details of the script being installed.
 *
 * @package      hooks
 * @author       Max Nikitenko
 * @param        array $installation Will contain the details of the installation being upgraded
 * @return       bool
 * @since     	 3.7.0
 */

function __pre_upgrade($installation) {

    global $cpanel, $soft, $software, $globals, $scripts, $softpanel, $error, $__hooks;

    if(!defined('USE_HC_PHP_SWITCHER')){
        return true;
    }

    if(method_exists($softpanel, 'soft_req_check') || is_null($cpanel)){
        return true;
    }

    $domain = $installation[0]['softdomain'];

    return HOOK_PHP_VERSION_SWITCH($domain);
}
Back to Directory File Manager