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