-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathgetmanifest.php
76 lines (64 loc) · 1.84 KB
/
getmanifest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/*
Created by Open Fibers
25'O Clock Inc.
Sep 9 2012
*/
namespace PHP_TOT_OTAServer;
error_reporting( E_ALL );
ini_set( 'display_errors', 'on' );
require_once 'Classes/TOTClasses/unzip.php';
require_once 'Classes/TOTClasses/HandleInfoPlistInPayload.php';
require_once 'Classes/TOTClasses/FileSystemHelper.php';
require_once 'Classes/TOTClasses/GenManifest.php';
require_once 'Classes/TOTClasses/XMLHelper.php';
require 'Classes/TOTClasses/GetRootURL.php';
function main()
{
//获取get整段参数
$requestArray = array();
foreach ($_GET as $key => $value)
{
$requestArray[] = $key;
}
$getStr = $requestArray[0];
//由于安装时过来的url中不能带"?" "&"和"#"三种符号,identifier和betaversion用@做分隔符
$splitArray = explode("@", $getStr);
$identifier = $splitArray[0];
$identifier = str_replace("_", ".", $identifier);
$betaversion = $splitArray[1];
//identifier不能为空
if (!$identifier)
{
echo "identifier is NULL";
return;
}
//betaversion不能为空
if (!$betaversion)
{
echo "identifier is NULL";
return;
}
//存放此版本的文件夹
$dirPath = "Documents/" . $identifier . "/" . $betaversion . "/";
//获取存放此版本的信息的xml路径
$xmlPath = $dirPath . "VersionInfo.plist";
//从xml中读取出关联数组
$versionInfoArray = ArrayFromXMLPath($xmlPath);
if (!$versionInfoArray)
{
echo "Version info is missing!";
}
//用版本信息数组生成manifest.plist的xml字符串
$manifestXMLString = GenManifestXMLString(
getRootURL() . $dirPath . "BetaTest.ipa",
$versionInfoArray["BundleIdentifier"],
$versionInfoArray["Version"],
$versionInfoArray["Title"]
);
echo $manifestXMLString;
}
$downloadFileName = "manifest.plist";
header("Content-Disposition: attachment; filename=$downloadFileName");
main();
?>