\TransvisionFiles

Files class

Utility functions for IO

Summary

Methods
Properties
Constants
fileForceContents()
getFoldersInPath()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

fileForceContents()

fileForceContents(string  $dir, string  $contents) : \Transvision\int/false

This is the equivalent of file_put_contents() but in addition it will create the folders and subfolders to the target if they don't exist

Parameters

string $dir

path to the file we want to create

string $contents

the string we want to write

Returns

\Transvision\int/false —

value in bytes if success, false otherwise

getFoldersInPath()

getFoldersInPath(string  $path, array  $excluded_folders = array()) : array

Return the list of folders in a path as an array.

Hidden folders starting with a dot (.svn, .htaccess...) are ignored.

Parameters

string $path

The directory we want to scan

array $excluded_folders

Folders to exclude from results

Returns

array —

Folders in path