Exemple #1
0
 /**
  * Gets the description, count of summaries, and number of partitions of the
  * summaries store in the supplied directory. If the file
  * arc_description.txt exists, this is viewed as a dummy index archive for
  * the sole purpose of allowing conversions of downloaded data such as arc
  * files into Yioop! format.
  *
  * @param string $dir_name path to a directory containing a summaries
  *      WebArchiveBundle
  * @return array summary of the given archive
  */
 static function getArchiveInfo($dir_name)
 {
     if (file_exists($dir_name . "/arc_description.txt")) {
         $crawl = array();
         $info = array();
         $crawl['DESCRIPTION'] = substr(file_get_contents($dir_name . "/arc_description.txt"), 0, 256);
         $crawl['ARCFILE'] = true;
         $info['VISITED_URLS_COUNT'] = 0;
         $info['COUNT'] = 0;
         $info['NUM_DOCS_PER_PARTITION'] = 0;
         $info['WRITE_PARTITION'] = 0;
         $info['DESCRIPTION'] = serialize($crawl);
         return $info;
     }
     return WebArchiveBundle::getArchiveInfo($dir_name . "/summaries");
 }