Skip to content

Commit c329466

Browse files
committed
Version 1.0.0
1 parent cf05955 commit c329466

2 files changed

Lines changed: 92 additions & 14 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php
2+
3+
/** @var ScriptPackageInstallationPlugin $this */
4+
5+
use wcf\system\package\plugin\ScriptPackageInstallationPlugin;
6+
use wcf\system\WCF;
7+
use wcf\util\FileUtil;
8+
9+
$packageID = $this->installation->getPackageID();
10+
11+
$statement = WCF::getDB()->prepareStatement('
12+
SELECT *
13+
FROM wcf' . WCF_N . '_package_installation_file_log
14+
WHERE packageID = ?
15+
');
16+
$statement->execute([$packageID]);
17+
18+
while ($row = $statement->fetchArray()) {
19+
if (!defined(\mb_strtoupper($row['application']) . '_DIR') || empty($row['filename'])) {
20+
continue;
21+
}
22+
23+
$filename = FileUtil::getRealPath(\constant(\mb_strtoupper($row['application']) . '_DIR')) . $row['filename'];
24+
25+
if (\file_exists($filename)) {
26+
\unlink($filename);
27+
}
28+
}
29+
30+
WCF::getDB()->prepareStatement('DELETE FROM wcf' . WCF_N . '_package_installation_file_log WHERE packageID = ?')->execute([$packageID]);
31+
32+
$statement = WCF::getDB()->prepareStatement('
33+
SELECT *
34+
FROM wcf' . WCF_N . '_acp_template
35+
WHERE packageID = ?
36+
');
37+
$statement->execute([$packageID]);
38+
39+
while ($row = $statement->fetchArray()) {
40+
if (!defined(\mb_strtoupper($row['application']) . '_DIR') || empty($row['templateName'])) {
41+
continue;
42+
}
43+
44+
$filename = FileUtil::getRealPath($row['application']) . 'acp/templates/' . $row['templateName'];
45+
46+
if (\file_exists($filename)) {
47+
\unlink($filename);
48+
}
49+
}
50+
51+
WCF::getDB()->prepareStatement('DELETE FROM wcf' . WCF_N . '_acp_template WHERE packageID = ?')->execute([$packageID]);
52+
53+
$statement = WCF::getDB()->prepareStatement('
54+
SELECT *
55+
FROM wcf' . WCF_N . '_template
56+
WHERE packageID = ?
57+
');
58+
$statement->execute([$packageID]);
59+
60+
while ($row = $statement->fetchArray()) {
61+
if (!defined(\mb_strtoupper($row['application']) . '_DIR') || empty($row['templateName'])) {
62+
continue;
63+
}
64+
65+
$filename = FileUtil::getRealPath(\constant(\mb_strtoupper($row['application']) . '_DIR')) . 'templates/' . $row['templateName'];
66+
67+
if (\file_exists($filename)) {
68+
\unlink($filename);
69+
}
70+
}
71+
72+
WCF::getDB()->prepareStatement('DELETE FROM wcf' . WCF_N . '_template WHERE packageID = ?')->execute([$packageID]);

package.xml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,43 @@
33
<packageinformation>
44
<packagename><![CDATA[Form Builder: Extension]]></packagename>
55
<packagedescription><![CDATA[Extension for the form builder API provided by WoltLab Suite Core 5.2+]]></packagedescription>
6-
7-
<version><![CDATA[1.0.0 Beta 1]]></version>
8-
<date><![CDATA[2021-06-10]]></date>
6+
7+
<version><![CDATA[1.0.0]]></version>
8+
<date><![CDATA[2021-07-16]]></date>
99
</packageinformation>
10-
11-
<compatibility>
12-
<api version="2019" />
13-
</compatibility>
14-
10+
1511
<requiredpackages>
1612
<requiredpackage minversion="5.2.9"><![CDATA[com.woltlab.wcf]]></requiredpackage>
1713
</requiredpackages>
18-
14+
1915
<excludedpackages>
20-
<excludedpackage version="5.4.0 Alpha 1"><![CDATA[com.woltlab.wcf]]></excludedpackage>
16+
<excludedpackage version="5.5.0 Alpha 1"><![CDATA[com.woltlab.wcf]]></excludedpackage>
2117
</excludedpackages>
22-
18+
2319
<authorinformation>
2420
<author><![CDATA[Florian Gail]]></author>
2521
<authorurl><![CDATA[https://www.mysterycode.de]]></authorurl>
2622
</authorinformation>
27-
23+
2824
<instructions type="install">
25+
<instruction type="file" />
2926
<instruction type="acpTemplate" />
3027
<instruction type="template" />
31-
<instruction type="file" />
3228
</instructions>
33-
29+
3430
<instructions type="update" fromversion="1.0.0 Alpha *">
31+
<instruction type="file">files_update.tar</instruction>
32+
<instruction type="script" run="standalone">acp/update_de.mysterycode.wcf.formBuilder.extension.php</instruction>
33+
34+
<instruction type="file" />
3535
<instruction type="acpTemplate" />
3636
<instruction type="template" />
37+
</instructions>
38+
<instructions type="update" fromversion="1.0.0 Beta *">
39+
<instruction type="script" run="standalone">acp/update_de.mysterycode.wcf.formBuilder.extension.php</instruction>
40+
3741
<instruction type="file" />
42+
<instruction type="acpTemplate" />
43+
<instruction type="template" />
3844
</instructions>
3945
</package>

0 commit comments

Comments
 (0)