EC-CUBE
Public メソッド | 変数
クラス File_SearchReplace

Public メソッド

 File_SearchReplace ($find, $replace, $files, $directories= '', $include_subdir=TRUE, $ignore_lines=array())
 getNumOccurences ()
 getLastError ()
 setFind ($find)
 setReplace ($replace)
 setFiles ($files)
 setDirectories ($directories)
 setIncludeSubdir ($include_subdir)
 setIgnoreLines ($ignore_lines)
 setSearchFunction ($search_function)
 search ($filename)
 quickSearch ($filename)
 pregSearch ($filename)
 eregSearch ($filename)
 writeout ($filename, $contents)
 doFiles ($ser_func)
 doDirectories ($ser_func)
 doSearch ()
 doReplace ()

変数

 $find
 $replace
 $files
 $directories
 $include_subdir
 $ignore_lines
 $ignore_sep
 $occurences
 $search_function
 $php5
 $last_error

関数

doDirectories ( ser_func)

Function called by doSearch() to go through any directories that need searching.

private

引数:
string$ser_funcThe search function to use.
doFiles ( ser_func)

Function called by doSearch() to go through any files that need searching.

private

引数:
string$ser_funcThe search function to use.
doReplace ( )

This starts the search/replace off. Call this to do the replace. First do whatever files are specified, and/or if directories are specified, do those too.

public

doSearch ( )

This starts the search/replace off. The behavior of this function will likely to be changed in future versions to work in read only mode. If you want to do actual replace with writing files - use doReplace method instead.

public

eregSearch ( filename)

Ereg search routine.

private

引数:
string$filenameThe filename to search and replace upon.
戻り値:
array Will return an array containing the new file contents and the number of occurences. Will return FALSE if there are no occurences.
File_SearchReplace ( find,
replace,
files,
directories = '',
include_subdir = TRUE,
ignore_lines = array() 
)

Sets up the object

public

引数:
string$findThe string/regex to find.
string$replaceThe string/regex to replace $find with.
array$filesThe file(s) to perform this operation on.
array$directories(optional) The directories to perform this operation on.
bool$include_subdirIf performing on directories, whether to traverse subdirectories.
array$ignore_linesIgnore lines beginning with any of the strings in this array. This feature only works with the "normal" search.

Accessor for retrieving last error.

public

戻り値:
string The last error that occurred, if any.

Accessor to return the number of occurences found.

public

戻り値:
int Number of occurences found.
pregSearch ( filename)

Preg search routine.

private

引数:
string$filenameThe filename to search and replace upon.
戻り値:
array Will return an array containing the new file contents and the number of occurences. Will return FALSE if there are no occurences.
quickSearch ( filename)

Quick search routine.

private

引数:
string$filenameThe filename to search and replace upon.
戻り値:
array Will return an array containing the new file contents and the number of occurences. Will return FALSE if there are no occurences.
search ( filename)

Default ("normal") search routine.

private

引数:
string$filenameThe filename to search and replace upon.
戻り値:
array Will return an array containing the new file contents and the number of occurences. Will return FALSE if there are no occurences.
setDirectories ( directories)

Accessor for setting directories variable.

public

引数:
array$directoriesThe directories to perform this operation on.
setFiles ( files)

Accessor for setting files variable.

public

引数:
array$filesThe file(s) to perform this operation on.
setFind ( find)

Accessor for setting find variable.

public

引数:
string$findThe string/regex to find.
setIgnoreLines ( ignore_lines)

Accessor for setting ignore_lines variable.

public

引数:
array$ignore_linesIgnore lines beginning with any of the strings in this array. This feature only works with the "normal" search.
setIncludeSubdir ( include_subdir)

Accessor for setting include_subdir variable.

public

引数:
bool$include_subdirWhether to traverse subdirectories or not.
setReplace ( replace)

Accessor for setting replace variable.

public

引数:
string$replaceThe string/regex to replace the find string/regex with.
setSearchFunction ( search_function)

Function to determine which search function is used.

public

引数:
stringThe search function that should be used. Can be any one of: normal - Default search. Goes line by line. Ignore lines feature only works with this type. quick - Uses str_replace for straight replacement throughout file. Quickest of the lot. preg - Uses preg_replace(), so any regex valid with this function is valid here. ereg - Uses ereg_replace(), so any regex valid with this function is valid here.
writeout ( filename,
contents 
)

Function to writeout the file contents.

private

引数:
string$filenameThe filename of the file to write.
string$contentsThe contents to write to the file.

このクラスの説明は次のファイルから生成されました:
 全て データ構造 ネームスペース 関数 変数