ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
MDB2_LOB Class Reference
+ Collaboration diagram for MDB2_LOB:

Public Member Functions

 stream_open ($path, $mode, $options, &$opened_path)
 open stream
 stream_read ($count)
 read stream
 stream_write ($data)
 write stream, note implemented
 stream_tell ()
 return the current position
 stream_eof ()
 Check if stream reaches EOF.
 stream_seek ($offset, $whence)
 Seek stream, not implemented.
 stream_stat ()
 return information about stream
 stream_close ()
 close stream

Data Fields

 $db_index
 $lob_index

Detailed Description

Definition at line 62 of file LOB.php.

Member Function Documentation

MDB2_LOB::stream_close ( )

close stream

public

Definition at line 245 of file LOB.php.

References $db_index, and $GLOBALS.

{
if (isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
$db =& $GLOBALS['_MDB2_databases'][$this->db_index];
if (isset($db->datatype->lobs[$this->lob_index])) {
$db->datatype->_destroyLOB($db->datatype->lobs[$this->lob_index]);
unset($db->datatype->lobs[$this->lob_index]);
}
}
}
MDB2_LOB::stream_eof ( )

Check if stream reaches EOF.

Returns
bool public

Definition at line 185 of file LOB.php.

References $db_index, and $GLOBALS.

{
if (!isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
return true;
}
$db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$result = $db->datatype->_endOfLOB($db->datatype->lobs[$this->lob_index]);
if (version_compare(phpversion(), "5.0", ">=")
&& version_compare(phpversion(), "5.1", "<")
) {
return !$result;
}
return $result;
}
MDB2_LOB::stream_open (   $path,
  $mode,
  $options,
$opened_path 
)

open stream

Parameters
stringspecifies the URL that was passed to fopen()
stringthe mode used to open the file
intholds additional flags set by the streams API
stringnot used
Returns
bool public

Definition at line 95 of file LOB.php.

References $db_index, $GLOBALS, and $path.

{
if (!preg_match('/^rb?\+?$/', $mode)) {
return false;
}
$url = parse_url($path);
if (empty($url['host'])) {
return false;
}
$this->db_index = (int)$url['host'];
if (!isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
return false;
}
$db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$this->lob_index = (int)$url['user'];
if (!isset($db->datatype->lobs[$this->lob_index])) {
return false;
}
return true;
}
MDB2_LOB::stream_read (   $count)

read stream

Parameters
intnumber of bytes to read
Returns
string public

Definition at line 127 of file LOB.php.

References $data, $db_index, $GLOBALS, and $lob_index.

{
if (isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
$db =& $GLOBALS['_MDB2_databases'][$this->db_index];
$db->datatype->_retrieveLOB($db->datatype->lobs[$this->lob_index]);
$data = $db->datatype->_readLOB($db->datatype->lobs[$this->lob_index], $count);
$length = strlen($data);
if ($length == 0) {
$db->datatype->lobs[$this->lob_index]['endOfLOB'] = true;
}
$db->datatype->lobs[$this->lob_index]['position'] += $length;
return $data;
}
}
MDB2_LOB::stream_seek (   $offset,
  $whence 
)

Seek stream, not implemented.

Parameters
intoffset
intwhence
Returns
bool public

Definition at line 213 of file LOB.php.

{
return false;
}
MDB2_LOB::stream_stat ( )

return information about stream

public

Definition at line 226 of file LOB.php.

References $db_index, and $GLOBALS.

{
if (isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
$db =& $GLOBALS['_MDB2_databases'][$this->db_index];
return array(
'db_index' => $this->db_index,
'lob_index' => $this->lob_index,
);
}
}
MDB2_LOB::stream_tell ( )

return the current position

Returns
int current position public

Definition at line 168 of file LOB.php.

References $db_index, $GLOBALS, and $lob_index.

{
if (isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
$db =& $GLOBALS['_MDB2_databases'][$this->db_index];
return $db->datatype->lobs[$this->lob_index]['position'];
}
}
MDB2_LOB::stream_write (   $data)

write stream, note implemented

Parameters
stringdata
Returns
int public

Definition at line 154 of file LOB.php.

{
return 0;
}

Field Documentation

MDB2_LOB::$db_index

Definition at line 71 of file LOB.php.

Referenced by stream_close(), stream_eof(), stream_open(), stream_read(), stream_stat(), and stream_tell().

MDB2_LOB::$lob_index

Definition at line 80 of file LOB.php.

Referenced by stream_read(), and stream_tell().


The documentation for this class was generated from the following file: