CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

MysqlSystemVariables.php
Go to the documentation of this file.
1 <?PHP
2
6 class MysqlSystemVariables
7 {
8
13 public function __construct(Database $DB)
14 {
15 $DB->Query("SHOW VARIABLES");
16 while (FALSE !== ($Row = $DB->FetchRow()))
17 {
18 $this->Variables[$Row["Variable_name"]] = $Row["Value"];
19 }
20 }
21
27 public function Get($Variable)
28 {
29 return (isset($this->Variables[$Variable]))
30 ? $this->Variables[$Variable] : NULL;
31 }
32
38 public function GetStopWords()
39 {
40 # default stop word list for MySQL 5
41 static $DefaultList = array(
42 "a's",
43 "able",
44 "about",
45 "above",
46 "according",
47 "accordingly",
48 "across",
49 "actually",
50 "after",
51 "afterwards",
52 "again",
53 "against",
54 "ain't",
55 "all",
56 "allow",
57 "allows",
58 "almost",
59 "alone",
60 "along",
61 "already",
62 "also",
63 "although",
64 "always",
65 "am",
66 "among",
67 "amongst",
68 "an",
69 "and",
70 "another",
71 "any",
72 "anybody",
73 "anyhow",
74 "anyone",
75 "anything",
76 "anyway",
77 "anyways",
78 "anywhere",
79 "apart",
80 "appear",
81 "appreciate",
82 "appropriate",
83 "are",
84 "aren't",
85 "around",
86 "as",
87 "aside",
88 "ask",
89 "asking",
90 "associated",
91 "at",
92 "available",
93 "away",
94 "awfully",
95 "be",
96 "became",
97 "because",
98 "become",
99 "becomes",
100 "becoming",
101 "been",
102 "before",
103 "beforehand",
104 "behind",
105 "being",
106 "believe",
107 "below",
108 "beside",
109 "besides",
110 "best",
111 "better",
112 "between",
113 "beyond",
114 "both",
115 "brief",
116 "but",
117 "by",
118 "c'mon",
119 "c's",
120 "came",
121 "can",
122 "can't",
123 "cannot",
124 "cant",
125 "cause",
126 "causes",
127 "certain",
128 "certainly",
129 "changes",
130 "clearly",
131 "co",
132 "com",
133 "come",
134 "comes",
135 "concerning",
136 "consequently",
137 "consider",
138 "considering",
139 "contain",
140 "containing",
141 "contains",
142 "corresponding",
143 "could",
144 "couldn't",
145 "course",
146 "currently",
147 "definitely",
148 "described",
149 "despite",
150 "did",
151 "didn't",
152 "different",
153 "do",
154 "does",
155 "doesn't",
156 "doing",
157 "don't",
158 "done",
159 "down",
160 "downwards",
161 "during",
162 "each",
163 "edu",
164 "eg",
165 "eight",
166 "either",
167 "else",
168 "elsewhere",
169 "enough",
170 "entirely",
171 "especially",
172 "et",
173 "etc",
174 "even",
175 "ever",
176 "every",
177 "everybody",
178 "everyone",
179 "everything",
180 "everywhere",
181 "ex",
182 "exactly",
183 "example",
184 "except",
185 "far",
186 "few",
187 "fifth",
188 "first",
189 "five",
190 "followed",
191 "following",
192 "follows",
193 "for",
194 "former",
195 "formerly",
196 "forth",
197 "four",
198 "from",
199 "further",
200 "furthermore",
201 "get",
202 "gets",
203 "getting",
204 "given",
205 "gives",
206 "go",
207 "goes",
208 "going",
209 "gone",
210 "got",
211 "gotten",
212 "greetings",
213 "had",
214 "hadn't",
215 "happens",
216 "hardly",
217 "has",
218 "hasn't",
219 "have",
220 "haven't",
221 "having",
222 "he",
223 "he's",
224 "hello",
225 "help",
226 "hence",
227 "her",
228 "here",
229 "here's",
230 "hereafter",
231 "hereby",
232 "herein",
233 "hereupon",
234 "hers",
235 "herself",
236 "hi",
237 "him",
238 "himself",
239 "his",
240 "hither",
241 "hopefully",
242 "how",
243 "howbeit",
244 "however",
245 "i'd",
246 "i'll",
247 "i'm",
248 "i've",
249 "ie",
250 "if",
251 "ignored",
252 "immediate",
253 "in",
254 "inasmuch",
255 "inc",
256 "indeed",
257 "indicate",
258 "indicated",
259 "indicates",
260 "inner",
261 "insofar",
262 "instead",
263 "into",
264 "inward",
265 "is",
266 "isn't",
267 "it",
268 "it'd",
269 "it'll",
270 "it's",
271 "its",
272 "itself",
273 "just",
274 "keep",
275 "keeps",
276 "kept",
277 "know",
278 "knows",
279 "known",
280 "last",
281 "lately",
282 "later",
283 "latter",
284 "latterly",
285 "least",
286 "less",
287 "lest",
288 "let",
289 "let's",
290 "like",
291 "liked",
292 "likely",
293 "little",
294 "look",
295 "looking",
296 "looks",
297 "ltd",
298 "mainly",
299 "many",
300 "may",
301 "maybe",
302 "me",
303 "mean",
304 "meanwhile",
305 "merely",
306 "might",
307 "more",
308 "moreover",
309 "most",
310 "mostly",
311 "much",
312 "must",
313 "my",
314 "myself",
315 "name",
316 "namely",
317 "nd",
318 "near",
319 "nearly",
320 "necessary",
321 "need",
322 "needs",
323 "neither",
324 "never",
325 "nevertheless",
326 "new",
327 "next",
328 "nine",
329 "no",
330 "nobody",
331 "non",
332 "none",
333 "noone",
334 "nor",
335 "normally",
336 "not",
337 "nothing",
338 "novel",
339 "now",
340 "nowhere",
341 "obviously",
342 "of",
343 "off",
344 "often",
345 "oh",
346 "ok",
347 "okay",
348 "old",
349 "on",
350 "once",
351 "one",
352 "ones",
353 "only",
354 "onto",
355 "or",
356 "other",
357 "others",
358 "otherwise",
359 "ought",
360 "our",
361 "ours",
362 "ourselves",
363 "out",
364 "outside",
365 "over",
366 "overall",
367 "own",
368 "particular",
369 "particularly",
370 "per",
371 "perhaps",
372 "placed",
373 "please",
374 "plus",
375 "possible",
376 "presumably",
377 "probably",
378 "provides",
379 "que",
380 "quite",
381 "qv",
382 "rather",
383 "rd",
384 "re",
385 "really",
386 "reasonably",
387 "regarding",
388 "regardless",
389 "regards",
390 "relatively",
391 "respectively",
392 "right",
393 "said",
394 "same",
395 "saw",
396 "say",
397 "saying",
398 "says",
399 "second",
400 "secondly",
401 "see",
402 "seeing",
403 "seem",
404 "seemed",
405 "seeming",
406 "seems",
407 "seen",
408 "self",
409 "selves",
410 "sensible",
411 "sent",
412 "serious",
413 "seriously",
414 "seven",
415 "several",
416 "shall",
417 "she",
418 "should",
419 "shouldn't",
420 "since",
421 "six",
422 "so",
423 "some",
424 "somebody",
425 "somehow",
426 "someone",
427 "something",
428 "sometime",
429 "sometimes",
430 "somewhat",
431 "somewhere",
432 "soon",
433 "sorry",
434 "specified",
435 "specify",
436 "specifying",
437 "still",
438 "sub",
439 "such",
440 "sup",
441 "sure",
442 "t's",
443 "take",
444 "taken",
445 "tell",
446 "tends",
447 "th",
448 "than",
449 "thank",
450 "thanks",
451 "thanx",
452 "that",
453 "that's",
454 "thats",
455 "the",
456 "their",
457 "theirs",
458 "them",
459 "themselves",
460 "then",
461 "thence",
462 "there",
463 "there's",
464 "thereafter",
465 "thereby",
466 "therefore",
467 "therein",
468 "theres",
469 "thereupon",
470 "these",
471 "they",
472 "they'd",
473 "they'll",
474 "they're",
475 "they've",
476 "think",
477 "third",
478 "this",
479 "thorough",
480 "thoroughly",
481 "those",
482 "though",
483 "three",
484 "through",
485 "throughout",
486 "thru",
487 "thus",
488 "to",
489 "together",
490 "too",
491 "took",
492 "toward",
493 "towards",
494 "tried",
495 "tries",
496 "truly",
497 "try",
498 "trying",
499 "twice",
500 "two",
501 "un",
502 "under",
503 "unfortunately",
504 "unless",
505 "unlikely",
506 "until",
507 "unto",
508 "up",
509 "upon",
510 "us",
511 "use",
512 "used",
513 "useful",
514 "uses",
515 "using",
516 "usually",
517 "value",
518 "various",
519 "very",
520 "via",
521 "viz",
522 "vs",
523 "want",
524 "wants",
525 "was",
526 "wasn't",
527 "way",
528 "we",
529 "we'd",
530 "we'll",
531 "we're",
532 "we've",
533 "welcome",
534 "well",
535 "went",
536 "were",
537 "weren't",
538 "what",
539 "what's",
540 "whatever",
541 "when",
542 "whence",
543 "whenever",
544 "where",
545 "where's",
546 "whereafter",
547 "whereas",
548 "whereby",
549 "wherein",
550 "whereupon",
551 "wherever",
552 "whether",
553 "which",
554 "while",
555 "whither",
556 "who",
557 "who's",
558 "whoever",
559 "whole",
560 "whom",
561 "whose",
562 "why",
563 "will",
564 "willing",
565 "wish",
566 "with",
567 "within",
568 "without",
569 "won't",
570 "wonder",
571 "would",
572 "would",
573 "wouldn't",
574 "yes",
575 "yet",
576 "you",
577 "you'd",
578 "you'll",
579 "you're",
580 "you've",
581 "your",
582 "yours",
583 "yourself",
584 "yourselves",
585 "zero");
586
587 # actual list
588 if (is_readable($this->Get("ft_stopword_file")))
589 {
590 static $ActualList;
591 if (!isset($ActualList))
592 {
593 $ActualList = explode("\n",
594 file_get_contents($this->Get("ft_stopword_file")));
595 }
596 return $ActualList;
597 }
598
599 # fall back to default list
600 else
601 {
602 return $DefaultList;
603 }
604 }
605
606 private $Variables;
607
608 }