Code Duplication    Length = 9-9 lines in 2 locations

manager/captcha.php 1 location

@@ 4-12 (lines=9) @@
1
<?php
2
define('MODX_API_MODE', true);
3
4
if (file_exists(__DIR__ . '/config.php')) {
5
    $config = require __DIR__ . '/config.php';
6
} elseif (file_exists(dirname(__DIR__) . '/config.php')) {
7
    $config = require dirname(__DIR__) . '/config.php';
8
} else {
9
    $config = [
10
        'root' => dirname(__DIR__)
11
    ];
12
}
13
14
if (!empty($config['root']) && file_exists($config['root']. '/index.php')) {
15
    require_once $config['root'] . '/index.php';

manager/index.php 1 location

@@ 64-72 (lines=9) @@
61
    define('IN_MANAGER_MODE', true);
62
}
63
64
if (file_exists(__DIR__ . '/config.php')) {
65
    $config = require __DIR__ . '/config.php';
66
} elseif (file_exists(dirname(__DIR__) . '/config.php')) {
67
    $config = require dirname(__DIR__) . '/config.php';
68
} else {
69
    $config = [
70
        'core' => dirname(__DIR__) . '/core'
71
    ];
72
}
73
74
if (!empty($config['core']) && file_exists($config['core'] . '/bootstrap.php')) {
75
    require_once $config['core'] . '/bootstrap.php';