diff options
Diffstat (limited to 'ext/interbase')
-rw-r--r-- | ext/interbase/CREDITS | 2 | ||||
-rw-r--r-- | ext/interbase/interbase.dsp | 118 | ||||
-rw-r--r-- | ext/interbase/interbase.rc | 82 | ||||
-rw-r--r-- | ext/interbase/tests/002.phpt | 32 | ||||
-rw-r--r-- | ext/interbase/tests/003.phpt | 131 | ||||
-rw-r--r-- | ext/interbase/tests/004.phpt | 179 | ||||
-rw-r--r-- | ext/interbase/tests/005.phpt | 292 | ||||
-rw-r--r-- | ext/interbase/tests/006.phpt | 303 | ||||
-rw-r--r-- | ext/interbase/tests/007.phpt | 185 | ||||
-rwxr-xr-x | ext/interbase/tests/interbase.inc | 118 | ||||
-rwxr-xr-x | ext/interbase/tests/skipif.inc | 9 |
11 files changed, 0 insertions, 1451 deletions
diff --git a/ext/interbase/CREDITS b/ext/interbase/CREDITS deleted file mode 100644 index d66f13b5f3..0000000000 --- a/ext/interbase/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -InterBase -Jouni Ahto, Andrew Avdeev, Ard Biesheuvel diff --git a/ext/interbase/interbase.dsp b/ext/interbase/interbase.dsp deleted file mode 100644 index b3cc811e92..0000000000 --- a/ext/interbase/interbase.dsp +++ /dev/null @@ -1,118 +0,0 @@ -# Microsoft Developer Studio Project File - Name="interbase" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=interbase - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "interbase.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "interbase.mak" CFG="interbase - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "interbase - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "interbase - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "interbase - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D "COMPILE_DL_INTERBASE" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ib_util_ms.lib gds32_ms.lib php5ts_debug.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_interbase.dll" /pdbtype:sept /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "interbase - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D ZEND_DEBUG=0 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D "COMPILE_DL_INTERBASE" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ib_util_ms.lib gds32_ms.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_interbase.dll" /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ENDIF
-
-# Begin Target
-
-# Name "interbase - Win32 Debug_TS"
-# Name "interbase - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\interbase.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_interbase.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\interbase.rc
-# ADD RSC /i "..\..\main" /i "..\..\win32" /d "PHP_H"
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/interbase/interbase.rc b/ext/interbase/interbase.rc deleted file mode 100644 index 243ccb39b2..0000000000 --- a/ext/interbase/interbase.rc +++ /dev/null @@ -1,82 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Ard Biesheuvel <a.k.biesheuvel@its.tudelft.nl> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef APSTUDIO_INVOKED -#error This file cannot be opened from the Visual Studio IDE -#endif - -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -#include "winres.h" -#undef APSTUDIO_READONLY_SYMBOLS - -#include "php_version.h" - -#ifdef _DEBUG -# define BUILD_TYPE "Debug" -#else -# define BUILD_TYPE "Release" -#endif - -#include <ibase.h> -#include "interbase.c" - -#ifdef FB_SQLDA -#define CLIENT_LIB "fbclient.dll" -#else -#define CLIENT_LIB "gds32.dll" -#endif - -#ifndef _MAC - -VS_VERSION_INFO VERSIONINFO - FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 - PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 -#ifndef _DEBUG - FILEFLAGS 0x0L -#else - FILEFLAGS 0x1L -#endif - FILEFLAGSMASK 0x3fL - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "FileDescription", "PHP Interbase module\0" - VALUE "FileVersion", PHP_VERSION "\0" - VALUE "File Revision", FILE_REVISION "\0" - VALUE "LegalCopyright", "Copyright © 2003 The PHP Group\0" - VALUE "Build Type", BUILD_TYPE "\0" - VALUE "Client Library", CLIENT_LIB "\0" - VALUE "URL", "http://www.php.net\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END - -#endif // !_MAC diff --git a/ext/interbase/tests/002.phpt b/ext/interbase/tests/002.phpt deleted file mode 100644 index 6f30fb85fd..0000000000 --- a/ext/interbase/tests/002.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -InterBase: connect, close and pconnect ---SKIPIF-- -<?php include("skipif.inc"); ?> ---POST-- ---GET-- ---FILE-- -<?php /* $Id$ */ - - require("interbase.inc"); - - ibase_connect($test_base); - out_table("test1"); - ibase_close(); - - $con = ibase_connect($test_base); - $pcon1 = ibase_pconnect($test_base); - $pcon2 = ibase_pconnect($test_base); - ibase_close($con); - ibase_close($pcon1); - - out_table("test1"); - - ibase_close($pcon2); -?> ---EXPECT-- ---- test1 --- -1 test table created with isql ---- ---- test1 --- -1 test table created with isql ---- diff --git a/ext/interbase/tests/003.phpt b/ext/interbase/tests/003.phpt deleted file mode 100644 index 2d105b1866..0000000000 --- a/ext/interbase/tests/003.phpt +++ /dev/null @@ -1,131 +0,0 @@ ---TEST-- -InterBase: misc sql types (may take a while) ---SKIPIF-- -<?php include("skipif.inc"); ?> ---POST-- ---GET-- ---FILE-- -<?php /* $Id$ */ - - require("interbase.inc"); - ibase_connect($test_base); - - ibase_query( - "create table test3 ( - iter integer, - v_char char(1000), - v_date timestamp, - v_decimal4_2 decimal(4,2), - v_decimal4_0 decimal(4,0), - v_decimal7_2 decimal(7,2), - v_decimal7_0 decimal(7,0), - v_numeric15_15 numeric(15,15), - v_numeric15_0 numeric(15,0), - v_double double precision, - v_float float, - v_integer integer, - v_smallint smallint, - v_varchar varchar(10000) - )"); - ibase_commit(); - - /* if timefmt is not supported, suppress error here */ - @ibase_timefmt("%m/%d/%Y %H:%M:%S"); - - for($iter = 0; $iter < 10; $iter++){ - /* prepare data */ - $v_char = rand_str(1000); - $v_date = rand_datetime(); - $v_decimal4_2 = rand_number(4,2); - $v_decimal4_0 = rand_number(4,0); - $v_decimal7_2 = rand_number(7,2); - $v_decimal7_0 = rand_number(7,0); - $v_numeric15_15 = rand_number(15,15); - $v_numeric15_0 = rand_number(15,0); - $v_double = rand_number(18); - $v_float = rand_number(7); - $v_integer = rand_number(9,0); - $v_smallint = rand_number(5) % 32767; - $v_varchar = rand_str(10000); - - ibase_query( - "insert into test3 (iter, v_char,v_date,v_decimal4_2, v_decimal4_0, v_decimal7_2, v_decimal7_0,v_numeric15_15, v_numeric15_0,v_double,v_float,v_integer,v_smallint,v_varchar) - values ($iter, '$v_char','$v_date',$v_decimal4_2, $v_decimal4_0, $v_decimal7_2, $v_decimal7_0,$v_numeric15_15, $v_numeric15_0,$v_double,$v_float,$v_integer,$v_smallint,'$v_varchar')"); - $sel = ibase_query("select * from test3 where iter = $iter"); - $row = ibase_fetch_object($sel); - if(substr($row->V_CHAR,0,strlen($v_char)) != $v_char){ - echo " CHAR fail:\n"; - echo " in: $v_char\n"; - echo " out: $row->V_CHAR\n"; - } - if($row->V_DATE != $v_date){ - echo " DATE fail\n"; - echo " in: $v_date\n"; - echo " out: $row->V_DATE\n"; - } - if($row->V_DECIMAL4_2 != $v_decimal4_2){ - echo " DECIMAL4_2 fail\n"; - echo " in: $v_decimal4_2\n"; - echo " out: $row->V_DECIMAL4_2\n"; - } - if($row->V_DECIMAL4_0 != $v_decimal4_0){ - echo " DECIMAL4_0 fail\n"; - echo " in: $v_decimal4_0\n"; - echo " out: $row->V_DECIMAL4_0\n"; - } - if($row->V_DECIMAL7_2 != $v_decimal7_2){ - echo " DECIMAL7_2 fail\n"; - echo " in: $v_decimal7_2\n"; - echo " out: $row->V_DECIMAL7_2\n"; - } - if($row->V_DECIMAL7_0 != $v_decimal7_0){ - echo " DECIMAL7_0 fail\n"; - echo " in: $v_decimal7_0\n"; - echo " out: $row->V_DECIMAL7_0\n"; - } - if($row->V_NUMERIC15_15 != $v_numeric15_15){ - echo " NUMERIC15_15 fail\n"; - echo " in: $v_numeric15_15\n"; - echo " out: $row->V_NUMERIC15_15\n"; - } - if($row->V_NUMERIC15_0 != $v_numeric15_0){ - echo " NUMERIC15_0 fail\n"; - echo " in: $v_numeric15_0\n"; - echo " out: $row->V_NUMERIC15_0\n"; - } - - if(abs($row->V_DOUBLE - $v_double) > abs($v_double / 1E15)){ - echo " DOUBLE fail\n"; - echo " in: $v_double\n"; - echo " out: $row->V_DOUBLE\n"; - } - if(abs($row->V_FLOAT - $v_float) > abs($v_float / 1E7)){ - echo " FLOAT fail\n"; - echo " in: $v_float\n"; - echo " out: $row->V_FLOAT\n"; - } - if($row->V_INTEGER != $v_integer){ - echo " INTEGER fail\n"; - echo " in: $v_integer\n"; - echo " out: $row->V_INTEGER\n"; - } - if($row->V_SMALLINT != $v_smallint){ - echo " SMALLINT fail\n"; - echo " in: $v_smallint\n"; - echo " out: $row->V_SMALLINT\n"; - } - - if(substr($row->V_VARCHAR,0,strlen($v_varchar)) != $v_varchar){ - echo " VARCHAR fail:\n"; - echo " in: $v_varchar\n"; - echo " out: $row->V_VARCHAR\n"; - } - - ibase_free_result($sel); - } /* for($iter) */ - - ibase_close(); - echo "end of test\n"; -?> ---EXPECT-- -end of test diff --git a/ext/interbase/tests/004.phpt b/ext/interbase/tests/004.phpt deleted file mode 100644 index c69524f131..0000000000 --- a/ext/interbase/tests/004.phpt +++ /dev/null @@ -1,179 +0,0 @@ ---TEST-- -InterBase: BLOB test ---SKIPIF-- -<?php include("skipif.inc"); ?> ---POST-- ---GET-- ---FILE-- -<?php /* $Id$ */ - - require("interbase.inc"); - - ibase_connect($test_base); - - ibase_query( - "create table test4 ( - v_integer integer, - v_blob blob)"); - ibase_commit(); - - /* create 100k blob file */ - $blob_str = rand_binstr(100*1024); - - $name = tempnam(dirname(__FILE__),"blob.tmp"); - $ftmp = fopen($name,"w"); - fwrite($ftmp,$blob_str); - fclose($ftmp); - - echo "import blob 1\n"; - $ftmp = fopen($name,"r"); - $bl_s = ibase_blob_import($ftmp); - ibase_query("insert into test4 (v_integer, v_blob) values (1, ?)", $bl_s); - - echo "test blob 1\n"; - $q = ibase_query("select v_blob from test4 where v_integer = 1"); - $row = ibase_fetch_object($q); - $bl_h = ibase_blob_open($row->V_BLOB); - - $blob = ''; - while($piece = ibase_blob_get($bl_h, 1 + rand() % 1024)) - $blob .= $piece; - if($blob != $blob_str) - echo " BLOB 1 fail (1)\n"; - ibase_blob_close($bl_h); - - $bl_h = ibase_blob_open($row->V_BLOB); - - $blob = ''; - while($piece = ibase_blob_get($bl_h, 100 * 1024)) - $blob .= $piece; - if($blob != $blob_str) - echo " BLOB 1 fail (2)\n"; - ibase_blob_close($bl_h); - ibase_free_result($q); - unset($blob); - - echo "create blob 2\n"; - - ibase_query("insert into test4 (v_integer, v_blob) values (2, ?)", $blob_str); - - echo "test blob 2\n"; - - $q = ibase_query("select v_blob from test4 where v_integer = 2"); - $row = ibase_fetch_object($q,IBASE_TEXT); - - if($row->V_BLOB != $blob_str) - echo " BLOB 2 fail\n"; - ibase_free_result($q); - unset($blob); - - - echo "create blob 3\n"; - - $bl_h = ibase_blob_create(); - - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - ibase_blob_add($bl_h, "| PHP HTML Embedded Scripting Language Version 3.0 |\n"); - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - ibase_blob_add($bl_h, "| Copyright (c) 1997-2000 PHP Development Team (See Credits file) |\n"); - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - ibase_blob_add($bl_h, "| This program is free software; you can redistribute it and/or modify |\n"); - ibase_blob_add($bl_h, "| it under the terms of one of the following licenses: |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| A) the GNU General Public License as published by the Free Software |\n"); - ibase_blob_add($bl_h, "| Foundation; either version 2 of the License, or (at your option) |\n"); - ibase_blob_add($bl_h, "| any later version. |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| B) the PHP License as published by the PHP Development Team and |\n"); - ibase_blob_add($bl_h, "| included in the distribution in the file: LICENSE |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| This program is distributed in the hope that it will be useful, |\n"); - ibase_blob_add($bl_h, "| but WITHOUT ANY WARRANTY; without even the implied warranty of |\n"); - ibase_blob_add($bl_h, "| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |\n"); - ibase_blob_add($bl_h, "| GNU General Public License for more details. |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| You should have received a copy of both licenses referred to here. |\n"); - ibase_blob_add($bl_h, "| If you did not, or have any questions about PHP licensing, please |\n"); - ibase_blob_add($bl_h, "| contact core@php.net. |\n"); - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - $bl_s = ibase_blob_close($bl_h); - ibase_query("insert into test4 (v_integer, v_blob) values (3, ?)", $bl_s); - ibase_commit(); - echo "echo blob 3\n"; - - $q = ibase_query("select v_blob from test4 where v_integer = 3"); - $row = ibase_fetch_object($q); - ibase_commit(); - ibase_close(); - - ibase_connect($test_base); - ibase_blob_echo($row->V_BLOB); - ibase_free_result($q); - - echo "fetch blob 3\n"; - $q = ibase_query("select v_blob from test4 where v_integer = 3"); - $row = ibase_fetch_object($q,IBASE_TEXT); - echo $row->V_BLOB; - ibase_free_result($q); - - ibase_close(); - unlink($name); - echo "end of test\n"; -?> ---EXPECT-- -import blob 1 -test blob 1 -create blob 2 -test blob 2 -create blob 3 -echo blob 3 -+----------------------------------------------------------------------+ -| PHP HTML Embedded Scripting Language Version 3.0 | -+----------------------------------------------------------------------+ -| Copyright (c) 1997-2000 PHP Development Team (See Credits file) | -+----------------------------------------------------------------------+ -| This program is free software; you can redistribute it and/or modify | -| it under the terms of one of the following licenses: | -| | -| A) the GNU General Public License as published by the Free Software | -| Foundation; either version 2 of the License, or (at your option) | -| any later version. | -| | -| B) the PHP License as published by the PHP Development Team and | -| included in the distribution in the file: LICENSE | -| | -| This program is distributed in the hope that it will be useful, | -| but WITHOUT ANY WARRANTY; without even the implied warranty of | -| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | -| GNU General Public License for more details. | -| | -| You should have received a copy of both licenses referred to here. | -| If you did not, or have any questions about PHP licensing, please | -| contact core@php.net. | -+----------------------------------------------------------------------+ -fetch blob 3 -+----------------------------------------------------------------------+ -| PHP HTML Embedded Scripting Language Version 3.0 | -+----------------------------------------------------------------------+ -| Copyright (c) 1997-2000 PHP Development Team (See Credits file) | -+----------------------------------------------------------------------+ -| This program is free software; you can redistribute it and/or modify | -| it under the terms of one of the following licenses: | -| | -| A) the GNU General Public License as published by the Free Software | -| Foundation; either version 2 of the License, or (at your option) | -| any later version. | -| | -| B) the PHP License as published by the PHP Development Team and | -| included in the distribution in the file: LICENSE | -| | -| This program is distributed in the hope that it will be useful, | -| but WITHOUT ANY WARRANTY; without even the implied warranty of | -| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | -| GNU General Public License for more details. | -| | -| You should have received a copy of both licenses referred to here. | -| If you did not, or have any questions about PHP licensing, please | -| contact core@php.net. | -+----------------------------------------------------------------------+ -end of test diff --git a/ext/interbase/tests/005.phpt b/ext/interbase/tests/005.phpt deleted file mode 100644 index ab2c04b66f..0000000000 --- a/ext/interbase/tests/005.phpt +++ /dev/null @@ -1,292 +0,0 @@ ---TEST-- -InterBase: transactions ---SKIPIF-- -<?php include("skipif.inc"); ?> ---POST-- ---GET-- ---FILE-- -<?php /* $Id$ */ - - require("interbase.inc"); - - ibase_connect($test_base); - - @ibase_query("create table test5 (i integer)"); - @ibase_query("delete from test5"); - ibase_close(); - - - echo "default transaction:\n"; - -/* -Difference between default and other transactions: -default commited when you call ibase_close(). -Other transaction doing rollback. - -If you not open default transaction with -ibase_trans, default transaction open -when you call ibase_query(), ibase_prepare(), -ibase_blob_create(), ibase_blob_import() first time. -*/ - -/* -simple default transaction test without ibase_trans() -*/ - - ibase_connect($test_base); - - echo "empty table\n"; - - /* out_table call ibase_query() - and ibase_query() start default transaction */ - out_table("test5"); - - /* in default transaction context */ - ibase_query("insert into test5 (i) values (1)"); - - echo "one row\n"; - out_table("test5"); - - ibase_rollback(); /* default rolled */ - - echo "after rollback table empty again\n"; - out_table("test5"); /* started new default transaction */ - - ibase_query("insert into test5 (i) values (2)"); - - ibase_close(); /* commit here! */ - - ibase_connect($test_base); - - echo "one row\n"; - out_table("test5"); - ibase_close(); - -/* -default transaction on default link -First open transaction on link will be default. -$tr_def_l1 may be ommited. All queryes without link and trans -parameters run in this context -*/ - - $link_def = ibase_connect($test_base); - - $tr_def_l1 = ibase_trans(IBASE_READ); /* here transaction start */ - - /* all default */ - $res = ibase_query("select * from test5"); - - echo "one row\n"; - out_result($res,"test5"); - - ibase_free_result($res); - - /* specify transaction context... */ - $res = ibase_query($tr_def_l1, "select * from test5"); - - echo "one row... again.\n"; - out_result($res,"test5"); - - ibase_free_result($res); - - /* specify default transaction on link */ - $res = ibase_query($link_def, "select * from test5"); - - echo "one row.\n"; - out_result($res,"test5"); - - ibase_free_result($res); - - ibase_rollback($link_def); /* just for example */ - - ibase_close(); - -/* -three transaction on default link -*/ - ibase_connect($test_base); - - $res = ibase_query("select * from test5"); - - echo "one row\n"; - out_result($res,"test5"); - - ibase_free_result($res); - - $tr_1 = ibase_trans(); /* this default transaction also */ - $tr_2 = ibase_trans(IBASE_READ); - $tr_3 = ibase_trans(IBASE_READ+IBASE_COMMITTED+IBASE_REC_VERSION+IBASE_WAIT); - $tr_4 = ibase_trans(IBASE_READ+IBASE_COMMITTED+IBASE_REC_NO_VERSION+IBASE_NOWAIT); - - /* insert in first transaction context... */ - /* as default */ - ibase_query("insert into test5 (i) values (3)"); - /* specify context */ - ibase_query($tr_1, "insert into test5 (i) values (4)"); - - $res = ibase_query("select * from test5"); - - echo "two rows\n"; - out_result($res,"test5"); - - ibase_free_result($res); - - $res = ibase_query($tr_1, "select * from test5"); - - echo "two rows again\n"; - out_result($res,"test5"); - - ibase_free_result($res); - - ibase_commit(); - ibase_commit($tr_1); - - $tr_1 = ibase_trans(); - ibase_query($tr_1, "insert into test5 (i) values (5)"); - - /* tr_2 is IBASE_READ + IBASE_CONCURRENCY + IBASE_WAIT */ - $res = ibase_query($tr_2, "select * from test5"); - - echo "one row in second transaction\n"; - out_result($res,"test5"); - - ibase_free_result($res); - - /* tr_3 is IBASE_COMMITTED + IBASE_REC_VERSION + IBASE_WAIT */ - $res = ibase_query($tr_3, "select * from test5"); - - echo "three rows in third transaction\n"; - out_result($res,"test5"); - - ibase_free_result($res); - - /* tr_4 IBASE_COMMITED + IBASE_REC_NO_VERSION + IBASE_NOWAIT */ - $res = ibase_query($tr_4, "select * from test5"); - - echo "three rows in fourth transaction with deadlock\n"; - out_result_trap_error($res,"test5"); - - ibase_free_result($res); - - ibase_rollback($tr_1); - ibase_close(); -/* -transactions on second link -*/ - $link_1 = ibase_pconnect($test_base); - $link_2 = ibase_pconnect($test_base); - - $tr_1 = ibase_trans(IBASE_DEFAULT, $link_2); /* this default transaction also */ - $tr_2 = ibase_trans(IBASE_COMMITTED, $link_2); - - $res = ibase_query($tr_1, "select * from test5"); - - echo "three rows\n"; - out_result($res,"test5"); - - ibase_free_result($res); - - ibase_query($tr_1, "insert into test5 (i) values (5)"); - - $res = ibase_query($tr_1, "select * from test5"); - - echo "four rows\n"; - out_result($res,"test5"); - - ibase_free_result($res); - - ibase_commit($tr_1); - - $res = ibase_query($tr_2, "select * from test5"); - - echo "four rows again\n"; - out_result($res,"test5"); - - ibase_free_result($res); - - ibase_close($link_1); - ibase_close($link_2); - - echo "end of test\n"; -?> ---EXPECT-- -default transaction: -empty table ---- test5 --- ---- -one row ---- test5 --- -1 ---- -after rollback table empty again ---- test5 --- ---- -one row ---- test5 --- -2 ---- -one row ---- test5 --- -2 ---- -one row... again. ---- test5 --- -2 ---- -one row. ---- test5 --- -2 ---- -one row ---- test5 --- -2 ---- -two rows ---- test5 --- -2 -3 ---- -two rows again ---- test5 --- -2 -4 ---- -one row in second transaction ---- test5 --- -2 ---- -three rows in third transaction ---- test5 --- -2 -3 -4 ---- -three rows in fourth transaction with deadlock ---- test5 --- -2 -3 -4 -errmsg [lock conflict on no wait transaction deadlock ] ---- -three rows ---- test5 --- -2 -3 -4 ---- -four rows ---- test5 --- -2 -3 -4 -5 ---- -four rows again ---- test5 --- -2 -3 -4 -5 ---- -end of test - diff --git a/ext/interbase/tests/006.phpt b/ext/interbase/tests/006.phpt deleted file mode 100644 index 45f397ab21..0000000000 --- a/ext/interbase/tests/006.phpt +++ /dev/null @@ -1,303 +0,0 @@ ---TEST-- -InterBase: binding (may take a while) ---SKIPIF-- -<?php include("skipif.inc"); ?> ---POST-- ---GET-- ---FILE-- -<?php /* $Id$ */ - - require("interbase.inc"); - - ibase_connect($test_base); - - ibase_query( - "create table test6 ( - iter integer, - v_char char(1000), - v_date timestamp, - v_decimal decimal(12,3), - v_double double precision, - v_float float, - v_integer integer, - v_numeric numeric(4,2), - v_smallint smallint, - v_varchar varchar(10000) - )"); - ibase_query( - "create procedure add1 (arg integer) - returns (result integer) - as - begin - result = arg +1; - end"); - ibase_commit(); - - /* if timefmt not supported, hide error */ - @ibase_timefmt("%m/%d/%Y %H:%M:%S"); - - echo "insert\n"; - - for($iter = 0; $iter < 3; $iter++) { - /* prepare data */ - $v_char = rand_str(1000); - $v_date = rand_datetime(); - $v_decimal = rand_number(12,3); - $v_double = rand_number(20); - $v_float = rand_number(7); - $v_integer = rand_number(9,0); - $v_numeric = rand_number(4,2); - $v_smallint = rand_number(5) % 32767; - $v_varchar = rand_str(10000); - - ibase_query("insert into test6 - (iter,v_char,v_date,v_decimal,v_double,v_float, - v_integer,v_numeric,v_smallint,v_varchar) - values (?,?,?,?,?,?,?,?,?,?)", - $iter, $v_char, $v_date, $v_decimal, $v_double, $v_float, - $v_integer, $v_numeric, $v_smallint, $v_varchar); - $sel = ibase_query("select * from test6 where iter = $iter"); - - $row = ibase_fetch_object($sel); - if(substr($row->V_CHAR,0,strlen($v_char)) != $v_char) { - echo " CHAR fail:\n"; - echo " in: $v_char\n"; - echo " out: $row->V_CHAR\n"; - } - if($row->V_DATE != $v_date) { - echo " DATE fail\n"; - echo " in: $v_date\n"; - echo " out: $row->V_DATE\n"; - } - if($row->V_DECIMAL != $v_decimal) { - echo " DECIMAL fail\n"; - echo " in: $v_decimal\n"; - echo " out: $row->V_DECIMAL\n"; - } - if(abs($row->V_DOUBLE - $v_double) > abs($v_double / 1E15)) { - echo " DOUBLE fail\n"; - echo " in: $v_double\n"; - echo " out: $row->V_DOUBLE\n"; - } - if(abs($row->V_FLOAT - $v_float) > abs($v_float / 1E7)) { - echo " FLOAT fail\n"; - echo " in: $v_float\n"; - echo " out: $row->V_FLOAT\n"; - } - if($row->V_INTEGER != $v_integer) { - echo " INTEGER fail\n"; - echo " in: $v_integer\n"; - echo " out: $row->V_INTEGER\n"; - } - if ($row->V_NUMERIC != $v_numeric) { - echo " NUMERIC fail\n"; - echo " in: $v_numeric\n"; - echo " out: $row->V_NUMERIC\n"; - } - if ($row->V_SMALLINT != $v_smallint) { - echo " SMALLINT fail\n"; - echo " in: $v_smallint\n"; - echo " out: $row->V_SMALLINT\n"; - } - if ($row->V_VARCHAR != $v_varchar) { - echo " VARCHAR fail:\n"; - echo " in: $v_varchar\n"; - echo " out: $row->V_VARCHAR\n"; - } - ibase_free_result($sel); - }/* for($iter)*/ - - echo "select\n"; - for($iter = 0; $iter < 3; $iter++) { - /* prepare data */ - $v_char = rand_str(1000); - $v_date = rand_datetime(); - $v_decimal = rand_number(12,3); - $v_double = rand_number(20); - $v_float = rand_number(7); - $v_integer = rand_number(9,0); - $v_numeric = rand_number(4,2); - $v_smallint = rand_number(5) % 32767; - $v_varchar = rand_str(10000); - - /* clear table*/ - ibase_query("delete from test6"); - - /* make one record */ - ibase_query("insert into test6 - (iter, v_char,v_date,v_decimal, - v_integer,v_numeric,v_smallint,v_varchar) - values (666, '$v_char','$v_date',$v_decimal, $v_integer, - $v_numeric, $v_smallint, '$v_varchar')"); - - /* test all types */ - if(!($sel = ibase_query( - "select iter from test6 where v_char = ?", $v_char)) || - !ibase_fetch_row($sel)) { - echo "CHAR fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_date = ?", $v_date)) || - !ibase_fetch_row($sel)) { - echo "DATE fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_decimal = ?", $v_decimal)) || - !ibase_fetch_row($sel)) { - echo "DECIMAL fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_integer = ?", $v_integer)) || - !ibase_fetch_row($sel)) { - echo "INTEGER fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_numeric = ?", $v_numeric)) || - !ibase_fetch_row($sel)) { - echo "NUMERIC fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_smallint = ?", $v_smallint)) || - !ibase_fetch_row($sel)) { - echo "SMALLINT fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_varchar = ?", $v_varchar)) || - !ibase_fetch_row($sel)) { - echo "VARCHAR fail\n"; - } - ibase_free_result($sel); - - } /*for iter*/ - - echo "prepare and exec insert\n"; - - /* prepare table */ - ibase_query("delete from test6"); - - /* prepare query */ - $query = ibase_prepare( - "insert into test6 (v_integer) values (?)"); - - for($i = 0; $i < 10; $i++) { - ibase_execute($query, $i); - } - - out_table("test6"); - - ibase_free_query($query); - - echo "prepare and exec select\n"; - - /* prepare query */ - $query = ibase_prepare("select * from test6 - where v_integer between ? and ?"); - - $low_border = 2; - $high_border = 6; - - $res = ibase_execute($query, $low_border, $high_border); - out_result($res, "test6"); - ibase_free_result($res); - - $low_border = 0; - $high_border = 4; - $res = ibase_execute($query, $low_border, $high_border); - out_result($res, "test6"); - ibase_free_result($res); - - $res = ibase_execute($query, "5", 7.5); - out_result($res, "test6"); - ibase_free_result($res); - - ibase_free_query($query); - - /* test execute procedure */ - $query = ibase_prepare("execute procedure add1(?)"); - $res = array(); - for ($i = 0; $i < 10; $i++) { - $res[] = ibase_execute($query,$i); - } - ibase_free_query($query); - foreach ($res as $r) { - out_result($r, "proc add1"); - ibase_free_result($r); - } - - ibase_close(); - echo "end of test\n"; -?> ---EXPECT-- -insert -select -prepare and exec insert ---- test6 --- - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 ---- -prepare and exec select ---- test6 --- - 2 - 3 - 4 - 5 - 6 ---- ---- test6 --- - 0 - 1 - 2 - 3 - 4 ---- ---- test6 --- - 5 - 6 - 7 ---- ---- proc add1 --- -1 ---- ---- proc add1 --- -2 ---- ---- proc add1 --- -3 ---- ---- proc add1 --- -4 ---- ---- proc add1 --- -5 ---- ---- proc add1 --- -6 ---- ---- proc add1 --- -7 ---- ---- proc add1 --- -8 ---- ---- proc add1 --- -9 ---- ---- proc add1 --- -10 ---- -end of test - diff --git a/ext/interbase/tests/007.phpt b/ext/interbase/tests/007.phpt deleted file mode 100644 index 0ccbdad106..0000000000 --- a/ext/interbase/tests/007.phpt +++ /dev/null @@ -1,185 +0,0 @@ ---TEST-- -InterBase: array handling ---SKIPIF-- -<?php include("skipif.inc"); ?> ---POST-- ---GET-- ---FILE-- -<?php /* $Id$ */ - - require("interbase.inc"); - - ibase_connect($test_base); - - ibase_query( - "create table test7 ( - iter integer, - v_multi integer[10,10,10], - v_char char(100)[10], - v_date timestamp[10], - v_decimal decimal(18,3)[10], - v_double double precision[10], - v_float float[10], - v_integer integer[10], - v_numeric numeric(9,2)[10], - v_smallint smallint[10], - v_varchar varchar(1000)[10] - )"); - ibase_commit(); - - /* if timefmt not supported, hide error */ - @ibase_timefmt("%m/%d/%Y %H:%M:%S"); - - echo "insert\n"; - - for ($i = 1; $i <= 10; ++$i) { - for ($j = 1; $j <= 10; ++$j) { - for ($k = 1; $k <= 10; ++$k) { - $v_multi[$i][$j][$k] = $i * $j * $k; - } - } - } - - for($iter = 0; $iter < 3; $iter++) { - - /* prepare data */ - $v_char = array(); - $v_date = array(); - $v_decimal = array(); - $v_double = array(); - $v_float = array(); - $v_integer = array(); - $v_numeric = array(); - $v_smallint = array(); - $v_varchar = array(); - - for ($i = 1; $i <= 10; ++$i) { - $v_char[$i] = rand_str(100); - $v_date[$i] = rand_datetime(); - $v_decimal[$i] = rand_number(18,3); - $v_double[$i] = rand_number(20); - $v_float[$i] = rand_number(7); - $v_integer[$i] = rand_number(9,0); - $v_numeric[$i] = rand_number(9,2); - $v_smallint[$i] = rand_number(5) % 32767; - $v_varchar[$i] = rand_str(1000); - } - - ibase_query("insert into test7 - (iter,v_multi,v_char,v_date,v_decimal,v_double,v_float, - v_integer,v_numeric,v_smallint,v_varchar) - values (?,?,?,?,?,?,?,?,?,?,?)", - $iter, $v_multi, $v_char, $v_date, $v_decimal, $v_double, $v_float, - $v_integer, $v_numeric, $v_smallint, $v_varchar); - $sel = ibase_query("select * from test7 where iter = $iter"); - - $row = ibase_fetch_object($sel,IBASE_FETCH_ARRAYS); - for ($i = 1; $i <= 10; ++$i) { - - if(strncmp($row->V_CHAR[$i],$v_char[$i],strlen($v_char[$i])) != 0) { - echo " CHAR[$i] fail:\n"; - echo " in: ".$v_char[$i]."\n"; - echo " out: ".$row->V_CHAR[$i]."\n"; - } - if($row->V_DATE[$i] != $v_date[$i]) { - echo " DATE[$i] fail\n"; - echo " in: ".$v_date[$i]."\n"; - echo " out: ".$row->V_DATE[$i]."\n"; - } - if($row->V_DECIMAL[$i] != $v_decimal[$i]) { - echo " DECIMAL[$i] fail\n"; - echo " in: ".$v_decimal[$i]."\n"; - echo " out: ".$row->V_DECIMAL[$i]."\n"; - } - if(abs($row->V_DOUBLE[$i] - $v_double[$i]) > abs($v_double[$i] / 1E15)) { - echo " DOUBLE[$i] fail\n"; - echo " in: ".$v_double[$i]."\n"; - echo " out: ".$row->V_DOUBLE[$i]."\n"; - } - if(abs($row->V_FLOAT[$i] - $v_float[$i]) > abs($v_float[$i] / 1E7)) { - echo " FLOAT[$i] fail\n"; - echo " in: ".$v_float[$i]."\n"; - echo " out: ".$row->V_FLOAT[$i]."\n"; - } - if($row->V_INTEGER[$i] != $v_integer[$i]) { - echo " INTEGER[$i] fail\n"; - echo " in: ".$v_integer[$i]."\n"; - echo " out: ".$row->V_INTEGER[$i]."\n"; - } - if ($row->V_NUMERIC[$i] != $v_numeric[$i]) { - echo " NUMERIC[$i] fail\n"; - echo " in: ".$v_numeric[$i]."\n"; - echo " out: ".$row->V_NUMERIC[$i]."\n"; - } - if ($row->V_SMALLINT[$i] != $v_smallint[$i]) { - echo " SMALLINT[$i] fail\n"; - echo " in: ".$v_smallint[$i]."\n"; - echo " out: ".$row->V_SMALLINT[$i]."\n"; - } - if ($row->V_VARCHAR[$i] != $v_varchar[$i]) { - echo " VARCHAR[$i] fail:\n"; - echo " in: ".$v_varchar[$i]."\n"; - echo " out: ".$row->V_VARCHAR[$i]."\n"; - } - } - ibase_free_result($sel); - }/* for($iter) */ - - echo "select\n"; - - $sel = ibase_query("SELECT v_multi[5,5,5],v_multi[10,10,10] FROM test7 WHERE iter = 0"); - print_r(ibase_fetch_row($sel)); - ibase_free_result($sel); - - for($iter = 1; $iter <= 3; $iter++) { - - if(!($sel = ibase_query( - "select iter from test7 where v_char[$iter] LIKE ?", $v_char[$iter]."%")) || - !ibase_fetch_row($sel)) { - echo "CHAR fail\n"; - } - ibase_free_result($sel); - - if(!($sel = ibase_query( - "select iter from test7 where v_date[$iter] = ?", $v_date[$iter])) || - !ibase_fetch_row($sel)) { - echo "DATE fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test7 where v_decimal[$iter] = ?", $v_decimal[$iter])) || - !ibase_fetch_row($sel)) { - echo "DECIMAL fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test7 where v_integer[$iter] = ?", $v_integer[$iter])) || - !ibase_fetch_row($sel)) { - echo "INTEGER fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test7 where v_numeric[$iter] = ?", $v_numeric[$iter])) || - !ibase_fetch_row($sel)) { - echo "NUMERIC fail\n"; - } - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test7 where v_smallint[$iter] = ?", $v_smallint[$iter])) || - !ibase_fetch_row($sel)) { - echo "SMALLINT fail\n"; - } - ibase_free_result($sel); - } - ibase_close(); - echo "end of test\n"; -?> ---EXPECT-- -insert -select -Array -( - [0] => 125 - [1] => 1000 -) -end of test diff --git a/ext/interbase/tests/interbase.inc b/ext/interbase/tests/interbase.inc deleted file mode 100755 index 260ef00622..0000000000 --- a/ext/interbase/tests/interbase.inc +++ /dev/null @@ -1,118 +0,0 @@ -<?php - -/* $Id$ */ -/* used in tests */ - -srand((double)microtime()*1000000); - -$test_base = dirname(__FILE__)."/ibase_test.tmp"; -@unlink($test_base); - -$name = tempnam(dirname(__FILE__), "CREATEDB"); -$ftmp = fopen($name,"w"); -fwrite($ftmp, -" - create database \"$test_base\"; - create table test1 (i integer, c varchar(100)); - commit; - insert into test1(i, c) values(1, 'test table created with isql'); - exit; -" -); -fclose($ftmp); - -/* set the correct binary */ -if (is_executable('isql')) { - $cmd = 'isql'; -} else { - $cmd = '/opt/interbase/bin/isql'; -} - -exec("$cmd -i $name 2>&1"); -@unlink($name); - - -function out_table($table_name) -{ - echo "--- $table_name ---\n"; - $res = ibase_query("select * from $table_name"); - $f = ibase_num_fields($res); - while ($r = ibase_fetch_row($res)){ - for($i = 0; $i < $f; $i++) - echo "$r[$i]\t"; - echo "\n"; - } - ibase_free_result($res); - echo "---\n"; -} - -function out_result($result, $table_name = "") -{ - echo "--- $table_name ---\n"; - $f = ibase_num_fields($result); - while ($r = ibase_fetch_row($result)){ - for($i = 0; $i < $f; $i++) - echo "$r[$i]\t"; - echo "\n"; - } - echo "---\n"; -} - -function out_result_trap_error($result, $table_name = "") -{ - echo "--- $table_name ---\n"; - while ($r = @ibase_fetch_assoc($result)){ - while (list($k, $v) = each($r) ){ - echo "$r[$k]\t"; - } - echo "\n"; - } - echo "errmsg [" . ibase_errmsg() . "]\t\n"; - echo "---\n"; -} - -/* M/D/Y H:M:S */ -function rand_datetime() -{ - return sprintf("%02d/%02d/%4d %02d:%02d:%02d", - rand()%12+1, rand()%28+1, rand()%100+1910, - rand()%24, rand()%60, rand()%60); -} - -/* random binary string */ -function rand_binstr($max_len) -{ - $len = rand() % $max_len; - $s = ""; - while($len--) - $s .= sprintf("%c", rand() % 256); - return $s; -} - -function rand_str($max_len) -{ - $len = rand() % $max_len; - $s = ""; - while($len--) - $s .= sprintf("%c", rand() % 26 + 65);; - return $s; -} - -function rand_number($len , $prec = -1, $sign = 1) -{ - if($prec == -1){ - $n = substr(rand() . rand(), 0, rand() % $len + 1); - if(strlen($n) < $len) - $n .= "." . substr(rand(), 0, rand() % ($len - strlen($n)) + 1); - }elseif ($prec == 0){ - $n = substr(rand() . rand(), 0, rand() % $len + 1); - }else{ - $n = substr(rand() . rand(), 0, rand() % ($len - $prec) + 1); - $n .= "." . substr(rand(), 0, $prec); - } - if($sign && (rand() % 3 == 0)) - $n = "-" .$n; - return $n; -} - -?> diff --git a/ext/interbase/tests/skipif.inc b/ext/interbase/tests/skipif.inc deleted file mode 100755 index 4f0395c60b..0000000000 --- a/ext/interbase/tests/skipif.inc +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -/* $Id$ */ -/* used in tests */ - -if (!extension_loaded("interbase")) print "skip"; -if (!is_executable("isql") && !is_executable("/opt/interbase/bin/isql")) print "skip"; - -?> |