@@ -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 ;
0 commit comments