[Vtigercrm-commits] [vtiger-commits] r4836 - /vtigercrm/branches/4.2_postgresql_integration/include/database/PearDatabase.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Apr 3 12:55:18 EDT 2006


Author: allanbush
Date: Mon Apr  3 10:55:13 2006
New Revision: 4836

Log:
Added support for postgres blob insertion (adodb is limited in it's postgres blob support and only one of UpdateBlobFile or UpdateBlob work 

Modified:
    vtigercrm/branches/4.2_postgresql_integration/include/database/PearDatabase.php

Modified: vtigercrm/branches/4.2_postgresql_integration/include/database/PearDatabase.php
==============================================================================
--- vtigercrm/branches/4.2_postgresql_integration/include/database/PearDatabase.php (original)
+++ vtigercrm/branches/4.2_postgresql_integration/include/database/PearDatabase.php Mon Apr  3 10:55:13 2006
@@ -264,7 +264,14 @@
 	{
 		$this->println("updateBlobFile t=".$tablename." c=".$colname." id=".$id." f=".$filename);
 		$this->checkConnection();
-		$result = $this->database->UpdateBlobFile($tablename, $colname, $filename, $id);
+		if($this->isPostgres()) {
+			$fp = fopen($filename, "r");
+			$filecontent = fread($fp, filesize($filename));
+			$result = $this->database->UpdateBlob($tablename, $colname, $filecontent, $id);
+			fclose($fp);
+		} else {
+			$result = $this->database->UpdateBlobFile($tablename, $colname, $filename, $id);
+		}
 		$this->println("updateBlobFile t=".$tablename." c=".$colname." id=".$id." f=".$filename." status=".$result);
 		return $result;
 	}





More information about the vtigercrm-commits mailing list