API Documentation

Filter/File/Rename.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Filter
version
$Id: Rename.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Filter_File_Rename

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Filter_File_Rename

Implements
Zend_Filter_Interface
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Filter
Properties
$_files
Methods
__construct
getFile
setFile
addFile
getNewName
filter
_convertOptions
_getFileName

Description

Properties

$_files

 $_files = 'array'

Internal array of array(source, target, overwrite)

Details

visibility
protected
default
array
final
false
static
false

Methods

__construct

__construct( string|array $options ) : void

Class constructor

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 ?

Arguments
$options
stringarray
Target file or directory to be renamed
Details
visibility
public
final
false
static
false

_convertOptions

_convertOptions( array $options ) : array

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

Arguments
$options
array
Output
array
Details
visibility
protected
final
false
static
false

_getFileName

_getFileName( string $file ) : array

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

Arguments
$file
string
Filename to get the informations for
Output
array
Details
visibility
protected
final
false
static
false

addFile

addFile( string|array $options ) : Zend_Filter_File_Rename

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

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 ?

Arguments
$options
stringarray
Old file or directory to be rewritten
Details
visibility
public
final
false
static
false

filter

filter( string $value ) : string

Defined by Zend_Filter_Interface

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

Arguments
$value
string
Full path of file to change
Output
string
The new filename which has been set, or false when there were errors
Details
visibility
public
final
false
static
false
throws

getFile

getFile( ) : array

Returns the files to rename and their new name and location

Output
array
Details
visibility
public
final
false
static
false

getNewName

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

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

Arguments
$value
string
Full path of file to change
$source
boolean
Return internal informations
Output
string
The new filename which has been set
Details
visibility
public
final
false
static
false

setFile

setFile( string|array $options ) : Zend_Filter_File_Rename

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

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 ?

Arguments
$options
stringarray
Old file or directory to be rewritten
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.