Line | |
---|
1 | <?php |
---|
2 | defined('SKELETON_PATH') or die('Hacking attempt!'); |
---|
3 | |
---|
4 | function skeleton_ws_add_methods($arr) |
---|
5 | { |
---|
6 | $service = &$arr[0]; |
---|
7 | |
---|
8 | $service->addMethod( |
---|
9 | 'pwg.PHPinfo', |
---|
10 | 'ws_php_info', |
---|
11 | array( |
---|
12 | 'what' => array('default'=>'INFO_ALL', 'info'=>'This parameter has a default value'), |
---|
13 | 'ids' => array('flags'=>WS_PARAM_FORCE_ARRAY, 'info'=>'This one must be an array'), |
---|
14 | ), |
---|
15 | 'Returns phpinfo (don\'t use XML request format)', |
---|
16 | null, |
---|
17 | array('hidden' => false) // you can hide your method from reflection.getMethodList method |
---|
18 | ); |
---|
19 | } |
---|
20 | |
---|
21 | function ws_php_info($params, &$service) |
---|
22 | { |
---|
23 | if (!is_admin()) |
---|
24 | { |
---|
25 | return new PwgError(403, 'Forbidden'); |
---|
26 | } |
---|
27 | |
---|
28 | return phpinfo(constant($params['what'])); |
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.