Class BufferedAction

Description

Primitive class that allows output to be suppressed

Located in /inc/actions/bufferedaction.php (line 31)

ActionAction
   |
   --BufferedAction
Direct descendents
Class Description
ActionBackupDB Create a dump of the database for backup purposes
ActionExport Export various views of the booking data in numerous formats
Variable Summary
string $errorMessage
string $filename
boolean $inline
string $mimetype
Method Summary
void BufferedAction (BumblebeeAuth $auth, array $pdata)
void getFilename (string $action, string $what, string $ext)
void outputTextFile (string $filename, string $stream)
void saveTextFile (string $filename, string $stream)
void startOutputTextFile (string $filename)
void unbuffer ()
void unbufferForError (string $err)
Variables
string $bufferedStream (line 36)

data stream to be buffered then output

string $errorMessage (line 46)

error message (if any) for display instead of the stream

string $filename (line 41)

filename to suggest to the browser for saving the stream

boolean $inline = true (line 56)

whether the file is to be displayed by the browser automatically or offered to be saved

string $mimetype = 'text/plain' (line 51)

mime type for instructing the browser what to do with the stream

Inherited Variables

Inherited from ActionAction

ActionAction::$auth
ActionAction::$DEBUG
ActionAction::$ob_flush_ok
ActionAction::$PD
ActionAction::$PDATA
ActionAction::$readOnly
ActionAction::$stdmessages
Methods
Constructor BufferedAction (line 65)

Initialising the class

  • return: nothing
void BufferedAction (BumblebeeAuth $auth, array $pdata)
  • BumblebeeAuth $auth: Authorisation object
  • array $pdata: extra state data from the call path
getFilename (line 139)

Work out an appropriate (and hopefully unique) filename for the data Uses the Config option in bumblebee.ini [export]::filename The following parameters are replaced: __date__ __action__ __what__

void getFilename (string $action, string $what, string $ext)
  • string $action: the action verb
  • string $what: the nature of the export
  • string $ext: the file extension (pdf, csv etc) without the dot.
outputTextFile (line 114)

Dump a data stream to the user

void outputTextFile (string $filename, string $stream)
  • string $filename: the suggested filename to give to the browser
  • string $stream: the data stream to be sent
saveTextFile (line 124)

Save the datastream to a local file

void saveTextFile (string $filename, string $stream)
  • string $filename: the filename to save the data to on the server
  • string $stream: the data stream to be saved
sendBufferedStream (line 95)

Send the data back to the user now

void sendBufferedStream ()
startOutputTextFile (line 103)

send headers to the browser with the filename and the mimetype

void startOutputTextFile (string $filename)
  • string $filename: the suggested filename to give to the browser
unbuffer (line 74)

Unbuffer the stream and allow the data to be output

void unbuffer ()
unbufferForError (line 86)

Unbuffer the stream and get ready to drop the error message to the user

void unbufferForError (string $err)
  • string $err: error message to be output

Inherited Methods

Inherited From ActionAction

ActionAction::ActionAction()
ActionAction::delete()
ActionAction::edit()
ActionAction::go()
ActionAction::log()
ActionAction::mungeInputData()
ActionAction::readOnlyError()
ActionAction::reportAction()
ActionAction::select()
ActionAction::_dataCleanse()

Documentation generated on Tue, 06 Mar 2007 10:00:56 +0000 by phpDocumentor 1.3.0