[] , 'files' => [] ] */ public static function getWpCoreFilesListInFolder($relPath = '') { $corePaths = self::getCorePathsList(); if (strlen($relPath) > 0) { $pExploded = explode('/', $relPath); foreach ($pExploded as $current) { if (!isset($corePaths[$current])) { $corePaths = array(); break; } if (is_scalar($corePaths[$current])) { // is file so don't have childs $corePaths = array(); } else { $corePaths = $corePaths[$current]; } } } $result = array( 'dirs' => array(), 'files' => array() ); foreach ($corePaths as $name => $content) { if (is_array($content)) { $result['dirs'][] = $name; } else { $result['files'][] = $name; } } return $result; } /** * get core path list from relative abs path * [ * 'folder' => [ * 's-folder1' => [ * file1 => [], * file2 => [], * ], * 's-folder2' => [], * file1 => [] * ] * ] * * @return array */ public static function getCorePathsList() { if (is_null(self::$corePathList)) { require_once(dirname(__FILE__).'/wordpress.core.files.php'); } return self::$corePathList; } /** * return object list of sites * * @return boolean */ public static function getSites($args = array()) { if (!function_exists('is_multisite') || !is_multisite()) { return false; } if (function_exists('get_sites')) { return get_sites($args); } else { $result = array(); $blogs = wp_get_sites($args); foreach ($blogs as $blog) { $result[] = (object) $blog; } return $result; } } /** * return the list of possible dropins plugins * * @return [string] */ public static function getDropinsPluginsNames() { return array( 'advanced-cache.php', // WP_CACHE 'db.php', // auto on load 'db-error.php', // auto on error 'install.php', // auto on installation 'maintenance.php', // auto on maintenance 'object-cache.php', // auto on load 'php-error.php', // auto on error 'fatal-error-handler.php', // auto on error 'sunrise.php', 'blog-deleted.php', 'blog-inactive.php', 'blog-suspended.php' ); } } }