getInstance() getInstance() : $this Return the current instance. If instance doesn't exist, a new instance will be created. Returns $this
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.