apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: File_Util

Source Location: /File-1.1.0RC2/File/Util.php

Class Overview


File_Util


Methods


Inherited Variables

Inherited Methods


Class Details

[line 40]
File_Util

File and directory utility functions.



[ Top ]


Method Detail

buildPath   [line 52]

void buildPath( array $parts, [string $separator = DIRECTORY_SEPARATOR])

Returns a string path built from the array $pathParts. Where a join occurs multiple separators are removed. Joins using the optional separator, defaulting to the PHP DIRECTORY_SEPARATOR constant.
  • Access: public

Parameters:

array   $parts   —  Array containing the parts to be joined
string   $separator   —  The directory seperator

[ Top ]

isAbsolute   [line 164]

boolean isAbsolute( string $path)

Returns boolean based on whether given path is absolute or not.
  • Return: True if the path is absolute, false if it is not
  • Access: public

Parameters:

string   $path   —  Given path

[ Top ]

listDir   [line 288]

array listDir( string $path, [int $list = FILE_LIST_ALL], [int $sort = FILE_SORT_NONE])

List Directory
  • Access: public

Parameters:

string   $path   — 
int   $list   — 
int   $sort   — 

[ Top ]

pathInRoot   [line 267]

bool pathInRoot( string $path, string $root)

Check whether path is in root path
  • Access: public

Parameters:

string   $path   — 
string   $root   — 

[ Top ]

realPath   [line 219]

string realPath( string $path, [string $separator = DIRECTORY_SEPARATOR])

Get real path (works with non-existant paths)
  • Access: public

Parameters:

string   $path   — 
string   $separator   — 

[ Top ]

relativePath   [line 185]

string relativePath( string $path, string $root, [string $separator = DIRECTORY_SEPARATOR])

Get path relative to another path
  • Access: public

Parameters:

string   $path   — 
string   $root   — 
string   $separator   — 

[ Top ]

skipRoot   [line 82]

string skipRoot( string $path)

Returns a path without leading / or C:\. If this is not present the path is returned as is.
  • Return: The processed path or the path as is
  • Access: public

Parameters:

string   $path   —  The path to be processed

[ Top ]

sortFiles   [line 327]

array sortFiles( array $files, int $sort)

Sort Files
  • Access: public

Parameters:

array   $files   — 
int   $sort   — 

[ Top ]

tmpDir   [line 102]

string tmpDir( )

Returns the temp directory according to either the TMP, TMPDIR, or TEMP env variables. If these are not set it will also check for the existence of /tmp, %WINDIR%\temp
  • Return: The system tmp directory
  • Access: public

[ Top ]

tmpFile   [line 148]

string tmpFile( [string $dirname = null])

Returns a temporary filename using tempnam() and File::tmpDir().
  • Return: Filename and path of the tmp file
  • Access: public

Parameters:

string   $dirname   —  Optional directory name for the tmp file

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:12:52 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.