ggoffy /
wggithub
| 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; |
||
| 24 | use XoopsModules\Wggithub; |
||
| 25 | use XoopsModules\Wggithub\{ |
||
| 26 | Constants, |
||
| 27 | Helper, |
||
| 28 | Github\Github, |
||
| 29 | Github\Repositories, |
||
| 30 | Github\Releases, |
||
| 31 | }; |
||
| 32 | |||
| 33 | require __DIR__ . '/header.php'; |
||
| 34 | $GLOBALS['xoopsOption']['template_main'] = 'wggithub_index.tpl'; |
||
| 35 | include_once \XOOPS_ROOT_PATH . '/header.php'; |
||
| 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 | |||
| 49 | $github = Github::getInstance(); |
||
| 50 | $github->apiErrorLimit = false; |
||
| 51 | $github->apiErrorMisc = false; |
||
| 52 | $crRepositories = new \CriteriaCompo(); |
||
|
0 ignored issues
–
show
|
|||
| 53 | $crRepositories->add(new \Criteria('repo_user', 'XoopsThemes')); |
||
|
0 ignored issues
–
show
The type
Criteria 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 54 | $crRepositories->add(new \Criteria('repo_status', '1')); |
||
| 55 | //$crRepositories->setStart(0); |
||
| 56 | //$crRepositories->setLimit(48); |
||
| 57 | $repositoriesCount = $repositoriesHandler->getCount($crRepositories); |
||
| 58 | $repositoriesAll = $repositoriesHandler->getAll($crRepositories); |
||
| 59 | if ($repositoriesCount > 0) { |
||
| 60 | // Get All Repositories |
||
| 61 | foreach (\array_keys($repositoriesAll) as $i) { |
||
| 62 | $repoId = $repositoriesAll[$i]->getVar('repo_id'); |
||
| 63 | $res = $helper->getHandler('Readmes')->updateReadmes($repoId, $repositoriesAll[$i]->getVar('repo_user'), $repositoriesAll[$i]->getVar('repo_name')); |
||
| 64 | //$res = $helper->getHandler('Releases')->updateReleases($repoId, $repositoriesAll[$i]->getVar('repo_user'), $repositoriesAll[$i]->getVar('repo_name')); |
||
| 65 | if ($res) { |
||
| 66 | // change status to updated |
||
| 67 | $repositoriesObj = $repositoriesHandler->get($repoId); |
||
| 68 | $repositoriesObj->setVar('repo_status', Constants::STATUS_UPTODATE); |
||
| 69 | $repositoriesHandler->insert($repositoriesObj, true); |
||
| 70 | } else { |
||
| 71 | echo "Error:" . $repositoriesAll[$i]->getVar('repo_user') . ' - ' . $repositoriesAll[$i]->getVar('repo_name'); |
||
| 72 | } |
||
| 73 | if ($github->apiErrorLimit) { |
||
| 74 | break; |
||
| 75 | } |
||
| 76 | } |
||
| 77 | } |
||
| 78 | |||
| 79 | //$releases = $libReleases->getReleases('XoopsModules25x', 'modulebuilder'); |
||
| 80 | //var_dump($releases); |
||
| 81 | |||
| 82 | //$helper->getHandler('Readmes')->updateTableReadmes(); |
||
| 83 | //$helper->getHandler('Releases')->updateTableReleases(); |
||
| 84 | |||
| 85 | |||
| 86 | /* |
||
| 87 | |||
| 88 | $github = GitHub::getInstance(); |
||
| 89 | |||
| 90 | |||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | |||
| 95 | |||
| 96 | $result = $libRepositories->getUserRepositories('ggoffy'); |
||
| 97 | //$result = $github->readOrgRepositories('XoopsModules25x'); |
||
| 98 | var_dump($result); |
||
| 99 | |||
| 100 | |||
| 101 | $githubLib = new Repositories(); |
||
| 102 | $result = $githubLib->getOrgRepositories('XoopsModules25x'); |
||
| 103 | var_dump($result); |
||
| 104 | |||
| 105 | $githubLib = new Releases(); |
||
| 106 | $result = $githubLib->getLatestRelease('XoopsModules25x', 'contact', true); |
||
| 107 | var_dump($result); |
||
| 108 | |||
| 109 | |||
| 110 | $result = $libRepositories->getReadme('XoopsModules25x', 'wggallery'); |
||
| 111 | var_dump($result); |
||
| 112 | */ |
||
| 113 | |||
| 114 | require __DIR__ . '/footer.php'; |
||
| 115 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths