00001 <?php 00002 ############################################################################ 00003 # Copyright (C) 2004 by Paolo Armani & Stefano Menegon # 00004 # paolo.armani@gmail.com menegon@itc.it # 00005 # # 00006 # This program is free software; you can redistribute it and#or modify # 00007 # it under the terms of the GNU Library General Public License as # 00008 # published by the Free Software Foundation; either version 2 of the # 00009 # License, or (at your option) any later version. # 00010 # # 00011 # This program is distributed in the hope that it will be useful, # 00012 # but WITHOUT ANY WARRANTY; without even the implied warranty of # 00013 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 00014 # GNU General Public License for more details. # 00015 # # 00016 # You should have received a copy of the GNU Library General Public # 00017 # License along with this program; if not, write to the # 00018 # Free Software Foundation, Inc., # 00019 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # 00020 ############################################################################ 00021 00022 if (version_compare(phpversion(), "4.2.0", "<")){ 00023 00024 function pg_query ($connection, $query) { 00025 return pg_exec($connection, $query); 00026 }; 00027 00028 function pg_num_rows ($result) { 00029 return pg_numrows($result); 00030 }; 00031 00032 function pg_num_fields ($result) { 00033 return pg_numfields($result); 00034 }; 00035 00036 function pg_free_result ($result) { 00037 return pg_freeresult($result); 00038 }; 00039 00040 function pg_lo_import ($connection,$result) { 00041 return pg_loimport($result,$connection); 00042 }; 00043 00044 function pg_lo_read_all ($result) { 00045 return pg_loreadall($result); 00046 }; 00047 00048 function pg_lo_read ($result,$size) { 00049 return pg_loread($result,$size); 00050 }; 00051 00052 function pg_lo_close ($result) { 00053 return pg_loclose($result); 00054 }; 00055 00056 function pg_lo_open($conn,$result,$mode) { 00057 return pg_loopen($conn,$result,$mode); 00058 }; 00059 00060 function pg_last_error () { 00061 }; 00062 00063 function pg_affected_rows ($q) { 00064 return pg_cmdtuples($q); 00065 }; 00066 00067 00068 00069 00070 function exif_read_data ($image, $bo1=1, $bo2=2, $thubnail=0){ 00071 if(function_exists(read_exif_data)){ 00072 $exif=read_exif_data($image); 00073 if (!$thubnail){$exif["Thumbnail"]='';}; 00074 return array("ANY_TAG"=>$exif); 00075 } 00076 else{ 00077 return array(); 00078 }; 00079 }; 00080 00081 function pg_escape_string($result){ 00082 return addslashes($result); 00083 }; 00084 00085 } 00086 00087 if (! function_exists("pg_fetch_all")) { 00088 function pg_fetch_all($res,$num=0,$assoc=PGSQL_ASSOC) { 00089 $num=$num?$num:pg_num_rows($res); 00090 for($i;$i<$num;$i++){ 00091 $array_out[] = pg_fetch_array($res, $i, $assoc); 00092 }; 00093 return $array_out; 00094 } 00095 }; 00096 00097 00098 ?>