CInbox (Common-Inbox)  0.1
Common functionality for ingesting files for archiving.
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes
TaskCleanFilenames Class Reference
Inheritance diagram for TaskCleanFilenames:
TaskFilesMatch CITask

List of all members.

Public Member Functions

 __construct (&$CIFolder)
 init ()
 run ()
 setMapping ($mapping)
 cleanFilename ($filename)

Public Attributes

const TASK_LABEL = 'Clean filenames'
const CONF_CLEAN_SOURCE = 'CLEAN_SOURCE'

Static Public Attributes

static $CHARS_UMLAUTS
static $CHARS_ILLEGAL
static $CHARS_WHITESPACE
static $CHARS_SLASHES
static $CHARS_BRACKETS
static $CHARS_QUOTATION
static $CHARS_QUOTATION2
static $CHARS_PICKY

Protected Member Functions

 loadSettings ()
 renameFile ($fileIn, $fileOut)

Protected Attributes

 $cleanSource

Detailed Description

Cleans files/foldernames of the folder, applying certain replacement rules for 'non-safe' characters.

Author:
Peter Bubestinger-Steindl (pb@av-rd.com)
See also:

Member Function Documentation

Replaces possibly dangerous/problematic characters in $filename string. To be used for file- or foldernames.

Prepare everything so it's ready for processing.

Returns:
bool success True if init went fine, False if an error occurred.

Reimplemented from TaskFilesMatch.

Load settings from config that are relevant for this task.

Reimplemented from CITask.

TaskCleanFilenames::renameFile ( fileIn,
fileOut 
) [protected]

Rename a file from $fileIn to $fileOut.

Perform the actual steps of this task.

Reimplemented from CITask.

Define custom mapping of characters for cleanFilename().


Member Data Documentation

TaskCleanFilenames::$CHARS_BRACKETS [static]
Initial value:
 array(
            "(" => "_",
            ")" => "_",
            "[" => "_",
            "]" => "_",
            "{" => "_",
            "}" => "_",
            "<" => "_",
            ">" => "_",
            )
TaskCleanFilenames::$CHARS_ILLEGAL [static]
Initial value:
 array(
            "?" => "_",
            "*" => "_",
            ":" => "_",
            )
TaskCleanFilenames::$CHARS_PICKY [static]
Initial value:
 array(
            "#" => "_",
            "," => "_",
            ";" => "_",
            "&" => "and",
            )
TaskCleanFilenames::$CHARS_QUOTATION [static]
Initial value:
 array(
            "„" => "\"",
            "“" => "\"",
            "´" => "'",
            "`" => "'",
            )
TaskCleanFilenames::$CHARS_QUOTATION2 [static]
Initial value:
 array(
            "„" => "_",
            "“" => "_",
            "´" => "_",
            "`" => "_",
            '"' => "_",
            "'" => "_",
            )
TaskCleanFilenames::$CHARS_SLASHES [static]
Initial value:
 array(
            "\\" => "_",
            "/" => "_",
            )
TaskCleanFilenames::$CHARS_UMLAUTS [static]
Initial value:
 array(
            "ä" => "ae",
            "ü" => "ue",
            "ö" => "oe",
            "ß" => "ss",

            "Ä" => "AE",
            "Ü" => "UE",
            "Ö" => "OE",
            )
TaskCleanFilenames::$CHARS_WHITESPACE [static]
Initial value:
 array(
            " " => "_",
            )

The documentation for this class was generated from the following file:
 All Classes Functions Variables