mambax7 /
extgallery
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 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 | * @copyright XOOPS Project https://xoops.org/ |
||
| 14 | * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) |
||
| 15 | * @package |
||
| 16 | * @since |
||
| 17 | * @author XOOPS Development Team |
||
| 18 | */ |
||
| 19 | |||
| 20 | |||
| 21 | $moduleDirName = basename(dirname(__DIR__)); |
||
| 22 | $capsDirName = strtoupper($moduleDirName); |
||
| 23 | |||
| 24 | if (!defined($capsDirName . '_DIRNAME')) { |
||
| 25 | //if (!defined($moduleDirName)) { |
||
|
0 ignored issues
–
show
|
|||
| 26 | define($capsDirName . '_DIRNAME', $GLOBALS['xoopsModule']->dirname()); |
||
| 27 | define($capsDirName . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName); |
||
| 28 | define($capsDirName . '_URL', XOOPS_URL . '/modules/' . $moduleDirName); |
||
| 29 | |||
| 30 | define($capsDirName . '_IMAGE_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images'); |
||
| 31 | define($capsDirName . '_IMAGE_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/assets/images'); |
||
| 32 | define($capsDirName . '_ADMIN_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/admin'); |
||
| 33 | |||
| 34 | define($capsDirName . '_ADMIN', constant($capsDirName . '_URL') . '/admin/index.php'); |
||
| 35 | define($capsDirName . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName); |
||
| 36 | define($capsDirName . '_AUTHOR_LOGOIMG', constant($capsDirName . '_URL') . '/assets/images/logoModule.png'); |
||
| 37 | define($capsDirName . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash |
||
| 38 | define($capsDirName . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash |
||
| 39 | } |
||
| 40 | |||
| 41 | //if (!defined('EXTGALLERY_MODULE_PATH')) { |
||
|
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
44% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. Loading history...
|
|||
| 42 | // define('EXTGALLERY_DIRNAME', basename(dirname(__DIR__))); |
||
| 43 | // define('EXTGALLERY_URL', XOOPS_URL . '/modules/' . EXTGALLERY_DIRNAME); |
||
| 44 | // define('EXTGALLERY_IMAGE_URL', EXTGALLERY_URL . '/assets/images/'); |
||
| 45 | // define('EXTGALLERY_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . EXTGALLERY_DIRNAME); |
||
| 46 | // define('EXTGALLERY_IMAGE_PATH', EXTGALLERY_ROOT_PATH . '/assets/images'); |
||
| 47 | // define('EXTGALLERY_ADMIN_URL', EXTGALLERY_URL . '/admin/'); |
||
| 48 | // define('EXTGALLERY_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . EXTGALLERY_DIRNAME); |
||
| 49 | // define('EXTGALLERY_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . EXTGALLERY_DIRNAME); |
||
| 50 | //} |
||
| 51 | //xoops_loadLanguage('common', EXTGALLERY_DIRNAME); |
||
| 52 | |||
| 53 | //require_once EXTGALLERY_ROOT_PATH . '/class/utility.php'; |
||
| 54 | //require_once EXTGALLERY_ROOT_PATH . '/include/constants.php'; |
||
| 55 | //require_once EXTGALLERY_ROOT_PATH . '/include/seo_functions.php'; |
||
| 56 | //require_once EXTGALLERY_ROOT_PATH . '/class/metagen.php'; |
||
| 57 | //require_once EXTGALLERY_ROOT_PATH . '/class/session.php'; |
||
| 58 | //require_once EXTGALLERY_ROOT_PATH . '/class/xoalbum.php'; |
||
| 59 | //require_once EXTGALLERY_ROOT_PATH . '/class/request.php'; |
||
| 60 | |||
| 61 | require_once EXTGALLERY_ROOT_PATH . '/class/helper.php'; |
||
| 62 | |||
| 63 | xoops_load('constants', EXTGALLERY_DIRNAME); |
||
| 64 | xoops_load('utility', EXTGALLERY_DIRNAME); |
||
| 65 | |||
| 66 | |||
| 67 | $extgallery = Extgallery::getInstance(); |
||
| 68 | $extgallery->loadLanguage('common'); |
||
| 69 | |||
| 70 | View Code Duplication | if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
|
|
0 ignored issues
–
show
The class
XoopsTpl does not exist. Did you forget a USE statement, or did you not list all dependencies?
This error could be the result of: 1. Missing dependenciesPHP Analyzer uses your Are you sure this class is defined by one of your dependencies, or did you maybe
not list a dependency in either the 2. Missing use statementPHP does not complain about undefined classes in if ($x instanceof DoesNotExist) {
// Do something.
}
If you have not tested against this specific condition, such errors might go unnoticed. Loading history...
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. Loading history...
|
|||
| 71 | require_once $GLOBALS['xoops']->path('class/template.php'); |
||
| 72 | $xoopsTpl = new XoopsTpl(); |
||
| 73 | } |
||
| 74 | |||
| 75 | $moduleDirName = basename(dirname(__DIR__)); |
||
| 76 | $xoopsTpl->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName); |
||
| 77 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.