source: extensions/skeleton/include/ws_functions.inc.php @ 19628

Last change on this file since 19628 was 17933, checked in by mistic100, 12 years ago

example of new API method

File size: 486 bytes
Line 
1<?php
2defined('SKELETON_PATH') or die('Hacking attempt!');
3
4function 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
18function 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.