Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

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