class Storage (View source)

Methods

static string
path()

Get absolute path from storage location

static bool|string
resolve(string $path)

Convert path to storage path

static void
autoclean(string $path, int $time = -1)

Clear old files in a folder from storage path

static bool|string
temp($data = null, $dir = 'tmp', $prefix = '~', $sulfix = '.tmp')

Create a tmp in storage/tmp folder

static bool
write(string $path, string $data = null)

Create a file in a folder or overwrite existing file

static bool
put(string $path, string $data = null, int $flags = null)

Create a file in a folder in storage or append data to existing file

static bool
remove(string $path)

Delete a file in storage

static bool
createFolder(string $path)

Create a folder in storage using 0700 permission (if unix-like)

static bool
removeFolder(string $path)

Remove recursive folders in storage folder

Details

static string path()

Get absolute path from storage location

Return Value

string

static bool|string resolve(string $path)

Convert path to storage path

Parameters

string $path

Return Value

bool|string

static void autoclean(string $path, int $time = -1)

Clear old files in a folder from storage path

Parameters

string $path
int $time

Return Value

void

static bool|string temp($data = null, $dir = 'tmp', $prefix = '~', $sulfix = '.tmp')

Create a tmp in storage/tmp folder

Parameters

$data
$dir
$prefix
$sulfix

Return Value

bool|string

static bool write(string $path, string $data = null)

Create a file in a folder or overwrite existing file

Parameters

string $path
string $data

Return Value

bool

static bool put(string $path, string $data = null, int $flags = null)

Create a file in a folder in storage or append data to existing file

Parameters

string $path
string $data
int $flags

Return Value

bool

static bool remove(string $path)

Delete a file in storage

Parameters

string $path

Return Value

bool

static bool createFolder(string $path)

Create a folder in storage using 0700 permission (if unix-like)

Parameters

string $path

Return Value

bool

static bool removeFolder(string $path)

Remove recursive folders in storage folder

Parameters

string $path

Return Value

bool