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'), |
---|
13 | ), |
---|
14 | 'Returns phpinfo (don\'t use XML request format)' |
---|
15 | ); |
---|
16 | } |
---|
17 | |
---|
18 | function ws_php_info($params, &$service) |
---|
19 | { |
---|
20 | if (!is_admin()) |
---|
21 | { |
---|
22 | return new PwgError(403, 'Forbidden'); |
---|
23 | } |
---|
24 | |
---|
25 | return phpinfo(constant($params['what'])); |
---|
26 | } |
---|
27 | |
---|
28 | |
---|
29 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.