/**
  *
  */
 public function fetch()
 {
     $this->urlsDone = array();
     if ($this->logFile) {
         File::delete($this->logFile);
         File::create($this->logFile);
         File::append($this->logFile, Encoding::BOM());
     }
     $this->log("url", "title", "description", "date");
     while ($running = $this->next()) {
     }
 }
Beispiel #2
0
 public function output($pFolder)
 {
     Folder::deleteRecursive($pFolder);
     Folder::create($pFolder);
     Folder::create($pFolder . '/classes');
     $smarty = new \Smarty();
     $smarty->clear_all_assign();
     $smartyDir = "includes/libs/core/tools/docs/templates/_cache/";
     $smarty->template_dir = "includes/libs/core/tools/docs/templates";
     $smarty->cache_dir = $smartyDir;
     $smarty->compile_dir = $smartyDir;
     $classIndex = array();
     foreach ($this->packages as $className => $details) {
         $parts = explode("\\", $className);
         $class = array_pop($parts);
         while (in_array($class, $classIndex) && !empty($parts)) {
             $class = $class . '\\' . array_pop($parts);
         }
         $file = 'classes/' . str_replace('\\', '_', $class) . '.html';
         $classIndex[] = array('name' => $class, 'href' => $file);
         $smarty->clear_all_assign();
         $details['name'] = $class;
         $smarty->assign('details', $details);
         file_put_contents($pFolder . $file, Encoding::BOM() . $smarty->fetch("template.class_details.tpl"));
     }
     $this->sortName($classIndex);
     $prefixed_ndx = array();
     foreach ($classIndex as $class) {
         $firstLetter = strtoupper(substr($class['name'], 0, 1));
         if (!array_key_exists($firstLetter, $prefixed_ndx)) {
             $prefixed_ndx[$firstLetter] = array();
         }
         $prefixed_ndx[$firstLetter][] = $class;
     }
     $classIndex = $prefixed_ndx;
     $smarty->clear_all_assign();
     $smarty->assign('classIndex', $classIndex);
     file_put_contents($pFolder . '/classes.html', Encoding::BOM() . $smarty->fetch("template.classes.tpl"));
     $smarty->clear_all_assign();
     file_put_contents($pFolder . '/index.html', Encoding::BOM() . $smarty->fetch("template.index.tpl"));
 }