将plist demo写入php文件

master
ELF 5 years ago
parent bcc4b10bd6
commit c6627a53c2

@ -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) {

@ -0,0 +1,48 @@
<?php
namespace Base\Tool;
/**
* 生成Plist的demo
* @author elf<360197197@qq.com>
*/
class PlistDemo
{
public static $content = '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>ipa_url</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>icon</string>
</dict>
</array><key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.dell</string>
<key>bundle-version</key>
<string>1.0.0</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>mchdemo</string>
</dict>
</dict>
</array>
</dict>
</plist>';
}
Loading…
Cancel
Save