Overview

Namespaces

  • Autarky
    • Config
      • Loaders
    • Console
    • Container
      • Exception
      • Factory
      • Proxy
    • Database
    • Errors
    • Events
    • Files
    • Http
    • Logging
    • Providers
    • Routing
      • Events
    • Testing
    • TwigTemplating
      • Extensions
    • Utils

Classes

  • LockingFilesystem
  • PathResolver

Exceptions

  • IOException
  • Overview
  • Namespace
  • Class

Class LockingFilesystem

Class that performs a locking file read/write operation.

The object will add a file lock before writing and release it right after the contents have been written. This can be used to prevent corruption of data when multiple requests try to write to the same file at the same time.

Namespace: Autarky\Files
Located at Files/LockingFilesystem.php
Methods summary
public string
# read( string $path, boolean $blocking = false )

Read from a file.

Read from a file.

Parameters

$path
Path to the file.
$blocking

Wait for other locks to expire rather than throwing an error when a lock cannot be aquired.

Returns

string

Throws

Autarky\Files\IOException
public
# write( string $path, string $contents, boolean $blocking = false )

Write to the file.

Write to the file.

Parameters

$path
Path to the file.
$contents
Contents to write to the file.
$blocking

Wait for other locks to expire rather than throwing an error when a lock cannot be aquired.

Throws

Autarky\Files\IOException
Autarky Framework API documentation generated by ApiGen