Skip to content

Commit 7c3d6bf

Browse files
committed
prepare release GitDeploy 1.0.3
1 parent 954b3f7 commit 7c3d6bf

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

gitdeploy.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class plgSystemGitDeploy extends CMSPlugin
4848
*/
4949
public function onAfterRoute()
5050
{
51-
if ($this->getApplication()->getInput()->getCmd('github', false))
51+
if (Factory::getApplication()->getInput()->getCmd('github', false))
5252
{
5353
set_error_handler(
5454
function($severity, $message, $file, $line)
@@ -62,7 +62,7 @@ function($e)
6262
{
6363
header('HTTP/1.1 500 Internal Server Error');
6464
echo "Error on line {$e->getLine()}: " . htmlspecialchars($e->getMessage());
65-
$this->getApplication()->close();
65+
Factory::getApplication()->close();
6666
}
6767
);
6868

@@ -77,7 +77,7 @@ function($e)
7777
$this->setPayload();
7878
$this->handleGitHubEvent();
7979

80-
$this->getApplication()->close();
80+
Factory::getApplication()->close();
8181
}
8282
}
8383

@@ -93,7 +93,7 @@ function($e)
9393
*/
9494
protected function checkSecret($hookSecret)
9595
{
96-
if (!$this->getApplication()->getInput()->server->get('HTTP_X_HUB_SIGNATURE_256', false))
96+
if (!Factory::getApplication()->getInput()->server->get('HTTP_X_HUB_SIGNATURE_256', false))
9797
{
9898
throw new \Exception("HTTP header 'X-Hub-Signature' is missing.");
9999
}
@@ -103,7 +103,7 @@ protected function checkSecret($hookSecret)
103103
throw new \Exception("Missing 'hash' extension to check the secret code validity.");
104104
}
105105

106-
list($algo, $hash) = explode('=', $this->getApplication()->getInput()->server->getString('HTTP_X_HUB_SIGNATURE_256'), 2) + array('', '');
106+
list($algo, $hash) = explode('=', Factory::getApplication()->getInput()->server->getString('HTTP_X_HUB_SIGNATURE_256'), 2) + array('', '');
107107

108108
if (!in_array($algo, hash_algos(), TRUE))
109109
{
@@ -128,11 +128,11 @@ protected function checkSecret($hookSecret)
128128
*/
129129
protected function checkContentType()
130130
{
131-
if (!$this->getApplication()->getInput()->server->getString('CONTENT_TYPE', false))
131+
if (!Factory::getApplication()->getInput()->server->getString('CONTENT_TYPE', false))
132132
{
133133
throw new \Exception("Missing HTTP 'Content-Type' header.");
134134
}
135-
elseif (!$this->getApplication()->getInput()->server->getString('HTTP_X_GITHUB_EVENT', false))
135+
elseif (!Factory::getApplication()->getInput()->server->getString('HTTP_X_GITHUB_EVENT', false))
136136
{
137137
throw new \Exception("Missing HTTP 'X-Github-Event' header.");
138138
}
@@ -148,18 +148,18 @@ protected function checkContentType()
148148
*/
149149
protected function setPayload()
150150
{
151-
switch ($this->getApplication()->getInput()->server->getString('CONTENT_TYPE'))
151+
switch (Factory::getApplication()->getInput()->server->getString('CONTENT_TYPE'))
152152
{
153153
case 'application/json':
154154
$json = $this->rawPost ?: file_get_contents('php://input');
155155
break;
156156

157157
case 'application/x-www-form-urlencoded':
158-
$json = $this->getApplication()->getInput()->post->get('payload');
158+
$json = Factory::getApplication()->getInput()->post->get('payload');
159159
break;
160160

161161
default:
162-
throw new \Exception('Unsupported content type: ' . $this->getApplication()->getInput()->server->getString('HTTP_CONTENT_TYPE'));
162+
throw new \Exception('Unsupported content type: ' . Factory::getApplication()->getInput()->server->getString('HTTP_CONTENT_TYPE'));
163163
}
164164

165165
$this->payload = json_decode($json);
@@ -175,7 +175,7 @@ protected function setPayload()
175175
*/
176176
protected function handleGitHubEvent()
177177
{
178-
$githubEvent = $this->getApplication()->getInput()->server->get('HTTP_X_GITHUB_EVENT');
178+
$githubEvent = Factory::getApplication()->getInput()->server->get('HTTP_X_GITHUB_EVENT');
179179

180180
switch (strtolower($githubEvent))
181181
{
@@ -197,7 +197,7 @@ protected function handleGitHubEvent()
197197
default:
198198
header('HTTP/1.0 404 Not Found');
199199
echo 'Event: ' . $githubEvent . ' Payload: \n' . $this->payload;
200-
$this->getApplication()->close();
200+
Factory::getApplication()->close();
201201
}
202202
}
203203

@@ -262,7 +262,7 @@ protected function runGitPull($payload)
262262
$commitsHtml .= '</ul>';
263263

264264
// Do we have a targetSite parameter
265-
$targetSite = $this->getApplication()->getInput()->getCmd('targetSite', false);
265+
$targetSite = Factory::getApplication()->getInput()->getCmd('targetSite', false);
266266

267267
$messageData['pusherName'] = $payload->pusher->name;
268268
$messageData['repoUrl'] = $payload->repository->url;

gitdeploy.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<extension version="3.9" type="plugin" group="system" method="upgrade">
33
<name>plg_system_gitdeploy</name>
44
<author>Tobias Zulauf</author>
5-
<creationDate>2021-07-10</creationDate>
5+
<creationDate>2025-10-25</creationDate>
66
<copyright>(C) 2020 Tobias Zulauf All rights reserved.</copyright>
77
<authorUrl>https://www.jah-tz.de</authorUrl>
8-
<version>1.0.2</version>
8+
<version>1.0.3</version>
99
<license>GNU/GPL Version 2 or later</license>
1010
<description>PLG_SYSTEM_GITDEPLOY_XML_DESCRIPTION</description>
1111
<scriptfile>script.php</scriptfile>

update.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<downloads>
1313
<downloadurl type="full" format="zip">https://github.com/zero-24/plg_system_gitdeploy/releases/download/1.0.2/plg_system_gitdeploy.zip</downloadurl>
1414
</downloads>
15-
<sha512>fda836d79074829b3fb9bec73db9c9b97cbbdc1246e726230c631a979037fea8644d21a7a5c71211d9fcc2148033856360419055c173106eeb07da37289e066d</sha512>
15+
<sha512>e5a00cba7417b28c8f8925c660f999b2069d6ddf2ebdd6d07c739260ef660309bc808867a59d58b3c0826971af075cd6965ae164bd28569c6ac145b917b6623a</sha512>
1616
<tags>
1717
<tag>stable</tag>
1818
</tags>
@@ -33,7 +33,7 @@
3333
<downloads>
3434
<downloadurl type="full" format="zip">https://github.com/zero-24/plg_system_gitdeploy/releases/download/1.0.2/plg_system_gitdeploy.zip</downloadurl>
3535
</downloads>
36-
<sha512>fda836d79074829b3fb9bec73db9c9b97cbbdc1246e726230c631a979037fea8644d21a7a5c71211d9fcc2148033856360419055c173106eeb07da37289e066d</sha512>
36+
<sha512>e5a00cba7417b28c8f8925c660f999b2069d6ddf2ebdd6d07c739260ef660309bc808867a59d58b3c0826971af075cd6965ae164bd28569c6ac145b917b6623a</sha512>
3737
<tags>
3838
<tag>stable</tag>
3939
</tags>
@@ -54,7 +54,7 @@
5454
<downloads>
5555
<downloadurl type="full" format="zip">https://github.com/zero-24/plg_system_gitdeploy/releases/download/1.0.2/plg_system_gitdeploy.zip</downloadurl>
5656
</downloads>
57-
<sha512>fda836d79074829b3fb9bec73db9c9b97cbbdc1246e726230c631a979037fea8644d21a7a5c71211d9fcc2148033856360419055c173106eeb07da37289e066d</sha512>
57+
<sha512>e5a00cba7417b28c8f8925c660f999b2069d6ddf2ebdd6d07c739260ef660309bc808867a59d58b3c0826971af075cd6965ae164bd28569c6ac145b917b6623a</sha512>
5858
<tags>
5959
<tag>stable</tag>
6060
</tags>

0 commit comments

Comments
 (0)