2 class MssqlBlob
extends Blob
{
3 public function __construct( $data ) {
4 if ( $data instanceof MssqlBlob
) {
6 } elseif ( $data instanceof Blob
) {
7 $this->mData
= $data->fetch();
8 } elseif ( is_array( $data ) && is_object( $data ) ) {
9 $this->mData
= serialize( $data );
16 * Returns an unquoted hex representation of a binary string
17 * for insertion into varbinary-type fields
20 public function fetch() {
21 if ( $this->mData
=== null ) {
26 $dataLength = strlen( $this->mData
);
27 for ( $i = 0; $i < $dataLength; $i++
) {
28 $ret .= bin2hex( pack( 'C', ord( $this->mData
[$i] ) ) );