public function compileManifest(array $directories)
    {
        $manifest = [];

        foreach ($directories as $directory) {
            // Find the root file of each plugin.
            // As we load the plugins from the mu-plugins directory
            // we do not need to get their header. Only the file
            // that defines them.
            if ($payload = $this->getPlugin($directory)) {
                $manifest[$directory] = $payload;
            }
        }

        return $this->writeManifest($manifest);
    }