Completed
Pull Request — master (#27)
by Michael
01:42
created

include/install.php (8 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
 * ****************************************************************************
4
 *  - A Project by Developers TEAM For Xoops - ( https://xoops.org )
5
 * ****************************************************************************
6
 *  XNEWSLETTER - MODULE FOR XOOPS
7
 *  Copyright (c) 2007 - 2012
8
 *  Goffy ( wedega.com )
9
 *
10
 *  You may not change or alter any portion of this comment or credits
11
 *  of supporting developers from this source code or any supporting
12
 *  source code which is considered copyrighted (c) material of the
13
 *  original comment or credit authors.
14
 *
15
 *  This program is distributed in the hope that it will be useful,
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *  GNU General Public License for more details.
19
 *  ---------------------------------------------------------------------------
20
 * @copyright  Goffy ( wedega.com )
21
 * @license    GPL 2.0
22
 * @package    xnewsletter
23
 * @author     Goffy ( [email protected] )
24
 *
25
 *  Version : 1 Mon 2012/11/05 14:31:32 :  Exp $
26
 * ****************************************************************************
27
 */
28
$indexFile = XOOPS_UPLOAD_PATH . '/index.html';
29
$blankFile = XOOPS_UPLOAD_PATH . '/blank.gif';
30
31
//Creation of folder "uploads" for the module to the site root
32
$module_uploads = XOOPS_ROOT_PATH . '/uploads/xnewsletter';
33 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...
34
    if (!mkdir($module_uploads, 0777) && !is_dir($module_uploads)) {
35
        throw new \RuntimeException(sprintf('Directory "%s" was not created', $module_uploads));
36
    }
37
}
38
chmod($module_uploads, 0777);
39
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/xnewsletter/index.html');
40
41
//Creation of the file accounts in uploads directory
42
$module_uploads = XOOPS_ROOT_PATH . '/uploads/xnewsletter/accounts';
43 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...
44
    if (!mkdir($module_uploads, 0777) && !is_dir($module_uploads)) {
45
        throw new \RuntimeException(sprintf('Directory "%s" was not created', $module_uploads));
46
    }
47
}
48
chmod($module_uploads, 0777);
49
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/xnewsletter/accounts/index.html');
50
51
//Creation of the file cat in uploads directory
52
$module_uploads = XOOPS_ROOT_PATH . '/uploads/xnewsletter/cat';
53 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...
54
    if (!mkdir($module_uploads, 0777) && !is_dir($module_uploads)) {
55
        throw new \RuntimeException(sprintf('Directory "%s" was not created', $module_uploads));
56
    }
57
}
58
chmod($module_uploads, 0777);
59
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/xnewsletter/cat/index.html');
60
61
//Creation of the file subscr in uploads directory
62
$module_uploads = XOOPS_ROOT_PATH . '/uploads/xnewsletter/subscr';
63 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...
64
    if (!mkdir($module_uploads, 0777) && !is_dir($module_uploads)) {
65
        throw new \RuntimeException(sprintf('Directory "%s" was not created', $module_uploads));
66
    }
67
}
68
chmod($module_uploads, 0777);
69
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/xnewsletter/subscr/index.html');
70
71
//Creation of the file catsubscr in uploads directory
72
$module_uploads = XOOPS_ROOT_PATH . '/uploads/xnewsletter/catsubscr';
73 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...
74
    if (!mkdir($module_uploads, 0777) && !is_dir($module_uploads)) {
75
        throw new \RuntimeException(sprintf('Directory "%s" was not created', $module_uploads));
76
    }
77
}
78
chmod($module_uploads, 0777);
79
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/xnewsletter/catsubscr/index.html');
80
81
//Creation of the file letter in uploads directory
82
$module_uploads = XOOPS_ROOT_PATH . '/uploads/xnewsletter/letter';
83 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...
84
    if (!mkdir($module_uploads, 0777) && !is_dir($module_uploads)) {
85
        throw new \RuntimeException(sprintf('Directory "%s" was not created', $module_uploads));
86
    }
87
}
88
chmod($module_uploads, 0777);
89
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/xnewsletter/letter/index.html');
90
91
//Creation of the file protocol in uploads directory
92
$module_uploads = XOOPS_ROOT_PATH . '/uploads/xnewsletter/protocol';
93 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...
94
    if (!mkdir($module_uploads, 0777) && !is_dir($module_uploads)) {
95
        throw new \RuntimeException(sprintf('Directory "%s" was not created', $module_uploads));
96
    }
97
}
98
chmod($module_uploads, 0777);
99
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/xnewsletter/protocol/index.html');
100
101
//Creation of the folder letter_attachment in uploads directory for files
102
$module_uploads = XOOPS_ROOT_PATH . '/uploads/xnewsletter/attachments/';
103 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...
104
    if (!mkdir($module_uploads, 0777) && !is_dir($module_uploads)) {
105
        throw new \RuntimeException(sprintf('Directory "%s" was not created', $module_uploads));
106
    }
107
}
108
chmod($module_uploads, 0777);
109
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/xnewsletter/attachments/index.html');
110