本文整理汇总了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;
}
}
示例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 {
//.........这里部分代码省略.........
示例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;
}