mambax7 /
extcal
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 {@link https://xoops.org/ XOOPS Project} |
||
| 14 | * @license {@link http://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 | |||
| 22 | //---------------------------------------------------- |
||
| 23 | class Extcal_2_15 |
||
| 24 | { |
||
| 25 | //---------------------------------------------------- |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param XoopsModule $module |
||
| 29 | * @param $options |
||
| 30 | */ |
||
| 31 | public function __construct(XoopsModule $module, $options) |
||
| 32 | { |
||
| 33 | global $xoopsDB; |
||
|
0 ignored issues
–
show
|
|||
| 34 | |||
| 35 | //$xoopsDB = XoopsDatabaseFactory::getDatabaseConnection(); |
||
|
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
50% 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...
|
|||
| 36 | $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection(); |
||
| 37 | |||
| 38 | $sql = 'ALTER TABLE `' . $xoopsDB->prefix('extcal_event') . "` CHANGE `event_approved` `event_approved` TINYINT( 1 ) NOT NULL DEFAULT '0' ;"; |
||
| 39 | $xoopsDB->query($sql); |
||
| 40 | |||
| 41 | $sql = 'ALTER TABLE `' . $xoopsDB->prefix('extcal_event') . '` ADD `event_isrecur` TINYINT( 1 ) NOT NULL AFTER `event_nbmember` ;'; |
||
| 42 | $xoopsDB->query($sql); |
||
| 43 | |||
| 44 | $sql = 'ALTER TABLE `' . $xoopsDB->prefix('extcal_event') . '` ADD `event_recur_rules` VARCHAR( 255 ) NOT NULL AFTER `event_isrecur` '; |
||
| 45 | $xoopsDB->query($sql); |
||
| 46 | |||
| 47 | $sql = 'ALTER TABLE `' . $xoopsDB->prefix('extcal_event') . '` ADD `event_recur_start` INT( 11 ) NOT NULL AFTER `event_recur_rules` ;'; |
||
| 48 | $xoopsDB->query($sql); |
||
| 49 | |||
| 50 | $sql = 'ALTER TABLE `' . $xoopsDB->prefix('extcal_event') . '` ADD `event_recur_end` INT( 11 ) NOT NULL AFTER `event_recur_start` ;'; |
||
| 51 | $xoopsDB->query($sql); |
||
| 52 | |||
| 53 | $sql = 'CREATE TABLE `' |
||
| 54 | . $xoopsDB->prefix('extcal_event') |
||
| 55 | . "` (`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' ;"; |
||
| 56 | $xoopsDB->query($sql); |
||
| 57 | |||
| 58 | $sql = 'CREATE TABLE `' |
||
| 59 | . $xoopsDB->prefix('extcal_file') |
||
| 60 | . "` (`file_id` INT(11) NOT NULL AUTO_INCREMENT,`file_name` VARCHAR(255) NOT NULL,`file_nicename` VARCHAR(255) NOT NULL,`file_mimetype` VARCHAR(255) NOT NULL,`file_size` INT(11) NOT NULL,`file_download` INT(11) NOT NULL,`file_date` INT(11) NOT NULL,`file_approved` TINYINT(1) NOT NULL,`event_id` INT(11) NOT NULL,`uid` INT(11) NOT NULL,PRIMARY KEY (`file_id`)) COMMENT='eXtcal By Zoullou' ;"; |
||
| 61 | $xoopsDB->query($sql); |
||
| 62 | } |
||
| 63 | |||
| 64 | //----------------------------------------------------------------- |
||
| 65 | } // fin de la classe |
||
| 66 |
Instead of relying on
globalstate, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state