Overview

Packages

  • Auth
    • Ads
    • Ldap
    • Xoops
  • Autotasks
  • Config
    • Category
    • Item
    • Option
  • Core
    • Filesystem
    • Filters
    • Logger
    • Mail
    • Message
    • Password
    • Security
    • StopSpammer
    • Template
    • Textsanitizer
    • VersionChecker
  • Data
    • Avatar
    • Comment
  • Database
    • Connection
    • Criteria
    • Legacy
    • MySQL
    • PDO
    • Updater
  • Feeds
    • RSS
  • File
  • Form
    • Base
    • Elements
  • ICMS
    • IPF
      • View
  • Image
    • Category
  • Ipf
    • Category
    • Controller
    • Export
    • form
    • Keyhighlighter
    • Member
    • Object
    • Permission
    • richfile
    • Tree
    • urllink
    • View
  • kernel
    • Set
  • Member
    • Group
    • GroupMembership
    • GroupPermission
    • User
  • Messaging
  • Module
  • None
  • Notification
  • Page
  • Plugins
    • Editor
  • Preload
    • Libraries
  • Privmessage
  • Session
  • SmartObject
  • View
    • Block
    • Breadcrumb
    • PageNav
    • PrinterFriendly
    • Template
    • Templates
    • Theme
    • Tree

Classes

  • icms_core_Filesystem
  • Overview
  • Package
  • Class

Class icms_core_Filesystem

Perform filesystem actions

Package: Core\Filesystem
Copyright: (c) 2007-2008 The ImpressCMS Project - www.impresscms.org
License: GNU General Public License (GPL)
Author: Steve Kenow skenow@impresscms.org
Located at core/Filesystem.php
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

Steve Kenow (aka skenow) skenow@impresscms.org
modified by Vaughan vaughan@impresscms.org
modified by Sina Asghari (aka stranger) pesian_stranger@users.sourceforge.net
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

Aidan Lister aidan@php.net
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

Sina Asghari stranger@impresscms.org
nensa at zeec dot biz
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

Steve Kenow skenow@impresscms.org
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

Steve Kenow skenow@impresscms.org
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') )
API documentation generated by ApiGen