Code Duplication    Length = 25-25 lines in 2 locations

install/setup.info.php 1 location

@@ 124-148 (lines=25) @@
121
122
// setup plugins template files - array : name, description, type - 0:file or 1:content, file or content,properties
123
$mp = &$modulePlugins;
124
if(is_dir($pluginPath) && is_readable($pluginPath)) {
125
    $d = dir($pluginPath);
126
    while (false !== ($tplfile = $d->read())) {
127
        if(substr($tplfile, -4) != '.tpl') {
128
            continue;
129
        }
130
        $params = parse_docblock($pluginPath, $tplfile);
131
        if(is_array($params) && count($params) > 0) {
132
            $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}";
133
            $mp[] = array(
134
                $params['name'],
135
                $description,
136
                "$pluginPath/{$params['filename']}",
137
                $params['properties'],
138
                $params['events'],
139
                $params['guid'],
140
                $params['modx_category'],
141
                $params['legacy_names'],
142
                array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false,
143
                (int)$params['disabled']
144
            );
145
        }
146
    }
147
    $d->close();
148
}
149
150
// setup modules - array : name, description, type - 0:file or 1:content, file or content,properties, guid,enable_sharedparams
151
$mm = &$moduleModules;

install/cli-install.php 1 location

@@ 677-701 (lines=25) @@
674
675
// setup plugins template files - array : name, description, type - 0:file or 1:content, file or content,properties
676
$mp = &$modulePlugins;
677
if(is_dir($pluginPath) && is_readable($pluginPath)) {
678
    $d = dir($pluginPath);
679
    while (false !== ($tplfile = $d->read())) {
680
        if(substr($tplfile, -4) != '.tpl') {
681
            continue;
682
        }
683
        $params = parse_docblock($pluginPath, $tplfile);
684
        if(is_array($params) && count($params) > 0) {
685
            $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}";
686
            $mp[] = array(
687
                $params['name'],
688
                $description,
689
                "$pluginPath/{$params['filename']}",
690
                $params['properties'],
691
                $params['events'],
692
                $params['guid'],
693
                $params['modx_category'],
694
                $params['legacy_names'],
695
                array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false,
696
                (int)$params['disabled']
697
            );
698
        }
699
    }
700
    $d->close();
701
}
702
703
// setup modules - array : name, description, type - 0:file or 1:content, file or content,properties, guid,enable_sharedparams
704
$mm = &$moduleModules;