Exemple #1
0
 public function search()
 {
     require_once 'src/Fetcher.php';
     require_once 'src/Decoder.php';
     $q = null;
     $results = [];
     if (isset($_GET['q'])) {
         $q = $_GET['q'];
         $fetcher = new Fetcher();
         if ($text = $fetcher->search($q)) {
             $decoder = new Decoder();
             $results = $decoder->decode($text);
         }
     }
     include_once 'html/index.html';
 }