Documentation

MarkdownFile extends DataFile
in package

Class MarkdownFile

Table of Contents

Properties

$formatter  : FileFormatterInterface

Methods

__clone()  : void
__construct()  : mixed
File constructor.
__destruct()  : mixed
Unlock file when the object gets destroyed.
__serialize()  : array<string|int, mixed>
__unserialize()  : void
delete()  : bool
Delete file from filesystem.
exists()  : bool
Check if the file exits in the filesystem.
getBasename()  : string
Get basename of the file (filename without the associated file extension).
getCreationTime()  : int
Get file creation time.
getExtension()  : string
Get file extension of the file.
getFilename()  : string
Get filename of the file.
getFilePath()  : string
Get both path and filename of the file.
getModificationTime()  : int
Get file modification time.
getPath()  : string
Get path of the file.
isLocked()  : bool
Returns true if file has been locked by you for writing.
isReadable()  : bool
Check if file exists and can be read.
isWritable()  : bool
Check if file can be written.
load()  : array<string|int, mixed>
(Re)Load a file and return file contents.
lock()  : bool
Lock file for writing. You need to manually call unlock().
rename()  : bool
Rename file in the filesystem if it exists.
save()  : void
Save file.
serialize()  : string
unlock()  : bool
Unlock file after writing.
unserialize()  : void
doSerialize()  : array<string|int, mixed>
doUnserialize()  : void
getUnserializeAllowedClasses()  : array<string|int, mixed>|bool
setFilepath()  : void
setPathInfo()  : void
tempname()  : string

Properties

Methods

__clone()

public __clone() : void
Attributes
#[ReturnTypeWillChange]

__destruct()

Unlock file when the object gets destroyed.

public __destruct() : mixed
Attributes
#[ReturnTypeWillChange]

__serialize()

public final __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

__unserialize()

public final __unserialize(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

delete()

Delete file from filesystem.

public delete() : bool
Tags
see
FileInterface::delete()
Return values
bool

Returns true if the file was successfully deleted, false otherwise.

exists()

Check if the file exits in the filesystem.

public exists() : bool
Tags
see
FileInterface::exists()
Return values
bool

Returns true if the filename exists and is a regular file, false otherwise.

getBasename()

Get basename of the file (filename without the associated file extension).

public getBasename() : string
Tags
see
FileInterface::getBasename()
Return values
string

Returns basename of the file.

getExtension()

Get file extension of the file.

public getExtension([bool $withDot = false ]) : string
Parameters
$withDot : bool = false

If true, return file extension with beginning dot (.json).

Tags
see
FileInterface::getExtension()
Return values
string

Returns file extension of the file (can be empty).

getFilePath()

Get both path and filename of the file.

public getFilePath() : string
Tags
see
FileInterface::getFilePath()
Return values
string

Returns path and filename in the filesystem. Can also be URI.

isLocked()

Returns true if file has been locked by you for writing.

public isLocked() : bool
Tags
see
FileInterface::isLocked()
Return values
bool

Returns true if the file is locked, false otherwise.

isReadable()

Check if file exists and can be read.

public isReadable() : bool
Tags
see
FileInterface::isReadable()
Return values
bool

Returns true if the file can be read, false otherwise.

load()

(Re)Load a file and return file contents.

public load() : array<string|int, mixed>
Return values
array<string|int, mixed>

lock()

Lock file for writing. You need to manually call unlock().

public lock([bool $block = true ]) : bool
Parameters
$block : bool = true

For non-blocking lock, set the parameter to false.

Tags
see
FileInterface::lock()
Return values
bool

Returns true if the file was successfully locked, false otherwise.

rename()

Rename file in the filesystem if it exists.

public rename(string $path) : bool
Parameters
$path : string

New path and filename for the file. Can also be URI.

Tags
see
FileInterface::rename()
Return values
bool

Returns true if the file was successfully renamed, false otherwise.

save()

Save file.

public save(mixed $data) : void
Parameters
$data : mixed

Data to be saved.

Tags
see
FileInterface::save()

serialize()

public final serialize() : string
Return values
string

unlock()

Unlock file after writing.

public unlock() : bool
Tags
see
FileInterface::unlock()
Return values
bool

Returns true if the file was successfully unlocked, false otherwise.

unserialize()

public final unserialize(string $serialized) : void
Parameters
$serialized : string

doSerialize()

protected doSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

doUnserialize()

protected doUnserialize(array<string|int, mixed> $serialized) : void
Parameters
$serialized : array<string|int, mixed>

getUnserializeAllowedClasses()

protected getUnserializeAllowedClasses() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|bool

setFilepath()

protected setFilepath(string $filepath) : void
Parameters
$filepath : string

tempname()

protected tempname(string $filename[, int $length = 5 ]) : string
Parameters
$filename : string
$length : int = 5
Return values
string

        
On this page

Search results