MCPcopy Create free account
hub / github.com/BaseXdb/basex / readString

Method readString

basex-api/src/main/php/BaseXClient/Session.php:162–187  ·  view source on GitHub ↗

* Reads a string. * * @return string */

()

Source from the content-addressed store, hash-verified

160 * @return string
161 */
162 public function readString()
163 {
164 $com = "";
165 while (($d = $this->read()) != chr(0))
166 {
167 $com .= $d;
168 $sUnread = substr($this->buffer, $this->bpos);
169 $sBeforeZero = strstr($sUnread, chr(0), true);
170
171 if ($sBeforeZero === false)
172 {
173 $com .= $sUnread;
174 $this->bpos = $this->bsize;
175 }
176 else
177 {
178 $iLen = strlen($sBeforeZero);
179 if ($iLen > 0)
180 {
181 $com .= $sBeforeZero;
182 $this->bpos += $iLen;
183 }
184 }
185 }
186 return $com;
187 }
188
189 /**
190 * Was the last command/query successful?

Callers 7

__constructMethod · 0.95
executeMethod · 0.95
receiveMethod · 0.95
moreMethod · 0.45
execMethod · 0.45
getMethod · 0.45
parseMethod · 0.45

Calls 1

readMethod · 0.95

Tested by

no test coverage detected