private function findExtensions(&$extensions, $name)
    {
        $extension = $this->getExtension($name);

        // Put deps first
        foreach ((array)$extension->getDependency() as $dep) {
            if (!isset($extensions[$dep])) {
                $this->findExtensions($extensions, $dep);
            }
        }

        $extensions[$name] = $extension;
    }