GlisWeb framework
_filesystem.used.php
Vai alla documentazione di questo file.
1 <?php
2 
14  // inclusione del framework
15  require '../../../_src/_config.php';
16 
17  // array delle directory
18  $dir = array();
19 
20  // impostazioni del timer
21  $t = 'check spazio disco';
22 
23  // timer
25 
26  // directory da controllare
27  $dr = array_diff( glob( DIRECTORY_BASE . ( ( isset( $_REQUEST['dir'] ) ) ? $_REQUEST['dir'] : NULL ) . '*' ), array( '.', '..' ) );
28 
29  // lettura dati
30  foreach( $dr as $d ) {
31  $d = str_replace( DIRECTORY_BASE, NULL, $d );
32  $s = getDirSize( $d );
33  $dir[ str_pad( $s, 20, 0, STR_PAD_LEFT ) . $d ] = array( 'dir' => $d, 'size' => writeByte( $s ) );
34  }
35 
36  // ordinamento
37  krsort( $dir );
38 
39  // header
41 
42  // intestazione report
43  echo txtHeader( 'report spazio occupato' );
44 
45  // valutazione spazio directory
46  foreach( $dir as $d ) {
47 
48  echo txtData( $d['dir'], $d['size'] );
49 
50  }
51 
52  // totale
53  echo txtFullLine();
54  echo txtData( 'totale', writeByte( getDirSize( 'var' ) + getDirSize( 'tmp' ) ) );
55 
56  // chiusura report
57  echo txtDateTimeLine( '=' );
58 
59  // chiusura report
60  echo 'report generato in ' . timerDiff( $start ) . ' secondi' . PHP_EOL;
61 
62  // debug
63  // timer_debug( $t );
64 
65 ?>
writeByte( $filesize)
buildContentHeader( $t=MIME_TEXT_PLAIN, $e=ENCODING_UTF8)
txtFullLine( $c='-', $w=REPORT_WIDTH)
Definition: _txt.tools.php:42
txtData( $l, $d, $c=' ', $w=REPORT_WIDTH)
Definition: _txt.tools.php:58
timerDiff( $start=START_TIME, $now=NULL)
if(!empty($_REQUEST['id'])) $d
txtHeader( $t, $c='=', $w=REPORT_WIDTH)
Definition: _txt.tools.php:20
timerNow()
const DIRECTORY_BASE
Definition: _osm.php:3
txtDateTimeLine( $c='-', $d=NULL, $w=REPORT_WIDTH)
Definition: _txt.tools.php:48
getDirSize( $d)
calcola ricorsivamente lo spazio occupato da una directory
$_REQUEST['__view__'][ $ct['view']['id']]['__restrict__']['id_progetto']['EQ']