Passed
Push — master ( f54565...4ee54c )
by Goffy
03:32
created
Labels
Severity
1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
/**
13
 * wgGitHub module for xoops
14
 *
15
 * @copyright      2020 XOOPS Project (https://xooops.org)
16
 * @license        GPL 2.0 or later
17
 * @package        wggithub
18
 * @since          1.0
19
 * @min_xoops      2.5.10
20
 * @author         Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com>
21
 */
22
23
use Xmf\Request;
0 ignored issues
show
The type Xmf\Request was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
24
use XoopsModules\Wggithub;
25
use XoopsModules\Wggithub\{
26
    Constants,
27
    Helper,
28
    Github\Github,
29
    Github\Repositories,
0 ignored issues
show
The type XoopsModules\Wggithub\Github\Repositories was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
30
    Github\Releases,
0 ignored issues
show
The type XoopsModules\Wggithub\Github\Releases was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
31
};
32
33
require __DIR__ . '/header.php';
34
$GLOBALS['xoopsOption']['template_main'] = 'wggithub_index.tpl';
35
include_once \XOOPS_ROOT_PATH . '/header.php';
0 ignored issues
show
The constant XOOPS_ROOT_PATH was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
36
// Define Stylesheet
37
$GLOBALS['xoTheme']->addStylesheet($style, null);
38
$keywords = [];
39
// 
40
$GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL);
41
$GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL);
42
//
43
44
$libRepositories = new Repositories();
45
$libReleases = new Releases();
46
47
48
$content = 'IVthbHQgWE9PUFMgQ01TXShodHRwczovL3hvb3BzLm9yZy9pbWFnZXMvbG9n
49
b1hvb3BzNEdpdGh1YlJlcG9zaXRvcnkucG5nKQojIyBDb250YWN0IG1vZHVs
50
ZSBmb3IgW1hPT1BTIENNUyAyLjUuOCtdKGh0dHBzOi8veG9vcHMub3JnKQpb
51
IVtYT09QUyBDTVMgTW9kdWxlXShodHRwczovL2ltZy5zaGllbGRzLmlvL2Jh
52
ZGdlL1hPT1BTJTIwQ01TLU1vZHVsZS1ibHVlLnN2ZyldKGh0dHBzOi8veG9v
53
cHMub3JnKQpbIVtTb2Z0d2FyZSBMaWNlbnNlXShodHRwczovL2ltZy5zaGll
54
bGRzLmlvL2JhZGdlL2xpY2Vuc2UtR1BMLWJyaWdodGdyZWVuLnN2Zz9zdHls
55
ZT1mbGF0KV0oTElDRU5TRSkKClshW1NjcnV0aW5pemVyIENvZGUgUXVhbGl0
56
eV0oaHR0cHM6Ly9pbWcuc2hpZWxkcy5pby9zY3J1dGluaXplci9nL21hbWJh
57
eDcvY29udGFjdC5zdmc/c3R5bGU9ZmxhdCldKGh0dHBzOi8vc2NydXRpbml6
58
ZXItY2kuY29tL2cvbWFtYmF4Ny9jb250YWN0Lz9icmFuY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5jb20vWE9PUFMK
93
';
94
$contentDecoded = base64_decode($content);
95
96
$res = $helper->getHandler('Readmes')->convertMD($contentDecoded);
97
98
99
100
/*
101
$github = Github::getInstance();
102
$github->apiErrorLimit = false;
103
$github->apiErrorMisc = false;
104
$crRepositories = new \CriteriaCompo();
105
$crRepositories->add(new \Criteria('repo_user', 'XoopsThemes'));
106
$crRepositories->add(new \Criteria('repo_status', '1'));
107
//$crRepositories->setStart(0);
108
//$crRepositories->setLimit(48);
109
$repositoriesCount = $repositoriesHandler->getCount($crRepositories);
110
$repositoriesAll = $repositoriesHandler->getAll($crRepositories);
111
if ($repositoriesCount > 0) {
112
    // Get All Repositories
113
    foreach (\array_keys($repositoriesAll) as $i) {
114
        $repoId = $repositoriesAll[$i]->getVar('repo_id');
115
        $res = $helper->getHandler('Readmes')->updateReadmes($repoId, $repositoriesAll[$i]->getVar('repo_user'), $repositoriesAll[$i]->getVar('repo_name'));
116
        //$res = $helper->getHandler('Releases')->updateReleases($repoId, $repositoriesAll[$i]->getVar('repo_user'), $repositoriesAll[$i]->getVar('repo_name'));
117
        if ($res) {
118
            // change status to updated
119
            $repositoriesObj = $repositoriesHandler->get($repoId);
120
            $repositoriesObj->setVar('repo_status', Constants::STATUS_UPTODATE);
121
            $repositoriesHandler->insert($repositoriesObj, true);
122
        } else {
123
            echo "Error:" . $repositoriesAll[$i]->getVar('repo_user') . ' - ' . $repositoriesAll[$i]->getVar('repo_name');
124
        }
125
        if ($github->apiErrorLimit) {
126
            break;
127
        }
128
    }
129
}
130
*/
131
132
133
//$releases = $libReleases->getReleases('XoopsModules25x', 'modulebuilder');
134
//var_dump($releases);
135
136
//$helper->getHandler('Readmes')->updateTableReadmes();
137
//$helper->getHandler('Releases')->updateTableReleases();
138
139
140
/*
141
142
$github = GitHub::getInstance();
143
144
145
146
147
148
149
150
$result = $libRepositories->getUserRepositories('ggoffy');
151
//$result = $github->readOrgRepositories('XoopsModules25x');
152
var_dump($result);
153
154
155
$githubLib = new Repositories();
156
$result = $githubLib->getOrgRepositories('XoopsModules25x');
157
var_dump($result);
158
159
$githubLib = new Releases();
160
$result = $githubLib->getLatestRelease('XoopsModules25x', 'contact', true);
161
var_dump($result);
162
163
164
$result = $libRepositories->getReadme('XoopsModules25x', 'wggallery');
165
var_dump($result);
166
*/
167
168
require __DIR__ . '/footer.php';
169