base.php 830 B

123456789101112131415161718192021222324
  1. <?php
  2. abstract class oracle {
  3. // some info to spit out alongside the result, so the user knows
  4. // what exactly is giving out the answer. prevents confusion
  5. // about what oracle is answering them for ambiguous queries.
  6. public $info = [
  7. "name" => "some oracle"
  8. ];
  9. // this function should take in a query string search from $_GET,
  10. // and return a bool determining whether or not it is a question
  11. // intended for the oracle.
  12. public function check_query($q) {
  13. return false;
  14. }
  15. // produce the correct answer for the query using the oracle.
  16. // note: if it becomes apparent /during generation/ that the
  17. // query is not in fact for the oracle, returning an empty
  18. // string will kill the oracle pane.
  19. // answer format: ["ans1 title" => "ans1", ...]
  20. public function generate_response($q) {
  21. return "";
  22. }
  23. }
  24. ?>