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

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