yana

phpDocumentor v 1.4.0

Class DbBlob

Description

read binary large objects (blobs) from database
Example of usage:
  1.  $db $YANA->connect('foo');
  2.  $id $db->get('foo.1.foo_file');
  3.  
  4.  $file new DbBlob($id);
  5.  $file->read();
  6.  
  7.  // output file to screen
  8.  print $file->get();
  9.  // copy file to some destination
  10.  $file->copy('foo/bar.dat');
  • since: 2.9.2
  • access: public
Object
   |
   --FileSystemResource
      |
      --FileReadonly
         |
         --DbBlob
Method Summary
  • bool copy (string $destFile, [bool $overwrite = true])
  • string|bool(false) getFileId ([int $i = null], [bool $fullsize = null])
  • int getFilesize ()
  • string|bool(false) getMimeType ()
  • bool read ()

Methods

copy the file to some destination
bool copy (
string $destFile, [bool $overwrite = true]
)
List of parameters:
Name Type Description
$destFile string destination to copy the file to
$overwrite bool setting this to false will prevent existing files from getting overwritten
Description:
  • access: public
read the current file id from the session vars
string|bool(false) getFileId (
[int $i = null], [bool $fullsize = null]
)
List of parameters:
Name Type Description
$i int index number in files list, of the file to get
$fullsize bool show full size or thumb-nail (images only)
Description:
Returns the database id of a selected file. This function is supposed to be used in combination with the form-generator.
Example of usage:
  1.  $dbBlob new DbBlob(DbBlob::getFileId());
Returns bool(false) on error.
  • since: 2.9.3
  • access: public
get size of this file
int getFilesize ()
Description:
Returns the size of the file in bytes (from cached value). If an error occurs, bool(false) is returned.
  • access: public
get mime-type of this file
string|bool(false) getMimeType ()
Description:
Returns bool(false) on error.
  • access: public
read file contents
bool read ()
Description:
Returns bool(true) on success and bool(false) on error.
  • access: public

Redefinition of: FileReadonly::read()

inherited from base classes

Inherited From FileReadonly

Inherited From FileSystemResource

Inherited From Object

Documentation generated on Sat, 03 Jan 2009 22:22:15 +0100 by phpDocumentor 1.4.0

yana author: Thomas MeyerHomepage: www.yanaframework.net