本文整理汇总了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)) {