class Illuminate / Filesystem / LockableFile
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

LockableFile

Properties

protected

$handle resource

The file resource.

Default: null
protected

$path string

The file path.

Default: null
protected

$isLocked bool

Indicates if the file is locked.

Default: false

Methods

public

__construct ( $path , $mode ) : void

Create a new File instance.

Parameters

  • $path string
  • $mode string
protected

ensureDirectoryExists ( $path ) : void

Create the file's directory if necessary.

Parameters

  • $path string
protected

createResource ( $path , $mode ) : void

Create the file resource.

Parameters

  • $path string
  • $mode string
public

read ( $length ) : string

Read the file contents.

Parameters

  • $length int|null
public

size ( ) : int

Get the file size.

public

write ( $contents ) : $this

Write to the file.

Parameters

  • $contents string
public

truncate ( ) : $this

Truncate the file.

public

getSharedLock ( $block ) : $this

Get a shared lock on the file.

Parameters

  • $block bool
public

getExclusiveLock ( $block ) : bool

Get an exclusive lock on the file.

Parameters

  • $block bool
public

releaseLock ( ) : $this

Release the lock on the file.

public

close ( ) : bool

Close the file.