Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
UFileSystem Class Reference

File system utilities Ubiquity\utils\base$UFileSystem This class is part of Ubiquity. More...

+ Inheritance diagram for UFileSystem:

Static Public Member Functions

static glob_recursive ($pattern, $flags=0)
 Find recursively pathnames matching a pattern.
 
static deleteAllFilesFromFolder ($folder, $mask=' *')
 Deletes all files from a folder (not in subfolders)
 
static deleteFile ($filename)
 Deletes a file, in safe mode.
 
static safeMkdir ($dir, $mode=0777, $recursive=true)
 Tests the existance and eventually creates a directory.
 
static cleanPathname ($path)
 Cleans a directory path by removing double backslashes or slashes and using DIRECTORY_SEPARATOR.
 
static cleanFilePathname ($path)
 Cleans a file path by removing double backslashes or slashes and using DIRECTORY_SEPARATOR.
 
static tryToRequire ($file)
 Try to require a file, in safe mode.
 
static lastModified ($filename)
 Gets file modification time.
 
static load ($filename)
 Reads entire file into a string in safe mode.
 
static getDirFromNamespace ($ns)
 Returns the directory base on ROOT, corresponding to a namespace.
 
static delTree ($dir)
 Deletes recursivly a folder and its content.
 
static getLines ($filename, $reverse=false, $maxLines=null, $lineCallback=null)
 Returns the lines of a file in an array.
 
static relativePath ($from, $to, $separator=DIRECTORY_SEPARATOR)
 Returns relative path between two sources.
 
- Static Public Member Functions inherited from UFileSystemWriter
static openReplaceInTemplateFile ($source, $keyAndValues)
 
static openReplaceWriteFromTemplateFile ($source, $destination, $keyAndValues)
 
static replaceFromTemplate ($content, $keyAndValues)
 
static replaceWriteFromContent ($content, $destination, $keyAndValues)
 
static save ($filename, $content, $flags=LOCK_EX)
 
static xcopy ($source, $dest, $permissions=0755)
 
static xmove (string $source, string $dest, int $permission=0755)
 

Static Protected Member Functions

static getLinesByLine ($filename, $reverse, $maxLines, $lineCallback)
 

Detailed Description

File system utilities Ubiquity\utils\base$UFileSystem This class is part of Ubiquity.

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.0.4

Definition at line 16 of file UFileSystem.php.

Member Function Documentation

◆ cleanFilePathname()

static cleanFilePathname (   $path)
static

Cleans a file path by removing double backslashes or slashes and using DIRECTORY_SEPARATOR.

Parameters
string$path
Returns
string

Definition at line 102 of file UFileSystem.php.

◆ cleanPathname()

static cleanPathname (   $path)
static

Cleans a directory path by removing double backslashes or slashes and using DIRECTORY_SEPARATOR.

Parameters
string$path
Returns
string

Definition at line 79 of file UFileSystem.php.

◆ deleteAllFilesFromFolder()

static deleteAllFilesFromFolder (   $folder,
  $mask = '*' 
)
static

Deletes all files from a folder (not in subfolders)

Parameters
string$folder
string$mask

Definition at line 39 of file UFileSystem.php.

◆ deleteFile()

static deleteFile (   $filename)
static

Deletes a file, in safe mode.

Parameters
string$filename
Returns
boolean

Definition at line 53 of file UFileSystem.php.

◆ delTree()

static delTree (   $dir)
static

Deletes recursivly a folder and its content.

Parameters
string$dir
Returns
boolean

Definition at line 169 of file UFileSystem.php.

◆ getDirFromNamespace()

static getDirFromNamespace (   $ns)
static

Returns the directory base on ROOT, corresponding to a namespace.

Parameters
string$ns
Returns
string

Definition at line 159 of file UFileSystem.php.

◆ getLines()

static getLines (   $filename,
  $reverse = false,
  $maxLines = null,
  $lineCallback = null 
)
static

Returns the lines of a file in an array.

Parameters
string$filename
boolean$reverse
null | int$maxLines
callback$lineCallback
Returns
array

Definition at line 186 of file UFileSystem.php.

◆ getLinesByLine()

static getLinesByLine (   $filename,
  $reverse,
  $maxLines,
  $lineCallback 
)
staticprotected

Definition at line 238 of file UFileSystem.php.

◆ glob_recursive()

static glob_recursive (   $pattern,
  $flags = 0 
)
static

Find recursively pathnames matching a pattern.

Parameters
string$pattern
integer$flags
Returns
array

Definition at line 25 of file UFileSystem.php.

◆ lastModified()

static lastModified (   $filename)
static

Gets file modification time.

Parameters
string$filename
Returns
number

Definition at line 136 of file UFileSystem.php.

◆ load()

static load (   $filename)
static

Reads entire file into a string in safe mode.

Parameters
string$filename
Returns
string|boolean

Definition at line 146 of file UFileSystem.php.

◆ relativePath()

static relativePath (   $from,
  $to,
  $separator = DIRECTORY_SEPARATOR 
)
static

Returns relative path between two sources.

Parameters
$from
$to
string$separator
Returns
string

Definition at line 225 of file UFileSystem.php.

◆ safeMkdir()

static safeMkdir (   $dir,
  $mode = 0777,
  $recursive = true 
)
static

Tests the existance and eventually creates a directory.

Parameters
string$dir
int$mode
boolean$recursive
Returns
boolean

Definition at line 67 of file UFileSystem.php.

◆ tryToRequire()

static tryToRequire (   $file)
static

Try to require a file, in safe mode.

Parameters
string$file
Returns
boolean

Definition at line 122 of file UFileSystem.php.


The documentation for this class was generated from the following file: