ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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

@access public

Definition at line 245 of file LOB.php.

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 }
$db_index
Definition: LOB.php:71
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $db_index, and $GLOBALS.

◆ stream_eof()

MDB2_LOB::stream_eof ( )

Check if stream reaches EOF.

Returns
bool @access public

Definition at line 185 of file LOB.php.

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

References $db_index, $GLOBALS, and $result.

◆ 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 @access public

Definition at line 95 of file LOB.php.

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 }
$url
Definition: shib_logout.php:72
$path
Definition: index.php:22

References $db_index, $GLOBALS, $path, and $url.

◆ stream_read()

MDB2_LOB::stream_read (   $count)

read stream

Parameters
intnumber of bytes to read
Returns
string @access public

Definition at line 127 of file LOB.php.

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
$data

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

◆ stream_seek()

MDB2_LOB::stream_seek (   $offset,
  $whence 
)

Seek stream, not implemented.

Parameters
intoffset
intwhence
Returns
bool @access public

Definition at line 213 of file LOB.php.

214 {
215 return false;
216 }

◆ stream_stat()

MDB2_LOB::stream_stat ( )

return information about stream

@access public

Definition at line 226 of file LOB.php.

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 }

References $db_index, and $GLOBALS.

◆ stream_tell()

MDB2_LOB::stream_tell ( )

return the current position

Returns
int current position @access public

Definition at line 168 of file LOB.php.

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 }

References $db_index, $GLOBALS, and $lob_index.

◆ stream_write()

MDB2_LOB::stream_write (   $data)

write stream, note implemented

Parameters
stringdata
Returns
int @access 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: