Code Duplication    Length = 25-25 lines in 2 locations

install/cli-install.php 1 location

@@ 716-740 (lines=25) @@
713
714
// setup plugins template files - array : name, description, type - 0:file or 1:content, file or content,properties
715
$mp = &$modulePlugins;
716
if (is_dir($pluginPath) && is_readable($pluginPath)) {
717
    $d = dir($pluginPath);
718
    while (false !== ($tplfile = $d->read())) {
719
        if (substr($tplfile, -4) != '.tpl') {
720
            continue;
721
        }
722
        $params = parse_docblock($pluginPath, $tplfile);
723
        if (is_array($params) && count($params) > 0) {
724
            $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}";
725
            $mp[] = array(
726
                $params['name'],
727
                $description,
728
                "$pluginPath/{$params['filename']}",
729
                $params['properties'],
730
                $params['events'],
731
                $params['guid'],
732
                $params['modx_category'],
733
                $params['legacy_names'],
734
                array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false,
735
                (int)$params['disabled']
736
            );
737
        }
738
    }
739
    $d->close();
740
}
741
742
// setup modules - array : name, description, type - 0:file or 1:content, file or content,properties, guid,enable_sharedparams
743
$mm = &$moduleModules;

install/src/processor/result.php 1 location

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