category Zend
package Zend_Filter
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Class constructor

__construct(string|array $options) : void

Options argument may be either a string, a Zend_Config object, or an array. If an array or Zend_Config object, it accepts the following keys: 'source' => Source filename or directory which will be renamed 'target' => Target filename or directory, the new name of the sourcefile 'overwrite' => Shall existing files be overwritten ?

Parameters

$options

stringarray

Target file or directory to be renamed

Adds a new file or directory as target to the existing ones

addFile(string|array $options) : \Zend_Filter_File_Rename

Array accepts the following keys: 'source' => Source filename or directory which will be renamed 'target' => Target filename or directory, the new name of the sourcefile 'overwrite' => Shall existing files be overwritten ?

Parameters

$options

stringarray

Old file or directory to be rewritten

Returns

\Zend_Filter_File_Rename

Defined by Zend_Filter_Interface

filter(string $value) : string

Renames the file $value to the new name set before Returns the file $value, removing all but digit characters

inherited_from \Zend_Filter_Interface::filter()

Parameters

$value

string

Full path of file to change

Exceptions

\Zend_Filter_Exception

Returns

stringThe new filename which has been set, or false when there were errors

Returns the files to rename and their new name and location

getFile() : array

Returns

array

Returns only the new filename without moving it But existing files will be erased when the overwrite option is true

getNewName(string $value, boolean $source = false) : string

Parameters

$value

string

Full path of file to change

$source

boolean

Return internal informations

Returns

stringThe new filename which has been set

Sets a new file or directory as target, deleting existing ones

setFile(string|array $options) : \Zend_Filter_File_Rename

Array accepts the following keys: 'source' => Source filename or directory which will be renamed 'target' => Target filename or directory, the new name of the sourcefile 'overwrite' => Shall existing files be overwritten ?

Parameters

$options

stringarray

Old file or directory to be rewritten

Returns

\Zend_Filter_File_Rename

Internal method for creating the file array Supports single and nested arrays

_convertOptions(array $options) : array

Parameters

$options

array

Returns

array

Internal method to resolve the requested source and return all other related parameters

_getFileName(string $file) : array

Parameters

$file

string

Filename to get the informations for

Returns

array

 Properties

 

Internal array of array(source, target, overwrite)

$_files 

Default

array()