@@ -20,7 +20,7 @@ |
||
20 | 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
21 | 21 | */ |
22 | 22 | |
23 | -include_once __DIR__ . '/admin.php'; |
|
23 | +include_once __DIR__.'/admin.php'; |
|
24 | 24 | |
25 | 25 | // ---------------- Main ---------------- |
26 | 26 | \define('_MA_WGGITHUB_INDEX', 'Übersicht'); |
@@ -20,8 +20,8 @@ |
||
20 | 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
21 | 21 | */ |
22 | 22 | |
23 | -include_once __DIR__ . '/common.php'; |
|
24 | -include_once __DIR__ . '/main.php'; |
|
23 | +include_once __DIR__.'/common.php'; |
|
24 | +include_once __DIR__.'/main.php'; |
|
25 | 25 | |
26 | 26 | // ---------------- Admin Index ---------------- |
27 | 27 | \define('_AM_WGGITHUB_STATISTICS', 'Statistiken'); |
@@ -20,8 +20,8 @@ |
||
20 | 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
21 | 21 | */ |
22 | 22 | |
23 | -include_once __DIR__ . '/common.php'; |
|
24 | -include_once __DIR__ . '/main.php'; |
|
23 | +include_once __DIR__.'/common.php'; |
|
24 | +include_once __DIR__.'/main.php'; |
|
25 | 25 | |
26 | 26 | // ---------------- Admin Index ---------------- |
27 | 27 | \define('_AM_WGGITHUB_STATISTICS', 'Statistics'); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public const DIRECTORY_TYPE_USER = 1; |
41 | 41 | public const DIRECTORY_TYPE_ORG = 2; |
42 | 42 | |
43 | - public const DIRECTORY_CONTENT_ALL = 0; |
|
43 | + public const DIRECTORY_CONTENT_ALL = 0; |
|
44 | 44 | public const DIRECTORY_CONTENT_OWN = 1; |
45 | 45 | |
46 | 46 | // Constants for status |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | public const PERM_README_UPDATE = 3; |
58 | 58 | |
59 | 59 | // Constants for log type |
60 | - public const LOG_TYPE_NONE = 0; |
|
60 | + public const LOG_TYPE_NONE = 0; |
|
61 | 61 | public const LOG_TYPE_UPDATE_START = 1; |
62 | 62 | public const LOG_TYPE_UPDATE_END = 2; |
63 | 63 | public const LOG_TYPE_REQUEST = 3; |
@@ -140,7 +140,7 @@ |
||
140 | 140 | $submitter = isset($GLOBALS['xoopsUser']) && \is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
141 | 141 | // add/update all items from table repositories |
142 | 142 | foreach ($repos as $key => $repo) { |
143 | - $fork = (bool)$repo['fork']; |
|
143 | + $fork = (bool) $repo['fork']; |
|
144 | 144 | if (Constants::DIRECTORY_CONTENT_ALL == $dirContent || false === $fork) { |
145 | 145 | $crRepositories = new \CriteriaCompo(); |
146 | 146 | $crRepositories->add(new \Criteria('repo_nodeid', $repo['node_id'])); |
@@ -164,7 +164,7 @@ |
||
164 | 164 | $ret['readme'] = $this->getVar('repo_readme'); |
165 | 165 | $ret['prerelease'] = $this->getVar('repo_prerelease'); |
166 | 166 | $ret['release'] = $this->getVar('repo_release'); |
167 | - $ret['approved'] = (int)$this->getVar('repo_approved') > 0 ? \_YES : \_NO; |
|
167 | + $ret['approved'] = (int) $this->getVar('repo_approved') > 0 ? \_YES : \_NO; |
|
168 | 168 | $status = $this->getVar('repo_status'); |
169 | 169 | $ret['status'] = $status; |
170 | 170 | switch ($status) { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | if (Constants::STATUS_NEW === $repoStatus || Constants::STATUS_UPDATED === $repoStatus || 0 == $releasesCount) { |
150 | 150 | $ghReleases = $githubClient->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; |
@@ -27,13 +27,13 @@ |
||
27 | 27 | switch (mb_substr($val, -1)) { |
28 | 28 | case 'K': |
29 | 29 | case 'k': |
30 | - return (int)$val * 1024; |
|
30 | + return (int) $val * 1024; |
|
31 | 31 | case 'M': |
32 | 32 | case 'm': |
33 | - return (int)$val * 1048576; |
|
33 | + return (int) $val * 1048576; |
|
34 | 34 | case 'G': |
35 | 35 | case 'g': |
36 | - return (int)$val * 1073741824; |
|
36 | + return (int) $val * 1073741824; |
|
37 | 37 | default: |
38 | 38 | return $val; |
39 | 39 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | function xoops_module_pre_install_wggithub(\XoopsModule $module) |
31 | 31 | { |
32 | - require \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
32 | + require \dirname(__DIR__).'/preloads/autoloader.php'; |
|
33 | 33 | |
34 | 34 | $utility = new Wggithub\Utility(); |
35 | 35 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if ($xoopsSuccess && $phpSuccess) { |
43 | 43 | $moduleTables = &$module->getInfo('tables'); |
44 | 44 | foreach ($moduleTables as $table) { |
45 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
45 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';'); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | function xoops_module_install_wggithub(\XoopsModule $module) |
57 | 57 | { |
58 | - require \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
58 | + require \dirname(__DIR__).'/preloads/autoloader.php'; |
|
59 | 59 | |
60 | 60 | /** @var Wggithub\Helper $helper */ |
61 | 61 | /** @var Wggithub\Utility $utility */ |
@@ -80,14 +80,14 @@ discard block |
||
80 | 80 | |
81 | 81 | // --- COPY blank.gif FILES --------------- |
82 | 82 | if ($configurator->copyBlankFiles && \is_array($configurator->copyBlankFiles)) { |
83 | - $file = \dirname(__DIR__) . '/assets/images/blank.gif'; |
|
83 | + $file = \dirname(__DIR__).'/assets/images/blank.gif'; |
|
84 | 84 | foreach (\array_keys($configurator->copyBlankFiles) as $i) { |
85 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.gif'; |
|
85 | + $dest = $configurator->copyBlankFiles[$i].'/blank.gif'; |
|
86 | 86 | $utility::copyFile($file, $dest); |
87 | 87 | } |
88 | - $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
88 | + $file = \dirname(__DIR__).'/assets/images/blank.png'; |
|
89 | 89 | foreach (\array_keys($configurator->copyBlankFiles) as $i) { |
90 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
90 | + $dest = $configurator->copyBlankFiles[$i].'/blank.png'; |
|
91 | 91 | $utility::copyFile($file, $dest); |
92 | 92 | } |
93 | 93 | } |