maintenance/importImages.inc 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.
 getFileCommentFromSourceWiki ($wiki_host, $file)
 getFileUserFromSourceWiki ($wiki_host, $file)


Detailed Description

Support functions for the importImages script.

Author:
Rob Church <robchur@gmail.com>

Mij <mij@bitchx.it>

Definition in file importImages.inc.


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 67 of file importImages.inc.

References $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 19 of file importImages.inc.

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

getFileCommentFromSourceWiki ( wiki_host,
file 
)

Definition at line 93 of file importImages.inc.

References $url, and Http::get().

getFileUserFromSourceWiki ( wiki_host,
file 
)

Definition at line 103 of file importImages.inc.

References $url, and Http::get().

splitFilename ( filename  ) 

Split a filename into filename and extension.

Parameters:
$filename Filename
Returns:
array

Definition at line 45 of file importImages.inc.

References $ext, $filename, and $fname.

Referenced by findFiles().


Generated on Sat Apr 30 22:57:28 2011 for MediaWiki by  doxygen 1.5.9