当前位置: 首页>>代码示例>>PHP>>正文


PHP mnet_peer::set_applicationid方法代码示例

本文整理汇总了PHP中mnet_peer::set_applicationid方法的典型用法代码示例。如果您正苦于以下问题:PHP mnet_peer::set_applicationid方法的具体用法?PHP mnet_peer::set_applicationid怎么用?PHP mnet_peer::set_applicationid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mnet_peer的用法示例。


在下文中一共展示了mnet_peer::set_applicationid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: trim

}
$mnet_peer = new mnet_peer();
$simpleform = new mnet_simple_host_form();
// the one that goes on the bottom of the main page
$reviewform = null;
// set up later in different code branches, so mnet_peer can be passed to the constructor
// if the first form has been submitted, bootstrap the peer and load up the review form
if ($formdata = $simpleform->get_data()) {
    // ensure we remove trailing slashes
    $formdata->wwwroot = trim($formdata->wwwroot);
    $formdata->wwwroot = rtrim($formdata->wwwroot, '/');
    // ensure the wwwroot starts with a http or https prefix
    if (strtolower(substr($formdata->wwwroot, 0, 4)) != 'http') {
        $formdata->wwwroot = 'http://' . $formdata->wwwroot;
    }
    $mnet_peer->set_applicationid($formdata->applicationid);
    $application = $DB->get_field('mnet_application', 'name', array('id' => $formdata->applicationid));
    $mnet_peer->bootstrap($formdata->wwwroot, null, $application);
    // bootstrap the second form straight with the data from the first form
    $reviewform = new mnet_review_host_form(null, array('peer' => $mnet_peer));
    // the second step (also the edit host form)
    $formdata->oldpublickey = $mnet_peer->public_key;
    // set this so we can confirm on form post without having to recreate the mnet_peer object
    $reviewform->set_data($mnet_peer);
    echo $OUTPUT->header();
    echo $OUTPUT->box_start();
    $reviewform->display();
    echo $OUTPUT->box_end();
    echo $OUTPUT->footer();
    exit;
} else {
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:31,代码来源:peers.php

示例2: fopen

 }
 $fh = fopen($mfile, 'r');
 $maharawebroot = fread($fh, filesize($mfile));
 fclose($fh);
 if (empty($maharawebroot)) {
     error('Step3 - could not find maharawebroot. Config failed.');
 }
 $strheader = get_string('mahoodle', 'configmahoodle');
 $navlinks = array();
 $navlinks[] = array('name' => $strheader, 'link' => null, 'type' => 'misc');
 $navigation = build_navigation($navlinks);
 print_header($strheader, $strheader, $navigation, "");
 //now set up pubkey stuff in Moodle
 $mnet_peer = new mnet_peer();
 $application = get_record('mnet_application', 'name', 'mahara');
 $mnet_peer->set_applicationid($application->id);
 $mnet_peer->bootstrap($maharawebroot, null, $application->name);
 $mnet_peer->set_name('localmahara');
 $mnet_peer->commit();
 //now configure Networking in Moodle.
 //first get hostid.
 $hostid = get_field('mnet_host', 'id', 'name', 'localmahara');
 $host2service = new stdClass();
 $host2service->hostid = $hostid;
 $host2service->serviceid = get_field('mnet_service', 'id', 'name', 'sso_idp');
 $host2service->publish = 1;
 $host2service->subscribe = 0;
 if ($hostrec = get_record('mnet_host2service', 'hostid', $hostid, 'serviceid', $host2service->serviceid)) {
     $host2service->id = $hostrec->id;
     update_record('mnet_host2service', $host2service);
 } else {
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:configmahoodle.php


注:本文中的mnet_peer::set_applicationid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。