Completed
Push — master ( 33f65d...fb9c39 )
by Richard
12s
created

update.php ➔ xoops_module_update_pm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 22
rs 9.2
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
 * Private Message
14
 *
15
 * @copyright       2000-2016 XOOPS Project (http://xoops.org)
16
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
17
 * @package         pm
18
 * @since           2.3.0
19
 * @author          Taiwen Jiang <[email protected]>
20
 */
21
22
/**
23
 * @param XoopsModule $module
24
 * @param string|null $oldversion
25
 * @return bool|void
26
 * @todo this should be removed, it is now handled by schema
27
 */
28
function xoops_module_update_pm(&$module, $oldversion = null)
0 ignored issues
show
Unused Code introduced by
The parameter $module is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $oldversion is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
{
30
    /*
31
    $xoops = Xoops::getInstance();
32
    if ($oldversion <= 100) {
33
        // Check pm table version
34
        $sql = "SHOW COLUMNS FROM " . $xoopsDB->prefix("system_privatemessage");
35
        if (!$result = $xoopsDB->queryF($sql)) {
36
            return false;
37
        }
38
        // Migrate from existent pm module
39
        if (($rows = $xoopsDB->getRowsNum($result)) == 12) {
40
            return true;
41
        } elseif ($rows == 8) {
42
            return $xoopsDB->queryFromFile(\XoopsBaseConfig::get('root-path') . "/modules/" . $module->getVar('dirname', 'n') . "/sql/mysql.upgrade.sql");
43
        } else {
44
            return false;
45
        }
46
    }
47
    */
48
    return true;
49
}
50