60 define(
'READ_FILE_AS_ARRAY' ,
'READ_ARRAY' );
61 define(
'READ_FILE_AS_STRING' ,
'READ_STRING' );
62 define(
'WRITE_FILE_OVERWRITE' ,
'w+' );
63 define(
'WRITE_FILE_APPEND' ,
'a+' );
98 $m =
'impossibile scrivere su ' .
$f;
138 $m =
'impossibile scrivere su ' .
$f;
209 if( file_exists(
$f ) && is_writeable(
$f ) ) {
212 $m =
'errore nella cancellazione di ' .
$f;
217 $m =
'impossibile cancellare di ' .
$f;
240 if( file_exists(
$f ) && is_writeable(
$f ) ) {
242 if(
$r ===
false ) { error_log(
'errore nella cancellazione di ' .
$f ); }
244 error_log(
'impossibile cancellare ' .
$f );
265 $files =
new RecursiveIteratorIterator(
266 new RecursiveDirectoryIterator(
$f, RecursiveDirectoryIterator::SKIP_DOTS ),
267 RecursiveIteratorIterator::CHILD_FIRST
271 foreach(
$files as $fileinfo ) {
272 $todo = ( $fileinfo->isDir() ) ?
'rmdir' :
'unlink';
273 $todo( $fileinfo->getRealPath() );
296 return @filesize(
$f );
312 if( file_exists(
$f ) && is_readable(
$f ) ) {
320 return file_get_contents(
$f );
363 $p = rtrim(
$p ,
'/' );
365 $passi = explode(
'/' ,
$p );
367 foreach( $passi as $passo ) {
371 if( ! is_dir(
$f ) ) {
379 $m =
'impossibile creare ' .
$f;
402 fclose( fopen(
$f,
'a+' ) );
415 $a = glob(
$d .
$f , GLOB_BRACE );
419 foreach(
$a as
$t ) {
420 if( is_file( $t ) ) {
441 foreach(
new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$d, FilesystemIterator::SKIP_DOTS ), RecursiveIteratorIterator::CHILD_FIRST ) as
$f ) {
443 $t[] = ( $full === true ) ? $f->getRealPath() : $f->getFileName();
462 foreach(
new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$d, FilesystemIterator::SKIP_DOTS ), RecursiveIteratorIterator::CHILD_FIRST ) as
$f ) {
464 $t[] = ( $full === true ) ? $f->getRealPath() : $f->getFileName();
486 foreach(
new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$d ) ) as
$f ) {
508 foreach(
new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$d ) ) as
$f ) {
511 $r[] = $f->getRealPath();
533 return @filesize(
$f );
550 return substr( basename(
$f ) , strrpos( basename(
$f ) ,
'.' ) + 1 );
579 if( filter_var( $f1, FILTER_VALIDATE_URL ) ) {
582 curl_setopt(
$ch, CURLOPT_URL, $f1);
583 curl_setopt(
$ch, CURLOPT_RETURNTRANSFER, 1);
584 $data = curl_exec (
$ch);
585 $error = curl_error(
$ch);
588 $h = fopen($f2,
'w+');
592 return ( ( empty( $error ) && file_exists( $f2 ) ) ?
true :
false );
599 return copy( $f1, $f2 );
614 $dh = @opendir(
$path );
617 while( (
$file = readdir( $dh ) ) !==
false ) {
619 if( substr(
$file, 0, 1) ==
'.' )
continue;
621 $rfile =
"{$path}/{$file}";
623 if ( is_dir( $rfile ) ) {
629 if( fnmatch( $find,
$file ) ) {
641 }
else {
$r =
false; }
654 $e = explode(
'.',
$f );
655 $a = array_reverse(
$e );
656 return array_shift(
$a );
669 return mime_content_type(
$f );
712 foreach(
new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$d, FilesystemIterator::SKIP_DOTS ), RecursiveIteratorIterator::CHILD_FIRST ) as
$f ) {
733 if( filter_var(
$f, FILTER_VALIDATE_URL ) ) {
734 $ch = curl_init(
$f);
735 curl_setopt(
$ch, CURLOPT_NOBODY,
true );
737 $code = curl_getinfo(
$ch, CURLINFO_HTTP_CODE );
738 $status = ( $code == 200 ) ?
true :
false;
743 return file_exists(
$f );
762 if( empty(
$r ) ||
$r ===
false ) {
766 $r = unserialize(
$r );
788 if( empty(
$r ) ||
$r ===
false ) {
789 $r = file_get_contents(
$f );
792 $r = unserialize(
$r );
807 if( filter_var(
$f, FILTER_VALIDATE_URL ) ) {
809 curl_setopt( $curl , CURLOPT_URL ,
$f );
810 curl_setopt( $curl , CURLOPT_HEADER , 1 );
811 curl_setopt( $curl , CURLOPT_NOBODY , 1 );
812 curl_setopt( $curl , CURLOPT_RETURNTRANSFER , 1 );
813 curl_setopt( $curl , CURLOPT_TIMEOUT , 5 );
814 $curl_result = curl_exec( $curl );
816 if ( $curl_result !==
false && strpos( $curl_result,
'200 OK' ) !==
false ) {
817 $headers = explode(
"\n" , $curl_result );
818 $last_modified = explode(
'Last-Modified: ' ,
$headers[3] );
819 return strtotime( $last_modified[1] );
827 return filemtime(
$f );
if(!empty($_REQUEST['id'])) $d
const MEMCACHE_DEFAULT_TTL
if(! isset( $_REQUEST['__view__'][ $ct['view']['id']]['__extra__']['assegnato'])|| $_REQUEST['__view__'][ $ct['view']['id']]['__extra__']['assegnato']=='__me__') elseif($_REQUEST[ '__view__'][$ct[ 'view'][ 'id']][ '__extra__'][ 'assegnato']=='__nessuno__')