Code Duplication    Length = 7-7 lines in 4 locations

install/Helper/ModulePackage.php 1 location

@@ 25-31 (lines=7) @@
22
        $sql_structure = file_get_contents(dirname(__FILE__) . '/../database-module_package-values.sql');
23
        $sql_arr = Intraface_Install::splitSql($sql_structure);
24
25
        foreach ($sql_arr as $sql) {
26
            if (empty($sql)) { continue; }
27
            $result = $this->db->exec($sql);
28
            if (PEAR::isError($result)) {
29
                throw new Exception($result->getUserInfo());
30
            }
31
        }
32
33
        require_once 'Intraface/modules/product/Product.php';
34
        $product = new Product($this->kernel);

install/Install.php 3 locations

@@ 48-54 (lines=7) @@
45
        $sql_structure = file_get_contents(dirname(__FILE__) . '/database-structure.sql');
46
        $sql_arr = Intraface_Install::splitSql($sql_structure);
47
48
        foreach ($sql_arr as $sql) {
49
            if (empty($sql)) { continue; }
50
            $result = $this->db->exec($sql);
51
            if (PEAR::isError($result)) {
52
                throw new Exception($result->getUserInfo());
53
            }
54
        }
55
56
        $sql_structure = file_get_contents(dirname(__FILE__) . '/database-update.sql');
57
        $sql_arr = Intraface_Install::splitSql($sql_structure);
@@ 59-65 (lines=7) @@
56
        $sql_structure = file_get_contents(dirname(__FILE__) . '/database-update.sql');
57
        $sql_arr = Intraface_Install::splitSql($sql_structure);
58
59
        foreach ($sql_arr as $sql) {
60
            if (empty($sql)) { continue; }
61
            $result = $this->db->exec($sql);
62
            if (PEAR::isError($result)) {
63
                throw new Exception($result->getUserInfo());
64
            }
65
        }
66
        return true;
67
    }
68
@@ 90-96 (lines=7) @@
87
        $sql_values = file_get_contents(dirname(__FILE__) . '/database-values.sql');
88
        $sql_arr = Intraface_Install::splitSql($sql_values);
89
90
        foreach ($sql_arr as $sql) {
91
            if (empty($sql)) { continue; }
92
            $result = $this->db->exec($sql);
93
            if (PEAR::isError($result)) {
94
                throw new Exception($result->getUserInfo());
95
            }
96
        }
97
        return true;
98
    }
99