package Default
inherited_from \Zend\Filter\AbstractFilter

 Methods

Class constructor

__construct(string|array|\Traversable $options) 

Options argument may be either a string, a Zend\Config\Config object, or an array. If an array or Zend\Config\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 source file 'overwrite' => Shall existing files be overwritten ? 'randomize' => Shall target files have a random postfix attached?

Parameters

$options

stringarray\Traversable

Target file or directory to be renamed

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Invoke filter as a command

__invoke(mixed $value) : mixed
Inherited

Proxies to \filter()

Parameters

$value

mixed

Exceptions

\Zend\Filter\Exception\ExceptionInterface If filtering $value is impossible

Returns

mixed

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? 'randomize' => Shall target files have a random postfix attached?

Parameters

$options

stringarray

Old file or directory to be rewritten

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\File\Rename

Defined by Zend\Filter\Filter

filter(string|array $value) : string | array

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

Parameters

$value

stringarray

Full path of file to change or $_FILES data array

Exceptions

\Zend\Filter\Exception\RuntimeException

Returns

stringarrayThe new filename which has been set

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

Exceptions

\Zend\Filter\Exception\InvalidArgumentException If the target file already exists.

Returns

stringThe new filename which has been set

Retrieve options representing object state

getOptions() : array
Inherited

Returns

array

hasPcreUnicodeSupport()

hasPcreUnicodeSupport() : boolean
InheritedStatic
deprecated Since 2.1.0

Returns

boolean

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? 'randomize' => Shall target files have a random postfix attached?

fluent This method is part of a fluent interface and will return the same instance

Parameters

$options

stringarray

Old file or directory to be rewritten

Returns

\Zend\Filter\File\Rename

setOptions()

setOptions(array|\Traversable $options) : \Zend\Filter\File\Rename
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$options

array\Traversable

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

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 | string

Parameters

$file

string

Filename to get the informations for

Returns

arraystring

isOptions()

isOptions(mixed $options) : boolean
InheritedStatic

Parameters

$options

mixed

Returns

boolean

 Properties

 

Internal array of array(source, target, overwrite)

$files 

Default

array()
 

Filter options

$options : array

Default

array()