@@ -58,22 +58,54 @@ private function _getUser($args)
58
58
59
59
/**
60
60
* Get the server version
61
- * @return Server version
61
+ * @return Server version in the form <major>.<minor>.<patch>
62
62
*/
63
63
public function version ($ args )
64
64
{
65
- $ data ['version ' ] = Zend_Registry::get ('configDatabase ' )->version ;
65
+ return array ('version ' => Zend_Registry::get ('configDatabase ' )->version );
66
+ }
67
+
68
+ /**
69
+ * Get the enabled modules on the server
70
+ * @return List of enabled modules on the server
71
+ */
72
+ public function modulesList ($ args )
73
+ {
74
+ return array ('modules ' => array_keys (Zend_Registry::get ('configsModules ' )));
75
+ }
76
+
77
+ /**
78
+ * List all available web api methods on the server
79
+ * @return List of api method names and their corresponding documentation
80
+ */
81
+ public function methodsList ($ args )
82
+ {
83
+ $ data = array ();
84
+ $ data ['methods ' ] = array ();
85
+
86
+ $ apiMethods = Zend_Registry::get ('notifier ' )->callback ('CALLBACK_API_HELP ' , array ());
87
+ foreach ($ apiMethods as $ module => $ methods )
88
+ {
89
+ foreach ($ methods as $ method )
90
+ {
91
+ $ apiMethodName = $ module != 'api ' ? $ module .'. ' : '' ;
92
+ $ apiMethodName .= $ method ['name ' ];
93
+ $ data ['methods ' ][] = array ('name ' => $ apiMethodName , 'help ' => $ method ['help ' ]);
94
+ }
95
+ }
66
96
return $ data ;
67
97
}
68
98
69
99
/**
70
- * Get the server information
100
+ * Get the server information including version, modules enabled,
101
+ and available web api methods (names do not include the global prefix)
71
102
* @return Server information
72
103
*/
73
104
public function info ($ args )
74
105
{
75
- $ data ['version ' ] = Zend_Registry::get ('configDatabase ' )->version ;
76
- return $ data ;
106
+ return array_merge ($ this ->version ($ args ),
107
+ $ this ->modulesList ($ args ),
108
+ $ this ->methodsList ($ args ));
77
109
}
78
110
79
111
/**
0 commit comments