Example #1
0
 if (count($sortedfiles) > 0) {
     echo "<div style='margin-bottom:10px; margin-top:-20px;'>(most recent are displayed first)</div>";
     //print_r($files);
     echo "<table border='1' style='min-width:400px; text-align:center'>";
     echo "<tr><th> filename </th><th> created </th><th> size </th><th> nr of lines </th><th> extract entities?</th><th> delete file?</th></tr>";
     foreach ($sortedfiles as $counterr => $filedata) {
         $logfilename = $filedata["name"];
         $timestamp = $filedata["time"];
         $fPathh = $filedata["path"];
         echo "<tr>";
         echo "<td  style='color:#6699FF'><a href='{$fPathh}'>" . $logfilename . "</a";
         echo "</td>";
         echo "<td>" . date('m/d/Y H:i:s', $timestamp);
         echo "</td>";
         echo "<td style='text-align:right'>" . $filedata["size"] . "</td>";
         echo "<td style='text-align:right'>" . getNrOfLines($fPathh) . "</td>";
         echo "<td>";
         echo "<form class='extr_form' action='../rdfgenerator/' method='post'><input type='hidden'  name='logfile' value='" . $logFilesDir . $logfilename . "' />";
         if (count($kiiis) > 0) {
             if (in_array($logfilename, $kiiis)) {
                 echo "<span class='done'>DONE</span>";
                 echo "<input type='submit'  value='Yes, do again.' name='start_get_entities'/></form>";
             } else {
                 echo "<input type='submit'  value='Yes, extract.' name='start_get_entities'/></form>";
             }
         } else {
             echo "<input type='submit'  value='Yes, extract.' name='start_get_entities'/></form>";
         }
         echo "</td>";
         echo "<td>";
         if ($logfilename != "crawl.log") {
Example #2
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once 'fileNames.php';
if (isset($_GET["id"]) && isset($_GET["filename"])) {
    $file = $logFilesDir . $_GET["filename"];
    $fid = $_GET["id"];
    $nrl = getNrOfLines($file);
    $farr = array($fid => $nrl);
    echo json_encode($farr);
}
function getNrOfLines($file)
{
    $f = fopen($file, 'rb');
    $lines = 0;
    while (!feof($f)) {
        $lines += substr_count(fread($f, 8192), "\n");
    }
    fclose($f);
    return $lines;
}