# FileInterface

Chevere\Interfaces\Filesystem\FileInterface

view source (opens new window)

# Description

Describes the component in charge of interacting with filesystem files.

# Constants

# CHECKSUM_ALGO

Type string

'sha256'

# CHECKSUM_LENGTH

Type integer

64

# Methods

# __construct

Parameters


# path

Provides access to the PathInterface instance.


# isPhp

Returns a boolean indicating whether the file name is a PHP file.

Return

bool


# exists

Returns a boolean indicating whether the file exists.

Return

bool


# assertExists

Return

void


# getChecksum

Retrieves the file checksum using the CHECKSUM_ALGO algorithm.

Return

string


# getSize

Retrieves the file size using filesize.

Return

int


# contents

Retrieves the file contents.

Return

string


# remove

Remove the file.

Return

void


# removeIfExists

Return

void


# create

Create the file.

Return

void


# put

Put contents to the file. If the file doesn't exists it will be created.

Parameters

  • contents: string

Return

void


Last Updated: 5/1/2021, 2:31:10 PM