提交服务端基础框架

This commit is contained in:
wanghao
2025-03-12 12:18:06 +08:00
parent b2dc631969
commit 7c1b4f1a4f
11794 changed files with 3510099 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
class ServiceSchemaWriter
{
/**
* @throws Exception
*/
public static function writeSchemaXmlString(array $attributesArr)
{
$dom = new DOMDocument('1.0', 'utf-8');
$root = $dom->createElement("serviceSchema");
foreach ($attributesArr as $attribute) {
if ($attribute instanceof XMLAttribute) {
$attribute->toValueElement($dom, $root);
}
}
$dom->appendChild($root);
return $dom->saveXML($dom->documentElement);
}
/**
* @throws Exception
*/
public static function writeFullchemaXmlString(array $attributesArr)
{
$dom = new DOMDocument('1.0', 'utf-8');
$root = $dom->createElement("serviceSchema");
foreach ($attributesArr as $attribute) {
if ($attribute instanceof XMLAttribute) {
$attribute->toElement($dom, $root);
}
}
$dom->appendChild($root);
return $dom->saveXML($dom->documentElement);
}
}