Code Duplication    Length = 21-21 lines in 2 locations

install/cli-install.php 1 location

@@ 570-590 (lines=21) @@
567
568
// check status of Inherit Parent Template plugin
569
$auto_template_logic = 'parent';
570
if ($installMode != 0) {
571
    $rs = mysqli_query($conn,
572
        "SELECT properties, disabled FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='Inherit Parent Template'");
573
    $row = mysqli_fetch_row($rs);
574
    if (!$row) {
575
        // not installed
576
        $auto_template_logic = 'system';
577
    } else {
578
        if ($row[1] == 1) {
579
            // installed but disabled
580
            $auto_template_logic = 'system';
581
        } else {
582
            // installed, enabled .. see how it's configured
583
            $properties = parseProperties($row[0]);
584
            if (isset($properties['inheritTemplate'])) {
585
                if ($properties['inheritTemplate'] == 'From First Sibling') {
586
                    $auto_template_logic = 'sibling';
587
                }
588
            }
589
        }
590
    }
591
}
592
593

install/src/controllers/install.php 1 location

@@ 140-160 (lines=21) @@
137
138
// check status of Inherit Parent Template plugin
139
$auto_template_logic = 'parent';
140
if ($installMode != 0) {
141
    $rs = mysqli_query($conn, "SELECT properties, disabled FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='Inherit Parent Template'");
142
    $row = mysqli_fetch_row($rs);
143
    if(!$row) {
144
        // not installed
145
        $auto_template_logic = 'system';
146
    } else {
147
        if($row[1] == 1) {
148
            // installed but disabled
149
            $auto_template_logic = 'system';
150
        } else {
151
            // installed, enabled .. see how it's configured
152
            $properties = parseProperties($row[0]);
153
            if(isset($properties['inheritTemplate'])) {
154
                if($properties['inheritTemplate'] == 'From First Sibling') {
155
                    $auto_template_logic = 'sibling';
156
                }
157
            }
158
        }
159
    }
160
}
161
162
// open db connection
163
$setupPath = realpath(__DIR__);