Exemplo n.º 1
0
Arquivo: App.php Projeto: ddliu/airdoc
 public function run()
 {
     $this->auth();
     list($root, $path) = Util::getUrlInfo();
     if ($this->ignore($path)) {
         return $this->notFound();
     }
     $currentInfo = $this->fs->search($path, 1);
     if (!$currentInfo) {
         return $this->notFound();
     }
     $currentInfo = $currentInfo[0];
     if ($currentInfo->isDir()) {
         $this->handleDir($path, $currentInfo);
     } elseif ($currentInfo->isFile()) {
         if (MimeType::isMarkdown($currentInfo->getFilename())) {
             $this->handleMarkdown($path, $currentInfo);
         } else {
             $this->handleStatic($path, $currentInfo);
         }
     } else {
         $this->notFound();
     }
 }