@@ -67,29 +67,29 @@ discard block |
||
67 | 67 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
68 | 68 | // Get Theme Form |
69 | 69 | \xoops_load('XoopsFormLoader'); |
70 | - $form = new \XoopsThemeForm(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_FORM_TITLE'), 'formfeedback', 'feedback.php', 'post', true); |
|
70 | + $form = new \XoopsThemeForm(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_FORM_TITLE'), 'formfeedback', 'feedback.php', 'post', true); |
|
71 | 71 | $form->setExtra('enctype="multipart/form-data"'); |
72 | 72 | |
73 | - $recipient = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_RECIPIENT'), 'recipient', 50, 255, $GLOBALS['xoopsModule']->getInfo('author_mail')); |
|
73 | + $recipient = new \XoopsFormText(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_RECIPIENT'), 'recipient', 50, 255, $GLOBALS['xoopsModule']->getInfo('author_mail')); |
|
74 | 74 | $recipient->setExtra('disabled="disabled"'); |
75 | 75 | $form->addElement($recipient); |
76 | - $your_name = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME'), 'your_name', 50, 255, $this->name); |
|
77 | - $your_name->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME_PLACEHOLER') . '"'); |
|
76 | + $your_name = new \XoopsFormText(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_NAME'), 'your_name', 50, 255, $this->name); |
|
77 | + $your_name->setExtra('placeholder="'.\constant('CO_'.$moduleDirNameUpper.'_'.'FB_NAME_PLACEHOLER').'"'); |
|
78 | 78 | $form->addElement($your_name); |
79 | - $your_site = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE'), 'your_site', 50, 255, $this->site); |
|
80 | - $your_site->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE_PLACEHOLER') . '"'); |
|
79 | + $your_site = new \XoopsFormText(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_SITE'), 'your_site', 50, 255, $this->site); |
|
80 | + $your_site->setExtra('placeholder="'.\constant('CO_'.$moduleDirNameUpper.'_'.'FB_SITE_PLACEHOLER').'"'); |
|
81 | 81 | $form->addElement($your_site); |
82 | - $your_mail = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL'), 'your_mail', 50, 255, $this->email); |
|
83 | - $your_mail->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL_PLACEHOLER') . '"'); |
|
82 | + $your_mail = new \XoopsFormText(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_MAIL'), 'your_mail', 50, 255, $this->email); |
|
83 | + $your_mail->setExtra('placeholder="'.\constant('CO_'.$moduleDirNameUpper.'_'.'FB_MAIL_PLACEHOLER').'"'); |
|
84 | 84 | $form->addElement($your_mail); |
85 | 85 | |
86 | - $fbtypeSelect = new \XoopsFormSelect(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE'), 'fb_type', $this->type); |
|
86 | + $fbtypeSelect = new \XoopsFormSelect(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE'), 'fb_type', $this->type); |
|
87 | 87 | $fbtypeSelect->addOption('', ''); |
88 | - $fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION')); |
|
89 | - $fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS')); |
|
90 | - $fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL')); |
|
91 | - $fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES')); |
|
92 | - $fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS')); |
|
88 | + $fbtypeSelect->addOption(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_SUGGESTION'), \constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_SUGGESTION')); |
|
89 | + $fbtypeSelect->addOption(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_BUGS'), \constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_BUGS')); |
|
90 | + $fbtypeSelect->addOption(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_TESTIMONIAL'), \constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_TESTIMONIAL')); |
|
91 | + $fbtypeSelect->addOption(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_FEATURES'), \constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_FEATURES')); |
|
92 | + $fbtypeSelect->addOption(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_OTHERS'), \constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_OTHERS')); |
|
93 | 93 | $form->addElement($fbtypeSelect, true); |
94 | 94 | |
95 | 95 | $editorConfigs = []; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $configHandler = \xoops_getHandler('config'); |
105 | 105 | $config = &$configHandler->getConfigsByCat(0, $module->getVar('mid')); |
106 | 106 | $editorConfigs['editor'] = $config['general_editor']; |
107 | - $editor = new \XoopsFormEditor(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT'), 'fb_content', $editorConfigs); |
|
107 | + $editor = new \XoopsFormEditor(\constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_CONTENT'), 'fb_content', $editorConfigs); |
|
108 | 108 | $form->addElement($editor, true); |
109 | 109 | |
110 | 110 | $form->addElement(new \XoopsFormHidden('op', 'send')); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | throw new \RuntimeException(\sprintf('Unable to create the %s directory', $folder)); |
36 | 36 | } |
37 | 37 | |
38 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
38 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
39 | 39 | } |
40 | 40 | } catch (\Exception $e) { |
41 | 41 | echo 'Caught exception: ', $e->getMessage(), '<br>'; |
@@ -61,14 +61,14 @@ discard block |
||
61 | 61 | $dir = \opendir($src); |
62 | 62 | // @\mkdir($dst); |
63 | 63 | if (!@\mkdir($dst) && !\is_dir($dst)) { |
64 | - throw new \RuntimeException('The directory ' . $dst . ' could not be created.'); |
|
64 | + throw new \RuntimeException('The directory '.$dst.' could not be created.'); |
|
65 | 65 | } |
66 | 66 | while (false !== ($file = \readdir($dir))) { |
67 | 67 | if (('.' !== $file) && ('..' !== $file)) { |
68 | - if (\is_dir($src . '/' . $file)) { |
|
69 | - self::recurseCopy($src . '/' . $file, $dst . '/' . $file); |
|
68 | + if (\is_dir($src.'/'.$file)) { |
|
69 | + self::recurseCopy($src.'/'.$file, $dst.'/'.$file); |
|
70 | 70 | } else { |
71 | - \copy($src . '/' . $file, $dst . '/' . $file); |
|
71 | + \copy($src.'/'.$file, $dst.'/'.$file); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | self::rrmdir($fObj->getPathname()); |
208 | 208 | } |
209 | 209 | } |
210 | - $iterator = null; // clear iterator Obj to close file/directory |
|
210 | + $iterator = null; // clear iterator Obj to close file/directory |
|
211 | 211 | return \rmdir($src); // remove the directory & return results |
212 | 212 | } |
213 | 213 | |
@@ -240,14 +240,14 @@ discard block |
||
240 | 240 | $iterator = new \DirectoryIterator($src); |
241 | 241 | foreach ($iterator as $fObj) { |
242 | 242 | if ($fObj->isFile()) { |
243 | - \rename($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
243 | + \rename($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
244 | 244 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
245 | 245 | // Try recursively on directory |
246 | - self::rmove($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
246 | + self::rmove($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
247 | 247 | // \rmdir($fObj->getPath()); // now delete the directory |
248 | 248 | } |
249 | 249 | } |
250 | - $iterator = null; // clear iterator Obj to close file/directory |
|
250 | + $iterator = null; // clear iterator Obj to close file/directory |
|
251 | 251 | return \rmdir($src); // remove the directory & return results |
252 | 252 | } |
253 | 253 | |
@@ -283,9 +283,9 @@ discard block |
||
283 | 283 | $iterator = new \DirectoryIterator($src); |
284 | 284 | foreach ($iterator as $fObj) { |
285 | 285 | if ($fObj->isFile()) { |
286 | - \copy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
286 | + \copy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
287 | 287 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
288 | - self::rcopy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
288 | + self::rcopy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
289 | 289 | } |
290 | 290 | } |
291 | 291 |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | //check for minimum XOOPS version |
41 | 41 | $currentVer = mb_substr(XOOPS_VERSION, 6); // get the numeric part of string |
42 | 42 | if (null === $requiredVer) { |
43 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
43 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
44 | 44 | } |
45 | 45 | $success = true; |
46 | 46 | |
47 | 47 | if (\version_compare($currentVer, $requiredVer, '<')) { |
48 | 48 | $success = false; |
49 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
49 | + $module->setErrors(\sprintf(\constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | return $success; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | if (false !== $reqVer && '' !== $reqVer) { |
77 | 77 | if (\version_compare($verNum, $reqVer, '<')) { |
78 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
78 | + $module->setErrors(\sprintf(\constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
79 | 79 | $success = false; |
80 | 80 | } |
81 | 81 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $moduleDirName = \basename(dirname(__DIR__, 2)); |
98 | 98 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
99 | 99 | $update = ''; |
100 | - $repository = 'XoopsModules25x/' . $moduleDirName; |
|
100 | + $repository = 'XoopsModules25x/'.$moduleDirName; |
|
101 | 101 | // $repository = 'XoopsModules25x/publisher'; //for testing only |
102 | 102 | $ret = ''; |
103 | 103 | $infoReleasesUrl = "https://api.github.com/repos/$repository/releases"; |
@@ -111,14 +111,14 @@ discard block |
||
111 | 111 | if (false === $curlReturn) { |
112 | 112 | \trigger_error(\curl_error($curlHandle)); |
113 | 113 | } elseif (mb_strpos($curlReturn, 'Not Found')) { |
114 | - \trigger_error('Repository Not Found: ' . $infoReleasesUrl); |
|
114 | + \trigger_error('Repository Not Found: '.$infoReleasesUrl); |
|
115 | 115 | } else { |
116 | 116 | $file = \json_decode($curlReturn, false); |
117 | 117 | $latestVersionLink = \sprintf("https://github.com/$repository/archive/%s.zip", $file ? reset($file)->tag_name : $default); |
118 | 118 | $latestVersion = $file[0]->tag_name; |
119 | 119 | $prerelease = $file[0]->prerelease; |
120 | 120 | if ('master' !== $latestVersionLink) { |
121 | - $update = \constant('CO_' . $moduleDirNameUpper . '_' . 'NEW_VERSION') . $latestVersion; |
|
121 | + $update = \constant('CO_'.$moduleDirNameUpper.'_'.'NEW_VERSION').$latestVersion; |
|
122 | 122 | } |
123 | 123 | //"PHP-standardized" version |
124 | 124 | $latestVersion = \mb_strtolower($latestVersion); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $latestVersion = \str_replace('_', '', \mb_strtolower($latestVersion)); |
127 | 127 | $latestVersion = \str_replace('final', '', \mb_strtolower($latestVersion)); |
128 | 128 | } |
129 | - $moduleVersion = ($helper->getModule()->getInfo('version') . '_' . $helper->getModule()->getInfo('module_status')); |
|
129 | + $moduleVersion = ($helper->getModule()->getInfo('version').'_'.$helper->getModule()->getInfo('module_status')); |
|
130 | 130 | //"PHP-standardized" version |
131 | 131 | $moduleVersion = \str_replace(' ', '', \mb_strtolower($moduleVersion)); |
132 | 132 | // $moduleVersion = '1.0'; //for testing only |
@@ -140,7 +140,7 @@ |
||
140 | 140 | $requestsObj = $requestsHandler->create(); |
141 | 141 | $requestsObj->setVar('req_request', $request); |
142 | 142 | $requestsObj->setVar('req_result', $result); |
143 | - $requestsObj->setVar('req_datecreated',time()); |
|
143 | + $requestsObj->setVar('req_datecreated', time()); |
|
144 | 144 | $requestsObj->setVar('req_submitter', $submitter); |
145 | 145 | // Insert Data |
146 | 146 | if ($requestsHandler->insert($requestsObj)) { |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | $ch = \curl_init(); |
46 | 46 | //set the url, number of POST vars, POST data |
47 | 47 | \curl_setopt($ch, \CURLOPT_URL, $url); |
48 | - \curl_setopt($ch, \CURLOPT_HTTPAUTH, 'token ' . $this->tokenAuth); |
|
49 | - \curl_setopt($ch, \CURLOPT_USERPWD, $this->userAuth . ':' . $this->tokenAuth); |
|
48 | + \curl_setopt($ch, \CURLOPT_HTTPAUTH, 'token '.$this->tokenAuth); |
|
49 | + \curl_setopt($ch, \CURLOPT_USERPWD, $this->userAuth.':'.$this->tokenAuth); |
|
50 | 50 | \curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, 'GET'); |
51 | 51 | \curl_setopt($ch, \CURLOPT_RETURNTRANSFER, true); |
52 | 52 | \curl_setopt($ch, \CURLOPT_CONNECTTIMEOUT, 25); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | \curl_setopt($ch, \CURLOPT_POST, 1); |
61 | 61 | $result = \curl_exec($ch); |
62 | 62 | $info = \curl_getinfo($ch); |
63 | - if (($errMsg = \curl_error($ch)) || !\in_array((int)$info['http_code'], [200, 201], true)) { |
|
63 | + if (($errMsg = \curl_error($ch)) || !\in_array((int) $info['http_code'], [200, 201], true)) { |
|
64 | 64 | $error = $throwError; |
65 | 65 | } |
66 | 66 | \curl_close($ch); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | if ($requestsHandler->insert($requestsObj, true)) { |
79 | 79 | $reqId = $requestsObj->getNewInsertedIdRequests(); |
80 | 80 | } else { |
81 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_INSERTREQ . '"'); |
|
81 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_INSERTREQ.'"'); |
|
82 | 82 | } |
83 | 83 | unset($requestsObj); |
84 | 84 | |
@@ -90,19 +90,19 @@ discard block |
||
90 | 90 | $requestsObj = $requestsHandler->get($reqId); |
91 | 91 | $requestsObj->setVar('req_result', $result); |
92 | 92 | if (!$requestsHandler->insert($requestsObj, true)) { |
93 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_INSERTREQ . '"'); |
|
93 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_INSERTREQ.'"'); |
|
94 | 94 | } |
95 | 95 | unset($requestsObj); |
96 | 96 | |
97 | 97 | if ($this->debug) { |
98 | - echo '<br>Error:' . $result; |
|
98 | + echo '<br>Error:'.$result; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | //catch common errors |
102 | - switch ((int)$info['http_code']) { |
|
102 | + switch ((int) $info['http_code']) { |
|
103 | 103 | case 401: |
104 | 104 | $this->apiErrorMisc = true; |
105 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_401 . '"'); |
|
105 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_401.'"'); |
|
106 | 106 | break; |
107 | 107 | case 403: |
108 | 108 | if (\strpos($result, 'API rate limit exceeded') > 0) { |
@@ -111,21 +111,21 @@ discard block |
||
111 | 111 | return false; |
112 | 112 | } else { |
113 | 113 | $this->apiErrorMisc = true; |
114 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_403 . '"'); |
|
114 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_403.'"'); |
|
115 | 115 | } |
116 | 116 | break; |
117 | 117 | case 404: |
118 | 118 | $this->apiErrorMisc = true; |
119 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_404 . '"'); |
|
119 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_404.'"'); |
|
120 | 120 | break; |
121 | 121 | case 405: |
122 | 122 | $this->apiErrorMisc = true; |
123 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_405 . '"'); |
|
123 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_405.'"'); |
|
124 | 124 | break; |
125 | 125 | case 0: |
126 | 126 | default: |
127 | 127 | $this->apiErrorMisc = true; |
128 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API . ': ' . $errMsg . '"'); |
|
128 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API.': '.$errMsg.'"'); |
|
129 | 129 | break; |
130 | 130 | } |
131 | 131 | } else { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function getReleases($user, $repository) |
36 | 36 | { |
37 | - $url = static::BASE_URL . 'repos/' . $user . '/' . $repository . '/releases'; |
|
37 | + $url = static::BASE_URL.'repos/'.$user.'/'.$repository.'/releases'; |
|
38 | 38 | |
39 | 39 | return $this->_get($url); |
40 | 40 | } |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | public function getLatestRelease($user, $repository, $prerelease = false) |
51 | 51 | { |
52 | 52 | if ($prerelease) { |
53 | - $url = static::BASE_URL . 'repos/' . $user . '/' . $repository . '/releases'; |
|
53 | + $url = static::BASE_URL.'repos/'.$user.'/'.$repository.'/releases'; |
|
54 | 54 | } else { |
55 | - $url = static::BASE_URL . 'repos/' . $user . '/' . $repository . '/releases/latest'; |
|
55 | + $url = static::BASE_URL.'repos/'.$user.'/'.$repository.'/releases/latest'; |
|
56 | 56 | } |
57 | 57 | $result = $this->_get($url); |
58 | 58 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function getUserRepositories($username, $per_page = 100, $page = 1) |
38 | 38 | { |
39 | - $url = static::BASE_URL . 'users/' . \rawurlencode($username) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
39 | + $url = static::BASE_URL.'users/'.\rawurlencode($username).'/repos?per_page='.$per_page.'&page='.$page; |
|
40 | 40 | |
41 | 41 | return $this->_get($url); |
42 | 42 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function getOrgRepositories($org, $per_page = 100, $page = 1) |
53 | 53 | { |
54 | - $url = static::BASE_URL . 'orgs/' . \rawurlencode($org) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
54 | + $url = static::BASE_URL.'orgs/'.\rawurlencode($org).'/repos?per_page='.$per_page.'&page='.$page; |
|
55 | 55 | |
56 | 56 | return $this->_get($url); |
57 | 57 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function getReadme($username, $repository) |
70 | 70 | { |
71 | - $url = static::BASE_URL . 'repos/' . \rawurlencode($username) . '/' . \rawurlencode($repository) . '/readme'; |
|
71 | + $url = static::BASE_URL.'repos/'.\rawurlencode($username).'/'.\rawurlencode($repository).'/readme'; |
|
72 | 72 | |
73 | 73 | return $this->_get($url, false, false); |
74 | 74 | } |
@@ -70,7 +70,7 @@ |
||
70 | 70 | */ |
71 | 71 | public function getHandler($name) |
72 | 72 | { |
73 | - $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; |
|
73 | + $class = __NAMESPACE__.'\\'.\ucfirst($name).'Handler'; |
|
74 | 74 | if (!\class_exists($class)) { |
75 | 75 | throw new \RuntimeException("Class '$class' not found"); |
76 | 76 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | if (Constants::STATUS_NEW === $repoStatus || Constants::STATUS_UPDATED === $repoStatus || 0 == $releasesCount) { |
150 | 150 | $ghReleases = $libReleases->getReleases($repositoriesAll[$i]->getVar('repo_user'), $repositoriesAll[$i]->getVar('repo_name')); |
151 | 151 | if ($releasesCount > 0) { |
152 | - $sql = 'DELETE FROM `' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '` WHERE `rel_repoid` = ' . $repoId; |
|
152 | + $sql = 'DELETE FROM `'.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'` WHERE `rel_repoid` = '.$repoId; |
|
153 | 153 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
154 | 154 | return false; |
155 | 155 | } |
@@ -159,13 +159,13 @@ discard block |
||
159 | 159 | $first = true; |
160 | 160 | $final = false; |
161 | 161 | foreach ($ghReleases as $ghRelease) { |
162 | - if ($first || (!$final && !(bool)$ghRelease['prerelease'])) { |
|
162 | + if ($first || (!$final && !(bool) $ghRelease['prerelease'])) { |
|
163 | 163 | // save first in any case and save first final version |
164 | 164 | $releasesObj = $releasesHandler->create(); |
165 | 165 | $releasesObj->setVar('rel_repoid', $repoId); |
166 | 166 | $releasesObj->setVar('rel_type', $ghRelease['type']); |
167 | 167 | $releasesObj->setVar('rel_name', $ghRelease['name']); |
168 | - $releasesObj->setVar('rel_prerelease', (true == (bool)$ghRelease['prerelease'])); |
|
168 | + $releasesObj->setVar('rel_prerelease', (true == (bool) $ghRelease['prerelease'])); |
|
169 | 169 | $releasesObj->setVar('rel_publishedat', \strtotime($ghRelease['published_at'])); |
170 | 170 | $releasesObj->setVar('rel_tarballurl', $ghRelease['tarball_url']); |
171 | 171 | $releasesObj->setVar('rel_zipballurl', $ghRelease['zipball_url']); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | } |
178 | 178 | } |
179 | 179 | $first = false; |
180 | - if (false === (bool)$ghRelease['prerelease']) { |
|
180 | + if (false === (bool) $ghRelease['prerelease']) { |
|
181 | 181 | $final = true; |
182 | 182 | } |
183 | 183 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | // must return true otherwise releases will not be loaded |
216 | 216 | return true; |
217 | 217 | } |
218 | - $sql = 'DELETE FROM `' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '` WHERE `rel_repoid` = ' . $repoId; |
|
218 | + $sql = 'DELETE FROM `'.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'` WHERE `rel_repoid` = '.$repoId; |
|
219 | 219 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
220 | 220 | return false; |
221 | 221 | } |
@@ -224,13 +224,13 @@ discard block |
||
224 | 224 | $first = true; |
225 | 225 | $final = false; |
226 | 226 | foreach ($ghReleases as $ghRelease) { |
227 | - if ($first || (!$final && !(bool)$ghRelease['prerelease'])) { |
|
227 | + if ($first || (!$final && !(bool) $ghRelease['prerelease'])) { |
|
228 | 228 | // save first in any case and save first final version |
229 | 229 | $releasesObj = $releasesHandler->create(); |
230 | 230 | $releasesObj->setVar('rel_repoid', $repoId); |
231 | 231 | $releasesObj->setVar('rel_type', $ghRelease['type']); |
232 | 232 | $releasesObj->setVar('rel_name', $ghRelease['name']); |
233 | - $releasesObj->setVar('rel_prerelease', (true == (bool)$ghRelease['prerelease'])); |
|
233 | + $releasesObj->setVar('rel_prerelease', (true == (bool) $ghRelease['prerelease'])); |
|
234 | 234 | $releasesObj->setVar('rel_publishedat', \strtotime($ghRelease['published_at'])); |
235 | 235 | $releasesObj->setVar('rel_tarballurl', $ghRelease['tarball_url']); |
236 | 236 | $releasesObj->setVar('rel_zipballurl', $ghRelease['zipball_url']); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | } |
243 | 243 | } |
244 | 244 | $first = false; |
245 | - if (false === (bool)$ghRelease['prerelease']) { |
|
245 | + if (false === (bool) $ghRelease['prerelease']) { |
|
246 | 246 | $final = true; |
247 | 247 | } |
248 | 248 | } |
@@ -259,17 +259,17 @@ discard block |
||
259 | 259 | public function updateRepoReleases() |
260 | 260 | { |
261 | 261 | // update repo_prerelease |
262 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . ' INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('wggithub_releases'); |
|
263 | - $sql .= ' ON ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_id = ' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '.rel_repoid '; |
|
264 | - $sql .= 'SET ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_prerelease = 1 '; |
|
265 | - $sql .= 'WHERE (((' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '.rel_prerelease)=1));'; |
|
262 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').' INNER JOIN '.$GLOBALS['xoopsDB']->prefix('wggithub_releases'); |
|
263 | + $sql .= ' ON '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_id = '.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'.rel_repoid '; |
|
264 | + $sql .= 'SET '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_prerelease = 1 '; |
|
265 | + $sql .= 'WHERE ((('.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'.rel_prerelease)=1));'; |
|
266 | 266 | $GLOBALS['xoopsDB']->queryF($sql); |
267 | 267 | |
268 | 268 | // update repo_release |
269 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . ' INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('wggithub_releases'); |
|
270 | - $sql .= ' ON ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_id = ' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '.rel_repoid '; |
|
271 | - $sql .= 'SET ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_release = 1 '; |
|
272 | - $sql .= 'WHERE (((' . $GLOBALS['xoopsDB']->prefix('wggithub_releases') . '.rel_prerelease)=0));'; |
|
269 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').' INNER JOIN '.$GLOBALS['xoopsDB']->prefix('wggithub_releases'); |
|
270 | + $sql .= ' ON '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_id = '.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'.rel_repoid '; |
|
271 | + $sql .= 'SET '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_release = 1 '; |
|
272 | + $sql .= 'WHERE ((('.$GLOBALS['xoopsDB']->prefix('wggithub_releases').'.rel_prerelease)=0));'; |
|
273 | 273 | $GLOBALS['xoopsDB']->queryF($sql); |
274 | 274 | |
275 | 275 | return true; |