MediaWiki
REL1_31
MssqlBlob.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Wikimedia\Rdbms
;
4
5
class
MssqlBlob
extends
Blob
{
11
public
function
__construct
(
$data
) {
12
if
(
$data
instanceof
MssqlBlob
) {
13
return
$data
;
14
} elseif (
$data
instanceof
Blob
) {
15
$this->data =
$data
->fetch();
16
} elseif ( is_array(
$data
) && is_object(
$data
) ) {
17
$this->data =
serialize
(
$data
);
18
}
else
{
19
$this->data =
$data
;
20
}
21
}
22
28
public
function
fetch
() {
29
if
( $this->data ===
null
) {
30
return
'null'
;
31
}
32
33
$ret
=
'0x'
;
34
$dataLength = strlen( $this->data );
35
for
( $i = 0; $i < $dataLength; $i++ ) {
36
$ret
.= bin2hex( pack(
'C'
, ord( $this->data[$i] ) ) );
37
}
38
39
return
$ret
;
40
}
41
}
serialize
serialize()
Definition
ApiMessage.php:184
Wikimedia\Rdbms\Blob
Definition
Blob.php:5
Wikimedia\Rdbms\Blob\$data
string $data
Definition
Blob.php:7
Wikimedia\Rdbms\MssqlBlob
Definition
MssqlBlob.php:5
Wikimedia\Rdbms\MssqlBlob\fetch
fetch()
Returns an unquoted hex representation of a binary string for insertion into varbinary-type fields.
Definition
MssqlBlob.php:28
Wikimedia\Rdbms\MssqlBlob\__construct
__construct( $data)
@noinspection PhpMissingParentConstructorInspection
Definition
MssqlBlob.php:11
$ret
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:2005
Wikimedia\Rdbms
Definition
ChronologyProtector.php:24
includes
libs
rdbms
encasing
MssqlBlob.php
Generated on Mon Nov 25 2024 15:35:02 for MediaWiki by
1.10.0