function synchronize() {

		$tCounter = 0;

		if ($this->changed) {
			$tFile = fopen ( $this->fileName, 'a' );

			while ( ! flock ( $tFile, LOCK_EX ) ) {
				usleep ( 5 );
				$tCounter ++;
				if ($tCounter == 100) {
					return false;
				}
			}

			$tContent = serialize ( $this->elements );

			ftruncate ( $tFile, 0 );

			if ($this->useZip) {
				$tContent = gzcompress ( $tContent );
			}

			fputs ( $tFile, $tContent );

			flock ( $tFile, LOCK_UN );
			fclose ( $tFile );
			return true;
		}
			
		return true;
	}
function synchronize() {

		$tCounter = 0;

		if ($this->changed) {
			$tFile = fopen ( $this->fileName, 'a' );

			while ( ! flock ( $tFile, LOCK_EX ) ) {
				usleep ( 5 );
				$tCounter ++;
				if ($tCounter == 100) {
					return false;
				}
			}

			$tContent = serialize ( $this->elements );

			ftruncate ( $tFile, 0 );

			if ($this->useZip) {
				$tContent = gzcompress ( $tContent );
			}

			fputs ( $tFile, $tContent );

			flock ( $tFile, LOCK_UN );
			fclose ( $tFile );
			return true;
		}
			
		return true;
	}
function synchronize ( ) { $ tCounter = 0 ; if ( $ this -> changed ) { $ tFile = fopen ( $ this -> fileName , 'a' ) ; while ( ! flock ( $ tFile , LOCK_EX ) ) { usleep ( 5 ) ; $ tCounter ++ ; if ( $ tCounter == 100 ) { return false ; } } $ tContent = serialize ( $ this -> elements ) ; ftruncate ( $ tFile , 0 ) ; if ( $ this -> useZip ) { $ tContent = gzcompress ( $ tContent ) ; } fputs ( $ tFile , $ tContent ) ; flock ( $ tFile , LOCK_UN ) ; fclose ( $ tFile ) ; return true ; } return true ; }
Synchronize cache with file

@return boolean
Synchronize cache with file