Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezfsfilehandler.php
Go to the documentation of this file.
1 <?php
12 class eZFSFileHandler implements eZClusterFileHandlerInterface
13 {
14 const EXPIRY_TIMESTAMP = 233366400;
15
21 public function __construct( $filePath = false )
22 {
23 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::instance( '$filePath' )", __METHOD__ );
24 $this->Mutex = null;
25 $this->filePath = $filePath;
26 $this->lifetime = 60; // Lifetime of lock
27 $this->loadMetaData();
28 }
29
41 function _exclusiveLock( $fname = false )
42 {
43 $mutex =& $this->_mutex();
44 while ( true )
45 {
46 $timestamp = $mutex->lockTS(); // Note: This does not lock, only checks what the timestamp is.
47 if ( $timestamp === false )
48 {
49 if ( !$mutex->lock() )
50 {
51 eZDebug::writeWarning( "Failed to acquire lock for file " . $this->filePath );
52 return false;
53 }
54 $mutex->setMeta( 'pid', getmypid() );
55 return true;
56 }
57 if ( $timestamp >= time() - $this->lifetime )
58 {
59 usleep( 500000 ); // Sleep 0.5 second
60 continue;
61 }
62
63 $oldPid = $mutex->meta( 'pid' );
64 if ( is_numeric( $oldPid ) &&
65 $oldPid != 0 &&
66 function_exists( 'posix_kill' ) )
67 {
68 posix_kill( $oldPid, 9 );
69 }
70 if ( !$mutex->steal() )
71 {
72 eZDebug::writeWarning( "Failed to steal lock for file " . $this->filePath . " from PID $oldPid" );
73 return false;
74 }
75 $mutex->setMeta( 'pid', getmypid() );
76 return true;
77 }
78 }
79
86 function _freeExclusiveLock( $fname = false )
87 {
88 $mutex =& $this->_mutex();
89 $mutex->unlock();
90 }
91
96 function &_mutex()
97 {
98 if ( $this->Mutex !== null )
99 return $this->Mutex;
100 $mutex = new eZMutex( $this->filePath );
101 return $mutex;
102 }
103
110 function loadMetaData( $force = false )
111 {
112 if ( $this->filePath !== false )
113 {
114 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
115 if ( $force )
116 {
117 clearstatcache();
118 eZDebugSetting::writeDebug( 'kernel-clustering', ' clearstatcache called on ' . $this->filePath, __METHOD__ );
119 }
120
121 $this->metaData = file_exists( $this->filePath ) ? stat( $this->filePath ) : false;
122 eZDebug::accumulatorStop( 'dbfile' );
123 }
124 }
125
131 function fileFetch( $filePath )
132 {
133 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileFetch( '$filePath' )", __METHOD__ );
134 return ( file_exists( $filePath ) ? $filePath : false );
135 }
136
142 function fetch( $noLocalCache = false )
143 {
144 $filePath = $this->filePath;
145 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fetch( '$filePath' )", __METHOD__ );
146 }
147
155 function fetchUnique()
156 {
157 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fetchUnique( '{$this->filePath}' )", __METHOD__ );
158 return $this->filePath;
159 }
160
170 function fileStore( $filePath, $scope = false, $delete = false, $datatype = false )
171 {
172 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileStore( '$filePath' )", __METHOD__ );
173 }
174
181 function fileStoreContents( $filePath, $contents, $scope = false, $datatype = false )
182 {
183 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileStoreContents( '$filePath' )", __METHOD__ );
184
185 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
186
187 eZFile::create( basename( $filePath ), dirname( $filePath ), $contents, true );
188
189 $perm = eZINI::instance()->variable( 'FileSettings', 'StorageFilePermissions' );
190 chmod( $filePath, octdec( $perm ) );
191
192 eZDebug::accumulatorStop( 'dbfile' );
193 }
194
205 function storeContents( $contents, $scope = false, $datatype = false, $storeLocally = false )
206 {
207 $filePath = $this->filePath;
208
209 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::storeContents( '$filePath' )", __METHOD__ );
210
211 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
212
213 eZFile::create( basename( $filePath ), dirname( $filePath ), $contents, true );
214 $perm = eZINI::instance()->variable( 'FileSettings', 'StorageFilePermissions' );
215 chmod( $filePath, octdec( $perm ) );
216
217 eZDebug::accumulatorStop( 'dbfile' );
218 }
219
225 function fileFetchContents( $filePath )
226 {
227 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileFetchContents( '$filePath' )", __METHOD__ );
228
229 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
230 $rslt = is_readable( $filePath ) ? file_get_contents( $filePath ) : false;
231 eZDebug::accumulatorStop( 'dbfile' );
232
233 return $rslt;
234 }
235
242 function fetchContents()
243 {
244 $filePath = $this->filePath;
245 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fetchContents( '$filePath' )", __METHOD__ );
246
247 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
248 $rslt = is_readable( $filePath ) ? file_get_contents( $filePath ) : false;
249 eZDebug::accumulatorStop( 'dbfile' );
250
251 return $rslt;
252 }
253
299 function processCache( $retrieveCallback, $generateCallback = null, $ttl = null, $expiry = null, $extraData = null )
300 {
301 $fname = $this->filePath;
302 $args = array( $fname );
303 if ( $extraData !== null )
304 $args[] = $extraData;
305 $curtime = time();
306 $tries = 0;
307 $noCache = false;
308
309 if ( $expiry < 0 )
310 $expiry = null;
311 if ( $ttl < 0 )
312 $ttl = null;
313
314 while ( true )
315 {
316 $forceGeneration = false;
317 $storeCache = true;
318 $mtime = file_exists( $fname ) ? filemtime( $fname ) : false;
319 if ( $retrieveCallback !== null && !$this->isExpired( $expiry, $curtime, $ttl ) )
320 {
321 $args = array( $fname, $mtime );
322 if ( $extraData !== null )
323 $args[] = $extraData;
324 $retval = call_user_func_array( $retrieveCallback, $args );
325 if ( !( $retval instanceof eZClusterFileFailure ) )
326 {
327 return $retval;
328 }
329 $forceGeneration = true;
330 }
331
332 if ( $tries >= 2 )
333 {
334 eZDebugSetting::writeDebug( 'kernel-clustering', "Reading was retried $tries times and reached the maximum, forcing generation", __METHOD__ );
335 $forceGeneration = true; // We will now generate the cache but not store it
336 $storeCache = false; // This disables the cache storage
337 }
338
339 // Generation part starts here
340 if ( isset( $retval ) &&
341 $retval instanceof eZClusterFileFailure )
342 {
343 // This error means that the retrieve callback told
344 // us NOT to enter generation mode and therefore NOT to store this
345 // cache.
346 // This parameter will then be passed to the generate callback,
347 // and this will set store to false
348 if ( $retval->errno() == 3 )
349 {
350 $noCache = true;
351 }
352 elseif ( $retval->errno() != 1 ) // check for non-expiry error codes
353 {
354 eZDebug::writeError( "Failed to retrieve data from callback", __METHOD__ );
355 return null;
356 }
357 $message = $retval->message();
358 if ( strlen( $message ) > 0 )
359 {
360 eZDebugSetting::writeDebug( 'kernel-clustering', $retval->message(), __METHOD__ );
361 }
362 // the retrieved data was expired so we need to generate it, let's continue
363 }
364
365 // We need to lock if we have a generate-callback or
366 // the generation is deferred to the caller.
367 // Note: false means no generation
368 if ( !$noCache and $generateCallback !== false and $forceGeneration === false )
369 {
370 // Lock the entry for exclusive access, if the entry does not exist
371 // it will be inserted with mtime=-1
372 if ( !$this->_exclusiveLock( $fname ) )
373 {
374 // Cannot get exclusive lock, so return null.
375 return null;
376 }
377
378 // This is where we perform a two-phase commit. If any other
379 // process or machine has generated the file data and it is valid
380 // we will retry the retrieval part and not do the generation.
381 clearstatcache();
382 eZDebugSetting::writeDebug( 'kernel-clustering', "clearstatcache called on $fname", __METHOD__ );
383 if ( file_exists( $fname ) && !$this->isExpired( $expiry, $curtime, $ttl ) )
384 {
385 eZDebugSetting::writeDebug( 'kernel-clustering', "File was generated while we were locked, use that instead", __METHOD__ );
386 $this->metaData = false;
387 $this->_freeExclusiveLock( 'storeCache' );
388 ++$tries;
389 continue; // retry reading file
390 }
391 }
392
393 // File in DB is outdated or non-existing, call write-callback to generate content
394 if ( $generateCallback )
395 {
396 $args = array( $fname );
397 if ( $noCache )
398 $extraData['noCache'] = true;
399 if ( $extraData !== null )
400 $args[] = $extraData;
401
402 if ( $generateCallback[1] == 'generateUserCacheForFile' )
403 {
404 $args[] = $extraData;
405 }
406
407 $fileData = call_user_func_array( $generateCallback, $args );
408 return $this->storeCache( $fileData, $storeCache );
409 }
410
411 break;
412 }
413
414 return new eZClusterFileFailure( 2, "Manual generation of file data is required, calling storeCache is required" );
415 }
416
427 public static function isFileExpired( $fname, $mtime, $expiry, $curtime, $ttl )
428 {
429 if ( $mtime == false )
430 {
431 $ret = true;
432 }
433 elseif ( $mtime == self::EXPIRY_TIMESTAMP )
434 {
435 $ret = true;
436 }
437 elseif ( $expiry != -1 and $ttl === null )
438 {
439 $ret = $mtime < $expiry;
440 }
441 else
442 {
443 $ret = $mtime < max( $expiry, $curtime - $ttl );
444 }
445 return $ret;
446 }
447
448
457 public function isExpired( $expiry, $curtime, $ttl )
458 {
459 if ( !file_exists( $this->filePath ) )
460 {
461 return true;
462 }
463
464 return self::isFileExpired( $this->filePath, filemtime( $this->filePath ), $expiry, $curtime, $ttl );
465 }
466
475 function storeCache( $fileData, $storeCache = true )
476 {
477 $fname = $this->filePath;
478
479 $scope = false;
480 $datatype = false;
481 $binaryData = null;
482 $fileContent = null;
483 $store = true;
484 if ( is_array( $fileData ) )
485 {
486 if ( isset( $fileData['scope'] ) )
487 $scope = $fileData['scope'];
488 if ( isset( $fileData['datatype'] ) )
489 $datatype = $fileData['datatype'];
490 if ( isset( $fileData['content'] ) )
491 $fileContent = $fileData['content'];
492 if ( isset( $fileData['binarydata'] ) )
493 $binaryData = $fileData['binarydata'];
494 if ( isset( $fileData['store'] ) )
495 $store = $fileData['store'];
496 }
497 else
498 $binaryData = $fileData;
499
500 // Disable storage if the caller of the function says so
501 if ( !$storeCache )
502 $store = false;
503
504 $mtime = false;
505 $result = null;
506 if ( $binaryData === null &&
507 $fileContent === null )
508 {
509 eZDebug::writeError( "Write callback need to set the 'content' or 'binarydata' entry" );
510 return null;
511 }
512
513 if ( $binaryData === null )
514 $binaryData = "<" . "?php\n\treturn ". var_export( $fileContent, true ) . ";\n?" . ">\n";
515
516 if ( $fileContent === null )
517 $result = $binaryData;
518 else
519 $result = $fileContent;
520
521 // Check if we are allowed to store the data, if not just return the result
522 if ( !$store )
523 {
524 $this->abortCacheGeneration();
525 return $result;
526 }
527
528 // Store content locally
529 $this->storeContents( $binaryData, $scope, $datatype, true );
530
531 $this->_freeExclusiveLock( 'storeCache' );
532
533 return $result;
534 }
535
547 function processFile( $callback, $expiry = false, $extraData = null )
548 {
549 $result = $this->processCache( $callback, false, null, $expiry, $extraData );
550 if ( $result instanceof eZClusterFileFailure )
551 {
552 return null;
553 }
554 return $result;
555 }
556
562 function stat()
563 {
564 eZDebugSetting::writeDebug( 'kernel-clustering', $this->metaData, "fs::stat( {$this->filePath} )" );
565 return $this->metaData;
566 }
567
573 function size()
574 {
575 $size = isset( $this->metaData['size'] ) ? $this->metaData['size'] : null;
576 eZDebugSetting::writeDebug( 'kernel-clustering', $size, "fs::size( {$this->filePath} )" );
577 return $size;
578 }
579
584 public function dataType()
585 {
586 $fileInfo = new finfo( FILEINFO_MIME_TYPE | FILEINFO_SYMLINK );
587 $mimeType = $fileInfo->file( $this->filePath );
588 eZDebugSetting::writeDebug( 'kernel-clustering', $mimeType, "fs::dataType( {$this->filePath} )" );
589 return $mimeType ?: null;
590 }
591
597 function mtime()
598 {
599 $mtime = isset( $this->metaData['mtime'] ) ? $this->metaData['mtime'] : null;
600 eZDebugSetting::writeDebug( 'kernel-clustering', $mtime, "fs::mtime( {$this->filePath} )" );
601 return $mtime;
602 }
603
609 function name()
610 {
611 eZDebugSetting::writeDebug( 'kernel-clustering', $this->filePath, "fs::name( {$this->filePath} )" );
612 return $this->filePath;
613 }
614
621 function fileDeleteByWildcard( $wildcard )
622 {
623 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileDeleteByWildcard( '$wildcard' )", __METHOD__ );
624
625 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
626 $unlinkArray = eZSys::globBrace( $wildcard );
627 if ( $unlinkArray !== false and ( count( $unlinkArray ) > 0 ) )
628 {
629 array_map( 'unlink', $unlinkArray );
630 }
631 eZDebug::accumulatorStop( 'dbfile' );
632 }
633
634
642 function fileDeleteByDirList( $dirList, $commonPath, $commonSuffix )
643 {
644 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileDeleteByDirList( '" . implode( ",", $dirList ) . "', '$commonPath', '$commonSuffix' )", __METHOD__ );
645
646 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
647
648 foreach ( $dirList as $dir )
649 {
650 $unlinkArray = eZSys::globBrace( "$commonPath/$dir/$commonSuffix*" );
651 if ( $unlinkArray !== false )
652 {
653 array_map( 'unlink', $unlinkArray );
654 }
655 }
656
657 eZDebug::accumulatorStop( 'dbfile' );
658 }
659
664 function fileDelete( $path, $fnamePart = false )
665 {
666 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileDelete( '$path' )", __METHOD__ );
667
668 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
669
670 $list = array();
671 if ( $fnamePart !== false )
672 {
673 $globResult = glob( $path . "/" . $fnamePart . "*" );
674 if ( is_array( $globResult ) )
675 {
676 $list = $globResult;
677 }
678 }
679 else
680 {
681 $list = array( $path );
682 }
683
684 foreach ( $list as $path )
685 {
686 if ( is_file( $path ) )
687 {
688 $handler = eZFileHandler::instance( false );
689 $handler->unlink( $path );
690 if ( file_exists( $path ) )
691 eZDebug::writeError( "File still exists after removal: '$path'", __METHOD__ );
692 }
693 else if ( is_dir( $path ) )
694 {
695 eZDir::recursiveDelete( $path );
696 }
697 else
698 {
699 continue;
700 }
701 }
702
703 eZDebug::accumulatorStop( 'dbfile' );
704 }
705
714 function delete()
715 {
716 $path = $this->filePath;
717 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::delete( '$path' )", __METHOD__ );
718
719 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
720
721 if ( is_file( $path ) )
722 {
723 $handler = eZFileHandler::instance( false );
724 $handler->unlink( $path );
725 if ( file_exists( $path ) )
726 eZDebug::writeError( "File still exists after removal: '$path'", __METHOD__ );
727 }
728 elseif ( is_dir( $path ) )
729 {
730 eZDir::recursiveDelete( $path );
731 }
732
733 eZClusterFileHandler::cleanupEmptyDirectories( $path );
734
735 $this->loadMetaData( true );
736
737 eZDebug::accumulatorStop( 'dbfile' );
738 }
739
740
748 function fileDeleteLocal( $path )
749 {
750 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileDeleteLocal( '$path' )", __METHOD__ );
751 }
752
760 function deleteLocal()
761 {
762 $path = $this->filePath;
763 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::deleteLocal( '$path' )", __METHOD__ );
764 }
765
769 function purge( $printCallback = false, $microsleep = false, $max = false, $expiry = false )
770 {
771 $file = $this->filePath;
772 if ( $max === false )
773 $max = 100;
774 $count = 0;
775 $list = array();
776 if ( is_file( $file ) )
777 {
778 $list = array( $file );
779 }
780 else
781 {
782 $globResult = glob( $file . "/*" );
783 if ( is_array( $globResult ) )
784 {
785 $list = $globResult;
786 }
787 }
788 do
789 {
790 if ( ( $count % $max ) == 0 && $microsleep )
791 usleep( $microsleep ); // Sleep a bit to make the filesystem happier
792
793 $count = 0;
794 $file = array_shift( $list );
795
796 if ( is_file( $file ) )
797 {
798 $mtime = @filemtime( $file );
799 if ( $expiry === false ||
800 $mtime < $expiry ) // remove it if it is too old
801 {
802 @unlink( $file );
803
804 eZClusterFileHandler::cleanupEmptyDirectories( $file );
805 }
806 ++$count;
807 }
808 else if ( is_dir( $file ) )
809 {
810 $globResult = glob( $file . "/*" );
811 if ( is_array( $globResult ) )
812 {
813 $list = array_merge( $globResult, $list );
814 }
815 }
816
817 if ( $printCallback )
818 call_user_func_array( $printCallback,
819 array( $file, 1 ) );
820 } while ( count( $list ) > 0 );
821 }
822
829 function fileExists( $path )
830 {
831 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileExists( '$path' )", __METHOD__ );
832
833 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
834 $rc = file_exists( $path );
835 eZDebug::accumulatorStop( 'dbfile' );
836
837 return $rc;
838 }
839
848 function exists()
849 {
850 $path = $this->filePath;
851 $rc = isset( $this->metaData['mtime'] );
852 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::exists( '$path' ): " . ( $rc ? 'true' :'false' ), __METHOD__ );
853 return $rc;
854 }
855
863 function passthrough( $offset = 0, $length = false )
864 {
865 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::passthrough( '{$this->filePath}' )", __METHOD__ );
866 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
867
868 eZFile::downloadContent( $this->filePath, $offset, $length );
869
870 eZDebug::accumulatorStop( 'dbfile' );
871 }
872
879 function fileCopy( $srcPath, $dstPath )
880 {
881 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileCopy( '$srcPath', '$dstPath' )", __METHOD__ );
882
883 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
884 eZFileHandler::copy( $srcPath, $dstPath );
885 eZDebug::accumulatorStop( 'dbfile' );
886 }
887
894 function fileLinkCopy( $srcPath, $dstPath, $symLink )
895 {
896 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileLinkCopy( '$srcPath', '$dstPath' )", __METHOD__ );
897
898 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
899 eZFileHandler::linkCopy( $srcPath, $dstPath, $symLink );
900 eZDebug::accumulatorStop( 'dbfile' );
901 }
902
909 function fileMove( $srcPath, $dstPath )
910 {
911 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileMove( '$srcPath', '$dstPath' )", __METHOD__ );
912
913 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
914 eZFile::rename( $srcPath, $dstPath, true );
915 eZDebug::accumulatorStop( 'dbfile' );
916 }
917
923 function move( $dstPath )
924 {
925 $srcPath = $this->filePath;
926
927 eZDebugSetting::writeDebug( 'kernel-clustering', "fs::move( '$srcPath', '$dstPath' )", __METHOD__ );
928
929 eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
930 eZFileHandler::move( $srcPath, $dstPath );
931 eZDebug::accumulatorStop( 'dbfile' );
932 }
933
945 public function startCacheGeneration()
946 {
947 return true;
948 }
949
953 public function endCacheGeneration( $rename = true )
954 {
955 return true;
956 }
957
964 public function abortCacheGeneration()
965 {
966 $this->_freeExclusiveLock( 'storeCache' );
967
968 return true;
969 }
970
976 public function checkCacheGenerationTimeout()
977 {
978 return true;
979 }
980
986 public function requiresClusterizing()
987 {
988 return false;
989 }
990
998 public function requiresPurge()
999 {
1000 return false;
1001 }
1002
1003 public function hasStaleCacheSupport()
1004 {
1005 return false;
1006 }
1007
1008 public function getFileList($scopes = false, $excludeScopes = false)
1009 {
1010 return false;
1011 }
1012
1013 public function isDBFileExpired($expiry, $curtime, $ttl)
1014 {
1015 return self::isFileExpired( $this->filePath, @filemtime( $this->filePath ), $expiry, $curtime, $ttl );
1016 }
1017
1018 public function isLocalFileExpired($expiry, $curtime, $ttl)
1019 {
1020 return self::isFileExpired( $this->filePath, @filemtime( $this->filePath ), $expiry, $curtime, $ttl );
1021 }
1022
1026 public function applyServerUri( $filePath )
1027 {
1028 return $filePath;
1029 }
1030
1031 public $metaData = null;
1032 public $filePath;
1033 public $Mutex;
1034 public $lifetime;
1035 }
1036
1037 ?>
$message
$message
Definition: admin/message.php:51
eZClusterFileFailure
Definition: ezclusterfilefailure.php:21
eZClusterFileHandler\cleanupEmptyDirectories
static cleanupEmptyDirectories( $path)
Definition: ezclusterfilehandler.php:103
eZDebugSetting\writeDebug
static writeDebug( $conditionName, $string, $label="")
Definition: ezdebugsetting.php:128
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:546
eZDebug\writeWarning
static writeWarning( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:503
eZDebug\accumulatorStart
static accumulatorStart( $key, $inGroup=false, $name=false, $recursive=false)
Definition: ezdebug.php:1362
eZDebug\accumulatorStop
static accumulatorStop( $key, $recursive=false)
Definition: ezdebug.php:1390
eZDir\recursiveDelete
static recursiveDelete( $dir, $rootCheck=true)
Definition: ezdir.php:265
eZFSFileHandler
Definition: ezfsfilehandler.php:13
eZFSFileHandler\getFileList
getFileList($scopes=false, $excludeScopes=false)
Definition: ezfsfilehandler.php:1008
eZFSFileHandler\fileMove
fileMove( $srcPath, $dstPath)
Definition: ezfsfilehandler.php:909
eZFSFileHandler\fileFetch
fileFetch( $filePath)
Definition: ezfsfilehandler.php:131
eZFSFileHandler\name
name()
Definition: ezfsfilehandler.php:609
eZFSFileHandler\isFileExpired
static isFileExpired( $fname, $mtime, $expiry, $curtime, $ttl)
Definition: ezfsfilehandler.php:427
eZFSFileHandler\stat
stat()
Definition: ezfsfilehandler.php:562
eZFSFileHandler\$Mutex
$Mutex
Definition: ezfsfilehandler.php:1033
eZFSFileHandler\dataType
dataType()
Definition: ezfsfilehandler.php:584
eZFSFileHandler\isExpired
isExpired( $expiry, $curtime, $ttl)
Definition: ezfsfilehandler.php:457
eZFSFileHandler\size
size()
Definition: ezfsfilehandler.php:573
eZFSFileHandler\abortCacheGeneration
abortCacheGeneration()
Definition: ezfsfilehandler.php:964
eZFSFileHandler\$filePath
$filePath
Definition: ezfsfilehandler.php:1032
eZFSFileHandler\__construct
__construct( $filePath=false)
Definition: ezfsfilehandler.php:21
eZFSFileHandler\fileStoreContents
fileStoreContents( $filePath, $contents, $scope=false, $datatype=false)
Definition: ezfsfilehandler.php:181
eZFSFileHandler\applyServerUri
applyServerUri( $filePath)
Definition: ezfsfilehandler.php:1026
eZFSFileHandler\storeCache
storeCache( $fileData, $storeCache=true)
Definition: ezfsfilehandler.php:475
eZFSFileHandler\loadMetaData
loadMetaData( $force=false)
Definition: ezfsfilehandler.php:110
eZFSFileHandler\fetchContents
fetchContents()
Definition: ezfsfilehandler.php:242
eZFSFileHandler\fileDeleteLocal
fileDeleteLocal( $path)
Definition: ezfsfilehandler.php:748
eZFSFileHandler\fetchUnique
fetchUnique()
Definition: ezfsfilehandler.php:155
eZFSFileHandler\startCacheGeneration
startCacheGeneration()
Definition: ezfsfilehandler.php:945
eZFSFileHandler\_freeExclusiveLock
_freeExclusiveLock( $fname=false)
Definition: ezfsfilehandler.php:86
eZFSFileHandler\fileFetchContents
fileFetchContents( $filePath)
Definition: ezfsfilehandler.php:225
eZFSFileHandler\hasStaleCacheSupport
hasStaleCacheSupport()
Definition: ezfsfilehandler.php:1003
eZFSFileHandler\storeContents
storeContents( $contents, $scope=false, $datatype=false, $storeLocally=false)
Definition: ezfsfilehandler.php:205
eZFSFileHandler\fileExists
fileExists( $path)
Definition: ezfsfilehandler.php:829
eZFSFileHandler\deleteLocal
deleteLocal()
Definition: ezfsfilehandler.php:760
eZFSFileHandler\processCache
processCache( $retrieveCallback, $generateCallback=null, $ttl=null, $expiry=null, $extraData=null)
Definition: ezfsfilehandler.php:299
eZFSFileHandler\exists
exists()
Definition: ezfsfilehandler.php:848
eZFSFileHandler\fileStore
fileStore( $filePath, $scope=false, $delete=false, $datatype=false)
Definition: ezfsfilehandler.php:170
eZFSFileHandler\isLocalFileExpired
isLocalFileExpired($expiry, $curtime, $ttl)
Definition: ezfsfilehandler.php:1018
eZFSFileHandler\fileDeleteByDirList
fileDeleteByDirList( $dirList, $commonPath, $commonSuffix)
Definition: ezfsfilehandler.php:642
eZFSFileHandler\passthrough
passthrough( $offset=0, $length=false)
Definition: ezfsfilehandler.php:863
eZFSFileHandler\move
move( $dstPath)
Definition: ezfsfilehandler.php:923
eZFSFileHandler\fetch
fetch( $noLocalCache=false)
Definition: ezfsfilehandler.php:142
eZFSFileHandler\fileDeleteByWildcard
fileDeleteByWildcard( $wildcard)
Definition: ezfsfilehandler.php:621
eZFSFileHandler\fileDelete
fileDelete( $path, $fnamePart=false)
Definition: ezfsfilehandler.php:664
eZFSFileHandler\endCacheGeneration
endCacheGeneration( $rename=true)
Definition: ezfsfilehandler.php:953
eZFSFileHandler\checkCacheGenerationTimeout
checkCacheGenerationTimeout()
Definition: ezfsfilehandler.php:976
eZFSFileHandler\fileCopy
fileCopy( $srcPath, $dstPath)
Definition: ezfsfilehandler.php:879
eZFSFileHandler\EXPIRY_TIMESTAMP
const EXPIRY_TIMESTAMP
Definition: ezfsfilehandler.php:14
eZFSFileHandler\fileLinkCopy
fileLinkCopy( $srcPath, $dstPath, $symLink)
Definition: ezfsfilehandler.php:894
eZFSFileHandler\requiresClusterizing
requiresClusterizing()
Definition: ezfsfilehandler.php:986
eZFSFileHandler\requiresPurge
requiresPurge()
Definition: ezfsfilehandler.php:998
eZFSFileHandler\$lifetime
$lifetime
Definition: ezfsfilehandler.php:1034
eZFSFileHandler\$metaData
$metaData
Definition: ezfsfilehandler.php:1031
eZFSFileHandler\processFile
processFile( $callback, $expiry=false, $extraData=null)
Definition: ezfsfilehandler.php:547
eZFSFileHandler\_exclusiveLock
_exclusiveLock( $fname=false)
Definition: ezfsfilehandler.php:41
eZFSFileHandler\mtime
mtime()
Definition: ezfsfilehandler.php:597
eZFSFileHandler\purge
purge( $printCallback=false, $microsleep=false, $max=false, $expiry=false)
Definition: ezfsfilehandler.php:769
eZFSFileHandler\isDBFileExpired
isDBFileExpired($expiry, $curtime, $ttl)
Definition: ezfsfilehandler.php:1013
eZFSFileHandler\_mutex
& _mutex()
Definition: ezfsfilehandler.php:96
eZFileHandler\linkCopy
static linkCopy( $sourceFilename, $destinationFilename, $symbolicLink=true)
Definition: ezfilehandler.php:148
eZFileHandler\instance
static instance( $identifier, $filename=false, $mode=false, $binaryFile=true)
Definition: ezfilehandler.php:1018
eZFileHandler\copy
static copy( $sourceFilename, $destinationFilename)
Definition: ezfilehandler.php:357
eZFileHandler\move
static move( $sourceFilename, $destinationFilename)
Definition: ezfilehandler.php:290
eZFile\downloadContent
static downloadContent( $file, $startOffset=0, $length=false)
Definition: ezfile.php:278
eZFile\rename
static rename( $srcFile, $destFile, $mkdir=false, $flags=0)
Definition: ezfile.php:153
eZFile\create
static create( $filename, $directory=false, $data=false, $atomic=false)
Definition: ezfile.php:42
eZSys\globBrace
static globBrace( $pattern, $flags=0)
Definition: ezsys.php:1334
$result
$result
Definition: companysearch.php:94
$args
$args
Definition: companytypelist.php:125
file_exists
static file_exists( $inifilename)
Definition: eZPBINIFile.php:195
$contents
$contents
Definition: ezarticle/user/extendedsearch.php:52
$size
if($file_debug) $size
Definition: ezfilemanager/user/filedownload.php:165
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
$dir
$dir
Definition: ezsitemanager/admin/filelist.php:87
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
$timestamp
$timestamp
Definition: ezstats/admin/cron.php:35
$offset
$offset
Definition: ezstats/admin/cron.php:51
eZClusterFileHandlerInterface
Definition: ezclusterfilehandlerinterface.php:16
$count
$count
Definition: onlinetypelist.php:108
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.