Code Duplication    Length = 28-28 lines in 2 locations

install/cli-install.php 1 location

@@ 490-517 (lines=28) @@
487
    }
488
}
489
490
if(!function_exists('parseProperties')) {
491
    /**
492
     * parses a resource property string and returns the result as an array
493
     * duplicate of method in documentParser class
494
     *
495
     * @param string $propertyString
496
     * @return array
497
     */
498
    function parseProperties($propertyString) {
499
        $parameter= array ();
500
        if (!empty ($propertyString)) {
501
            $tmpParams= explode("&", $propertyString);
502
            $countParams = count($tmpParams);
503
            for ($x= 0; $x < $countParams; $x++) {
504
                if (strpos($tmpParams[$x], '=', 0)) {
505
                    $pTmp= explode("=", $tmpParams[$x]);
506
                    $pvTmp= explode(";", trim($pTmp[1]));
507
                    if ($pvTmp[1] == 'list' && $pvTmp[3] != "")
508
                        $parameter[trim($pTmp[0])]= $pvTmp[3]; //list default
509
                    else
510
                        if ($pvTmp[1] != 'list' && $pvTmp[2] != "")
511
                            $parameter[trim($pTmp[0])]= $pvTmp[2];
512
                }
513
            }
514
        }
515
        return $parameter;
516
    }
517
}
518
519
// check status of Inherit Parent Template plugin
520
$auto_template_logic = 'parent';

install/instprocessor.php 1 location

@@ 127-154 (lines=28) @@
124
    }
125
}
126
127
if(!function_exists('parseProperties')) {
128
    /**
129
     * parses a resource property string and returns the result as an array
130
     * duplicate of method in documentParser class
131
     *
132
     * @param string $propertyString
133
     * @return array
134
     */
135
    function parseProperties($propertyString) {
136
        $parameter= array ();
137
        if (!empty ($propertyString)) {
138
            $tmpParams= explode("&", $propertyString);
139
            $countParams = count($tmpParams);
140
            for ($x= 0; $x < $countParams; $x++) {
141
                if (strpos($tmpParams[$x], '=', 0)) {
142
                    $pTmp= explode("=", $tmpParams[$x]);
143
                    $pvTmp= explode(";", trim($pTmp[1]));
144
                    if ($pvTmp[1] == 'list' && $pvTmp[3] != "")
145
                        $parameter[trim($pTmp[0])]= $pvTmp[3]; //list default
146
                    else
147
                        if ($pvTmp[1] != 'list' && $pvTmp[2] != "")
148
                            $parameter[trim($pTmp[0])]= $pvTmp[2];
149
                }
150
            }
151
        }
152
        return $parameter;
153
    }
154
}
155
156
// check status of Inherit Parent Template plugin
157
$auto_template_logic = 'parent';