forked from TeamCodefire/CFBalancerPHP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructure.xml
More file actions
256 lines (256 loc) · 12.9 KB
/
Copy pathstructure.xml
File metadata and controls
256 lines (256 loc) · 12.9 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?xml version="1.0" encoding="utf-8"?>
<project version="2.0.0a10" title="">
<file path="CFBalancePHP.php" hash="8a22c25c35759fdb24af41716e06768a" package="Default">
<class final="false" abstract="false" namespace="CFBalancerPHP" line="3" package="Default">
<extends/>
<name>CFBalancerPHP</name>
<full_name>\CFBalancerPHP\CFBalancerPHP</full_name>
<constant namespace="CFBalancerPHP" line="14" package="Default">
<name>WEBSERVICE_HOST</name>
<full_name>WEBSERVICE_HOST</full_name>
<value><![CDATA["localhost"]]></value>
<docblock line="10">
<description><![CDATA[Webservice daemon hostname.]]></description>
<long-description><![CDATA[<p>This should be localhost under most cases. Running the service on a remove machine will
skew the results and cause the load calculation to fail.</p>]]></long-description>
</docblock>
</constant>
<constant namespace="CFBalancerPHP" line="19" package="Default">
<name>WEBSERVICE_PORT</name>
<full_name>WEBSERVICE_PORT</full_name>
<value><![CDATA[44444]]></value>
<docblock line="16">
<description><![CDATA[Webservice daemon port
Change this to the port that you are running the service on]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</constant>
<constant namespace="CFBalancerPHP" line="36" package="Default">
<name>WEBSERVICE_TIMEOUT</name>
<full_name>WEBSERVICE_TIMEOUT</full_name>
<value><![CDATA[1]]></value>
<docblock line="34">
<description><![CDATA[Stores timeout for the webservice in seconds]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</constant>
<constant namespace="CFBalancerPHP" line="40" package="Default">
<name>WEBSERVICE_API_EXPIRE</name>
<full_name>WEBSERVICE_API_EXPIRE</full_name>
<value><![CDATA[0]]></value>
<docblock line="38">
<description><![CDATA[Stores which array index contains the time since last check-in]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</constant>
<constant namespace="CFBalancerPHP" line="44" package="Default">
<name>WEBSERVICE_API_CNAME</name>
<full_name>WEBSERVICE_API_CNAME</full_name>
<value><![CDATA[1]]></value>
<docblock line="42">
<description><![CDATA[Stores which array index contains the host cname]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</constant>
<constant namespace="CFBalancerPHP" line="48" package="Default">
<name>WEBSERVICE_API_CPULOAD</name>
<full_name>WEBSERVICE_API_CPULOAD</full_name>
<value><![CDATA[2]]></value>
<docblock line="46">
<description><![CDATA[Stores which array index contains the cpu load]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</constant>
<constant namespace="CFBalancerPHP" line="52" package="Default">
<name>WEBSERVICE_API_NETLOAD</name>
<full_name>WEBSERVICE_API_NETLOAD</full_name>
<value><![CDATA[3]]></value>
<docblock line="50">
<description><![CDATA[Stores which array index contains the net load]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</constant>
<constant namespace="CFBalancerPHP" line="56" package="Default">
<name>WEBSERVICE_API_LOCALHOST_REF</name>
<full_name>WEBSERVICE_API_LOCALHOST_REF</full_name>
<value><![CDATA[4]]></value>
<docblock line="54">
<description><![CDATA[Stores which elements contains localhost signifier]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</constant>
<property final="false" static="false" visibility="private" line="65" namespace="CFBalancerPHP" package="Default">
<name>$debugLog</name>
<default><![CDATA[]]></default>
<docblock line="63">
<description><![CDATA[Stores the rolling debug log for timing purposes]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</property>
<property final="false" static="false" visibility="private" line="69" namespace="CFBalancerPHP" package="Default">
<name>$dead</name>
<default><![CDATA[]]></default>
<docblock line="67">
<description><![CDATA[Emergency variable.]]></description>
<long-description><![CDATA[<p>True if this function is defunct and should not be used.</p>]]></long-description>
</docblock>
</property>
<property final="false" static="false" visibility="private" line="73" namespace="CFBalancerPHP" package="Default">
<name>$timer</name>
<default><![CDATA[]]></default>
<docblock line="71">
<description><![CDATA[For performance-tracking]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</property>
<property final="false" static="false" visibility="private" line="77" namespace="CFBalancerPHP" package="Default">
<name>$localhost</name>
<default><![CDATA[]]></default>
<docblock line="75">
<description><![CDATA[Stores the local node performance counters]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</property>
<method final="false" abstract="false" static="false" visibility="public" namespace="CFBalancerPHP" line="85" package="Default">
<name>__construct</name>
<full_name>__construct</full_name>
<docblock line="83">
<description><![CDATA[This initializes the CFBalancerPHP class.]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</method>
<method final="false" abstract="false" static="false" visibility="public" namespace="CFBalancerPHP" line="93" package="Default">
<name>getNodeList</name>
<full_name>getNodeList</full_name>
<docblock line="90">
<description><![CDATA[Returns an array of each server in the CFBalancer pool.]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="90" name="return" description="contains the server's internal IP, it's public CNAME, it's CPU load average, and it's current outgoing network rate." type="string">
<type by_reference="false">string</type>
</tag>
</docblock>
</method>
<method final="false" abstract="false" static="false" visibility="private" namespace="CFBalancerPHP" line="126" package="Default">
<name>getArray</name>
<full_name>getArray</full_name>
<docblock line="120">
<description><![CDATA[Allows us to access data returned as an array from a function.]]></description>
<long-description><![CDATA[<p>This is a workaround for php5.3 limitation</p>]]></long-description>
<tag line="120" name="param" description="The array to operate on" type="array" variable="$array">
<type by_reference="false">array</type>
</tag>
<tag line="120" name="param" description="The key to return from $array" type="string" variable="$key">
<type by_reference="false">string</type>
</tag>
<tag line="120" name="return" description="value of $array at $key" type="string">
<type by_reference="false">string</type>
</tag>
</docblock>
<argument line="126">
<name>$array</name>
<default><![CDATA[]]></default>
<type>array</type>
</argument>
<argument line="126">
<name>$key</name>
<default><![CDATA[]]></default>
<type/>
</argument>
</method>
<method final="false" abstract="false" static="false" visibility="private" namespace="CFBalancerPHP" line="134" package="Default">
<name>processNodeList</name>
<full_name>processNodeList</full_name>
<docblock line="130">
<description><![CDATA[Processes the raw nodelist, into an array]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="130" name="param" description="The raw node list in text form" type="string" variable="$raw">
<type by_reference="false">string</type>
</tag>
<tag line="130" name="return" description="Array of nodes other than localhost" type="array">
<type by_reference="false">array</type>
</tag>
</docblock>
<argument line="134">
<name>$raw</name>
<default><![CDATA[]]></default>
<type/>
</argument>
</method>
<method final="false" abstract="false" static="false" visibility="public" namespace="CFBalancerPHP" line="167" package="Default">
<name>checkAndRedirect</name>
<full_name>checkAndRedirect</full_name>
<docblock line="163">
<description><![CDATA[Checks the pool of servers, determines the most available node, and redirects the client to the new node.]]></description>
<long-description><![CDATA[<p>Uses a "Location:" header to accomplish the transfer.</p>]]></long-description>
<tag line="163" name="param" description="The URL to append to the CNAME to redirect to." type="string" variable="$postfix">
<type by_reference="false">string</type>
</tag>
</docblock>
<argument line="167">
<name>$postfix</name>
<default><![CDATA[]]></default>
<type/>
</argument>
</method>
<method final="false" abstract="false" static="false" visibility="public" namespace="CFBalancerPHP" line="179" package="Default">
<name>getRedirectNode</name>
<full_name>getRedirectNode</full_name>
<docblock line="176">
<description><![CDATA[Performs the comparison of servers in the pool to determine the most available node in the pool.]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="176" name="return" description="the CNAME of the node that is most available" type="string">
<type by_reference="false">string</type>
</tag>
</docblock>
</method>
<method final="false" abstract="false" static="false" visibility="private" namespace="CFBalancerPHP" line="194" package="Default">
<name>openWebservice</name>
<full_name>openWebservice</full_name>
<docblock line="190">
<description><![CDATA[Connects to the webservice port that CFBalancer exposes on localhost.]]></description>
<long-description><![CDATA[<p>After connecting to the webservice port, it returns a handle (fp) to that connection.</p>]]></long-description>
<tag line="190" name="return" description="a handle to the now-open webservice" type="resource">
<type by_reference="false">resource</type>
</tag>
</docblock>
</method>
<method final="false" abstract="false" static="false" visibility="private" namespace="CFBalancerPHP" line="210" package="Default">
<name>debug</name>
<full_name>debug</full_name>
<docblock line="207">
<description><![CDATA[Saves debug text along with timing data to a buffer for recall with getDebug() later.]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="207" name="param" description="The text to write to the debug buffer" type="string" variable="$text">
<type by_reference="false">string</type>
</tag>
</docblock>
<argument line="210">
<name>$text</name>
<default><![CDATA[]]></default>
<type/>
</argument>
</method>
<method final="false" abstract="false" static="false" visibility="public" namespace="CFBalancerPHP" line="220" package="Default">
<name>debugPrint</name>
<full_name>debugPrint</full_name>
<docblock line="218">
<description><![CDATA[Prints the debugging buffer.]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</method>
</class>
<markers>
<fixme line="135">need to add error handing for null NodeList</fixme>
<fixme line="184">still need to break up the nodes array into variables to calculate our values to do our math.</fixme>
</markers>
<parse_markers>
<error line="0" code="50007">No page-level DocBlock was found in file CFBalancePHP.php</error>
<error line="3" code="50000">No DocBlock was found for \CFBalancerPHP\CFBalancerPHP</error>
</parse_markers>
</file>
<package name="Default" full_name="Default"/>
<namespace name="CFBalancerPHP" full_name="CFBalancerPHP"/>
<marker count="0">todo</marker>
<marker count="2">fixme</marker>
<deprecated count="0"/>
</project>