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