Class fileWriteDelete

Description

Classes used for handling files (writing/reading)

  • author: Andreas Plank <andreas.plank@web.de>
  • version: 2009-04-05 15:53:30
  • license: Noncommercial-Share

Located in /structure/classes/filemanage.php (line 22)


	
			
Variable Summary
Method Summary
 fileWriteDelete __construct ( $directory)
 void __destruct ()
 void deleteFile (string $source)
 void errors ( $which_error,  $error_message)
 void validateImage (binary $file_binary)
 void write (string $strFilename, string $strReferenceName, image $content)
 void writeDirectory (string $directory_name, [string $mode = 0777])
 image writeReference (string $strFileInput, string $strReferenceName, string $strFilename)
Variables
mixed $content (line 47)
  • access: public
string $directory = "." (line 30)

Directory to read

  • access: public
mixed $directory_name (line 74)
  • access: public
string $error_message = "" (line 38)

Error messages

Messages are generated by fileWriteDelete::errors()

  • access: public
array $error_no (line 46)

Error number

Messages are generated by fileWriteDelete::errors()

  • access: public
mixed $file_binary (line 64)
  • access: public
array $file_extension (line 55)

File's extension/data

  • access: public
mixed $source (line 73)
  • access: public
string $strFileInput (line 63)

Uploded file

It comes usually from PHP directory like /tmp/php5PBI4u

  • access: public
string $strFilename (line 72)

Destination to write the file

  • access: public
mixed $strReferenceName (line 65)
  • access: public
Methods
Constructor __construct (line 79)

Test directory if it can be opend or is writable

  • access: public
fileWriteDelete __construct ( $directory)
  • $directory
Destructor __destruct (line 99)

Close directory reading

  • access: public
void __destruct ()
deleteFile (line 360)

Deletes an image file.

void deleteFile (string $source)
  • string $source: ?path to the deleted file
errors (line 113)

Some error messages

Errors appering while reading writing files. Uses CSS class 'error'

  1. <div class="error">Some error message...</div>

void errors ( $which_error,  $error_message)
  • $which_error
  • $error_message
validateImage (line 182)

Test whether it is an image

This function tests also some settings from the configuration file. If it fails script stops with

  1. exit;

void validateImage (binary $file_binary)
  • binary $file_binary
write (line 149)

Writes a file_r.jpeg, file_r.png or file_r.gif

Writes an image file with a reference name where '_r' means is referenced. It is used e.g. for uploads.

void write (string $strFilename, string $strReferenceName, image $content)
  • string $strFilename
  • string $strReferenceName
  • image $content: from PHP variable $_FILES['uploadfile']['tmp_name']
writeDirectory (line 371)

Create a directory with full rights (mode=0777)

void writeDirectory (string $directory_name, [string $mode = 0777])
  • string $directory_name
  • string $mode: default 0777
writeReference (line 230)

Writes a reference into the image file.

An image file is referenced when the reference name is included into the image. So to say as sub caption.

image writeReference (string $strFileInput, string $strReferenceName, string $strFilename)
  • string $strFileInput: from PHP directory /tmp/php5PBI4u
  • string $strReferenceName: name of reference (default short authors' names)
  • string $strFilename: whole name of file without path, e.g.: Prcl_chor_hes_Rie2001_r.gif

Documentation generated on Mon, 14 Dec 2009 14:37:05 +0100 by phpDocumentor 1.4.2