From c6627a53c28b8a0070cb3d52d2777dfe1d15297a Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 7 Nov 2019 12:14:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86plist=20demo=E5=86=99=E5=85=A5php?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Base/Service/GameSourceService.class.php | 3 +- Application/Base/Tool/PlistDemo.class.php | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 Application/Base/Tool/PlistDemo.class.php diff --git a/Application/Base/Service/GameSourceService.class.php b/Application/Base/Service/GameSourceService.class.php index fb948c576..f38f52b67 100644 --- a/Application/Base/Service/GameSourceService.class.php +++ b/Application/Base/Service/GameSourceService.class.php @@ -4,6 +4,7 @@ namespace Base\Service; use Base\Model\PromoteModel; use Base\Model\ApplyModel; use Base\Tool\Base62; +use Base\Tool\PlistDemo; class GameSourceService { @@ -333,7 +334,7 @@ class GameSourceService { } $xml = new \DOMDocument(); - $xml->load(ROOTTT . 'Uploads/Plist/testdemo.Plist'); + $xml->loadXML(PlistDemo::$content); $online = $xml->getElementsByTagName('dict'); //查找节点 $elements = $online->item(1)->getElementsByTagName('string'); //第二个节点下所有string foreach ($elements as $element) { diff --git a/Application/Base/Tool/PlistDemo.class.php b/Application/Base/Tool/PlistDemo.class.php new file mode 100644 index 000000000..a1c5c6f77 --- /dev/null +++ b/Application/Base/Tool/PlistDemo.class.php @@ -0,0 +1,48 @@ + + */ +class PlistDemo +{ + public static $content = ' + + + + items + + + assets + + + kind + software-package + url + ipa_url + + + kind + display-image + needs-shine + + url + icon + + metadata + + bundle-identifier + com.dell + bundle-version + 1.0.0 + kind + software + title + mchdemo + + + + + '; +} \ No newline at end of file