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


PHP DataForm::ListFields方法代码示例

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


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

示例1: __construct

 public function __construct(DataForm $ConnectionConfig)
 {
     if (!$ConnectionConfig instanceof DataForm) {
         throw new Exception(_("ConnectionConfig must be an instance of DataForm"));
     }
     foreach ($ConnectionConfig->ListFields() as $field) {
         $this->{$field->Name} = $field->Value;
     }
 }
开发者ID:rchicoria,项目名称:epp-drs,代码行数:9,代码来源:class.Transport.php

示例2: RunTest

 public function RunTest(DataForm $DF)
 {
     $filename = '/tmp/eppdrs-srsplus-certtest-' . date('YmdHis') . '.log';
     Log::RegisterLogger("File", "SRSPLUS", $filename);
     Log::SetDefaultLogger("SRSPLUS");
     $fields = $DF->ListFields();
     $conf_fields = $this->Config->ListFields();
     $conf_fields['Login']->Value = $fields['Login']->Value;
     $conf_fields['Email']->Value = $fields['Email']->Value;
     $conf_fields['Host']->Value = $fields['Host']->Value;
     $conf_fields['GPGPass']->Value = $fields['GPGPass']->Value;
     $conf_fields['TestMode']->Value = '1';
     $Module = new SRSPlusRegistryModule(new RegistryManifest(MODULES_PATH . "/registries/SRSPlus/module.xml"));
     $Module->InitializeModule('com', $this->Config);
     $Registry = new Registry($Module);
     $oplog = array();
     ////
     // 1. Create contact
     $op = array('title' => "Create contact");
     try {
         $Contact = $Registry->NewContactInstanceByGroup('generic');
         $Contact->SetFieldList(array("firstname" => "Marat", "lastname" => "Komarov", "org" => "Webta", "street1" => "Testing str. 80", "street2" => "Drive 54", "city" => "Testing", "pc" => "90210", "cc" => "US", "sp" => "TX", "voice" => "+333.1234567", "fax" => "+333.1234567", "email" => "marat@webta.net"));
         $Registry->CreateContact($Contact);
         $Contact2 = $Registry->NewContactInstanceByGroup('generic');
         $Contact2->SetFieldList(array("firstname" => "Marat", "lastname" => "Komarov", "org" => "Webta", "street1" => "Testing str. 80", "street2" => "Drive 54", "city" => "Testing", "pc" => "90210", "cc" => "US", "sp" => "TX", "voice" => "+333.1234567", "fax" => "+333.1234567", "email" => "marat@webta.net"));
         $Registry->CreateContact($Contact2);
         $op['ok'] = true;
     } catch (Exception $e) {
         $op['ok'] = false;
         $op['fail_reason'] = $e->getMessage();
     }
     $oplog[] = $op;
     ////
     // 2. Get remote contact
     $op = array('title' => 'Get contact');
     try {
         $RContact = $Registry->NewContactInstanceByGroup('generic');
         $RContact->CLID = $Contact->CLID;
         $RContact = $Registry->GetRemoteContact($Contact);
         $contact_fields = $Contact->GetFieldList();
         $rcontact_fields = $RContact->GetFieldList();
         $op['ok'] = $contact_fields['first_name'] == $rcontact_fields['first_name'] && $contact_fields['last_name'] == $rcontact_fields['last_name'];
         if (!$op['ok']) {
             $op['fail_reason'] = 'Invalid module behavoiur';
         }
     } catch (Exception $e) {
         $op['ok'] = false;
         $op['fail_reason'] = $e->getMessage();
     }
     $oplog[] = $op;
     ////
     // 3. Update contact
     $op = array('title' => 'Edit contact');
     try {
         $contact_fields['email'] = 'pupkin-vasiliy@mail.ru';
         $contact_fields['voice'] = '+554.233456';
         $Contact->SetFieldList($contact_fields);
         $Registry->UpdateContact($Contact);
         $op['ok'] = true;
     } catch (Exception $e) {
         $op['ok'] = false;
         $op['fail_reason'] = $e->getMessage();
     }
     $oplog[] = $op;
     ////
     // 4. Create domain
     $op = array('title' => 'Create domain');
     try {
         $Domain = $Registry->NewDomainInstance();
         $Domain->Name = 'webta' . rand(100, 999);
         $Domain->SetContact($Contact, CONTACT_TYPE::REGISTRANT);
         $Domain->SetContact($Contact2, CONTACT_TYPE::TECH);
         $period = 1;
         $Registry->CreateDomain($Domain, $period);
         $op['ok'] = true;
     } catch (Exception $e) {
         $op['ok'] = false;
         $op['fail_reason'] = $e->getMessage();
     }
     $oplog[] = $op;
     ////
     // 5. Get remote domain
     $op = array('title' => 'Whois');
     try {
         $RDomain = $Registry->NewDomainInstance();
         $RDomain->Name = $Domain->Name;
         $RDomain = $Registry->GetRemoteDomain($RDomain);
         $op['ok'] = date('Ymd', $RDomain->CreateDate) == date('Ymd', $Domain->CreateDate) && date('Ymd', $RDomain->ExpireDate) == date('Ymd', $Domain->ExpireDate);
         if (!$ok) {
             $op['fail_reason'] = 'Invalid module behavoiur';
         }
     } catch (Exception $e) {
         $op['ok'] = false;
         $op['fail_reason'] = $e->getMessage();
     }
     $oplog[] = $op;
     ////
     // 6. Renew domain
     $op = array('title' => 'Renew domain');
     try {
//.........这里部分代码省略.........
开发者ID:rchicoria,项目名称:epp-drs,代码行数:101,代码来源:class.RegistryModule.php

示例3: SetUp

 public function SetUp(DataForm $TestConf)
 {
     $test_conf = $TestConf->ListFields();
     $ModuleConf = DotSERegistryModule::GetConfigurationForm();
     $module_conf = $ModuleConf->ListFields();
     $module_conf['ServerHost']->Value = $test_conf['ServerHost']->Value;
     $module_conf['ServerPort']->Value = $test_conf['ServerPort']->Value;
     $module_conf['Login']->Value = $test_conf['Login']->Value;
     $module_conf['Password']->Value = $test_conf['Password']->Value;
     $this->Module = new DotSERegistryModule(new RegistryManifest(MODULES_PATH . "/registries/DotSE/module.xml"));
     $this->Module->InitializeModule("se", $ModuleConf);
     $this->Registry = new Registry($this->Module);
     $this->Prefix = $test_conf["DomainPrefix"]->Value;
     $this->ContactCLID = $test_conf["ContactCLID"]->Value;
     $this->AuthInfo = $test_conf["AuthInfo"]->Value;
 }
开发者ID:rchicoria,项目名称:epp-drs,代码行数:16,代码来源:class.RegistryModule.php


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