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


PHP mnet_peer::set_name方法代码示例

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


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

示例1: unset

 } else {
     // PARAM_URL requires a genuine TLD (I think) This breaks my testing
     $temp_wwwroot = clean_param($form->wwwroot, PARAM_URL);
     if ($temp_wwwroot !== $form->wwwroot) {
         trigger_error("We now parse the wwwroot with PARAM_URL. Your URL will need to have a valid TLD, etc.");
         print_error('invalidurl', 'mnet', 'peers.php');
         exit;
     }
     unset($temp_wwwroot);
     $mnet_peer->set_applicationid($form->applicationid);
     $application = $DB->get_field('mnet_application', 'name', array('id' => $form->applicationid));
     $mnet_peer->bootstrap($form->wwwroot, null, $application);
 }
 if (isset($form->name) && $form->name != $mnet_peer->name) {
     $form->name = clean_param($form->name, PARAM_NOTAGS);
     $mnet_peer->set_name($form->name);
 }
 if (isset($form->deleted) && ($form->deleted == '0' || $form->deleted == '1')) {
     $mnet_peer->deleted = $form->deleted;
 }
 if (isset($form->public_key)) {
     $form->public_key = clean_param($form->public_key, PARAM_PEM);
     if (empty($form->public_key)) {
         print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid=' . $mnet_peer->id, '');
         exit;
     } else {
         $oldkey = $mnet_peer->public_key;
         $mnet_peer->public_key = $form->public_key;
         $credentials = $mnet_peer->check_credentials($form->public_key);
         $mnet_peer->public_key_expires = $credentials['validTo_time_t'];
         if ($mnet_peer->public_key_expires == false) {
开发者ID:ajv,项目名称:Offline-Caching,代码行数:31,代码来源:peers.php

示例2: fread

 $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 {
     insert_record('mnet_host2service', $host2service);
 }
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:configmahoodle.php


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