@@ -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 */ |
@@ -79,14 +79,14 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | // --- COPY blank.gif FILES --------------- |
| 81 | 81 | if ($configurator->copyBlankFiles && \is_array($configurator->copyBlankFiles)) { |
| 82 | - $file = \dirname(__DIR__) . '/assets/images/blank.gif'; |
|
| 82 | + $file = \dirname(__DIR__).'/assets/images/blank.gif'; |
|
| 83 | 83 | foreach (\array_keys($configurator->copyBlankFiles) as $i) { |
| 84 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.gif'; |
|
| 84 | + $dest = $configurator->copyBlankFiles[$i].'/blank.gif'; |
|
| 85 | 85 | $utility::copyFile($file, $dest); |
| 86 | 86 | } |
| 87 | - $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
| 87 | + $file = \dirname(__DIR__).'/assets/images/blank.png'; |
|
| 88 | 88 | foreach (\array_keys($configurator->copyBlankFiles) as $i) { |
| 89 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
| 89 | + $dest = $configurator->copyBlankFiles[$i].'/blank.png'; |
|
| 90 | 90 | $utility::copyFile($file, $dest); |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | if ($elementCount > 0) { |
| 49 | 49 | $crKeywords = new \CriteriaCompo(); |
| 50 | - for ($i = 0; $i < $elementCount; $i++) { |
|
| 50 | + for ($i = 0; $i < $elementCount; $i++) { |
|
| 51 | 51 | $crKeyword = new \CriteriaCompo(); |
| 52 | 52 | unset($crKeyword); |
| 53 | 53 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | if ($userid && \is_array($userid)) { |
| 57 | 57 | $userid = array_map('intval', $userid); |
| 58 | 58 | $crUser = new \CriteriaCompo(); |
| 59 | - $crUser->add(new \Criteria('repo_submitter', '(' . \implode(',', $userid) . ')', 'IN'), 'OR'); |
|
| 59 | + $crUser->add(new \Criteria('repo_submitter', '('.\implode(',', $userid).')', 'IN'), 'OR'); |
|
| 60 | 60 | } elseif (is_numeric($userid) && $userid > 0) { |
| 61 | 61 | $crUser = new \CriteriaCompo(); |
| 62 | 62 | $crUser->add(new \Criteria('repo_submitter', $userid), 'OR'); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | foreach (\array_keys($repositoriesAll) as $i) { |
| 77 | 77 | $ret[] = [ |
| 78 | 78 | 'image' => 'assets/icons/16/repositories.png', |
| 79 | - 'link' => 'repositories.php?op=show&repo_id=' . $repositoriesAll[$i]->getVar('repo_id'), |
|
| 79 | + 'link' => 'repositories.php?op=show&repo_id='.$repositoriesAll[$i]->getVar('repo_id'), |
|
| 80 | 80 | 'title' => $repositoriesAll[$i]->getVar('repo_name'), |
| 81 | 81 | 'time' => $repositoriesAll[$i]->getVar('repo_datecreated') |
| 82 | 82 | ]; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | global $xoopsDB; |
| 33 | 33 | |
| 34 | 34 | if (!\defined('WGGITHUB_URL')) { |
| 35 | - \define('WGGITHUB_URL', \XOOPS_URL . '/modules/wggithub'); |
|
| 35 | + \define('WGGITHUB_URL', \XOOPS_URL.'/modules/wggithub'); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | switch ($category) { |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | return $item; |
| 43 | 43 | break; |
| 44 | 44 | case 'repositories': |
| 45 | - $sql = 'SELECT repo_name FROM ' . $xoopsDB->prefix('wggithub_repositories') . ' WHERE repo_id = '. $item_id; |
|
| 45 | + $sql = 'SELECT repo_name FROM '.$xoopsDB->prefix('wggithub_repositories').' WHERE repo_id = '.$item_id; |
|
| 46 | 46 | $result = $xoopsDB->query($sql); |
| 47 | 47 | $result_array = $xoopsDB->fetchArray($result); |
| 48 | 48 | $item['name'] = $result_array['repo_name']; |
| 49 | - $item['url'] = WGGITHUB_URL . '/repositories.php?repo_id=' . $item_id; |
|
| 49 | + $item['url'] = WGGITHUB_URL.'/repositories.php?repo_id='.$item_id; |
|
| 50 | 50 | return $item; |
| 51 | 51 | break; |
| 52 | 52 | } |
@@ -20,14 +20,14 @@ discard block |
||
| 20 | 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | -include dirname(__DIR__, 3) . '/include/cp_header.php'; |
|
| 24 | -include_once \dirname(__DIR__) . '/include/common.php'; |
|
| 23 | +include dirname(__DIR__, 3).'/include/cp_header.php'; |
|
| 24 | +include_once \dirname(__DIR__).'/include/common.php'; |
|
| 25 | 25 | |
| 26 | -$sysPathIcon16 = '../' . $GLOBALS['xoopsModule']->getInfo('sysicons16'); |
|
| 27 | -$sysPathIcon32 = '../' . $GLOBALS['xoopsModule']->getInfo('sysicons32'); |
|
| 26 | +$sysPathIcon16 = '../'.$GLOBALS['xoopsModule']->getInfo('sysicons16'); |
|
| 27 | +$sysPathIcon32 = '../'.$GLOBALS['xoopsModule']->getInfo('sysicons32'); |
|
| 28 | 28 | $pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'); |
| 29 | -$modPathIcon16 = WGGITHUB_URL . '/' . $GLOBALS['xoopsModule']->getInfo('modicons16') . '/'; |
|
| 30 | -$modPathIcon32 = WGGITHUB_URL . '/' . $GLOBALS['xoopsModule']->getInfo('modicons32') . '/'; |
|
| 29 | +$modPathIcon16 = WGGITHUB_URL.'/'.$GLOBALS['xoopsModule']->getInfo('modicons16').'/'; |
|
| 30 | +$modPathIcon32 = WGGITHUB_URL.'/'.$GLOBALS['xoopsModule']->getInfo('modicons32').'/'; |
|
| 31 | 31 | |
| 32 | 32 | // Get instance of module |
| 33 | 33 | $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $myts = MyTextSanitizer::getInstance(); |
| 41 | 41 | // |
| 42 | 42 | if (!isset($xoopsTpl) || !\is_object($xoopsTpl)) { |
| 43 | - include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 43 | + include_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 44 | 44 | $xoopsTpl = new \XoopsTpl(); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -64,4 +64,4 @@ discard block |
||
| 64 | 64 | $GLOBALS['xoopsTpl']->assign('modPathIcon32', $modPathIcon32); |
| 65 | 65 | |
| 66 | 66 | $adminObject = \Xmf\Module\Admin::getInstance(); |
| 67 | -$style = WGGITHUB_URL . '/assets/css/admin/style.css'; |
|
| 67 | +$style = WGGITHUB_URL.'/assets/css/admin/style.css'; |
|
@@ -24,26 +24,26 @@ discard block |
||
| 24 | 24 | * return object |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | -$moduleDirName = \basename(\dirname(__DIR__)); |
|
| 28 | -$moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
| 29 | -return (object)[ |
|
| 30 | - 'name' => \mb_strtoupper($moduleDirName) . ' Module Configurator', |
|
| 27 | +$moduleDirName = \basename(\dirname(__DIR__)); |
|
| 28 | +$moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
| 29 | +return (object) [ |
|
| 30 | + 'name' => \mb_strtoupper($moduleDirName).' Module Configurator', |
|
| 31 | 31 | 'paths' => [ |
| 32 | 32 | 'dirname' => $moduleDirName, |
| 33 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
| 34 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
| 35 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
| 36 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 37 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
| 33 | + 'admin' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin', |
|
| 34 | + 'modPath' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName, |
|
| 35 | + 'modUrl' => XOOPS_URL.'/modules/'.$moduleDirName, |
|
| 36 | + 'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
| 37 | + 'uploadUrl' => XOOPS_UPLOAD_URL.'/'.$moduleDirName, |
|
| 38 | 38 | ], |
| 39 | 39 | 'uploadFolders' => [ |
| 40 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 40 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
| 41 | 41 | ], |
| 42 | 42 | 'copyBlankFiles' => [ |
| 43 | 43 | ], |
| 44 | 44 | 'copyTestFolders' => [ |
| 45 | - [XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/uploads', |
|
| 46 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName], |
|
| 45 | + [XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/testdata/uploads', |
|
| 46 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName], |
|
| 47 | 47 | ], |
| 48 | 48 | 'templateFolders' => [ |
| 49 | 49 | '/templates/', |
@@ -56,5 +56,5 @@ discard block |
||
| 56 | 56 | ], |
| 57 | 57 | 'moduleStats' => [ |
| 58 | 58 | ], |
| 59 | - 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'><img src='" . XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/assets/images/logo/logoModule.png' alt='XOOPS Project'></a>", |
|
| 59 | + 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'><img src='".XOOPS_ROOT_PATH.'/modules/'.$moduleDirName."/assets/images/logo/logoModule.png' alt='XOOPS Project'></a>", |
|
| 60 | 60 | ]; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function & __get($name) |
| 15 | 15 | { |
| 16 | - throw new LogicException('Cannot read an undeclared property ' . get_class($this) . "::\$$name."); |
|
| 16 | + throw new LogicException('Cannot read an undeclared property '.get_class($this)."::\$$name."); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function __set($name, $value) |
| 24 | 24 | { |
| 25 | - throw new LogicException('Cannot write to an undeclared property ' . get_class($this) . "::\$$name."); |
|
| 25 | + throw new LogicException('Cannot write to an undeclared property '.get_class($this)."::\$$name."); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | } |
@@ -148,7 +148,7 @@ |
||
| 148 | 148 | */ |
| 149 | 149 | public static function parseLink($link, $rel) |
| 150 | 150 | { |
| 151 | - if (!preg_match('(<([^>]+)>;\s*rel="' . preg_quote($rel) . '")', $link, $match)) { |
|
| 151 | + if (!preg_match('(<([^>]+)>;\s*rel="'.preg_quote($rel).'")', $link, $match)) { |
|
| 152 | 152 | return NULL; |
| 153 | 153 | } |
| 154 | 154 | |
@@ -47,15 +47,15 @@ discard block |
||
| 47 | 47 | $options = [ |
| 48 | 48 | 'http' => [ |
| 49 | 49 | 'method' => $request->getMethod(), |
| 50 | - 'header' => implode("\r\n", $headerStr) . "\r\n", |
|
| 51 | - 'follow_location' => 0, # Github sets the Location header for 201 code too and redirection is not required for us |
|
| 50 | + 'header' => implode("\r\n", $headerStr)."\r\n", |
|
| 51 | + 'follow_location' => 0, # Github sets the Location header for 201 code too and redirection is not required for us |
|
| 52 | 52 | 'protocol_version' => 1.1, |
| 53 | 53 | 'ignore_errors' => TRUE, |
| 54 | 54 | ], |
| 55 | 55 | 'ssl' => [ |
| 56 | 56 | 'verify_peer' => TRUE, |
| 57 | - 'cafile' => realpath(__DIR__ . '/../../ca-chain.crt'), |
|
| 58 | - 'disable_compression' => TRUE, # Effective since PHP 5.4.13 |
|
| 57 | + 'cafile' => realpath(__DIR__.'/../../ca-chain.crt'), |
|
| 58 | + 'disable_compression' => TRUE, # Effective since PHP 5.4.13 |
|
| 59 | 59 | ], |
| 60 | 60 | ]; |
| 61 | 61 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $headers = []; |
| 105 | 105 | foreach ($http_response_header as $header) { |
| 106 | 106 | if (in_array(substr($header, 0, 1), [' ', "\t"], TRUE)) { |
| 107 | - $headers[$last] .= ' ' . trim($header); # RFC2616, 2.2 |
|
| 107 | + $headers[$last] .= ' '.trim($header); # RFC2616, 2.2 |
|
| 108 | 108 | } else { |
| 109 | 109 | list($name, $value) = explode(':', $header, 2) + [NULL, NULL]; |
| 110 | 110 | $headers[$last = trim($name)] = trim($value); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | CURLOPT_CONNECTTIMEOUT => 10, |
| 59 | 59 | CURLOPT_SSL_VERIFYHOST => 2, |
| 60 | 60 | CURLOPT_SSL_VERIFYPEER => 1, |
| 61 | - CURLOPT_CAINFO => realpath(__DIR__ . '/../ca-chain.crt'), |
|
| 61 | + CURLOPT_CAINFO => realpath(__DIR__.'/../ca-chain.crt'), |
|
| 62 | 62 | ]; |
| 63 | 63 | |
| 64 | 64 | $hardOptions = [ |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $responseHeaders = []; |
| 79 | 79 | |
| 80 | 80 | } elseif (in_array(substr($line, 0, 1), [' ', "\t"], TRUE)) { |
| 81 | - $responseHeaders[$last] .= ' ' . trim($line); # RFC2616, 2.2 |
|
| 81 | + $responseHeaders[$last] .= ' '.trim($line); # RFC2616, 2.2 |
|
| 82 | 82 | |
| 83 | 83 | } elseif ($line !== "\r\n") { |
| 84 | 84 | list($name, $value) = explode(':', $line, 2); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | $result = curl_setopt_array($this->curl, $hardOptions + ($this->options ?: []) + $softOptions); |
| 104 | 104 | if ($result === FALSE) { |
| 105 | - throw new BadResponseException('Setting cURL options failed: ' . curl_error($this->curl), curl_errno($this->curl)); |
|
| 105 | + throw new BadResponseException('Setting cURL options failed: '.curl_error($this->curl), curl_errno($this->curl)); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $content = curl_exec($this->curl); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | $code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE); |
| 114 | 114 | if ($code === FALSE) { |
| 115 | - throw new BadResponseException('HTTP status code is missing:' . curl_error($this->curl), curl_errno($this->curl)); |
|
| 115 | + throw new BadResponseException('HTTP status code is missing:'.curl_error($this->curl), curl_errno($this->curl)); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | return new Response($code, $responseHeaders, $content); |