maintenance/importImages.inc.php File Reference

Support functions for the importImages script. More...

Go to the source code of this file.

Functions

 findFiles ($dir, $exts)
 Search a directory for files with one of a set of extensions.
 splitFilename ($filename)
 Split a filename into filename and extension.
 findAuxFile ($file, $auxExtension, $maxStrip=1)
 Find an auxilliary file with the given extension, matching the give base file path.


Detailed Description

Support functions for the importImages script.

Author:
Rob Church <robchur@gmail.com>

Definition in file importImages.inc.php.


Function Documentation

findAuxFile ( file,
auxExtension,
maxStrip = 1 
)

Find an auxilliary file with the given extension, matching the give base file path.

$maxStrip determines how many extensions may be stripped from the original file name before appending the new extension. For example, with $maxStrip = 1 (the default), file files acme.foo.bar.txt and acme.foo.txt would be auxilliary files for acme.foo.bar and the extension ".txt". With $maxStrip = 2, acme.txt would also be acceptable.

Parameters:
$file base path
$auxExtension the extension to be appended to the base path
$maxStrip the maximum number of extensions to strip from the base path (default: 1)
Returns:
string or false

Definition at line 65 of file importImages.inc.php.

References $file, and $n.

findFiles ( dir,
exts 
)

Search a directory for files with one of a set of extensions.

Parameters:
$dir Path to directory to search
$exts Array of extensions to search for
Returns:
mixed Array of filenames on success, or false on failure

Definition at line 18 of file importImages.inc.php.

References $ext, $file, $files, and splitFilename().

splitFilename ( filename  ) 

Split a filename into filename and extension.

Parameters:
$filename Filename
Returns:
array

Definition at line 43 of file importImages.inc.php.

References $ext, $filename, and $fname.

Referenced by findFiles().


Generated on Sat Sep 5 02:08:27 2009 for MediaWiki by  doxygen 1.5.9