Code Duplication    Length = 25-25 lines in 2 locations

install/cli-install.php 1 location

@@ 661-685 (lines=25) @@
658
659
// setup plugins template files - array : name, description, type - 0:file or 1:content, file or content,properties
660
$mp = &$modulePlugins;
661
if(is_dir($pluginPath) && is_readable($pluginPath)) {
662
    $d = dir($pluginPath);
663
    while (false !== ($tplfile = $d->read())) {
664
        if(substr($tplfile, -4) != '.tpl') {
665
            continue;
666
        }
667
        $params = parse_docblock($pluginPath, $tplfile);
668
        if(is_array($params) && count($params) > 0) {
669
            $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}";
670
            $mp[] = array(
671
                $params['name'],
672
                $description,
673
                "$pluginPath/{$params['filename']}",
674
                $params['properties'],
675
                $params['events'],
676
                $params['guid'],
677
                $params['modx_category'],
678
                $params['legacy_names'],
679
                array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false,
680
                (int)$params['disabled']
681
            );
682
        }
683
    }
684
    $d->close();
685
}
686
687
// setup modules - array : name, description, type - 0:file or 1:content, file or content,properties, guid,enable_sharedparams
688
$mm = &$moduleModules;

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;