Thread:Project:Support desk/problems with oci8 using Oracle 11g

I have many problems related to BLOB data type: /usr/local/apache2/htdocs/wiki/includes/db/DatabaseOracle.php(1146) : Warning - strpos expects parameter 1 to be string, object given /usr/local/apache2/htdocs/wiki/includes/db/DatabaseOracle.php(1142) : Warning - strpos expects parameter 1 to be string, object given /usr/local/apache2/htdocs/wiki/includes/db/DatabaseOracle.php(1142) : Warning - substr expects parameter 1 to be string, object given I fixed these errors with this code: public function removeIdentifierQuotes( $s ) { if ( is_object ( $s ) ) { return $s; }               else { return strpos( $s, '/*Q*/' ) === false ? $s : substr( $s, 5 ); }       }

public function isQuotedIdentifier( $s ) { if ( is_object ( $s ) ) { return false; }               else { return strpos( $s, '/*Q*/' ) !== false; }       } Another error during config was: INSERT INTO /*Q*/WIKI_INTERWIKI (iw_prefix,iw_url,iw_local,iw_api,iw_wikiid) VALUES (:iw_prefix, :iw_url, :iw_local, NULL, NULL) Error: 1400 ORA-01400: cannot insert NULL into ("WIKI"."WIKI_INTERWIKI"."IW_API")

To solve that, I Changed INTERWIKI table definition:

SQL> desc WIKI_INTERWIKI ; Name                                     Null? Type -  IW_PREFIX                                 NOT NULL VARCHAR2(32) IW_URL                                   NOT NULL VARCHAR2(127) IW_API                                   NOT NULL BLOB IW_WIKIID                                         VARCHAR2(64) IW_LOCAL                                 NOT NULL CHAR(1) IW_TRANS                                 NOT NULL CHAR(1)

columns IW_API, IW_LOCAL and IW_TRANS now accepting null values

After both changes made, the configuration ran OK without warnings

Basic operation is OK

Problem cannot solve:

string(425) "UPDATE /*Q*/WIKI_IMAGE SET img_size = :img_size, img_width = :img_width, img_height = :img_height, img_bits = :img_bits, img_media_type = :img_media_type, img_major_mime = :img_major_mime, img_minor_mime = :img_minor_mime, img_timestamp = :img_timestamp, img_description = :img_description, img_user = :img_user, img_user_text = :img_user_text, img_metadata = :img_metadata, img_sha1 = :img_sha1 WHERE img_name = 'Debug.png'"

Warning: OCI-Lob::writetemporary expects parameter 1 to be string, object given in /usr/local/apache2/htdocs/wiki/includes/db/DatabaseOracle.php on line 1327

message during uploaded file delete or replace operation

if ( $col_type == 'BLOB' ) { $lob[$col]->writeTemporary( $val ); oci_bind_by_name( $stmt, ":$col", $lob[$col], - 1, SQLT_BLOB ); } else { $lob[$col]->writeTemporary( $val ); <<<<<< problem with thic call oci_bind_by_name( $stmt, ":$col", $lob[$col], - 1, OCI_B_CLOB ); } The value of $val is an object (BLOB) with this value

object(Blob)#188 (1) { ["mData":"Blob":private]=> string(168) "a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}" }

About environment

DB: Oracle 11g (11.1.0.7.0) OS: Red Hat Enterprise Linux Server release 5 (Tikanga) httpd-2.2.27 php-5.3.28 (configure --with-apxs2=/usr/local/apache2/bin/apxs --with-oci8=/opt/oracle/product/oracle/11.1.0/db)

Please help !!

regards, Haroldo