Example #1
0
        printf("<td>%s</td>\n", count($childData['children']));
        printf("<td>%s</td>\n", getParentsList($childData));
        echo "</tr>\n";
    }
    echo "</table>\n";
    echo "</body>\n";
    echo "</html>\n";
}
if (!isset($_GET['file'])) {
    die('Please specifiy the file to analyze with the "file" parameter');
}
$meminfoFile = $_GET['file'];
if (!file_exists($meminfoFile)) {
    die("Unable to find {$meminfoFile}");
}
$data = json_decode(file_get_contents($meminfoFile), true);
if (null === $data) {
    printf('Invalid JSON format: %s.', json_last_error());
    die;
}
$header = $data['header'];
$itemsData = $data['items'];
$totalSize = getTotalSize($itemsData);
appendFullSize($itemsData);
appendParents($itemsData);
if (isset($_GET['item_id'])) {
    $itemId = $_GET['item_id'];
    showItemId($itemsData, $meminfoFile, $itemId);
} else {
    showTopConsumers($header, $itemsData, $meminfoFile, $totalSize);
}
Example #2
0
        list($Size) = $DB->next_record();
        $Cache->cache_value('ptpimg_sql_size', array($Size), 60);
        // 30 minutes
    }
    return $Size;
}
switch ($Action) {
    case 'random':
        // random
        $Count = getImageCount();
        // Grab image count
        $Rand = rand(1, $Count);
        $DB->query("SELECT Code, Type, Size FROM uploads LIMIT {$Rand}, 1");
        list($Code, $Type, $Size) = $DB->next_record();
        echo json_encode(array(array('code' => $Code, 'type' => $Type, 'size' => $Size)));
        break;
    case 'last5':
        // last5
        $DB->query("SELECT Code, Type, Size FROM uploads ORDER BY ID DESC LIMIT 5");
        $Data = array();
        while (list($Code, $Type, $Size) = $DB->next_record()) {
            $Data[] = array('code' => $Code, 'type' => $Type, 'size' => $Size);
        }
        echo json_encode(array($Data));
        break;
    case 'stats':
        // stats
        $Size = getTotalSize();
        $Count = getImageCount();
        echo json_encode(array(array('size' => $Size, 'count' => $Count)));
}
Example #3
0
  {
     if($FolderOrFile != "." && $FolderOrFile != "..")
     { 
       if(is_dir("$dir/$FolderOrFile"))
       { deldir("$dir/$FolderOrFile"); }  // recursive
       else
       { unlink("$dir/$FolderOrFile"); }
     } 
  }
} 

if($delete != "") {
	delcache($cachefolder);
}

$cacheSize = getTotalSize($cachefolder);

?>
<a href="<?php 
echo $HTTP_SERVER['PHP_SELF'];
?>
">[Refresh]</a><br><br>
Total size of cache folder: <B><?php 
echo $cacheSize / 1000000;
?>
 Mb.</B> (<?php 
echo $cacheSize;
?>
 bytes)
<br><br>
<form method="post" action="<?php