Methods summary
public static
boolean
|
#
chmod( string $target, integer $mode = 0777 )
Change the permission of a file or folder
Replaces icms_chmod()
Parameters
- $target
- target file or folder
- $mode
- permission
Returns
boolean Returns true on success, false on failure
Author
Newbb2 developement team
|
public static
boolean
|
#
mkdir( string $target, integer $mode = 0777, string $base = ICMS_ROOT_PATH, array $metachars = array() )
Safely create a folder and any folders in between
Replaces icms_mkdir()
Parameters
- $target
- path to the folder to be created
- $mode
- permissions to set on the folder. This is affected by umask in effect
- $base
- root location for the folder, ICMS_ROOT_PATH or ICMS_TRUST_PATH, for example
- $metachars
- Characters to exclude from a valid path name
Returns
boolean True if folder is created, False if it is not
|
public static
|
#
cleanFolders( string $dir, boolean $remove_admin_cache = FALSE )
Removes the content of a folder.
Replaces icms_clean_folders()
Parameters
- $dir
- The folder path to cleaned. Must be an array like: array('templates_c' => ICMS_COMPILE_PATH . "/");
- $remove_admin_cache
- True to remove admin cache, if required.
Author
|
public static
|
#
cleanWriteFolders( )
Clean up all writable folders
Replaces icms_cleaning_write_folders()
|
public static
boolean
|
#
copyRecursive( string $source, string $dest )
Copy a file, or a folder and its contents
Replaces icms_copyr()
Parameters
- $source
- The source
- $dest
- The destination
Returns
boolean Returns true on success, false on failure
Author
|
public static
The
|
#
deleteFile( string $dirname )
Deletes a file
Replaces icms_deleteFile()
Parameters
- $dirname
- path of the file
Returns
The unlinked dirname
|
public static
boolean
|
#
copyStream( string $src, string $dest )
Copy a file, or a folder and its contents from a website to your host
Replaces icms_stream_copy()
Parameters
- $src
- The source
- $dest
- The destination
Returns
boolean Returns stream_copy_to_stream($src, $dest) on success, false on failure
Author
|
public static
|
#
deleteRecursive( string $dir, boolean $deleteRootToo = true )
Recursively delete a directory
Replaces icms_unlinkRecursive()
Parameters
- $dir
- Directory name
- $deleteRootToo
- Delete specified top-level directory as well
|
public static
boolean
|
#
writeIndexFile( string $path = '' )
Writes index file
Replaces xoops_write_index_file() from cp_functions.php
Writes index file
Replaces xoops_write_index_file() from cp_functions.php
Parameters
- $path
- path to the file to write
Returns
boolean
|
public static
|
#
generateChecksum( )
Create a checksum file for your installation directory
Create a checksum file for your installation directory
Author
|
public static
|
#
validateChecksum( )
Validate the current installation directory against an existing checksum file
This reports any changes to your installation directory - added, removed or changed files
Validate the current installation directory against an existing checksum file
This reports any changes to your installation directory - added, removed or changed files
Author
|
public static
array
|
#
getDirList( string $dirname, array $ignore = array('cvs', '_darcs', '.svn'), boolean $hideDot = TRUE )
Gets a list of all directories within a path
Gets a list of all directories within a path
Parameters
- $dirname
- A path to a directory
- $ignore
- A list of folders to ignore
- $hideDot
- Hide folders starting with a dot?
Returns
array An array of directory names
|
public static
array
|
#
getFileList( string $dirname, string $prefix = '', array $extension = array(), boolean $hideDot = FALSE )
Get a list of files in a directory
Get a list of files in a directory
This can be used for several different situations - To retrieve an array of images, use getFileList($dirname, $prefix, array('gif', 'jpg', 'png')) To retrieve an array of fonts, use getFileList($dirname, $prefix, array('ttf')) To retrieve an array of HTML files, use getFileList($dirname, $prefix, array('html', 'htm', 'xhtml'))
Parameters
- $dirname
- A path to a directory
- $prefix
- A prefix to add to the beginning of the file names
- $extension
- Filter the list by these extensions
- $hideDot
- Hide files starting with a dot?
Returns
array $fileList A list of files in a directory
|
public static
|
#
writeFile( $contents, $filename, $extension = '', $location = ICMS_TRUST_PATH )
|
public static
|
#
getImgList( $dirname, $prefix = '', $extension = array('gif', 'jpg', 'png') )
|
public static
|
#
getFontList( $dirname, $prefix = '', $extension = array('ttf') )
|
public static
|
#
getPhpFiles( $dirname, $prefix = '', $extension = array('php') )
|
public static
|
#
getHtmlFiles( $dirname, $prefix = '', $extension = array('htm', 'html', 'xhtml') )
|