本文整理匯總了PHP中mnet_environment::replace_keys方法的典型用法代碼示例。如果您正苦於以下問題:PHP mnet_environment::replace_keys方法的具體用法?PHP mnet_environment::replace_keys怎麽用?PHP mnet_environment::replace_keys使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mnet_environment
的用法示例。
在下文中一共展示了mnet_environment::replace_keys方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getRealPOST
// whatever the case, the master record is always added as an "extra" mnet_host record, after "self", and "all Hosts".
$remotehost = $DB->get_record_select('mnet_host', " TRIM(REPLACE(public_key, '\r', '')) = TRIM(REPLACE('{$masterpk}', '\r', '')) AND id > 1 ");
if ($remotehost || $test) {
// $CFG->bootstrap_init is a key that has been added by master when postprocessing the deployment template
// We check that the public key given matches the identity of the master who initiated the platform restoring.
// get it hard !!
$initroot = $DB->get_field('config', array('name' => 'bootstrap_init'));
if ($test || $initroot == $remotehost->wwwroot) {
// at this time, the local platform may not have self key, or may inherit
// an obsolete key from the template SQL backup.
// we must fix that forcing a local key replacement
$MNET = new mnet_environment();
$MNET->init();
$MNET->name = '';
$oldkey = $MNET->public_key;
$MNET->replace_keys();
// debug_trace("REMOTE : Replaced keys from \n$oldkey\nto\n{$MNET->public_key}\n");
// Finally we disable the keyboot script locking definitively the door.
set_config('bootstrap_init', null);
echo "SUCCESS";
} else {
echo "ERROR : Calling net booting host {$remotehost->wwwroot} don't match with master : {$initroot}";
}
} else {
echo "ERROR : Master host not found or master host key is empty";
}
function getRealPOST()
{
$pairs = explode("&", file_get_contents("php://input"));
$vars = array();
if (!empty($pairs)) {