Core_Command::get_wp_core_files PHP Method

get_wp_core_files() private method

private get_wp_core_files ( )
    private function get_wp_core_files()
    {
        $core_files = array();
        try {
            $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(ABSPATH, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST);
            foreach ($files as $file_info) {
                $pathname = substr($file_info->getPathname(), strlen(ABSPATH));
                if ($file_info->isFile() && (0 === strpos($pathname, 'wp-admin/') || 0 === strpos($pathname, 'wp-includes/'))) {
                    $core_files[] = str_replace(ABSPATH, '', $file_info->getPathname());
                }
            }
        } catch (Exception $e) {
            WP_CLI::error($e->getMessage());
        }
        return $core_files;
    }