\app\framework\Component\Storage\Driver\LocalLocalHelper

Class LocalHelper v1.1

Summary

Methods
Properties
Constants
getInstance()
deleteInstance()
getKey()
ensureDirectoryExists()
normalizeDirectoryPath()
buildPath()
No public properties found
No constants found
init()
createDirectory()
normalizePath()
getAbsolutePrefix()
$wfInstance
N/A
__construct()
__wakeup()
__clone()
No private properties found
N/A

Properties

$wfInstance

$wfInstance : 

Type

Methods

getInstance()

getInstance() : $this

Return the current instance.

If instance doesn't exist, a new instance will be created.

Returns

$this

deleteInstance()

deleteInstance() 

Deletes the current singleton instance.

getKey()

getKey(string  $path, string  $directory) : string

Gets the key using file $path and storage $directory

Parameters

string $path

Path to extract file key from

string $directory

Directory of the storage

Returns

string

ensureDirectoryExists()

ensureDirectoryExists(  $directory,   $create) 

To check if directory exists.

Parameters

$directory
$create


StorageException If directory doesn't exist

normalizeDirectoryPath()

normalizeDirectoryPath(  $path) : string

Normalize path (strip '.', '.

.' and make sure it's not a symlink)

Parameters

$path

Returns

string

buildPath()

buildPath(  $key,   $directory,   $create) : mixed

Build absolute path by given $key and $directory

Parameters

$key
$directory
$create

Returns

mixed

init()

init() 

Override this if you wish to do some stuff once the singleton instance has been created.

createDirectory()

createDirectory(string  $directory) 

Create directory

Parameters

string $directory

Directory path to create

normalizePath()

normalizePath(string  $path) : string

Normalizes the given path

Parameters

string $path

Returns

string

getAbsolutePrefix()

getAbsolutePrefix(string  $path) : string

Returns the absolute prefix of the given path

Parameters

string $path

A normalized path

Returns

string

__construct()

__construct() 

The constructor is set to private to prevent creating new instances.

If you want to fire a function after the singleton instance is created, just implement 'init' method into your class.

__wakeup()

__wakeup() 

Declare it as private.

__clone()

__clone() 

Declare it as private.