Completed
Push — master ( 54d4eb...375a6b )
by Michael
02:05
created

include/install.php (4 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Module: RandomQuote
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
 *
9
 * PHP version 5
10
 *
11
 * @category        Module
12
 * @package         Randomquote
13
 * @author          XOOPS Development Team, Mamba
14
 * @copyright       2001-2016 XOOPS Project (http://xoops.org)
15
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
16
 * @link            http://xoops.org/
17
 * @since           2.0.0
18
 */
19
20
$indexFile = 'index.html';
21
$blankFile = XOOPS_ROOT_PATH . '/modules/randomquote/assets/images/icons/blank.gif';
22
23
//Creation du dossier "uploads" pour le module à la racine du site
24
$module_uploads = XOOPS_ROOT_PATH . '/uploads/randomquote';
25 View Code Duplication
if (!is_dir($module_uploads)) {
0 ignored issues
show
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...
26
    //    mkdir($module_uploads, 0777);
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% 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...
27
    if (!@mkdir($module_uploads, 0757) && !is_dir($module_uploads)) {
28
        throw Exception("Couldn't create this directory: " . $module_uploads);
29
    }
30
}
31
chmod($module_uploads, 0777);
32
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/randomquote/index.html');
33
34
//Creation du fichier citas dans uploads
35
$module_uploads = XOOPS_ROOT_PATH . '/uploads/randomquote/citas';
36 View Code Duplication
if (!is_dir($module_uploads)) {
0 ignored issues
show
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...
37
    //    mkdir($module_uploads, 0777);
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% 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...
38
    if (!@mkdir($module_uploads, 0757) && !is_dir($module_uploads)) {
39
        throw Exception("Couldn't create this directory: " . $module_uploads);
40
    }
41
}
42
chmod($module_uploads, 0777);
43
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/randomquote/citas/index.html');
44