ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
MDB2_LOB Class Reference
+ Collaboration diagram for MDB2_LOB:

Public Member Functions

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

Data Fields

 $db_index
 
 $lob_index
 

Detailed Description

Definition at line 62 of file LOB.php.

Member Function Documentation

◆ stream_close()

MDB2_LOB::stream_close ( )

close stream

public

Definition at line 245 of file LOB.php.

References $db_index, $GLOBALS, and MDB2\raiseError().

246  {
247  if (isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
248  $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
249  if (isset($db->datatype->lobs[$this->lob_index])) {
250  $db->datatype->_destroyLOB($db->datatype->lobs[$this->lob_index]);
251  unset($db->datatype->lobs[$this->lob_index]);
252  }
253  }
254  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$db_index
Definition: LOB.php:71
+ Here is the call graph for this function:

◆ stream_eof()

MDB2_LOB::stream_eof ( )

Check if stream reaches EOF.

Returns
bool public

Definition at line 185 of file LOB.php.

References $db_index, $GLOBALS, and $result.

186  {
187  if (!isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
188  return true;
189  }
190 
191  $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
192  $result = $db->datatype->_endOfLOB($db->datatype->lobs[$this->lob_index]);
193  if (version_compare(phpversion(), "5.0", ">=")
194  && version_compare(phpversion(), "5.1", "<")
195  ) {
196  return !$result;
197  }
198  return $result;
199  }
$result
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$db_index
Definition: LOB.php:71

◆ stream_open()

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, $path, and $url.

96  {
97  if (!preg_match('/^rb?\+?$/', $mode)) {
98  return false;
99  }
100  $url = parse_url($path);
101  if (empty($url['host'])) {
102  return false;
103  }
104  $this->db_index = (int)$url['host'];
105  if (!isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
106  return false;
107  }
108  $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
109  $this->lob_index = (int)$url['user'];
110  if (!isset($db->datatype->lobs[$this->lob_index])) {
111  return false;
112  }
113  return true;
114  }
$path
Definition: aliased.php:25
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$url
Definition: shib_logout.php:72
$db_index
Definition: LOB.php:71

◆ stream_read()

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.

128  {
129  if (isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
130  $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
131  $db->datatype->_retrieveLOB($db->datatype->lobs[$this->lob_index]);
132 
133  $data = $db->datatype->_readLOB($db->datatype->lobs[$this->lob_index], $count);
134  $length = strlen($data);
135  if ($length == 0) {
136  $db->datatype->lobs[$this->lob_index]['endOfLOB'] = true;
137  }
138  $db->datatype->lobs[$this->lob_index]['position'] += $length;
139  return $data;
140  }
141  }
$lob_index
Definition: LOB.php:80
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$db_index
Definition: LOB.php:71

◆ stream_seek()

MDB2_LOB::stream_seek (   $offset,
  $whence 
)

Seek stream, not implemented.

Parameters
intoffset
intwhence
Returns
bool public

Definition at line 213 of file LOB.php.

214  {
215  return false;
216  }

◆ stream_stat()

MDB2_LOB::stream_stat ( )

return information about stream

public

Definition at line 226 of file LOB.php.

References $db_index, $GLOBALS, and array.

227  {
228  if (isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
229  $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
230  return array(
231  'db_index' => $this->db_index,
232  'lob_index' => $this->lob_index,
233  );
234  }
235  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
$db_index
Definition: LOB.php:71

◆ stream_tell()

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.

169  {
170  if (isset($GLOBALS['_MDB2_databases'][$this->db_index])) {
171  $db =& $GLOBALS['_MDB2_databases'][$this->db_index];
172  return $db->datatype->lobs[$this->lob_index]['position'];
173  }
174  }
$lob_index
Definition: LOB.php:80
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$db_index
Definition: LOB.php:71

◆ stream_write()

MDB2_LOB::stream_write (   $data)

write stream, note implemented

Parameters
stringdata
Returns
int public

Definition at line 154 of file LOB.php.

155  {
156  return 0;
157  }

Field Documentation

◆ $db_index

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().

◆ $lob_index

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: