MediaWiki REL1_33
MssqlBlob.php
Go to the documentation of this file.
1<?php
2
3namespace Wikimedia\Rdbms;
4
5class MssqlBlob extends Blob {
11 public function __construct( $data ) {
12 if ( $data instanceof MssqlBlob ) {
13 $this->data = $data->data;
14 } elseif ( $data instanceof Blob ) {
15 $this->data = $data->fetch();
16 } else {
17 $this->data = $data;
18 }
19 }
20
26 public function fetch() {
27 if ( $this->data === null ) {
28 return 'null';
29 }
30
31 $ret = '0x';
32 $dataLength = strlen( $this->data );
33 for ( $i = 0; $i < $dataLength; $i++ ) {
34 $ret .= bin2hex( pack( 'C', ord( $this->data[$i] ) ) );
35 }
36
37 return $ret;
38 }
39}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
fetch()
Returns an unquoted hex representation of a binary string for insertion into varbinary-type fields.
Definition MssqlBlob.php:26
__construct( $data)
@noinspection PhpMissingParentConstructorInspection
Definition MssqlBlob.php:11
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
Definition hooks.txt:2003