-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanageapp.php
More file actions
executable file
·40 lines (35 loc) · 1.02 KB
/
manageapp.php
File metadata and controls
executable file
·40 lines (35 loc) · 1.02 KB
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
<?php
require_once 'utils.php';
require_once 'constants.php';
class ManageApp
{
function addApp($zip, $sprintdir)
{
if (!isset($sprintdir)) {
return;
}
$zipname = TMP_DIR . "/" . $zip['name'];
$zipArchive = new ZipArchive;
$zipFileName = pathinfo($zip['name'])['filename'];
if ($zipArchive->open($zipname) === TRUE && isset($zipFileName)) {
$zipArchive->extractTo(ASSETS . "/" . $sprintdir);
$dir = ASSETS . "/" . $sprintdir . "/" . $zipFileName;
$files = glob($dir . "/*.ipa");
if (count($files) == 1) {
rename($files[0], $dir . "/app.ipa");
}
} else {
echo "Error: Not a zip file";
}
unlink($zipname);
$zipArchive->close();
}
function removeApp($app_path, $sprintdir)
{
if (!isset($sprintdir)) {
return;
}
$path = ASSETS . "/" . $sprintdir . "/" . $app_path;
removeDirectory($path);
}
}