-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathws_server.php
More file actions
65 lines (42 loc) · 749 Bytes
/
ws_server.php
File metadata and controls
65 lines (42 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
set_include_path(realpath(dirname(__FILE__) . '/inc'));
/**
* Service class for example REST server
*
* @author jfaustin
*
*/
class MyService
{
/**
* returns an uppercase string
* @param string $string
* @return string;
*/
public function toUpper($string)
{
return strtoupper($string);
}
/**
* returns a lowercase string
* @param string $string
* @return string
*/
public function toLower($string)
{
return strtolower($string);
}
/**
* Makes a string awesome
*
* @param string $string
*/
public function encode($string)
{
return md5($string);
}
}
require_once 'Zend/Rest/Server.php';
$server = new Zend_Rest_Server();
$server->setClass('MyService');
$server->handle();