These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * Adminer Module based on Ghost Module |
||
4 | * |
||
5 | * You may not change or alter any portion of this comment or credits |
||
6 | * of supporting developers from this source code or any supporting source code |
||
7 | * which is considered copyrighted (c) material of the original comment or credit authors. |
||
8 | * This program is distributed in the hope that it will be useful, |
||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
11 | * |
||
12 | * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ |
||
13 | * @license http://www.fsf.org/copyleft/gpl.html GNU public license |
||
14 | * @package Adminer Module |
||
15 | * @since 2.3.0 |
||
16 | * @author Kris <http://www.xoofoo.org> |
||
17 | * @version $Id $ |
||
18 | **/ |
||
19 | // connect xoops database |
||
20 | if ( !include("../../mainfile.php") ) { |
||
21 | die("XOOPS root path not defined"); |
||
22 | } |
||
23 | $module_dirname = basename( dirname( __FILE__ ) ) ; |
||
24 | include(XOOPS_ROOT_PATH."/header.php"); |
||
25 | View Code Duplication | if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) exit( _NOPERM ); |
|
26 | |||
27 | View Code Duplication | function adminer_object() { |
|
0 ignored issues
–
show
|
|||
28 | class AdminerKfr extends Adminer { |
||
29 | function name() { |
||
0 ignored issues
–
show
|
|||
30 | return 'XOOPS Admin'; |
||
31 | } |
||
32 | function credentials() { |
||
0 ignored issues
–
show
|
|||
33 | return array(XOOPS_DB_HOST,XOOPS_DB_USER,XOOPS_DB_PASS); |
||
34 | } |
||
35 | function database() { |
||
0 ignored issues
–
show
|
|||
36 | return XOOPS_DB_NAME; |
||
37 | } |
||
38 | function login($login, $password) { |
||
0 ignored issues
–
show
|
|||
39 | return ($login == XOOPS_DB_USER); |
||
40 | } |
||
41 | } |
||
42 | return new AdminerKfr; |
||
43 | } |
||
44 | |||
45 | /*function adminer_object() { |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
53% 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. ![]() |
|||
46 | include_once "./include/plugins/plugin.php"; |
||
47 | foreach (glob("include/plugins/*.php") as $filename) { |
||
48 | include_once "./$filename"; |
||
49 | } |
||
50 | $plugins = array( |
||
51 | new AdminerDumpZip, |
||
52 | new AdminerDumpXml, |
||
53 | new AdminerTinymce, |
||
54 | new AdminerFileUpload("data/"), |
||
55 | new AdminerSlugify, |
||
56 | new AdminerTranslation, |
||
57 | new AdminerForeignSystem, |
||
58 | ); |
||
59 | return new AdminerPlugin($plugins); |
||
60 | }*/ |
||
61 | include "./include/adminer.php"; |
||
62 | ?> |
||
0 ignored issues
–
show
It is not recommended to use PHP's closing tag
?> in files other than templates.
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore. A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever. ![]() |
This check looks for functions that have already been defined in other files.
Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the
@ignore
annotation.See also the PhpDoc documentation for @ignore.