| 1 |
lars |
1 |
--TEST--
|
|
|
2 |
Bug #11314: Following codesniffer standards param docs mess up
|
|
|
3 |
--FILE--
|
|
|
4 |
<?php
|
|
|
5 |
set_include_path(realpath(dirname(__FILE__) . '/../../../') . PATH_SEPARATOR . get_include_path());
|
|
|
6 |
/**
|
|
|
7 |
* Point to a problem with the autodocumentation of servers which follows the specifications
|
|
|
8 |
* in PHPCodeSniffer.
|
|
|
9 |
*
|
|
|
10 |
* PHP version 5
|
|
|
11 |
*
|
|
|
12 |
* @category XML
|
|
|
13 |
* @package XML_RPC2
|
|
|
14 |
* @author Lars Olesen <lars@legestue.net>
|
|
|
15 |
|
|
|
16 |
* @copyright 2007 Lars Olesen
|
|
|
17 |
* @license GPL http://www.opensource.org/licenses/gpl-license.php
|
|
|
18 |
* @version @package-version@
|
|
|
19 |
* @link http://pear.php.net/package/XML_RPC2
|
|
|
20 |
*/
|
|
|
21 |
require_once 'XML/RPC2/Server.php';
|
|
|
22 |
|
|
|
23 |
/**
|
|
|
24 |
* The implementation
|
|
|
25 |
*
|
|
|
26 |
* @category XML
|
|
|
27 |
* @package XML_RPC2
|
|
|
28 |
* @author Lars Olesen <lars@legestue.net>
|
|
|
29 |
* @copyright 2007 Lars Olesen
|
|
|
30 |
* @license GPL http://www.opensource.org/licenses/gpl-license.php
|
|
|
31 |
* @version @package-version@
|
|
|
32 |
* @link http://pear.php.net/package/XML_RPC2
|
|
|
33 |
*/
|
|
|
34 |
class DocumentationServer {
|
|
|
35 |
|
|
|
36 |
/**
|
|
|
37 |
* returns something
|
|
|
38 |
*
|
|
|
39 |
* @param array $something A description
|
|
|
40 |
* @param string $another_thing A description of another thing
|
|
|
41 |
* @param boolean $return Whether to return nothing - server doesn't care though
|
|
|
42 |
*
|
|
|
43 |
* @return string An international string
|
|
|
44 |
*/
|
|
|
45 |
public static function getSomething($something, $another_thing, $credentials) {
|
|
|
46 |
return 'nothing interesting';
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
$options = array(
|
|
|
52 |
'prefix' => 'test.',
|
|
|
53 |
'encoding' => 'ISO-8859-1'
|
|
|
54 |
);
|
|
|
55 |
|
|
|
56 |
$server = XML_RPC2_Server::create('DocumentationServer', $options);
|
|
|
57 |
$GLOBALS['HTTP_RAW_POST_DATA'] = '';
|
|
|
58 |
$server->handleCall();
|
|
|
59 |
?>
|
|
|
60 |
--EXPECT--
|
|
|
61 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
62 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
|
|
63 |
<head>
|
|
|
64 |
<meta http-equiv="Content-Type" content="text/HTML; charset=ISO-8859-1" />
|
|
|
65 |
<title>Available XMLRPC methods for this server</title>
|
|
|
66 |
<style type="text/css">
|
|
|
67 |
li,p { font-size: 10pt; font-family: Arial,Helvetia,sans-serif; }
|
|
|
68 |
a:link { background-color: white; color: blue; text-decoration: underline; font-weight: bold; }
|
|
|
69 |
a:visited { background-color: white; color: blue; text-decoration: underline; font-weight: bold; }
|
|
|
70 |
table { border-collapse:collapse; width: 100% }
|
|
|
71 |
table,td { padding: 5px; border: 1px solid black; }
|
|
|
72 |
div.bloc { border: 1px dashed gray; padding: 10px; margin-bottom: 20px; }
|
|
|
73 |
div.description { border: 1px solid black; padding: 10px; }
|
|
|
74 |
span.type { background-color: white; color: gray; font-weight: normal; }
|
|
|
75 |
span.paratype { background-color: white; color: gray; font-weight: normal; }
|
|
|
76 |
span.name { background-color: white; color: #660000; }
|
|
|
77 |
span.paraname { background-color: white; color: #336600; }
|
|
|
78 |
img { border: 0px; }
|
|
|
79 |
li { font-size: 12pt; }
|
|
|
80 |
</style>
|
|
|
81 |
</head>
|
|
|
82 |
<body>
|
|
|
83 |
<h1>Available XMLRPC methods for this server</h1>
|
|
|
84 |
<h2><a name="index">Index</a></h2>
|
|
|
85 |
<ul>
|
|
|
86 |
<li><a href="#2d6b7f96be69b46a6523f48b4a288864">test.getSomething()</a></li>
|
|
|
87 |
</ul>
|
|
|
88 |
<h2>Details</h2>
|
|
|
89 |
<div class="bloc">
|
|
|
90 |
<h3><a name="2d6b7f96be69b46a6523f48b4a288864"><span class="type">(string)</span> <span class="name">test.getSomething</span><span class="other">(</span><span class="paratype">(array) </span><span class="paraname">something</span>, <span class="paratype">(string) </span><span class="paraname">another_thing</span>, <span class="paratype">(boolean) </span><span class="paraname">credentials</span><span class="other">)</span></a></h3>
|
|
|
91 |
<p><b>Description :</b></p>
|
|
|
92 |
<div class="description">
|
|
|
93 |
returns something
|
|
|
94 |
</div>
|
|
|
95 |
<p><b>Parameters : </b></p>
|
|
|
96 |
<table>
|
|
|
97 |
<tr><td><b>Type</b></td><td><b>Name</b></td><td><b>Documentation</b></td></tr>
|
|
|
98 |
<tr><td>array</td><td>something</td><td>A description</td></tr>
|
|
|
99 |
<tr><td>string</td><td>another_thing</td><td>A description of another thing</td></tr>
|
|
|
100 |
<tr><td>boolean</td><td>credentials</td><td>Whether to return nothing - server doesn't care though</td></tr>
|
|
|
101 |
</table>
|
|
|
102 |
<p>(return to <a href="#index">index</a>)</p>
|
|
|
103 |
</div>
|
|
|
104 |
</body>
|
|
|
105 |
</html>
|