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 {@link https://xoops.org/ XOOPS Project} |
14
|
|
|
* @license {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later} |
15
|
|
|
* @package extcal |
16
|
|
|
* @since |
17
|
|
|
* @author XOOPS Development Team, |
18
|
|
|
* @author JJDai <http://xoops.kiolo.com> |
19
|
|
|
*/ |
20
|
|
|
//---------------------------------------------------- |
21
|
|
|
class Extcal_2_21 |
22
|
|
|
{ |
23
|
|
|
//---------------------------------------------------- |
24
|
|
|
/** |
25
|
|
|
* @param \XoopsModule $module |
26
|
|
|
* @param $options |
27
|
|
|
*/ |
28
|
|
|
public function __construct(\XoopsModule $module, $options) |
|
|
|
|
29
|
|
|
{ |
30
|
|
|
global $xoopsDB; |
31
|
|
|
|
32
|
|
|
// Create eXtcal upload directory if don't exist |
33
|
|
|
$dir = XOOPS_ROOT_PATH . '/uploads/extcal'; |
34
|
|
|
if (!is_dir($dir)) { |
35
|
|
|
if (!mkdir($dir) && !is_dir($dir)) { |
36
|
|
|
throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir)); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
// Copy index.html files on uploads folders |
40
|
|
|
$indexFile = __DIR__ . '/index.html'; |
41
|
|
|
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/extcal/index.html'); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
// Create who's not going table to fix bug. If the table exist, the query will faile |
45
|
|
|
$sql = 'CREATE TABLE `' |
46
|
|
|
. $xoopsDB->prefix('extcal_eventnotmember') |
47
|
|
|
. "` (`eventnotmember_id` INT(11) NOT NULL AUTO_INCREMENT,`event_id` INT(11) NOT NULL DEFAULT '0',`uid` INT(11) NOT NULL DEFAULT '0',PRIMARY KEY (`eventnotmember_id`),UNIQUE KEY `eventnotmember` (`event_id`,`uid`)) COMMENT='eXtcal By Zoullou' ;"; |
48
|
|
|
$xoopsDB->query($sql); |
49
|
|
|
} |
50
|
|
|
//----------------------------------------------------------------- |
51
|
|
|
} // fin de la classe |
52
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.