Hi,

In a personal project, I use the ezcConfigurationManager class. In
this project, I need to retrieve the list of available groups in a
configuration file. ezcConfiguration class has a getGroupNames()
method unfortunately, this method is not exposed in the manager. The
attached patch (generated against a github clone) adds the method
ezcConfigurationManager::getGroupNames().

I don't know if it's the right method to provide such an enhancement,
if I'm wrong let me know :-)

Cheers
--
Damien Pobel <dam...@pobel.fr>
http://pwet.fr
diff --git a/Configuration/src/configuration_manager.php b/Configuration/src/configuration_manager.php
index 0eab218..9f72c4a 100644
--- a/Configuration/src/configuration_manager.php
+++ b/Configuration/src/configuration_manager.php
@@ -557,5 +557,22 @@ class ezcConfigurationManager
         $reader = $this->fetchReader( $name );
         return $reader->configExists();
     }
+
+    /**
+     * Returns the names of all the groups as an array
+     *
+     * @throws ezcConfigurationUnknownConfigException if the configuration
+     *         $name does not exist.
+     * @throws ezcConfigurationManagerNotInitializedException
+     *         if the manager has not been initialized with the init() method.
+     *
+     * @param string $name
+     * @return array
+     */
+    public function getGroupNames( $name )
+    {
+        $config = $this->fetchConfig( $name );
+        return $config->getGroupNames();
+    }
 }
 ?>

Reply via email to