[PHP-CVS] cvs: php4 /main main.c
ssb Wed Apr 25 14:46:40 2001 EDT Modified files: /php4/main main.c Log: * define PEAR_EXTENSION_DIR as well Index: php4/main/main.c diff -u php4/main/main.c:1.359 php4/main/main.c:1.360 --- php4/main/main.c:1.359 Sat Apr 21 18:09:13 2001 +++ php4/main/main.cWed Apr 25 14:46:40 2001 @@ -19,7 +19,7 @@ */ -/* $Id: main.c,v 1.359 2001/04/22 01:09:13 ssb Exp $ */ +/* $Id: main.c,v 1.360 2001/04/25 21:46:40 ssb Exp $ */ #include stdio.h @@ -854,6 +854,7 @@ REGISTER_MAIN_STRINGL_CONSTANT(PHP_OS, php_os, strlen(php_os), CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(DEFAULT_INCLUDE_PATH, PHP_INCLUDE_PATH, sizeof(PHP_INCLUDE_PATH)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PEAR_INSTALL_DIR, PEAR_INSTALLDIR, sizeof(PEAR_INSTALLDIR)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PEAR_EXTENSION_DIR, PHP_EXTENSION_DIR, +sizeof(PHP_EXTENSION_DIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_EXTENSION_DIR, PHP_EXTENSION_DIR, sizeof(PHP_EXTENSION_DIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_BINDIR, PHP_BINDIR, sizeof(PHP_BINDIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_LIBDIR, PHP_LIBDIR, sizeof(PHP_LIBDIR)-1, CONST_PERSISTENT | CONST_CS); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 / TODO-4.1.txt
ssb Tue Apr 24 16:18:37 2001 EDT Modified files: /php4 TODO-4.1.txt Log: whoops, two less items for 4.1 Index: php4/TODO-4.1.txt diff -u php4/TODO-4.1.txt:1.4 php4/TODO-4.1.txt:1.5 --- php4/TODO-4.1.txt:1.4 Mon Apr 16 06:54:10 2001 +++ php4/TODO-4.1.txt Tue Apr 24 16:18:37 2001 @@ -1,12 +1,5 @@ -* define PEAR_INSTALL_DIR, PHP_EXTENSION_DIR, PHP_BINDIR and more - in main/main.c - * always build CGI (--disable-cgi option to disable) -* clean up installation directories, start using proper autoconf - directories: php.ini goes into $sysconfdir, PEAR stuff goes into - $datadir[/php]/pear, extensions go into $libdir[/php]/apispec. - * move most extensions and PEAR packages out of the PHP CVS tree, include them again during release packaging @@ -16,4 +9,4 @@ * allow foreach($array as list($var1, $var2)) -* clean up $instance = new object syntax. +* clean up $instance = new object syntax (default to the = behaviour?) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: CVSROOT / avail cvsusers gen_acl_file.m4
ssb Thu Apr 19 04:57:04 2001 EDT Modified files: /CVSROOTavail cvsusers gen_acl_file.m4 Log: * added "kaltoft" with access to PEAR Index: CVSROOT/avail diff -u CVSROOT/avail:1.147 CVSROOT/avail:1.148 --- CVSROOT/avail:1.147 Tue Apr 17 00:31:35 2001 +++ CVSROOT/avail Thu Apr 19 04:57:04 2001 @@ -2,12 +2,12 @@ unavail avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane|CVSROOT avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak,jmcastagnetto,dams|phpweb -avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern,chregu,bkelly,tfromm,subjective,cox,mboeren,fireclaw,jmcastagnetto|php4/pear,pearweb,pear +avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern,chregu,bkelly,tfromm,subjective,cox,mboeren,fireclaw,jmcastagnetto,kaltoft|php4/pear,pearweb,pear avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin|php4,php3,php31,phpfi avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin,hholzgra|functable -avail|rasmus,sterling,jimw,ssb,thies|pres +avail|rasmus,sterling,jimw,ssb|pres avail|jalal,zak,andre,ultrapingo,lyric,jmoore,ronabop,sbergmann,joey,sniper,torben,hellekin,cnewbill|qaweb -avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,zhang,kevin,php_ext,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern,fams,smasiello,dim,lucasr,cpereira,lagflores,kjh90,ernani,theseer,cevm,noribsd,eskaly,mctrash,berto,leobopp,tcr,subjective,mboeren,ufux,virtual,fireclaw,hadar_p,asautins,dbenson|phpdoc
[PHP-CVS] cvs: php4 /main SAPI.h fopen_wrappers.c /sapi/cgi cgi_main.c
ssb Mon Apr 16 16:20:47 2001 EDT Modified files: /php4/main SAPI.h fopen_wrappers.c /php4/sapi/cgi cgi_main.c Log: @Added -C command-line option to avoid chdir to the script's directory (Stig) Index: php4/main/SAPI.h diff -u php4/main/SAPI.h:1.68 php4/main/SAPI.h:1.69 --- php4/main/SAPI.h:1.68 Sat Mar 17 18:32:04 2001 +++ php4/main/SAPI.hMon Apr 16 16:20:47 2001 @@ -25,6 +25,8 @@ #include "zend_operators.h" #include sys/stat.h +#define SAPI_OPTION_NO_CHDIR 1 + #define SAPI_POST_BLOCK_SIZE 4000 #ifdef PHP_WIN32 @@ -109,6 +111,7 @@ char *default_charset; HashTable *rfc1867_uploaded_files; long post_max_size; +int options; } sapi_globals_struct; Index: php4/main/fopen_wrappers.c diff -u php4/main/fopen_wrappers.c:1.111 php4/main/fopen_wrappers.c:1.112 --- php4/main/fopen_wrappers.c:1.111Sun Feb 25 22:07:31 2001 +++ php4/main/fopen_wrappers.c Mon Apr 16 16:20:47 2001 @@ -16,7 +16,7 @@ | Jim Winstead [EMAIL PROTECTED] | +--+ */ -/* $Id: fopen_wrappers.c,v 1.111 2001/02/26 06:07:31 andi Exp $ */ +/* $Id: fopen_wrappers.c,v 1.112 2001/04/16 23:20:47 ssb Exp $ */ #include "php.h" #include "php_globals.h" @@ -348,7 +348,9 @@ STR_FREE(SG(request_info).path_translated); /* for same reason as above */ return NULL; } - V_CHDIR_FILE(filename); +if (!(SG(options) SAPI_OPTION_NO_CHDIR)) { + V_CHDIR_FILE(filename); +} SG(request_info).path_translated = filename; return fp; Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.100 php4/sapi/cgi/cgi_main.c:1.101 --- php4/sapi/cgi/cgi_main.c:1.100 Thu Mar 22 10:54:51 2001 +++ php4/sapi/cgi/cgi_main.cMon Apr 16 16:20:47 2001 @@ -80,7 +80,7 @@ extern char *ap_php_optarg; extern int ap_php_optind; -#define OPTSTRING "ac:d:ef:g:hilmnqs?vz:" +#define OPTSTRING "aCc:d:ef:g:hilmnqs?vz:" static int _print_module_info ( zend_module_entry *module, void *arg ) { php_printf("%s\n", module-name); @@ -246,6 +246,7 @@ " -s Display colour syntax highlighted source.\n" " -f file Parse file. Implies `-q'\n" " -v Version number\n" +" -C Do not chdir to the script's directory\n" " -c path Look for php.ini file in this directory\n" #if SUPPORT_INTERACTIVE " -a Run interactively\n" @@ -525,7 +526,10 @@ #endif break; - case 'd': /* define ini entries on command line */ + case 'C': /* don't chdir to the script directory */ + SG(options) |= SAPI_OPTION_NO_CHDIR; + break; + case 'd': /* define ini entries on command line */ define_command_line_ini_entry(ap_php_optarg); break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 / run-tests.php /build rules.mk
ssb Mon Apr 16 16:28:58 2001 EDT Modified files: /php4 run-tests.php /php4/build rules.mk Log: * using CGI -C option, you no longer have to specify "full" path to tests Index: php4/run-tests.php diff -u php4/run-tests.php:1.22 php4/run-tests.php:1.23 --- php4/run-tests.php:1.22 Thu Mar 29 04:07:37 2001 +++ php4/run-tests.php Mon Apr 16 16:28:57 2001 @@ -127,7 +127,7 @@ $term_bold = $term_norm = ""; } -$windows_p = (substr(php_uname(), 0, 7) == "Windows"); +$windows_p = (substr(PHP_OS, 0, 3) == "WIN"); if ($windows_p) { if (file_exists('Release_TS_inline\\php.exe')) { $php = 'Release_TS_inline\\php.exe'; @@ -137,8 +137,11 @@ $php=trim($windows_p ? `cd`:`pwd`).'\\php'; } } else { -// $php = $GLOBALS["TOP_BUILDDIR"]."/php"; // where should be the origin of this variable -$php=trim(`pwd`).'/php'; +if (isset($GLOBALS["TOP_BUILDDIR"])) { +$php = $GLOBALS["TOP_BUILDDIR"]."/php"; +} else { +$php = getcwd() . '/php'; +} } create_compiled_in_modules_list(); Index: php4/build/rules.mk diff -u php4/build/rules.mk:1.30 php4/build/rules.mk:1.31 --- php4/build/rules.mk:1.30Sun Dec 24 08:03:16 2000 +++ php4/build/rules.mk Mon Apr 16 16:28:58 2001 @@ -14,7 +14,7 @@ # | Authors: Sascha Schumann [EMAIL PROTECTED]| # +--+ # -# $Id: rules.mk,v 1.30 2000/12/24 16:03:16 sas Exp $ +# $Id: rules.mk,v 1.31 2001/04/16 23:28:58 ssb Exp $ # include $(top_srcdir)/build/rules_common.mk @@ -55,9 +55,9 @@ test: $(top_builddir)/php @if test "$(TESTS)" = ""; then \ - TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/php -d "include_path=.:$(top_srcdir)/pear:$(top_builddir)/pear:$(PEAR_INSTALLDIR)" -q $(top_srcdir)/run-tests.php $(srcdir); \ + TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) +$(top_builddir)/php -C -q $(top_srcdir)/run-tests.php $(srcdir); \ else \ - TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/php -d include_path=".:$(top_srcdir)/pear:$(top_builddir)/pear:$(PEAR_INSTALLDIR)" -q $(top_srcdir)/run-tests.php $(TESTS); \ + TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) +$(top_builddir)/php -C -q $(top_srcdir)/run-tests.php $(TESTS); \ fi include $(builddir)/.deps -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 / TODO-4.1.txt
ssb Fri Apr 13 13:47:13 2001 EDT Added files: /php4 TODO-4.1.txt Log: here's a preliminary list of stuff for 4.1 Index: php4/TODO-4.1.txt +++ php4/TODO-4.1.txt * define PEAR_INSTALL_DIR, PHP_EXTENSION_DIR, PHP_BINDIR and more in main/main.c * always build CGI (--disable-cgi option to disable) * clean up installation directories, start using proper autoconf directories: php.ini goes into $sysconfdir, PEAR stuff goes into $datadir[/php]/pear, extensions go into $libdir[/php]/apispec. * move most extensions and PEAR packages out of the PHP CVS tree, include them again during release packaging -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 / ChangeLog ChangeLog.1999.gz ChangeLog.2000.gz
tween user and kernel land too many times. If that does not work, we -fall back to the read/write method. - -2000-12-22 Andrei Zmievski [EMAIL PROTECTED] - -* ext/pcre/php_pcre.c - ext/standard/array.c: -(PHP preg_replace) Fix to allow proper escaping of captured subpattern -references in the replacement string. -(PHP array_sum) Check that argument is an array. - -2000-12-22 Zeev Suraski [EMAIL PROTECTED] - -* ext/standard/array.c - ext/standard/info.c - ext/standard/string.c - ext/standard/var.c - ext/wddx/wddx.c - sapi/apache2filter/apache_config.c - ext/pcre/php_pcre.c - ext/pfpro/pfpro.c - ext/sablot/sablot.c - ext/session/session.c - ext/imap/php_imap.c - ext/java/java.c - ext/ldap/ldap.c - ext/oracle/oracle.c - ext/com/COM.c - ext/curl/curl.c - ext/hyperwave/hw.c: Heads up people! - -Updated the get_current_key() API - the relevant authors, please take -a look at the updated code and make sure it's ok... - -2000-12-21 Jani Taskinen [EMAIL PROTECTED] - -* ext/standard/string.c: -- Changed setlocale() to use LC_* constants. - -2000-12-21 Sascha Schumann [EMAIL PROTECTED] - -* ext/session/mod_mm.c: No need for GCC extensions in non-debugging mode. - -PR: #8345 - -* configure.in: -Some AC_SUBST substitutions were removed which are still needed. - -Submitted by: Andrei Zmievski - -2000-12-20 Chuck Hagenbuch [EMAIL PROTECTED] - -* pear/Makefile.in: install the Math/* files. - -2000-12-20 Sascha Schumann [EMAIL PROTECTED] - -* build/genif.sh - ext/oci8/config.m4 - ext/odbc/config.m4 - ext/oracle/config.m4 - sapi/cgi/config.m4 - acinclude.m4 - configure.in - genif.sh: Stop automatically passing vars to AC_SUBST through PHP_SUBST. - -There are some variables which are needed for Makefiles and files -created by AC_OUTPUT; we use PHP_SUBST_OLD for those now. - -genif.sh was moved to an appropiate place. - -* build/print_include.awk - configure.in - genif.sh: -Speed up the genif.sh script a little bit. Whereas it took three seconds -previously, it takes now about 100ms on a P233. - -2000-12-20 Andi Gutmans [EMAIL PROTECTED] - -* ext/standard/fsock.c: -- Use memcmp() instead of ugly char-by-char compare - -2000-12-20 Zak Greant [EMAIL PROTECTED] - -* ext/standard/basic_functions.c: Removed unused variable from is_scalar - -2000-12-20 Jani Taskinen [EMAIL PROTECTED] - -* NEWS: Note about fix under correct version. - -2000-12-20 Sascha Schumann [EMAIL PROTECTED] - -* ext/ctype/ctype.c - ext/ctype/php_ctype.h - ext/ctype/tests/001.phpt - ext/ctype/tests/002.phpt: merge in function name changes - -2000-12-19 Zeev Suraski [EMAIL PROTECTED] - -* ext/standard/credits.c - ext/standard/info.c - ext/standard/info.h: Add the QA team to the credits - -2000-12-19 Hartmut Holzgraefe [EMAIL PROTECTED] - -* ext/ctype/ctype.c - ext/ctype/php_ctype.h - ext/ctype/tests/001.phpt - ext/ctype/tests/002.phpt: - ctype functions now follow the extension naming conventions - -2000-12-19 Stanislav Malyshev [EMAIL PROTECTED] - -* ext/standard/fsock.c: Fix possible crash - -2000-12-19 Ron Chmara [EMAIL PROTECTED] - -* CODING_STANDARDS: Updated to reflect recent discussions on php-dev. - -2000-12-19 Sascha Schumann [EMAIL PROTECTED] - -* NEWS - configure.in - main/php_version.h: Preparing 4.0.4 - -2000-12-19 Jani Taskinen [EMAIL PROTECTED] - -* ext/java/config.m4: wb fix. - -* ext/java/config.m4: Fix pr: #7982 - -2000-12-18 Zak Greant [EMAIL PROTECTED] - -* ext/standard/tests/general_functions/005.phpt: -Adding test for is_scalar(). - -2000-12-18 Chuck Hagenbuch [EMAIL PROTECTED] - -* pear/Crypt/HCEMD5.php: Add some error checking/tolerance. - -2000-12-18 Zak Greant [EMAIL PROTECTED] - -* ext/standard/basic_functions.c - ext/standard/basic_functions.h: Added is_scalar() function. - -2000-12-18 Andi Gutmans [EMAIL PROTECTED] - -* makedist: - No need to generate number.c and number.h anymore. - -2000-12-18 Hartmut Holzgraefe [EMAIL PROTECTED] - -* ext/sysvshm/sysvshm.c: -fixed BUG #8306: shmat() returns -1 on errors, not NULL - -2000-12-18 Stig Bakken [EMAIL PROTECTED] - -* pear/DB/mysql.php: -* change mysql sequence type to unsigned and add not null (thanks Mikhail) - -2000-12-17 Stanislav Malyshev [EMAIL PROTECTED] - -* ext/odbc/config.m4: -No need to link main binary with ODBC libs if we use shared module - -2000-12-17 Thies C. Arntzen [EMAIL PROTECTED] - -* TODO: add a reminder about #3149 - -2000-12-17 Sascha Schumann [EMAIL PROTECTED] - -* ext/standard/string.c: -Don't do anything, if the input string has a length of 0. - -PR: #7686 - -2000-12-16 Andi Gutmans [EMAIL PROTECTED] - -* ext/dba/dba.c: -
[PHP-CVS] cvs: CVSROOT / loginfo
ssb Wed Apr 11 11:26:51 2001 EDT Modified files: /CVSROOTloginfo Log: * send commit messages for "pear" and "pearweb" to [EMAIL PROTECTED] Index: CVSROOT/loginfo diff -u CVSROOT/loginfo:1.41 CVSROOT/loginfo:1.42 --- CVSROOT/loginfo:1.41Tue Apr 10 09:31:01 2001 +++ CVSROOT/loginfo Wed Apr 11 11:26:50 2001 @@ -1,5 +1,5 @@ # -#ident "@(#)cvs/examples:$Name: $:$Id: loginfo,v 1.41 2001/04/10 16:31:01 rasmus Exp $" +#ident "@(#)cvs/examples:$Name: $:$Id: loginfo,v 1.42 2001/04/11 18:26:50 ssb Exp $" # # The "loginfo" file is used to control where "cvs commit" log information # is sent. The first entry on a line is a regular expression which is tested @@ -42,7 +42,8 @@ .*distributions.* $CVSROOT/CVSROOT/log -s -f $CVSROOT/CVSROOT/mylog -u $USER %s phpweb $CVSROOT/CVSROOT/loginfo.pl [EMAIL PROTECTED] $USER %{sVv} phpdoc $CVSROOT/CVSROOT/loginfo.pl [EMAIL PROTECTED] $USER %{sVv} -pearweb $CVSROOT/CVSROOT/loginfo.pl [EMAIL PROTECTED] $USER %{sVv} +pear $CVSROOT/CVSROOT/loginfo.pl [EMAIL PROTECTED] $USER %{sVv} +pearweb $CVSROOT/CVSROOT/loginfo.pl [EMAIL PROTECTED] $USER %{sVv} qaweb $CVSROOT/CVSROOT/loginfo.pl [EMAIL PROTECTED] $USER %{sVv} portal $CVSROOT/CVSROOT/loginfo.pl [EMAIL PROTECTED] $USER %{sVv} pres $CVSROOT/CVSROOT/loginfo.pl [EMAIL PROTECTED] $USER %{sVv} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/HTML Processor.php
ssb Sun Apr 8 00:39:27 2001 EDT Modified files: /php4/pear/HTML Processor.php Log: * using GLOBALS to set global variable (in case the file is included from within a function) Index: php4/pear/HTML/Processor.php diff -u php4/pear/HTML/Processor.php:1.1 php4/pear/HTML/Processor.php:1.2 --- php4/pear/HTML/Processor.php:1.1Wed Jan 17 08:34:05 2001 +++ php4/pear/HTML/Processor.phpSun Apr 8 00:39:27 2001 @@ -16,7 +16,7 @@ // | Authors: Sterling Hughes [EMAIL PROTECTED] | // +--+ // -// $Id: Processor.php,v 1.1 2001/01/17 16:34:05 sterling Exp $ +// $Id: Processor.php,v 1.2 2001/04/08 07:39:27 ssb Exp $ // // HTML processing utility functions. // @@ -30,7 +30,7 @@ // {{{ HTML_Processor -$_HTML_Processor_translation_table = array(); +$GLOBALS['_HTML_Processor_translation_table'] = array(); /** * The HTML_Processor class facilitates the parsing and processing of @@ -99,4 +99,4 @@ } // }}} -? \ No newline at end of file +? -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/XML Parser.php
ssb Sun Apr 8 00:40:21 2001 EDT Modified files: /php4/pear/XML Parser.php Log: * indentation and inline doc fixes Index: php4/pear/XML/Parser.php diff -u php4/pear/XML/Parser.php:1.10 php4/pear/XML/Parser.php:1.11 --- php4/pear/XML/Parser.php:1.10 Thu Mar 15 12:39:14 2001 +++ php4/pear/XML/Parser.phpSun Apr 8 00:40:21 2001 @@ -25,7 +25,6 @@ * based on the bundled expat library. * * @author Stig Bakken [EMAIL PROTECTED] - * @version $id $ * @todoTests that need to be made: * - error class * - mixing character encodings @@ -37,28 +36,22 @@ // {{{ properties /** -* XML parser handle -* -* @var resource xml_parser -*/ + * @var resource XML parser handle var $parser; /** -* -* @var resourcefopen -*/ + * @var resource File handle if parsing from a file + */ var $fp; /** -* -* @var boolean -*/ + * @var boolean Whether to do case folding + */ var $folding = true; /** -* -* @var string -*/ + * @var string Mode of operation, one of "event" or "func" + */ var $mode; @@ -68,13 +61,13 @@ * @var array */ var $handler = array( -"character_data_handler"= "cdataHandler", -"default_handler" = "defaultHandler", -"processing_instruction_handler"= "piHandler", -"unparsed_entitry_decl_handler" = "unparsedHandler", -"notation_decl_handler" = "notationHandler", -"external_entity_ref_handler" = "entityrefHandler" -); +"character_data_handler"= "cdataHandler", +"default_handler" = "defaultHandler", +"processing_instruction_handler"= "piHandler", +"unparsed_entitry_decl_handler" = "unparsedHandler", +"notation_decl_handler" = "notationHandler", +"external_entity_ref_handler" = "entityrefHandler" +); // }}} @@ -87,21 +80,17 @@ * @paramstring * @throws XML_Parser_Error */ -function XML_Parser($charset = 'UTF-8', $mode = "event") { +function XML_Parser($charset = 'UTF-8', $mode = "event") +{ +$$this-PEAR(); -$this-PEAR(); - $xp = @xml_parser_create($charset); if (is_resource($xp)) { - $this-parser = $xp; $this-setMode($mode); xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, $this-folding); - } else { - -return new XML_Parser_Error("Can't create xml parser"); - +return new XML_Parser_Error("Can not create xml parser"); } } @@ -251,13 +240,12 @@ // }}} // {{{ funcEndHandler() -function funcEndHandler($xp, $elem) { - +function funcEndHandler($xp, $elem) +{ $func = $elem . '_'; if (method_exists($this, $func)) { call_user_method($func, $this, $xp, $elem); } - } @@ -265,7 +253,8 @@ * * @abstract */ -function StartHandler($xp, $elem, $attribs) { +function StartHandler($xp, $elem, $attribs) +{ return NULL; } @@ -274,7 +263,8 @@ * * @abstract */ -function EndHandler($xp, $elem) { +function EndHandler($xp, $elem) +{ return NULL; } @@ -305,4 +295,4 @@ // }}} } -? \ No newline at end of file +? -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard dir.c
ssb Sun Apr 8 14:57:14 2001 EDT Modified files: /php4/ext/standard dir.c Log: @Add DIRECTORY_SEPARATOR constant ('/' on UNIX, '\' on Windows) (Stig) Index: php4/ext/standard/dir.c diff -u php4/ext/standard/dir.c:1.58 php4/ext/standard/dir.c:1.59 --- php4/ext/standard/dir.c:1.58Sun Feb 25 22:07:17 2001 +++ php4/ext/standard/dir.c Sun Apr 8 14:57:13 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: dir.c,v 1.58 2001/02/26 06:07:17 andi Exp $ */ +/* $Id: dir.c,v 1.59 2001/04/08 21:57:13 ssb Exp $ */ /* {{{ includes/startup/misc */ @@ -128,6 +128,7 @@ PHP_MINIT_FUNCTION(dir) { +static char tmpstr[2]; zend_class_entry dir_class_entry; le_dirp = zend_register_list_destructors_ex(_dir_dtor, NULL, "dir", module_number); @@ -138,6 +139,9 @@ #ifdef ZTS dir_globals_id = ts_allocate_id(sizeof(php_dir_globals), NULL, NULL); #endif +tmpstr[0] = DEFAULT_SLASH; +tmpstr[1] = '\0'; +REGISTER_STRING_CONSTANT("DIRECTORY_SEPARATOR", tmpstr, 0); return SUCCESS; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 / Makefile.in configure.in /main build-defs.h.in /pear PEAR.php.in /sapi Makefile.in /sapi/cgi config.m4
LE_API_NO=`egrep '#define ZEND_MODULE_API_NO ' +$srcdir/Zend/zend_modules.h|sed 's/#define ZEND_MODULE_API_NO //'` + +extbasedir="$ZEND_MODULE_API_NO" if test "$enable_experimental_zts" = "yes"; then - PART2=zts -else - PART2=non-zts + extbasedir="${extbasedir}-zts" fi -ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO ' $srcdir/Zend/zend_modules.h|sed 's/#define ZEND_MODULE_API_NO //'` +if test "$PHP_DEBUG" = "1"; then + extbasedir="${extbasedir}-debug" +fi if test -z "$PEAR_INSTALLDIR"; then - PEAR_INSTALLDIR="$prefix/lib/php" + PEAR_INSTALLDIR="\${datadir}/pear" fi - -EXTENSION_DIR="${PEAR_INSTALLDIR}/extensions/$PART1-$PART2-$ZEND_MODULE_API_NO" +if test -z "$EXTENSION_DIR"; then + EXTENSION_DIR="\${libdir}/$extbasedir" +fi -INCLUDE_PATH=".:${PEAR_INSTALLDIR}" +old_prefix="$prefix" +old_exec_prefix="$exec_prefix" +old_libdir="$libdir" +old_datadir="$datadir" +prefix=`eval echo $prefix` +exec_prefix=`eval echo $exec_prefix` +libdir=`eval echo $libdir` +datadir=`eval echo $datadir` +EXPANDED_PEAR_INSTALLDIR=`eval echo $PEAR_INSTALLDIR` +EXPANDED_EXTENSION_DIR=`eval echo $EXTENSION_DIR` +EXPANDED_LOCALSTATEDIR=`eval echo $localstatedir` +INCLUDE_PATH=".:$EXPANDED_PEAR_INSTALLDIR" +if test "$PHP_CONFIG_FILE_PATH" != "no"; then + EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"` + AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "$EXPANDED_PHP_CONFIG_FILE_PATH",[ ]) + AC_DEFINE(USE_CONFIG_FILE, 1, [ ]) +else + AC_DEFINE(CONFIGURATION_FILE_PATH, 0, [ ]) + AC_DEFINE(USE_CONFIG_FILE, 0, [ ]) +fi +prefix="$old_prefix" +exec_prefix="$old_exec_prefix" +libdir="$old_libdir" +datadir="$old_datadir" +AC_SUBST(EXPANDED_PEAR_INSTALLDIR) +AC_SUBST(EXPANDED_EXTENSION_DIR) +AC_SUBST(EXPANDED_LOCALSTATEDIR) PHP_BUILD_RPATH @@ -744,6 +766,7 @@ PHP_SUBST(phptempdir) PHP_SUBST(prefix) PHP_SUBST(localstatedir) +PHP_SUBST(datadir) PHP_SUBST(AWK) PHP_SUBST(CC) Index: php4/main/build-defs.h.in diff -u php4/main/build-defs.h.in:1.2 php4/main/build-defs.h.in:1.3 --- php4/main/build-defs.h.in:1.2 Sun Feb 25 22:07:31 2001 +++ php4/main/build-defs.h.in Sun Apr 8 15:30:17 2001 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: build-defs.h.in,v 1.2 2001/02/26 06:07:31 andi Exp $ */ +/* $Id: build-defs.h.in,v 1.3 2001/04/08 22:30:17 ssb Exp $ */ #define CONFIGURE_COMMAND "@CONFIGURE_COMMAND@" #define PHP_ADA_INCLUDE"" @@ -27,7 +27,6 @@ #define PHP_FHTTPD_INCLUDE "" #define PHP_FHTTPD_LIB "" #define PHP_FHTTPD_TARGET "" -#define PHP_BINNAME"@BINNAME@" #define PHP_CFLAGS "@CFLAGS@" #define PHP_DBASE_LIB "" #define PHP_BUILD_DEBUG"@DEBUG_CFLAGS@" @@ -39,7 +38,6 @@ #define PHP_IFX_INCLUDE"" #define PHP_IFX_LFLAGS "" #define PHP_IFX_LIBS "" -#define PHP_INSTALL_IT "@INSTALL_IT@" #define PHP_IODBC_INCLUDE "" #define PHP_IODBC_LFLAGS "" #define PHP_IODBC_LIBS "" @@ -50,14 +48,9 @@ #define PHP_MYSQL_LFLAGS "" #define PHP_MYSQL_LIBS "" #define PHP_ODBC_TYPE "@ODBC_TYPE@" -#define PHP_ODBC_INCLUDE"@ODBC_INCLUDE@" -#define PHP_ODBC_LFLAGS "@ODBC_LFLAGS@" -#define PHP_ODBC_LIBS "@ODBC_LIBS@" #define PHP_OCI8_SHARED_LIBADD "@OCI8_SHARED_LIBADD@" #define PHP_OCI8_DIR "@OCI8_DIR@" #define PHP_OCI8_VERSION "@OCI8_VERSION@" -#define PHP_ORACLE_SHARED_LIBADD "@ORACLE_SHARED_LIBADD@" -#define PHP_ORACLE_DIR "@ORACLE_DIR@" #define PHP_ORACLE_VERSION "@ORACLE_VERSION@" #define PHP_PGSQL_INCLUDE "" #define PHP_PGSQL_LFLAGS "" @@ -78,5 +71,5 @@ #define PHP_LDAP_LIBS "" #define PHP_VELOCIS_INCLUDE "" #define PHP_VELOCIS_LIBS"" -#define PHP_EXTENSION_DIR "@EXTENSION_DIR@" -#define PHP_INCLUDE_PATH "@INCLUDE_PATH@" +#define PHP_EXTENSION_DIR "@EXPANDED_EXTENSION_DIR@" +#define PHP_INCLUDE_PATH "@EXPANDED_INCLUDE_PATH@" Index: php4/pear/PEAR.php.in diff -u php4/pear/PEAR.php.in:1.18 php4/pear/PEAR.php.in:1.19 --- php4/pear/PEAR.php.in:1.18 Mon Apr 2 20:12:49 2001 +++ php4/pear/PEAR.php.in Sun Apr 8 15:30:17 2001 @@ -17,7 +17,7 @@ // | Stig Bakken [EMAIL
[PHP-CVS] cvs: CVSROOT / avail gen_acl_file.m4
ssb Thu Apr 5 08:32:44 2001 EDT Modified files: /CVSROOTavail gen_acl_file.m4 Log: * let myself commit to pres Index: CVSROOT/avail diff -u CVSROOT/avail:1.138 CVSROOT/avail:1.139 --- CVSROOT/avail:1.138 Thu Apr 5 08:29:03 2001 +++ CVSROOT/avail Thu Apr 5 08:32:44 2001 @@ -5,7 +5,7 @@ avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern,chregu,bkelly,tfromm,subjective,cox,mboeren,fireclaw|php4/pear,pearweb,pear avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm|php4,php3,php31,phpfi avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,hholzgra|functable -avail|rasmus,sterling,jimw|pres +avail|rasmus,sterling,jimw,ssb|pres avail|jalal,zak,andre,ultrapingo,lyric,jmoore,ronabop,sbergmann,joey,sniper,torben,hellekin,cnewbill|qaweb avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,dbenson,bmcadams,swm,php_ext,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern,fams,smasiello,dim,lucasr,cpereira,lagflores,kjh90,ernani,theseer,cevm,noribsd,eskaly,mctrash,berto,leobopp,tcr,subjective,mboeren,ufux,virtual,fireclaw,hadar_p|phpdoc avail|andrei,fmk,zimt,jan,changelog,miester|php-gtk Index: CVSROOT/gen_acl_file.m4 diff -u CVSROOT/gen_acl_file.m4:1.142 CVSROOT/gen_acl_file.m4:1.143 --- CVSROOT/gen_acl_file.m4:1.142 Thu Apr 5 08:29:03 2001 +++ CVSROOT/gen_acl_file.m4 Thu Apr 5 08:32:44 2001 @@ -11,7 +11,7 @@ dnl PHP.NET Website define(`php_web', `cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak,jmcastagnetto,dams')dnl dnl -define(`php_pres', `rasmus,sterling,jimw')dnl +define(`php_pres', `rasmus,sterling,jimw,ssb')dnl dnl define(`php_midgard', `emile,davidg,alan_k,ab')dnl dnl PHP-GTK Documentation Group -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB STATUS
ssb Sun Mar 25 02:25:11 2001 EDT Modified files: /php4/pear/DB STATUS Log: wrapped to 80 columns, replaced a few "-" with "n" for ifx (some features are emulated through DB_common) Index: php4/pear/DB/STATUS diff -u php4/pear/DB/STATUS:1.17 php4/pear/DB/STATUS:1.18 --- php4/pear/DB/STATUS:1.17Sat Mar 24 10:56:24 2001 +++ php4/pear/DB/STATUS Sun Mar 25 02:25:10 2001 @@ -9,16 +9,16 @@ "n" - returns "not capable" "-" - no implementation of this feature -FEATURE ibase msqlmssql mysql oci8odbcpgsql sybase ifx -simpleQuery x x x T T x T x x -numCols x x x T T x T x x -numRows n x x T E n T n n -errorNative n n n T x x T n x -prepare/execute x e e E T e E e - -sequences n n n E T n T n - -affectedRows n n n T T n T n x -fetch modes x x x T T x T x x -transactions x n n n x x x n - -auto-commit x n n n x x x n - -error mapping - - - T T x E - x -tableInfo n n n T n n n n - +FEATURE ibase ifx msql mssql mysql oci8 odbc pgsql sybase +simpleQuery x x x x T T x T x +numCols x x x x T T x T x +numRows n n x x T E n T n +errorNative n x n n T x x T n +prepare/execute x e e e E T e E e +sequences n n n n E T n T n +affectedRows n x n n T T n T n +fetch modes x x(t) x x T T x T x +transactions x n n n n x x x n +auto-commit x n n n n x x x n +error mapping - - - - T T x E - +tableInfo n n n n T n n n n -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB ifx.php
ssb Sun Mar 25 02:34:31 2001 EDT Modified files: /php4/pear/DB ifx.php Log: * changed DB_ifx::errorCode to take a parameter, moved the error code map into the constructor Index: php4/pear/DB/ifx.php diff -u php4/pear/DB/ifx.php:1.2 php4/pear/DB/ifx.php:1.3 --- php4/pear/DB/ifx.php:1.2Sat Mar 24 10:56:24 2001 +++ php4/pear/DB/ifx.phpSun Mar 25 02:34:31 2001 @@ -44,7 +44,18 @@ 'pconnect' = true, 'transactions' = false ); -$this-errorcode_map = array(); +$this-errorcode_map = array( +'-201'= DB_ERROR_SYNTAX, +'-206'= DB_ERROR_NOSUCHTABLE, +'-217'= DB_ERROR_NOSUCHFIELD, +'-329'= DB_ERROR_NODBSELECTED, +'-1204' = DB_ERROR_INVALID_DATE, +'-1205' = DB_ERROR_INVALID_DATE, +'-1206' = DB_ERROR_INVALID_DATE, +'-1209' = DB_ERROR_INVALID_DATE, +'-1210' = DB_ERROR_INVALID_DATE, +'-1212' = DB_ERROR_INVALID_DATE + ); } /** @@ -197,8 +208,8 @@ function ifxraiseError($errno = null) { -if ($errno == null) { -$errno = $this-errorCode(); +if ($errno === null) { +$errno = $this-errorCode(ifx_error()); } return $this-raiseError($errno, null, null, null, @@ -214,24 +225,12 @@ * implementation has no mapping for the given error code. */ -function errorCode() +function errorCode($nativecode) { -if (ereg('SQLCODE=(.*)]', ifx_error(), $match)) { +if (ereg('SQLCODE=(.*)]', $nativecode, $match)) { $code = $match[1]; -$codes = array( -'-201'= DB_ERROR_SYNTAX, -'-206'= DB_ERROR_NOSUCHTABLE, -'-217'= DB_ERROR_NOSUCHFIELD, -'-329'= DB_ERROR_NODBSELECTED, -'-1204' = DB_ERROR_INVALID_DATE, -'-1205' = DB_ERROR_INVALID_DATE, -'-1206' = DB_ERROR_INVALID_DATE, -'-1209' = DB_ERROR_INVALID_DATE, -'-1210' = DB_ERROR_INVALID_DATE, -'-1212' = DB_ERROR_INVALID_DATE -); -if (isset($codes[$code])) { -return $codes[$code]; +if (isset($this-errorcode_map[$code])) { +return $this-errorcode_map[$code]; } } return DB_ERROR; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: CVSROOT / avail gen_acl_file.m4
ssb Sun Mar 25 03:35:22 2001 EDT Modified files: /CVSROOTavail gen_acl_file.m4 Log: * added "ufux" Index: CVSROOT/avail diff -u CVSROOT/avail:1.126 CVSROOT/avail:1.127 --- CVSROOT/avail:1.126 Thu Mar 22 12:10:57 2001 +++ CVSROOT/avail Sun Mar 25 03:35:21 2001 @@ -7,7 +7,7 @@ avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,hholzgra|functable avail|rasmus,sterling,jimw|pres avail|jalal,zak,andre,ultrapingo,lyric,jmoore,ronabop,sbergmann,joey,sniper,torben,hellekin,cnewbill|qaweb -avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,php_ext,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern,fams,smasiello,dim,lucasr,cpereira,lagflores,kjh90,ernani,theseer,cevm,noribsd,eskaly,mctrash,berto,leobopp,tcr,subjective,mboeren|phpdoc +avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,php_ext,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern,fams,smasiello,dim,lucasr,cpereira,lagflores,kjh90,ernani,theseer,cevm,noribsd,eskaly,mctrash,berto,leobopp,tcr,subjective,mboeren,ufux|phpdoc avail|andrei,fmk,zimt,jan,changelog|php-gtk avail|jmoore,adrianz,protoman,sfox|php-gtk/docs avail|andrei,fmk,jmoore,jskinner|php-gtk-web Index: CVSROOT/gen_acl_file.m4 diff -u CVSROOT/gen_acl_file.m4:1.130 CVSROOT/gen_acl_file.m4:1.131 --- CVSROOT/gen_acl_file.m4:1.130 Thu Mar 22 12:10:57 2001 +++ CVSROOT/gen_acl_file.m4 Sun Mar 25 03:35:21 2001 @@ -3,7 +3,7 @@ dnl PHP Developers (full access to the source trees) define(`php_dev', `php_group,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo') dnl PHP Documentation Group -define(`php_doc',
[PHP-CVS] cvs: php4 /pear DB.php /pear/DB STATUS common.php mysql.php /pear/DB/tests tableinfo.inc /pear/DB/tests/mysql 012.phpt
ssb Fri Mar 23 23:00:45 2001 EDT Added files: /php4/pear/DB/tests tableinfo.inc /php4/pear/DB/tests/mysql 012.phpt Modified files: /php4/pear DB.php /php4/pear/DB STATUS common.php mysql.php Log: * added Christian Stocker's tableInfo() implementation Index: php4/pear/DB.php diff -u php4/pear/DB.php:1.52 php4/pear/DB.php:1.53 --- php4/pear/DB.php:1.52 Thu Mar 22 17:15:05 2001 +++ php4/pear/DB.phpFri Mar 23 23:00:44 2001 @@ -17,7 +17,7 @@ // | Tomas V.V.Cox [EMAIL PROTECTED] | // +--+ // -// $Id: DB.php,v 1.52 2001/03/23 01:15:05 ssb Exp $ +// $Id: DB.php,v 1.53 2001/03/24 07:00:44 ssb Exp $ // // Database independent query interface. // @@ -133,6 +133,17 @@ define('DB_GETMODE_FLIPPED', DB_FETCHMODE_FLIPPED); /** + * these are constants for the tableInfo-function + * they are bitwised or'ed. so if there are more constants to be defined + * in the future, adjust DB_TABLEINFO_FULL accordingly + */ + +define('DB_TABLEINFO_ORDER', 1); +define('DB_TABLEINFO_ORDERTABLE', 2); +define('DB_TABLEINFO_FULL', 3); + + +/** * The main "DB" class is simply a container class with some static * methods for creating DB objects as well as some utility functions * common to all parts of DB. @@ -625,6 +636,11 @@ } $this-result = false; return true; +} + +function tableInfo($mode = null) +{ +return $this-dbh-tableInfo($this-result, $mode); } } Index: php4/pear/DB/STATUS diff -u php4/pear/DB/STATUS:1.15 php4/pear/DB/STATUS:1.16 --- php4/pear/DB/STATUS:1.15Thu Mar 22 17:15:06 2001 +++ php4/pear/DB/STATUS Fri Mar 23 23:00:45 2001 @@ -21,3 +21,4 @@ transactions x n n n x x x n auto-commit x n n n x x x n error mapping - - - T T x E - +tableInfo n n n T n n n n Index: php4/pear/DB/common.php diff -u php4/pear/DB/common.php:1.40 php4/pear/DB/common.php:1.41 --- php4/pear/DB/common.php:1.40Thu Mar 22 17:15:06 2001 +++ php4/pear/DB/common.php Fri Mar 23 23:00:45 2001 @@ -865,6 +865,14 @@ } // }}} +// {{{ tableInfo() + +function tableInfo($result, $mode = null) +{ +return $this-raiseError(DB_ERROR_NOT_CAPABLE); +} + +// }}} } ? Index: php4/pear/DB/mysql.php diff -u php4/pear/DB/mysql.php:1.49 php4/pear/DB/mysql.php:1.50 --- php4/pear/DB/mysql.php:1.49 Mon Feb 19 04:22:26 2001 +++ php4/pear/DB/mysql.php Fri Mar 23 23:00:45 2001 @@ -453,6 +453,102 @@ } // }}} +// {{{ tableInfo() + +function tableInfo($result, $mode = null) { +$count = 0; +$id= 0; +$res = array(); + +/* + * depending on $mode, metadata returns the following values: + * + * - mode is false (default): + * $result[]: + * [0]["table"] table name + * [0]["name"] field name + * [0]["type"] field type + * [0]["len"]field length + * [0]["flags"] field flags + * + * - mode is DB_TABLEINFO_ORDER + * $result[]: + * ["num_fields"] number of metadata records + * [0]["table"] table name + * [0]["name"] field name + * [0]["type"] field type + * [0]["len"]field length + * [0]["flags"] field flags + * ["order"][field name] index of field named "field name" + * The last one is used, if you have a field name, but no index. + * Test: if (isset($result['meta']['myfield'])) { ... + * + * - mode is DB_TABLEINFO_ORDERTABLE + *the same as above. but additionally + * ["ordertable"][table name][field name] index of field + * named "field name" + * + * this is, because if you have fields from different + * tables with the same field name * they override each + * other with DB_TABLEINFO_ORDER + * + * you can combine DB_TABLEINFO_ORDER and + * DB_TABLEINFO_ORDERTABLE with DB_TABLEINFO_ORDER | + * DB_TABLEINFO_ORDERTABLE * or with DB_TABLEINFO_FULL + */ + +// if $result is a string, then we want information about a +// table without a resultset +if (is_string($result)) { +$id = @mysql_list_fields($this-dsn["database"], + $result, $this-connection); +if (empty($id)) { +return $this-mysqlRaiseError(); +} +} else { // else we want information about a resultset +$id = $result; +if (empty($id)) { +
[PHP-CVS] cvs: CVSROOT / avail gen_acl_file.m4
ssb Thu Mar 22 12:10:57 2001 EDT Modified files: /CVSROOTavail gen_acl_file.m4 Log: added Thomas V.V.Cox (pear) Index: CVSROOT/avail diff -u CVSROOT/avail:1.125 CVSROOT/avail:1.126 --- CVSROOT/avail:1.125 Thu Mar 22 11:18:23 2001 +++ CVSROOT/avail Thu Mar 22 12:10:57 2001 @@ -2,7 +2,7 @@ unavail avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane|CVSROOT avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak,jmcastagnetto,dams|phpweb -avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern,chregu,bkelly,tfromm,subjective|php4/pear,pearweb,pear +avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern,chregu,bkelly,tfromm,subjective,cox,mboeren|php4/pear,pearweb,pear avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo|php4,php3,php31,phpfi avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,hholzgra|functable avail|rasmus,sterling,jimw|pres Index: CVSROOT/gen_acl_file.m4 diff -u CVSROOT/gen_acl_file.m4:1.129 CVSROOT/gen_acl_file.m4:1.130 --- CVSROOT/gen_acl_file.m4:1.129 Thu Mar 22 11:18:24 2001 +++ CVSROOT/gen_acl_file.m4 Thu Mar 22 12:10:57 2001 @@ -7,7 +7,7 @@ dnl Quality Assurance Team define(`php_qa', `jalal,zak,andre,ultrapingo,lyric,jmoore,ronabop,sbergmann,joey,sniper,torben,hellekin,cnewbill')dnl dnl PEAR Team -define(`php_pear', `jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern,chregu,bkelly,tfromm,subjective')dnl +define(`php_pear', +`jon,rael,jlp,sbergmann,troels,urs,jpm,adaniel,tuupola,mj,ssb,metallic,heyesr,aj,andre,zimt,uw,jeichorn,bjoern,chregu,bkelly,tfromm,subjective,cox,mboeren')dnl dnl PHP.NET Website define(`php_web', `cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,sniper,david,lyric,zimt,mk,goba,zak,jmcastagnetto,dams')dnl dnl -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: CVSROOT / cvsusers
ssb Thu Mar 22 12:12:02 2001 EDT Modified files: /CVSROOTcvsusers Log: * added Thomas V.V.Cox here too Index: CVSROOT/cvsusers diff -u CVSROOT/cvsusers:1.242 CVSROOT/cvsusers:1.243 --- CVSROOT/cvsusers:1.242 Thu Mar 22 11:18:24 2001 +++ CVSROOT/cvsusersThu Mar 22 12:12:02 2001 @@ -285,3 +285,4 @@ ohrn Fredrik Öhrn[EMAIL PROTECTED]YP and ClibPDF mboeren Marc Boeren [EMAIL PROTECTED]"dbx" db.abstraction extension romoloRomolo Manfredini [EMAIL PROTECTED]Bug fixes +cox Thomas V.V.Cox [EMAIL PROTECTED] PEAR DB +Informix extension -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear DB.php PEAR.php.in /pear/DB STATUS common.php oci8.php /pear/DB/tests errors.inc fetchrow.inc numrows.inc sequences.inc /pear/DB/tests/ibase mktable.inc /pear/DB/tests/mysql mktable.inc /pear/DB/tests/oci8 002.phpt 007.phpt 009.phpt 010.phpt connect.inc mktable.inc skipif.inc /pear/DB/tests/odbc mktable.inc /pear/DB/tests/pgsql mktable.inc
ssb Thu Mar 22 17:15:10 2001 EDT Modified files: /php4/pear DB.php PEAR.php.in /php4/pear/DB STATUS common.php oci8.php /php4/pear/DB/tests errors.inc fetchrow.inc numrows.inc sequences.inc /php4/pear/DB/tests/ibase mktable.inc /php4/pear/DB/tests/mysql mktable.inc /php4/pear/DB/tests/oci8002.phpt 007.phpt 009.phpt 010.phpt connect.inc mktable.inc skipif.inc /php4/pear/DB/tests/odbcmktable.inc /php4/pear/DB/tests/pgsql mktable.inc Log: * fixed Oracle tests, fixed some bugs in DB_oci8, all tests but errorNative() pass now (but that may be a bug in the test :-) * implemented numRows() emulation in DB_oci8 that is available in "optimize portability" mode only Index: php4/pear/DB.php diff -u php4/pear/DB.php:1.51 php4/pear/DB.php:1.52 --- php4/pear/DB.php:1.51 Tue Mar 20 20:15:40 2001 +++ php4/pear/DB.phpThu Mar 22 17:15:05 2001 @@ -17,7 +17,7 @@ // | Tomas V.V.Cox [EMAIL PROTECTED] | // +--+ // -// $Id: DB.php,v 1.51 2001/03/21 04:15:40 jon Exp $ +// $Id: DB.php,v 1.52 2001/03/23 01:15:05 ssb Exp $ // // Database independent query interface. // @@ -56,6 +56,7 @@ define("DB_ERROR_NOT_LOCKED", -21); define("DB_ERROR_VALUE_COUNT_ON_ROW", -22); define("DB_ERROR_INVALID_DSN",-23); +define("DB_ERROR_CONNECT_FAILED", -24); /* * Warnings are not detected as errors by DB::isError(), and are not @@ -326,6 +327,8 @@ DB_ERROR_SYNTAX = 'syntax error', DB_ERROR_UNSUPPORTED= 'not supported', DB_ERROR_VALUE_COUNT_ON_ROW = 'value count on row', +DB_ERROR_INVALID_DSN= "invalid DSN", +DB_ERROR_CONNECT_FAILED = "connect failed", DB_OK = 'no error', DB_WARNING = 'unknown warning', DB_WARNING_READ_ONLY= 'read only' Index: php4/pear/PEAR.php.in diff -u php4/pear/PEAR.php.in:1.15 php4/pear/PEAR.php.in:1.16 --- php4/pear/PEAR.php.in:1.15 Sat Mar 10 01:59:15 2001 +++ php4/pear/PEAR.php.in Thu Mar 22 17:15:05 2001 @@ -17,7 +17,7 @@ // | Stig Bakken [EMAIL PROTECTED] | // +--+ // -// $Id: PEAR.php.in,v 1.15 2001/03/10 09:59:15 ssb Exp $ +// $Id: PEAR.php.in,v 1.16 2001/03/23 01:15:05 ssb Exp $ // define('PEAR_ERROR_RETURN', 1); @@ -513,12 +513,12 @@ $modes[] = "return"; } return sprintf('[%s: message="%s" code=%d mode=%s level=%s prefix="%s" '. - 'prepend="%s" append="%s" debug="%s"]', + 'prepend="%s" append="%s" info="%s"]', get_class($this), $this-message, $this-code, implode("|", $modes), $levels[$this-level], $this-error_message_prefix, $this-error_prepend, $this-error_append, - $this-debuginfo); + $this-userinfo); } // }}} Index: php4/pear/DB/STATUS diff -u php4/pear/DB/STATUS:1.14 php4/pear/DB/STATUS:1.15 --- php4/pear/DB/STATUS:1.14Sun Jan 14 17:19:28 2001 +++ php4/pear/DB/STATUS Thu Mar 22 17:15:06 2001 @@ -10,14 +10,14 @@ "-" - no implementation of this feature FEATURE ibase msqlmssql mysql oci8odbcpgsql sybase -simpleQuery x x x T x x T x -numCols x x x T x x T x -numRows n x x T n n T n +simpleQuery x x x T T x T x +numCols x x x T T x T x +numRows n x x T E n T n errorNative n n n T x x T n -prepare/execute x e e E x e E e -sequences n n n E n n T n -affectedRows n n n T x n T n -fetch modes x x x T x x T x +prepare/execute x e e E T e E e +sequences n n n E T n T n +affectedRows n n n T T n T n +fetch modes x x x T T x
[PHP-CVS] cvs: CVSROOT / avail gen_acl_file.m4
ssb Wed Mar 21 08:10:38 2001 EDT Modified files: /CVSROOTavail gen_acl_file.m4 Log: * give mboeren access to phpdoc too Index: CVSROOT/avail diff -u CVSROOT/avail:1.123 CVSROOT/avail:1.124 --- CVSROOT/avail:1.123 Tue Mar 20 22:58:25 2001 +++ CVSROOT/avail Wed Mar 21 08:10:38 2001 @@ -7,7 +7,7 @@ avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,hholzgra|functable avail|rasmus,sterling,jimw|pres avail|jalal,zak,andre,ultrapingo,lyric,jmoore,ronabop,sbergmann,joey,sniper,torben,hellekin,cnewbill|qaweb -avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,php_ext,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern,fams,smasiello,dim,lucasr,cpereira,lagflores,kjh90,ernani,theseer,cevm,noribsd,eskaly,mctrash,berto,leobopp,tcr,subjective|phpdoc +avail|andi,andrei,jimw,rasmus,rubys,sas,ssb,thies,zeev,shane,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,php_ext,chad,torben,lynch,kk,ted,kwazy,aka,affinity,paul,skaag,pglat,mbritton,coar,lwest,joey,bibi,mrobinso,lwh,perugini,hamoralesr,tzwenny,hirokawa,drews,paulsen,hartmann,philross,leon,valdirh,dmarion,dubois,jonen,tschuer,tfromm,manuel,stas,danbeck,sli,jmcastagnetto,mohrt,cris,goba,samesch,jon,soneca,kaufm,ronabop,glace,latoserver,phpguru_dk,lojmann,rafael,jan,jcmeloni,chrullrich,mk,sbergmann,troels,mathieu,voize,phaethon,mgx,mj,corean,pandach,brown,cycle98,vizvil,openlife,regina,cynic,jpm,dams,alponce,menuconfig,obst,topgoods,karoora,pcraft,suvia,zak,zimt,mgx,sintoris,jmoore,ftfuture,uttam,ag315,ropik,jbi1979,bbonev,malo,afortaleza,neotron,cg,delrom,dickmeiss,jkj,hellekin,kgergely,andreroq,eduardh,cnewbill,fuzzy74,inki,bjoern,fams,smasiello,dim,lucasr,cpereira,lagflores,kjh90,ernani,theseer,cevm,noribsd,eskaly,mctrash,berto,leobopp,tcr,subjective,mboeren|phpdoc avail|andrei,fmk,zimt,jan,changelog|php-gtk avail|jmoore,adrianz,protoman,sfox|php-gtk/docs avail|andrei,fmk,jmoore,jskinner|php-gtk-web Index: CVSROOT/gen_acl_file.m4 diff -u CVSROOT/gen_acl_file.m4:1.127 CVSROOT/gen_acl_file.m4:1.128 --- CVSROOT/gen_acl_file.m4:1.127 Tue Mar 20 22:48:06 2001 +++ CVSROOT/gen_acl_file.m4 Wed Mar 21 08:10:38 2001 @@ -3,7 +3,7 @@ dnl PHP Developers (full access to the source trees) define(`php_dev', `php_group,fmk,hirokawa,jah,eschmid,dbeu,sbergmann,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,changelog,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,shuric,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn') dnl PHP Documentation Group -define(`php_doc',
[PHP-CVS] cvs: CVSROOT / cvsusers gen_acl_file.m4
ssb Tue Mar 20 22:48:06 2001 EDT Modified files: /CVSROOTcvsusers gen_acl_file.m4 Log: * added mboeren (Marc Boeren [EMAIL PROTECTED]), access to php4/ext/dbx Index: CVSROOT/cvsusers diff -u CVSROOT/cvsusers:1.240 CVSROOT/cvsusers:1.241 --- CVSROOT/cvsusers:1.240 Sat Mar 17 16:37:01 2001 +++ CVSROOT/cvsusersTue Mar 20 22:48:06 2001 @@ -283,3 +283,4 @@ sfox Steph Fox [EMAIL PROTECTED]PHP-GTK docs jskinner Jared Skinner [EMAIL PROTECTED] PHP-GTK website maintenance ohrn Fredrik Öhrn[EMAIL PROTECTED]YP and ClibPDF +mboeren Marc Boeren [EMAIL PROTECTED]"dbx" +db.abstraction extension Index: CVSROOT/gen_acl_file.m4 diff -u CVSROOT/gen_acl_file.m4:1.126 CVSROOT/gen_acl_file.m4:1.127 --- CVSROOT/gen_acl_file.m4:1.126 Mon Mar 19 10:41:46 2001 +++ CVSROOT/gen_acl_file.m4 Tue Mar 20 22:48:06 2001 @@ -119,5 +119,6 @@ avail|phanto|php4/win32 avail|brad|php4/ext/notes avail|spages|php4/ext/cybermut +avail|mboeren|php4/ext/dbx dnl dnl -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: CVSROOT / avail
ssb Tue Mar 20 22:58:25 2001 EDT Modified files: /CVSROOTavail Log: * added mboeren Index: CVSROOT/avail diff -u CVSROOT/avail:1.122 CVSROOT/avail:1.123 --- CVSROOT/avail:1.122 Mon Mar 19 10:41:46 2001 +++ CVSROOT/avail Tue Mar 20 22:58:25 2001 @@ -100,3 +100,4 @@ avail|phanto|php4/win32 avail|brad|php4/ext/notes avail|spages|php4/ext/cybermut +avail|mboeren|php4/ext/dbx -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: pear /PEAR pear.c
ssb Sat Mar 17 16:34:31 2001 EDT Modified files: /pear/PEAR pear.c Log: * whoops, zend_is_callable suddenly got two more args Index: pear/PEAR/pear.c diff -u pear/PEAR/pear.c:1.4 pear/PEAR/pear.c:1.5 --- pear/PEAR/pear.c:1.4Thu Mar 15 20:57:02 2001 +++ pear/PEAR/pear.cSat Mar 17 16:34:30 2001 @@ -213,7 +213,7 @@ PHP_MINFO_FUNCTION(pear) { php_info_print_table_start(); - php_info_print_table_header(2, "PEAR", " $Revision: 1.4 $"); + php_info_print_table_header(2, "PEAR", " $Revision: 1.5 $"); php_info_print_table_end(); /* DISPLAY_INI_ENTRIES(); */ @@ -422,7 +422,7 @@ #define FIND_DEFAULT(h,p,v) (zend_hash_find((h), (p), sizeof(p), (void **) (v)) == SUCCESS Z_TYPE_PP(v) != IS_NULL) switch (Z_LVAL_PP(mode)) { case PEAR_ERROR_CALLBACK: -if ((Z_TYPE_PP(options) == IS_NULL || !zend_is_callable(*options)) +if ((Z_TYPE_PP(options) == IS_NULL || !zend_is_callable(*options, 0, +NULL)) !FIND_DEFAULT(this-value.obj.properties, "_default_error_callback", options) !FIND_DEFAULT(EG(symbol_table), "_PEAR_default_error_callback", options)) { @@ -647,7 +647,7 @@ efree(tmpstr); } if (Z_LVAL_PP(mode) PEAR_ERROR_CALLBACK) { -if (zend_is_callable(*options)) { +if (zend_is_callable(*options, 1, NULL)) { zval *retval, **args[1]; args[0] = this; if (call_user_function_ex(EG(function_table), NULL, *options, retval, 1, args, 1, NULL) == FAILURE) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: pear /PEAR pear.c php_pear.h
ssb Thu Mar 15 20:57:03 2001 EDT Modified files: /pear/PEAR pear.c php_pear.h Log: * PEAR and PEAR_Error C implementations done Index: pear/PEAR/pear.c diff -u pear/PEAR/pear.c:1.3 pear/PEAR/pear.c:1.4 --- pear/PEAR/pear.c:1.3Wed Mar 14 16:53:06 2001 +++ pear/PEAR/pear.cThu Mar 15 20:57:02 2001 @@ -24,6 +24,8 @@ #include "build-defs.h" #include "ext/standard/info.h" +/* {{{ structs and globals */ + ZEND_DECLARE_MODULE_GLOBALS(pear) /* Every user visible function must have an entry in pear_functions[]. @@ -33,28 +35,24 @@ }; static zend_function_entry php_class_functions_pear[] = { -PHP_FALIAS(pear, pear_constructor, NULL) -PHP_FALIAS(_pear, pear_destructor, NULL) -PHP_FALIAS(iserror, pear_isError, first_arg_force_ref) -PHP_FALIAS(seterrorhandling, pear_setErrorHandling, NULL) -#if 0 -PHP_FALIAS(raiseerror,pear_raiseError, NULL) -#endif +PHP_FALIAS(pear, PEAR_constructor, NULL) +PHP_FALIAS(_pear, PEAR_destructor, NULL) +PHP_FALIAS(iserror, PEAR_isError, NULL) +PHP_FALIAS(seterrorhandling, PEAR_setErrorHandling, NULL) +PHP_FALIAS(raiseerror,PEAR_raiseError, NULL) {NULL, NULL, NULL} }; static zend_function_entry php_class_functions_pear_error[] = { -#if 0 -PHP_FALIAS(pear_error,pear_error_constructor, NULL) -PHP_FALIAS(getmode, pear_error_getmode, NULL) -PHP_FALIAS(getcallback, pear_error_getcallback, NULL) -PHP_FALIAS(getmessage,pear_error_getmessage, NULL) -PHP_FALIAS(getcode, pear_error_getcode, NULL) -PHP_FALIAS(gettype, pear_error_gettype, NULL) -PHP_FALIAS(getuserinfo, pear_error_getuserinfo, NULL) -PHP_FALIAS(getdebuginfo, pear_error_getdebuginfo, NULL) -PHP_FALIAS(tostring, pear_error_tostring, NULL) -#endif +PHP_FALIAS(pear_error,PEAR_Error_constructor, NULL) +PHP_FALIAS(getmode, PEAR_Error_getMode, NULL) +PHP_FALIAS(getcallback, PEAR_Error_getCallback, NULL) +PHP_FALIAS(getmessage,PEAR_Error_getMessage, NULL) +PHP_FALIAS(getcode, PEAR_Error_getCode, NULL) +PHP_FALIAS(gettype, PEAR_Error_getType, NULL) +PHP_FALIAS(getuserinfo, PEAR_Error_getUserInfo, NULL) +PHP_FALIAS(getdebuginfo, PEAR_Error_getUserInfo, NULL) +PHP_FALIAS(tostring, PEAR_Error_toString, NULL) {NULL, NULL, NULL} }; @@ -71,16 +69,27 @@ static zend_class_entry *pear_ptr, *pear_error_ptr; +/* }}} */ + +/* {{{ get_module() */ #ifdef COMPILE_DL_PEAR ZEND_GET_MODULE(pear) #endif +/* }}} */ + +/* {{{ ini entries */ + /* Remove comments and fill if you need to have entries in php.ini PHP_INI_BEGIN() PHP_INI_END() */ +/* }}} */ + +/* {{{ minit */ + PHP_MINIT_FUNCTION(pear) { zend_class_entry pear, pear_error; @@ -106,14 +115,14 @@ pear_error.handle_property_get = NULL; pear_error.handle_property_set = NULL; pear_error_ptr = zend_register_internal_class(pear_error); +EMPTY_STRING_PROPERTY(pear_error_ptr, tmp, "message"); LONG_PROPERTY(pear_error_ptr, tmp, "code", -1); -NULL_PROPERTY(pear_error_ptr, tmp, "n2345678901234567"); -NULL_PROPERTY(pear_error_ptr, tmp, "error_message_prefix"); -NULL_PROPERTY(pear_error_ptr, tmp, "error_prepend"); -NULL_PROPERTY(pear_error_ptr, tmp, "error_append"); LONG_PROPERTY(pear_error_ptr, tmp, "mode", PEAR_ERROR_RETURN); LONG_PROPERTY(pear_error_ptr, tmp, "level", E_USER_NOTICE); -NULL_PROPERTY(pear_error_ptr, tmp, "debuginfo"); +NULL_PROPERTY(pear_error_ptr, tmp, "userinfo"); +EMPTY_STRING_PROPERTY(pear_error_ptr, tmp, "error_message_prefix"); +EMPTY_STRING_PROPERTY(pear_error_ptr, tmp, "error_prepend"); +EMPTY_STRING_PROPERTY(pear_error_ptr, tmp, "error_append"); LONG_CONSTANT("PEAR_ERROR_RETURN",PEAR_ERROR_RETURN); LONG_CONSTANT("PEAR_ERROR_PRINT", PEAR_ERROR_PRINT); @@ -125,6 +134,9 @@ return SUCCESS; } +/* }}} */ +/* {{{ mshutdown */ + PHP_MSHUTDOWN_FUNCTION(pear) { /* Remove comments if you have entries in php.ini @@ -133,6 +145,10 @@ return SUCCESS; } +/* }}} */ + +/* {{{ _destructor_objects_dtor() */ + static void _destructor_objects_dtor(void *data) { @@ -140,35 +156,17 @@ /*ZVAL_DELREF(object);*/ zval_dtor(object); } - -/* Remove if there's nothing to do at request start */ -PHP_RINIT_FUNCTION(pear) -{ -zend_llist_init(PEARG(destructor_objects), sizeof(zval), _destructor_objects_dtor, 0); - return SUCCESS; -} -static zval *_pear_string_zval(const char *str) -{ - zval *ret; - int len = strlen(str); - MAKE_STD_ZVAL(ret); - - ret-type = IS_STRING; - ret-value.str.len = len; - ret-value.str.val = estrndup(str, len); - return ret; -} +/* }}} */ +/* {{{ _call_destructors() */
[PHP-CVS] cvs: pear /PEAR PEAR.php
ssb Thu Mar 15 21:13:00 2001 EDT Added files: /pear/PEAR PEAR.php Log: by putting this dir before $prefix/lib/php in your include_path, you will use the C version of PEAR and PEAR_Error Index: pear/PEAR/PEAR.php +++ pear/PEAR/PEAR.php ?php // To use the C version of PEAR/PEAR_Error, put the directory where // this file is before $prefix/lib/php in your include_path. // if (!extension_loaded("PEAR")) { if (substr(PHP_OS, 0, 3) == "WIN") { dl("php_pear.dll"); } else { dl("PEAR.so"); } } ? -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: pear /PEAR pear.c
ssb Wed Mar 14 16:53:07 2001 EDT Modified files: /pear/PEAR pear.c Log: * implemented setErrorHandling Index: pear/PEAR/pear.c diff -u pear/PEAR/pear.c:1.2 pear/PEAR/pear.c:1.3 --- pear/PEAR/pear.c:1.2Tue Mar 13 17:04:45 2001 +++ pear/PEAR/pear.cWed Mar 14 16:53:06 2001 @@ -22,6 +22,7 @@ #include "php_pear.h" #include "config.h" #include "build-defs.h" +#include "ext/standard/info.h" ZEND_DECLARE_MODULE_GLOBALS(pear) @@ -35,8 +36,8 @@ PHP_FALIAS(pear, pear_constructor, NULL) PHP_FALIAS(_pear, pear_destructor, NULL) PHP_FALIAS(iserror, pear_isError, first_arg_force_ref) -#if 0 PHP_FALIAS(seterrorhandling, pear_setErrorHandling, NULL) +#if 0 PHP_FALIAS(raiseerror,pear_raiseError, NULL) #endif {NULL, NULL, NULL} @@ -136,13 +137,14 @@ _destructor_objects_dtor(void *data) { zval *object = (zval *)data; -ZVAL_DELREF(object); +/*ZVAL_DELREF(object);*/ +zval_dtor(object); } /* Remove if there's nothing to do at request start */ PHP_RINIT_FUNCTION(pear) { -zend_llist_init(PEARG(destructor_objects), sizeof(zval), NULL, 0); +zend_llist_init(PEARG(destructor_objects), sizeof(zval), +_destructor_objects_dtor, 0); return SUCCESS; } @@ -183,6 +185,9 @@ zval_dtor(funcname); zval_dtor(retval); zval_dtor(arg); +efree(funcname); +efree(retval); +efree(arg); } /* Remove if there's nothing to do at request end */ @@ -197,7 +202,7 @@ PHP_MINFO_FUNCTION(pear) { php_info_print_table_start(); - php_info_print_table_header(2, "PEAR", " $Revision: 1.2 $"); + php_info_print_table_header(2, "PEAR", " $Revision: 1.3 $"); php_info_print_table_end(); /* DISPLAY_INI_ENTRIES(); */ @@ -222,7 +227,7 @@ dtorfunc[len - 1] = '\0'; if (zend_hash_exists(this-value.obj.ce-function_table, dtorfunc, len)) { zend_llist_add_element(PEARG(destructor_objects), this); -ZVAL_ADDREF(this); +/*ZVAL_ADDREF(this);*/ /*php_printf("registered object on destructor list\n");*/ } efree(dtorfunc); @@ -254,6 +259,76 @@ ce = ce-parent; } while (ce != NULL); RETURN_FALSE; +} + + +PHP_FUNCTION(pear_setErrorHandling) +{ +zval **mode = NULL, **options = NULL, *this = getThis(), *tmp; +HashTable *symtab; +char *modename, *optionsname, *callbackname; +int argc; + +argc = ZEND_NUM_ARGS(); + +if (argc 1 || argc 2 || +zend_get_parameters_ex(argc, mode, options) == FAILURE) { +ZEND_WRONG_PARAM_COUNT(); +} + +convert_to_long_ex(mode); + +if (this == NULL) { +modename = "_PEAR_default_error_mode"; +optionsname = "_PEAR_default_error_options"; +callbackname = "_PEAR_default_error_callback"; +symtab = EG(symbol_table); +} else { +modename = "_default_error_mode"; +optionsname = "_default_error_options"; +callbackname = "_default_error_callback"; +symtab = this-value.obj.properties; +} + +MAKE_STD_ZVAL(tmp); + +switch ((*mode)-value.lval) { +case PEAR_ERROR_RETURN: +case PEAR_ERROR_PRINT: +case PEAR_ERROR_TRIGGER: +case PEAR_ERROR_DIE: +ZVAL_LONG(tmp, (*mode)-value.lval); +ZEND_SET_SYMBOL(symtab, modename, tmp); +if (options != NULL) { +ZEND_SET_SYMBOL(symtab, optionsname, *options); +} +break; + +case PEAR_ERROR_CALLBACK: +ZVAL_LONG(tmp, (*mode)-value.lval); +ZEND_SET_SYMBOL(symtab, modename, tmp); +if (options != NULL) { +zval **el0, **el1; +if (((*options)-type != IS_STRING (*options)-type != IS_ARRAY) || +((*options)-type == IS_ARRAY + (zend_hash_num_elements((*options)-value.ht) != 2 || + zend_hash_index_find((*options)-value.ht, 0, (void **)el0) == +FAILURE || + zend_hash_index_find((*options)-value.ht, 1, (void **)el1) == +FAILURE || + (*el0)-type != IS_OBJECT || (*el1)-type != IS_STRING))) { +php_error(E_USER_WARNING, + "PEAR::setErrorHandler: invalid error callback"); +} +memcpy(tmp, *options, sizeof(zval)); +ZEND_SET_SYMBOL(symtab, optionsname, tmp); +} +break; + +default: +php_error(E_USER_WARNING, + "PEAR::setErrorHandler: invalid error mode"); +break; +} + } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: pear /PEAR pear.c php_pear.h
ssb Tue Mar 13 17:04:45 2001 EDT Modified files: /pear/PEAR pear.c php_pear.h Log: * implemented PEAR::isError() Index: pear/PEAR/pear.c diff -u pear/PEAR/pear.c:1.1 pear/PEAR/pear.c:1.2 --- pear/PEAR/pear.c:1.1Mon Mar 12 02:12:57 2001 +++ pear/PEAR/pear.cTue Mar 13 17:04:45 2001 @@ -21,6 +21,7 @@ #include "php_ini.h" #include "php_pear.h" #include "config.h" +#include "build-defs.h" ZEND_DECLARE_MODULE_GLOBALS(pear) @@ -33,8 +34,8 @@ static zend_function_entry php_class_functions_pear[] = { PHP_FALIAS(pear, pear_constructor, NULL) PHP_FALIAS(_pear, pear_destructor, NULL) -#if 0 PHP_FALIAS(iserror, pear_isError, first_arg_force_ref) +#if 0 PHP_FALIAS(seterrorhandling, pear_setErrorHandling, NULL) PHP_FALIAS(raiseerror,pear_raiseError, NULL) #endif @@ -82,6 +83,7 @@ PHP_MINIT_FUNCTION(pear) { zend_class_entry pear, pear_error; +zval *tmp; /* REGISTER_INI_ENTRIES();*/ pear.name = strdup("pear"); @@ -91,7 +93,11 @@ pear.handle_property_get = NULL; pear.handle_property_set = NULL; pear_ptr = zend_register_internal_class(pear); - +LONG_PROPERTY(pear_ptr, tmp, "_debug", 0); +NULL_PROPERTY(pear_ptr, tmp, "_default_error_mode"); +NULL_PROPERTY(pear_ptr, tmp, "_default_error_options"); +NULL_PROPERTY(pear_ptr, tmp, "_default_error_handler"); + pear_error.name = strdup("pear_error"); pear_error.name_length = 10; pear_error.builtin_functions = php_class_functions_pear_error; @@ -99,6 +105,21 @@ pear_error.handle_property_get = NULL; pear_error.handle_property_set = NULL; pear_error_ptr = zend_register_internal_class(pear_error); +LONG_PROPERTY(pear_error_ptr, tmp, "code", -1); +NULL_PROPERTY(pear_error_ptr, tmp, "n2345678901234567"); +NULL_PROPERTY(pear_error_ptr, tmp, "error_message_prefix"); +NULL_PROPERTY(pear_error_ptr, tmp, "error_prepend"); +NULL_PROPERTY(pear_error_ptr, tmp, "error_append"); +LONG_PROPERTY(pear_error_ptr, tmp, "mode", PEAR_ERROR_RETURN); +LONG_PROPERTY(pear_error_ptr, tmp, "level", E_USER_NOTICE); +NULL_PROPERTY(pear_error_ptr, tmp, "debuginfo"); + +LONG_CONSTANT("PEAR_ERROR_RETURN",PEAR_ERROR_RETURN); +LONG_CONSTANT("PEAR_ERROR_PRINT", PEAR_ERROR_PRINT); +LONG_CONSTANT("PEAR_ERROR_TRIGGER", PEAR_ERROR_TRIGGER); +LONG_CONSTANT("PEAR_ERROR_DIE", PEAR_ERROR_DIE); +LONG_CONSTANT("PEAR_ERROR_CALLBACK", PEAR_ERROR_CALLBACK); +STRING_CONSTANT("PEAR_EXTENSION_DIR", PHP_EXTENSION_DIR); return SUCCESS; } @@ -115,7 +136,7 @@ _destructor_objects_dtor(void *data) { zval *object = (zval *)data; -object-refcount--; +ZVAL_DELREF(object); } /* Remove if there's nothing to do at request start */ @@ -176,7 +197,7 @@ PHP_MINFO_FUNCTION(pear) { php_info_print_table_start(); - php_info_print_table_header(2, "PEAR", " $Revision: 1.1 $"); + php_info_print_table_header(2, "PEAR", " $Revision: 1.2 $"); php_info_print_table_end(); /* DISPLAY_INI_ENTRIES(); */ @@ -201,7 +222,7 @@ dtorfunc[len - 1] = '\0'; if (zend_hash_exists(this-value.obj.ce-function_table, dtorfunc, len)) { zend_llist_add_element(PEARG(destructor_objects), this); -this-refcount++; +ZVAL_ADDREF(this); /*php_printf("registered object on destructor list\n");*/ } efree(dtorfunc); @@ -214,6 +235,26 @@ } +PHP_FUNCTION(pear_isError) +{ +zval **obj; +zend_class_entry *ce = NULL; + +if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, obj) == FAILURE) { +ZEND_WRONG_PARAM_COUNT(); +} +if ((*obj)-type != IS_OBJECT) { +RETURN_FALSE; +} +ce = (*obj)-value.obj.ce; +do { +if (strcmp(ce-name, pear_error_ptr-name) == 0) { +RETURN_TRUE; +} +ce = ce-parent; +} while (ce != NULL); +RETURN_FALSE; +} /* Index: pear/PEAR/php_pear.h diff -u pear/PEAR/php_pear.h:1.1 pear/PEAR/php_pear.h:1.2 --- pear/PEAR/php_pear.h:1.1Mon Mar 12 02:12:57 2001 +++ pear/PEAR/php_pear.hTue Mar 13 17:04:45 2001 @@ -29,6 +29,59 @@ #define PHP_PEAR_API #endif +#define PEAR_ERROR_RETURN 1 +#define PEAR_ERROR_PRINT 2 +#define PEAR_ERROR_TRIGGER4 +#define PEAR_ERROR_DIE8 +#define PEAR_ERROR_CALLBACK 16 + +#define LONG_CONSTANT(n,v) \ +REGISTER_LONG_CONSTANT((n),(v),CONST_CS|CONST_PERSISTENT) + +#define STRING_CONSTANT(n,v) \ +REGISTER_STRING_CONSTANT((n),(v),CONST_CS|CONST_PERSISTENT) + +#define MINIT_ZVAL(z) \ +z = emalloc(sizeof(zval)); \ +INIT_PZVAL(z); \ +persist_alloc(z) + +#define LONG_PROPERTY(ptr,tmp,p,l) \ +MINIT_ZVAL(tmp); \ +ZVAL_LONG(tmp, 0); \ +zend_hash_add((ptr)-default_properties, (p), sizeof(p), tmp, +sizeof(zval*), NULL) + +#define
[PHP-CVS] cvs: php4 /pear/DB common.php
ssb Mon Mar 12 01:33:21 2001 EDT Modified files: /php4/pear/DB common.php Log: * bugfix (thanks to Alexey Borzov) Index: php4/pear/DB/common.php diff -u php4/pear/DB/common.php:1.38 php4/pear/DB/common.php:1.39 --- php4/pear/DB/common.php:1.38Mon Feb 19 04:22:25 2001 +++ php4/pear/DB/common.php Mon Mar 12 01:33:21 2001 @@ -721,7 +721,8 @@ } } else { // return scalar values -while (($row = $this-fetchRow($res)) !DB::isError($row)) { +while (($row = $this-fetchRow($res, DB_FETCHMODE_ORDERED)) + !DB::isError($row)) { $results[$row[0]] = $row[1]; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear pear.m4
ssb Mon Mar 12 01:54:26 2001 EDT Modified files: /php4/pear pear.m4 Log: HEADS UP: renamed config header file in "phpize"d extensions to "config.h" rather than "php_config.h". Index: php4/pear/pear.m4 diff -u php4/pear/pear.m4:1.7 php4/pear/pear.m4:1.8 --- php4/pear/pear.m4:1.7 Mon Oct 30 10:27:46 2000 +++ php4/pear/pear.m4 Mon Mar 12 01:54:26 2001 @@ -81,6 +81,6 @@ test -d modules || mkdir modules touch .deps -AC_CONFIG_HEADER(php_config.h) +AC_CONFIG_HEADER(config.h) AC_OUTPUT() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB oci8.php
ssb Mon Mar 12 04:50:44 2001 EDT Modified files: /php4/pear/DB oci8.php Log: * added "@" in front of all OCI* function calls Index: php4/pear/DB/oci8.php diff -u php4/pear/DB/oci8.php:1.19 php4/pear/DB/oci8.php:1.20 --- php4/pear/DB/oci8.php:1.19 Mon Feb 19 04:22:26 2001 +++ php4/pear/DB/oci8.php Mon Mar 12 04:50:44 2001 @@ -87,9 +87,9 @@ DB::assertExtension("oci8"); $connect_function = $persistent ? 'OCIPLogon' : 'OCILogon'; if ($hostspec) { - $conn = $connect_function($user,$pw,$hostspec); + $conn = @$connect_function($user,$pw,$hostspec); } elseif ($user || $pw) { - $conn = $connect_function($user,$pw); + $conn = @$connect_function($user,$pw); } else { $conn = false; } @@ -110,7 +110,7 @@ */ function disconnect() { - return OCILogOff($this-connection); + return @OCILogOff($this-connection); } // }}} @@ -130,15 +130,15 @@ { $this-last_query = $query; $query = $this-modifyQuery($query); - $result = OCIParse($this-connection, $query); + $result = @OCIParse($this-connection, $query); if (!$result) { return $this-raiseError(); } if ($this-autoCommit) { - $success=OCIExecute($result,OCI_COMMIT_ON_SUCCESS); + $success = @OCIExecute($result,OCI_COMMIT_ON_SUCCESS); } else { - $success=OCIExecute($result,OCI_DEFAULT); + $success = @OCIExecute($result,OCI_DEFAULT); } if (!$success) { return $this-raiseError(); @@ -167,9 +167,9 @@ $fetchmode = $this-fetchmode; } if ($fetchmode DB_FETCHMODE_ASSOC) { - $moredata = OCIFetchInto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS + OCI_RETURN_LOBS); + $moredata = @OCIFetchInto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS + +OCI_RETURN_LOBS); } else { - $moredata = OCIFetchInto($result, $row, OCI_RETURN_NULLS + OCI_RETURN_LOBS); + $moredata = @OCIFetchInto($result, $row, OCI_RETURN_NULLS + +OCI_RETURN_LOBS); } if (!$row) { return $this-raiseError(); @@ -198,9 +198,9 @@ $fetchmode = $this-fetchmode; } if ($fetchmode DB_FETCHMODE_ASSOC) { - $moredata=OCIFetchInto($result,$arr,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS); + $moredata = +@OCIFetchInto($result,$arr,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS); } else { - $moredata=OCIFetchInto($result,$arr,OCI_RETURN_NULLS+OCI_RETURN_LOBS); + $moredata = +@OCIFetchInto($result,$arr,OCI_RETURN_NULLS+OCI_RETURN_LOBS); } if (!($arr $moredata)) { return $this-raiseError(); @@ -221,7 +221,7 @@ function freeResult($result) { if (is_resource($result)) { - return OCIFreeStatement($result); + return @OCIFreeStatement($result); } if (!isset($this-prepare_tokens[$result])) { return false; @@ -243,7 +243,7 @@ */ function numCols($result) { - $cols = OCINumCols($result); + $cols = @OCINumCols($result); if (!$cols) { return $this-raiseError(); } @@ -263,7 +263,7 @@ */ function errorNative() { - $error=OCIError($this-connection); + $error = @OCIError($this-connection); if (is_array($error)) { return $error['code']; } @@ -302,7 +302,7 @@ $newquery .= $tokens[$i]; $this-last_query = $query; $newquery = $this-modifyQuery($newquery); - $stmt=OCIParse($this-connection, $newquery); + $stmt = @OCIParse($this-connection, $newquery); $this-prepare_types[$stmt] = $types; $this-manip_query[$stmt] = DB::isManip($query); return $stmt; @@ -343,15 +343,15 @@ } } } - if (!OCIBindByName($stmt,":bind".$i,$pdata[$i],-1)) { + if (!@OCIBindByName($stmt,":bind".$i,$pdata[$i],-1)) { return $this-raiseError(); } } if ($this-autoCommit) { -
[PHP-CVS] cvs: php4 /pear PEAR.php.in
ssb Sat Mar 10 01:59:16 2001 EDT Modified files: /php4/pear PEAR.php.in Log: * only register the destructor if it exists Index: php4/pear/PEAR.php.in diff -u php4/pear/PEAR.php.in:1.14 php4/pear/PEAR.php.in:1.15 --- php4/pear/PEAR.php.in:1.14 Thu Feb 1 12:15:08 2001 +++ php4/pear/PEAR.php.in Sat Mar 10 01:59:15 2001 @@ -17,7 +17,7 @@ // | Stig Bakken [EMAIL PROTECTED] | // +--+ // -// $Id: PEAR.php.in,v 1.14 2001/02/01 20:15:08 cmv Exp $ +// $Id: PEAR.php.in,v 1.15 2001/03/10 09:59:15 ssb Exp $ // define('PEAR_ERROR_RETURN', 1); @@ -73,11 +73,14 @@ /** * Constructor. Registers this object in - * $_PEAR_destructor_object_list for destructor emulation. + * $_PEAR_destructor_object_list for destructor emulation if a + * destructor object exists. */ function PEAR() { -global $_PEAR_destructor_object_list; -$_PEAR_destructor_object_list[] = $this; +if (method_exists($this, "_".get_class($this))) { +global $_PEAR_destructor_object_list; +$_PEAR_destructor_object_list[] = $this; +} if ($this-_debug) { printf("PEAR constructor called, class=%s\n", get_class($this)); @@ -199,7 +202,30 @@ // {{{ raiseError() /** - * This method is called by DB to generate an error. + * This method is a wrapper that returns an instance of PEAR_Error + * with this object's default error handling applied. If the + * $mode and $options parameters are not specified, the object's + * defaults are used. + * + * @param $message a text error message + * @param $code a numeric error code (it is up to your class + * to define these if you want to use codes) + * @param $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE or + * PEAR_ERROR_CALLBACK. + * @param $options If $mode is PEAR_ERROR_TRIGGER, this parameter + * specifies the PHP-internal error level (one of + * E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). + * If $mode is PEAR_ERROR_CALLBACK, this + * parameter specifies the callback function or + * method. In other error modes this parameter + * is ignored. + * @param $userinfo If you need to pass along for example debug + * information, this parameter is meant for that. + * + * @return object a PEAR error object + * + * @see PEAR::setErrorHandling * * @since PHP 4.0.5 */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB/tests db_error.phpt db_error2.phpt
ssb Sat Mar 10 23:58:19 2001 EDT Modified files: /php4/pear/DB/tests db_error.phpt db_error2.phpt Log: * new line numbers Index: php4/pear/DB/tests/db_error.phpt diff -u php4/pear/DB/tests/db_error.phpt:1.6 php4/pear/DB/tests/db_error.phpt:1.7 --- php4/pear/DB/tests/db_error.phpt:1.6Sun Feb 18 16:47:30 2001 +++ php4/pear/DB/tests/db_error.phptSat Mar 10 23:58:19 2001 @@ -47,11 +47,11 @@ testing different error modes... DB Error: unknown error[db_error: message="DB Error: unknown error" code=-1 mode=print level=notice prefix="" prepend="" append="" debug=""] br -bNotice/b: DB Error: syntax error in bPEAR.php/b on line b327/bbr +bNotice/b: DB Error: syntax error in bPEAR.php/b on line b353/bbr testing different error serverities... br -bNotice/b: DB Error: syntax error in bPEAR.php/b on line b327/bbr +bNotice/b: DB Error: syntax error in bPEAR.php/b on line b353/bbr br -bWarning/b: DB Error: syntax error in bPEAR.php/b on line b327/bbr +bWarning/b: DB Error: syntax error in bPEAR.php/b on line b353/bbr br -bFatal error/b: DB Error: syntax error in bPEAR.php/b on line b327/bbr +bFatal error/b: DB Error: syntax error in bPEAR.php/b on line b353/bbr Index: php4/pear/DB/tests/db_error2.phpt diff -u php4/pear/DB/tests/db_error2.phpt:1.6 php4/pear/DB/tests/db_error2.phpt:1.7 --- php4/pear/DB/tests/db_error2.phpt:1.6 Sun Feb 18 16:47:30 2001 +++ php4/pear/DB/tests/db_error2.phpt Sat Mar 10 23:58:19 2001 @@ -39,6 +39,6 @@ default: [db_error: message="DB Error: return testing error" code=-1 mode=return level=notice prefix="" prepend="" append="" debug=""] mode=print: DB Error: print testing error mode=trigger: br -bNotice/b: DB Error: trigger testing error in bPEAR.php/b on line b327/bbr +bNotice/b: DB Error: trigger testing error in bPEAR.php/b on line +b353/bbr mode=function callback: myfunc here, obj=[db_error: message="DB Error: function callback testing error" code=-1 mode=callback callback=myfunc prefix="" prepend="" append="" debug=""] mode=object callback: myclass::myfunc here, obj=[db_error: message="DB Error: object callback testing error" code=-1 mode=callback callback=myclass::myfunc prefix="" prepend="" append="" debug=""] -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/odbc config.m4
ssb Wed Feb 21 10:23:53 2001 EDT Modified files: /php4/ext/odbc config.m4 Log: * dbmaker fix, shared support Index: php4/ext/odbc/config.m4 diff -u php4/ext/odbc/config.m4:1.35 php4/ext/odbc/config.m4:1.36 --- php4/ext/odbc/config.m4:1.35Thu Dec 28 11:12:28 2000 +++ php4/ext/odbc/config.m4 Wed Feb 21 10:23:53 2001 @@ -82,6 +82,7 @@ [ --with-adabas[=DIR] Include Adabas D support. DIR is the Adabas base install directory, defaults to /usr/local.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local fi @@ -113,6 +114,7 @@ [ --with-sapdb[=DIR] Include SAP DB support. DIR is SAP DB base install directory, defaults to /usr/local.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local fi @@ -139,6 +141,7 @@ [ --with-solid[=DIR] Include Solid support. DIR is the Solid base install directory, defaults to /usr/local/solid], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local/solid fi @@ -200,6 +203,7 @@ [ --with-empress[=DIR]Include Empress support. DIR is the Empress base install directory, defaults to \$EMPRESSPATH], [ + PHP_WITH_SHARED if test "$withval" != "no"; then if test "$withval" = "yes"; then ODBC_INCDIR=$EMPRESSPATH/odbccl/include @@ -227,6 +231,7 @@ [ --with-velocis[=DIR]Include Velocis support. DIR is the Velocis base install directory, defaults to /usr/local/velocis.], [ + PHP_WITH_SHARED if test "$withval" != "no"; then if test "$withval" = "yes"; then ODBC_INCDIR=/usr/local/velocis/include @@ -296,6 +301,7 @@ [ --with-iodbc[=DIR] Include iODBC support. DIR is the iODBC base install directory, defaults to /usr/local.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local fi @@ -320,6 +326,7 @@ install directory, defaults to /usr/local/easysoft/oob/client.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local/easysoft/oob/client fi @@ -346,6 +353,7 @@ [ --with-unixODBC[=DIR] Include unixODBC support. DIR is the unixODBC base install directory, defaults to /usr/local.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local fi @@ -373,6 +381,7 @@ OpenLink base install directory, defaults to /usr/local/openlink.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local/openlink fi @@ -409,8 +418,8 @@ # check DBMaker version (from 5.0 to 2.0) DBMAKER_VERSION=5.0 -while [[ test ! -d $DBMAKER_HOME/$DBMAKER_VERSION -a \ - "$DBMAKER_VERSION" != "2.9" ]]; do +while test test ! -d $DBMAKER_HOME/$DBMAKER_VERSION -a \ + "$DBMAKER_VERSION" != "2.9"; do DM_VER=`echo $DBMAKER_VERSION | sed -e 's/\.//' | awk '{ print $1-1;}'` MAJOR_V=`echo $DM_VER | awk '{ print $1/10; }' \ | awk -F. '{ print $1; }'` @@ -418,7 +427,7 @@ DBMAKER_VERSION=$MAJOR_V.$MINOR_V done -if [[ "$DBMAKER_VERSION" = "2.9" ]]; then +if test "$DBMAKER_VERSION" = "2.9"; then withval=$DBMAKER_HOME else DBMAKER_PATH=$DBMAKER_HOME/$DBMAKER_VERSION -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear DB.php
ssb Tue Feb 20 15:00:09 2001 EDT Modified files: /php4/pear DB.php Log: * allow empty passwords in dsn (for example "mysql://user:@database") Index: php4/pear/DB.php diff -u php4/pear/DB.php:1.48 php4/pear/DB.php:1.49 --- php4/pear/DB.php:1.48 Fri Feb 16 09:14:39 2001 +++ php4/pear/DB.phpTue Feb 20 15:00:08 2001 @@ -17,7 +17,7 @@ // | | // +--+ // -// $Id: DB.php,v 1.48 2001/02/16 17:14:39 chagenbu Exp $ +// $Id: DB.php,v 1.49 2001/02/20 23:00:08 ssb Exp $ // // Database independent query interface. // @@ -413,7 +413,7 @@ $dsn = $arr[1]; } -if (preg_match("|^([^:]+):([^@]+)@?(.*)$|", $dsn, $arr)) { +if (preg_match("|^([^:]+):([^@]*)@?(.*)$|", $dsn, $arr)) { $parsed["username"] = urldecode($arr[1]); $parsed["password"] = urldecode($arr[2]); $dsn = $arr[3]; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB common.php ibase.php msql.php mssql.php mysql.php oci8.php odbc.php pgsql.php sybase.php /pear/DB/tests transactions.inc /pear/DB/tests/pgsql 011.phpt
) { return $this-raiseError(); // XXX ERRORMSG } +$this-dsn = $dsninfo; $this-dbsyntax = $dsninfo['dbsyntax']; switch ($this-dbsyntax) { case 'solid': Index: php4/pear/DB/pgsql.php diff -u php4/pear/DB/pgsql.php:1.29 php4/pear/DB/pgsql.php:1.30 --- php4/pear/DB/pgsql.php:1.29 Sun Feb 18 16:14:27 2001 +++ php4/pear/DB/pgsql.php Mon Feb 19 04:22:26 2001 @@ -14,7 +14,7 @@ // | [EMAIL PROTECTED] so we can mail you a copy immediately. | // +--+ // | Authors: Rui Hirokawa [EMAIL PROTECTED] | -// | | +// | Stig Bakken [EMAIL PROTECTED] | // +--+ // // Database independent query interface definition for PHP's PostgreSQL @@ -38,10 +38,12 @@ var $phptype, $dbsyntax; var $prepare_tokens = array(); var $prepare_types = array(); +var $transaction_opcount = 0; var $numrows; var $row; var $affected; -var $autocommit = 1; +var $autocommit = true; +var $dsn; // }}} // {{{ constructor @@ -85,6 +87,7 @@ if (!$dsninfo || !$dsninfo['phptype']) { return $this-raiseError(); // XXX ERRORMSG } +$this-dsn = $dsninfo; $dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'unix'; if ($dbhost == 'unix') { $protocol = 'unix'; @@ -154,18 +157,25 @@ */ function simpleQuery($query) { +$ismanip = DB::isManip($query); $this-last_query = $query; $query = $this-modifyQuery($query); +if (!$this-autocommit $ismanip) { +if ($this-transaction_opcount == 0) { +$result = @pg_exec($this-connection, "begin;"); +if (!$result) { +return $this-pgsqlRaiseError(); +} +} +$this-transaction_opcount++; +} $result = @pg_exec($this-connection, $query); if (!$result) { return $this-pgsqlRaiseError(); } -if ($this-autocommit DB::isManip($query)) { -$this-commit(); -} // Determine which queries that should return data, and which // should return an error code only. -if (DB::isManip($query)) { +if ($ismanip) { $this-affected = @pg_cmdtuples($result); return DB_OK; } elseif (preg_match('/^\s*(SELECT)\s/i', $query) @@ -413,9 +423,9 @@ // {{{ execute() /** - * @return int returns a PostgreSQL result resource for successful - * SELECT queries, DB_OK for other successful queries. A DB error - * code is returned on failure. + * @return mixed returns a DB result object for successful SELECT + * queries, DB_OK for other successful queries. A DB + * error is returned on failure. */ function execute($stmt, $data = false) { @@ -436,6 +446,8 @@ */ function autoCommit($onoff = false) { +// XXX if $this-transaction_opcount 0, we should probably +// issue a warning here. $this-autocommit = $onoff ? true : false; return DB_OK; } @@ -444,15 +456,18 @@ // {{{ commit() /** - * Commit transactions on the current connection + * Commit the current transaction. */ function commit() { -// hack to shut up error messages from ext/pgsql or libpq.a -@fclose(@fopen("php://stderr", "w")); -$result = @pg_exec($this-connection, "end;"); -if (!$result) { -return $this-pgsqlRaiseError(); +if ($this-transaction_opcount 0) { +// (disabled) hack to shut up error messages from libpq.a +//@fclose(@fopen("php://stderr", "w")); +$result = @pg_exec($this-connection, "end;"); +$this-transaction_opcount = 0; +if (!$result) { +return $this-pgsqlRaiseError(); +} } return DB_OK; } @@ -461,13 +476,16 @@ // {{{ rollback() /** - * Roll back all uncommitted transactions on the current connection. + * Roll back (undo) the current transaction. */ function rollback() { -$result = @pg_exec($this-connection, "abort;"); -if (!$result) { -return $this-pgsqlRaiseError(); +if ($this-transaction_opcount 0) { +$result = @pg_exec($this-connection, "abort;"); +$this-transaction_opcount = 0; +if (!$result) { +return $this-pgsqlRaiseError(); +} } return DB_OK;
[PHP-CVS] cvs: php4 /pear/DB common.php
ssb Sun Feb 18 08:23:03 2001 EDT Modified files: /php4/pear/DB common.php Log: * added "persistent" option Index: php4/pear/DB/common.php diff -u php4/pear/DB/common.php:1.36 php4/pear/DB/common.php:1.37 --- php4/pear/DB/common.php:1.36Thu Feb 1 12:16:53 2001 +++ php4/pear/DB/common.php Sun Feb 18 08:23:03 2001 @@ -41,6 +41,7 @@ var $last_query = ''; var $fetchmode = DB_FETCHMODE_ORDERED; var $options = array( +'persistent' = false, // persistent connection? 'optimize' = 'performance', // 'performance' or 'portability' ); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB oci8.php
ssb Sun Feb 18 08:24:00 2001 EDT Modified files: /php4/pear/DB oci8.php Log: * use "hostspec" dsn parameter as SID if specified Index: php4/pear/DB/oci8.php diff -u php4/pear/DB/oci8.php:1.17 php4/pear/DB/oci8.php:1.18 --- php4/pear/DB/oci8.php:1.17 Fri Feb 16 09:14:40 2001 +++ php4/pear/DB/oci8.php Sun Feb 18 08:24:00 2001 @@ -83,10 +83,11 @@ $pw = $dsninfo['password']; $hostspec = $dsninfo['hostspec']; +DB::assertExtension("oci8"); $connect_function = $persistent ? 'OCIPLogon' : 'OCILogon'; - if ($user $pw $hostspec) { + if ($hostspec) { $conn = $connect_function($user,$pw,$hostspec); - } elseif ($user $pw) { + } elseif ($user || $pw) { $conn = $connect_function($user,$pw); } else { $conn = false; @@ -373,10 +374,10 @@ function autoCommit($onoff = false) { if (!$onoff) { - $this-autoCommit=0; + $this-autoCommit = 0; } else { - $this-autoCommit=1; + $this-autoCommit = 1; } return DB_OK; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB odbc.php pgsql.php storage.php
ssb Sun Feb 18 16:14:27 2001 EDT Modified files: /php4/pear/DB odbc.php pgsql.php storage.php Log: odbc.php: load "odbc" extension on demand pgsql.php: unix domain socket support (set hostname to "unix") storage.php: inherit PEAR Index: php4/pear/DB/odbc.php diff -u php4/pear/DB/odbc.php:1.26 php4/pear/DB/odbc.php:1.27 --- php4/pear/DB/odbc.php:1.26 Fri Feb 16 09:14:40 2001 +++ php4/pear/DB/odbc.php Sun Feb 18 16:14:27 2001 @@ -113,6 +113,7 @@ $dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'localhost'; $user = $dsninfo['username']; $pw = $dsninfo['password']; +DB::assertExtension("odbc"); if ($this-provides('pconnect')) { $connect_function = $persistent ? 'odbc_pconnect' : 'odbc_connect'; } else { Index: php4/pear/DB/pgsql.php diff -u php4/pear/DB/pgsql.php:1.28 php4/pear/DB/pgsql.php:1.29 --- php4/pear/DB/pgsql.php:1.28 Sat Feb 17 08:45:01 2001 +++ php4/pear/DB/pgsql.php Sun Feb 18 16:14:27 2001 @@ -85,8 +85,12 @@ if (!$dsninfo || !$dsninfo['phptype']) { return $this-raiseError(); // XXX ERRORMSG } -$dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'localhost'; -$protocol = $dsninfo['protocol'] ? $dsninfo['protocol'] : 'tcp'; +$dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'unix'; +if ($dbhost == 'unix') { +$protocol = 'unix'; +} else { +$protocol = $dsninfo['protocol'] ? $dsninfo['protocol'] : 'tcp'; +} $user = $dsninfo['username']; $pw = $dsninfo['password']; $dbname = $dsninfo['database']; Index: php4/pear/DB/storage.php diff -u php4/pear/DB/storage.php:1.11 php4/pear/DB/storage.php:1.12 --- php4/pear/DB/storage.php:1.11 Tue Jan 9 17:01:53 2001 +++ php4/pear/DB/storage.phpSun Feb 18 16:14:27 2001 @@ -21,6 +21,7 @@ // can be manipulated and that updates the database accordingly. // +require_once "PEAR.php"; require_once "DB.php"; function DB_storage_destructor() { @@ -35,7 +36,7 @@ } } -class DB_storage +class DB_storage extends PEAR { /** the name of the table (or view, if the backend database supports updates in views) we hold data from */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB/tests db_error.phpt db_error2.phpt
ssb Sun Feb 18 16:47:30 2001 EDT Modified files: /php4/pear/DB/tests db_error.phpt db_error2.phpt Log: updated some line numbers Index: php4/pear/DB/tests/db_error.phpt diff -u php4/pear/DB/tests/db_error.phpt:1.5 php4/pear/DB/tests/db_error.phpt:1.6 --- php4/pear/DB/tests/db_error.phpt:1.5Fri Dec 8 03:01:24 2000 +++ php4/pear/DB/tests/db_error.phptSun Feb 18 16:47:30 2001 @@ -47,11 +47,11 @@ testing different error modes... DB Error: unknown error[db_error: message="DB Error: unknown error" code=-1 mode=print level=notice prefix="" prepend="" append="" debug=""] br -bNotice/b: DB Error: syntax error in bPEAR.php/b on line b206/bbr +bNotice/b: DB Error: syntax error in bPEAR.php/b on line b327/bbr testing different error serverities... br -bNotice/b: DB Error: syntax error in bPEAR.php/b on line b206/bbr +bNotice/b: DB Error: syntax error in bPEAR.php/b on line b327/bbr br -bWarning/b: DB Error: syntax error in bPEAR.php/b on line b206/bbr +bWarning/b: DB Error: syntax error in bPEAR.php/b on line b327/bbr br -bFatal error/b: DB Error: syntax error in bPEAR.php/b on line b206/bbr +bFatal error/b: DB Error: syntax error in bPEAR.php/b on line b327/bbr Index: php4/pear/DB/tests/db_error2.phpt diff -u php4/pear/DB/tests/db_error2.phpt:1.5 php4/pear/DB/tests/db_error2.phpt:1.6 --- php4/pear/DB/tests/db_error2.phpt:1.5 Fri Dec 8 03:01:24 2000 +++ php4/pear/DB/tests/db_error2.phpt Sun Feb 18 16:47:30 2001 @@ -39,6 +39,6 @@ default: [db_error: message="DB Error: return testing error" code=-1 mode=return level=notice prefix="" prepend="" append="" debug=""] mode=print: DB Error: print testing error mode=trigger: br -bNotice/b: DB Error: trigger testing error in bPEAR.php/b on line b206/bbr +bNotice/b: DB Error: trigger testing error in bPEAR.php/b on line +b327/bbr mode=function callback: myfunc here, obj=[db_error: message="DB Error: function callback testing error" code=-1 mode=callback callback=myfunc prefix="" prepend="" append="" debug=""] mode=object callback: myclass::myfunc here, obj=[db_error: message="DB Error: object callback testing error" code=-1 mode=callback callback=myclass::myfunc prefix="" prepend="" append="" debug=""] -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB/tests/oci8 .cvsignore
ssb Sun Feb 18 16:57:43 2001 EDT Added files: /php4/pear/DB/tests/oci8.cvsignore Log: ignore "sqlnet.log" file Index: php4/pear/DB/tests/oci8/.cvsignore +++ php4/pear/DB/tests/oci8/.cvsignore sqlnet.log -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB mysql.php
ssb Fri Feb 16 09:57:06 2001 EDT Modified files: /php4/pear/DB mysql.php Log: * load mysql extension if needed Index: php4/pear/DB/mysql.php diff -u php4/pear/DB/mysql.php:1.46 php4/pear/DB/mysql.php:1.47 --- php4/pear/DB/mysql.php:1.46 Fri Feb 16 09:14:40 2001 +++ php4/pear/DB/mysql.php Fri Feb 16 09:57:06 2001 @@ -51,33 +51,33 @@ function DB_mysql() { $this-DB_common(); - $this-phptype = "mysql"; - $this-dbsyntax = "mysql"; - $this-features = array( - "prepare" = false, - "pconnect" = true, - "transactions" = false - ); - - $this-errorcode_map = array( - 1004 = DB_ERROR_CANNOT_CREATE, - 1005 = DB_ERROR_CANNOT_CREATE, - 1006 = DB_ERROR_CANNOT_CREATE, - 1007 = DB_ERROR_ALREADY_EXISTS, - 1008 = DB_ERROR_CANNOT_DROP, - 1046 = DB_ERROR_NODBSELECTED, +$this-phptype = "mysql"; +$this-dbsyntax = "mysql"; +$this-features = array( +"prepare" = false, +"pconnect" = true, +"transactions" = false +); +$this-errorcode_map = array( +1004 = DB_ERROR_CANNOT_CREATE, +1005 = DB_ERROR_CANNOT_CREATE, +1006 = DB_ERROR_CANNOT_CREATE, +1007 = DB_ERROR_ALREADY_EXISTS, +1008 = DB_ERROR_CANNOT_DROP, +1046 = DB_ERROR_NODBSELECTED, 1050 = DB_ERROR_ALREADY_EXISTS, - 1051 = DB_ERROR_NOSUCHTABLE, - 1054 = DB_ERROR_NOSUCHFIELD, - 1062 = DB_ERROR_ALREADY_EXISTS, - 1064 = DB_ERROR_SYNTAX, - 1100 = DB_ERROR_NOT_LOCKED, - 1136 = DB_ERROR_VALUE_COUNT_ON_ROW, - 1146 = DB_ERROR_NOSUCHTABLE, - ); +1051 = DB_ERROR_NOSUCHTABLE, +1054 = DB_ERROR_NOSUCHFIELD, +1062 = DB_ERROR_ALREADY_EXISTS, +1064 = DB_ERROR_SYNTAX, +1100 = DB_ERROR_NOT_LOCKED, +1136 = DB_ERROR_VALUE_COUNT_ON_ROW, +1146 = DB_ERROR_NOSUCHTABLE, +); } // }}} + // {{{ connect() /** @@ -92,44 +92,45 @@ function connect($dsn, $persistent = false) { - if (is_array($dsn)) { - $dsninfo = $dsn; - } else { - $dsninfo = DB::parseDSN($dsn); - } - - if (!$dsninfo || !$dsninfo["phptype"]) { - return $this-raiseError(); // XXX ERRORMSG - } +if (is_array($dsn)) { +$dsninfo = $dsn; +} else { +$dsninfo = DB::parseDSN($dsn); +} + +if (!$dsninfo || !$dsninfo["phptype"]) { +return $this-raiseError(); // XXX ERRORMSG +} - $dbhost = $dsninfo["hostspec"] ? $dsninfo["hostspec"] : "localhost"; - $user = $dsninfo["username"]; - $pw = $dsninfo["password"]; - - $connect_function = $persistent ? "mysql_pconnect" : "mysql_connect"; - - if ($dbhost $user $pw) { - $conn = $connect_function($dbhost, $user, $pw); - } elseif ($dbhost $user) { - $conn = $connect_function($dbhost, $user); - } elseif ($dbhost) { - $conn = $connect_function($dbhost); - } else { - $conn = false; - } - - if ($conn == false) { - return $this-raiseError(); // XXX ERRORMSG - } - - if ($dsninfo["database"]) { - if (!mysql_select_db($dsninfo["database"], $conn)) { - return $this-raiseError(); // XXX ERRORMSG - } - } - - $this-connection = $conn; - return DB_OK; +$dbhost = $dsninfo["hostspec"] ? $dsninfo["hostspec"] : "localhost"; +$user = $dsninfo["username"]; +$pw = $dsninfo["password"]; + +DB::assertExtension("mysql"); +$connect_function = $persistent ? "mysql_pconnect" : "mysql_connect"; + +if ($dbhost $user $pw) { +$conn = $connect_function($dbhost, $user, $pw); +} elseif ($dbhost $user) { +$conn = $connect_function($dbhost, $user); +} elseif ($dbhost) { +$conn = $connect_function($dbhost); +} else { +$conn = false; +} + +if ($conn == false) { +return $this-raiseError(); // XXX ERRORMSG +} + +if ($dsninfo["database"]) { +if (!mysql_select_db($dsninfo["database"], $conn)) { +return $this-raiseError(); // XXX ERRORMSG +} +} + +$this-connection = $conn; +return DB_OK; } // }}} @@ -144,7 +145,7 @@ */ function disconnect() { - return mysql_close($this-connection); +return mysql_close($this-connection); } // }}} @@ -166,12 +167,12 @@ { $this-last_query = $query; $query = $this-modifyQuery($query); - $result
[PHP-CVS] cvs: php4 /pear DB.php /pear/DB/tests db_parsedsn.phpt
ssb Tue Jan 30 00:34:56 2001 EDT Modified files: /php4/pear DB.php /php4/pear/DB/tests db_parsedsn.phpt Log: @Allow url encoding in DB usernames and passwords (Stig, PEAR) Index: php4/pear/DB.php diff -u php4/pear/DB.php:1.44 php4/pear/DB.php:1.45 --- php4/pear/DB.php:1.44 Fri Jan 26 12:07:22 2001 +++ php4/pear/DB.phpTue Jan 30 00:34:55 2001 @@ -17,7 +17,7 @@ // | | // +--+ // -// $Id: DB.php,v 1.44 2001/01/26 20:07:22 chagenbu Exp $ +// $Id: DB.php,v 1.45 2001/01/30 08:34:55 ssb Exp $ // // Database independent query interface. // @@ -55,6 +55,7 @@ define("DB_ERROR_NEED_MORE_DATA", -20); define("DB_ERROR_NOT_LOCKED", -21); define("DB_ERROR_VALUE_COUNT_ON_ROW", -22); +define("DB_ERROR_INVALID_DSN",-23); /* * Warnings are not detected as errors by DB::isError(), and are not @@ -171,8 +172,8 @@ { @include_once("DB/${type}.php"); - $classname = "DB_" . $type; - $obj = @new $classname; + $classname = "DB_${type}"; + @$obj = new $classname; if (!$obj) { return new DB_Error(DB_ERROR_NOT_FOUND); @@ -188,39 +189,50 @@ * method for a description of the dsn format. Can also be * specified as an array of the format returned by DB::parseDSN. * - * @param $persistent bool whether this connection should be - * persistent. Ignored if the backend extension does not support - * persistent connections. + * @param $options mixed if boolean (or scalar), tells whether + * this connection should be persistent (for backends that support + * this). This parameter can also be an array of options, see + * DB_common::setOption for more information on connection + * options. * * @return object a newly created DB object, or a DB error code on * error * * @see DB::parseDSN */ -function connect($dsn, $persistent = false) +function connect($dsn, $options = false) { - if (is_array($dsn)) { - $dsninfo = $dsn; - } else { - $dsninfo = DB::parseDSN($dsn); - } - $type = $dsninfo["phptype"]; - $classname = "DB_" . $type; +if (is_array($dsn)) { +$dsninfo = $dsn; +} else { +$dsninfo = DB::parseDSN($dsn); +} +$type = $dsninfo["phptype"]; - @include_once("DB/${type}.php"); - $obj = @new $classname; +$classname = "DB_${type}"; +@$obj = new $classname; - if (!$obj) { - return new DB_Error(DB_ERROR_NOT_FOUND); - } +if (!$obj) { +return new DB_Error(DB_ERROR_NOT_FOUND); +} - $err = $obj-connect($dsninfo, $persistent); +if (is_array($options)) { +foreach ($persistent as $option = $value) { +$test = $obj-setOption($option, $value); +if (DB::isError($test)) { +return $test; +} +} +} else { +$obj-setOption('persistent', $persistent); +} +$err = $obj-connect($dsninfo, $obj-getOption('persistent')); - if (DB::isError($err)) { - return $err; - } +if (DB::isError($err)) { +return $err; +} - return $obj; +return $obj; } /** @@ -402,11 +414,11 @@ } if (preg_match("|^([^:]+):([^@]+)@?(.*)$|", $dsn, $arr)) { - $parsed["username"] = $arr[1]; - $parsed["password"] = $arr[2]; + $parsed["username"] = urldecode($arr[1]); + $parsed["password"] = urldecode($arr[2]); $dsn = $arr[3]; } elseif (preg_match("|^([^:]+)@(.*)$|", $dsn, $arr)) { - $parsed["username"] = $arr[1]; + $parsed["username"] = urldecode($arr[1]); $dsn = $arr[2]; } @@ -426,6 +438,29 @@ } return $parsed; +} + +/** + * Load a PHP database extension if it is not loaded already. + * + * @access public + * + * @param $name the base name of the extension (without the .so or + * .dll suffix) + * + * @return bool true if the extension was already or successfully + * loaded, false if it could not be loaded + */ +function assertExtension($name) +{ +if (!extension_loaded($name)) { +$dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so"; +@dl($name . $dlext); +} +if (!extension_loaded($name)) { +return false; +} +return true; } } Index: php4/pear/DB/tests/db_parsedsn.phpt diff -u php4/pear/DB/tests/db_parsedsn.phpt:1.1 php4/pear/DB/tests/db_parsedsn.phpt:1.2 --- php4/pear/DB/tests/db_parsedsn.phpt:1.1 Fri Sep 8 19:39:56 2000 +++
[PHP-CVS] cvs: php4 /pear PEAR.php.in
ssb Tue Jan 30 17:27:11 2001 EDT Modified files: /php4/pear PEAR.php.in Log: whitespace Index: php4/pear/PEAR.php.in diff -u php4/pear/PEAR.php.in:1.12 php4/pear/PEAR.php.in:1.13 --- php4/pear/PEAR.php.in:1.12 Mon Jan 29 16:55:27 2001 +++ php4/pear/PEAR.php.in Tue Jan 30 17:27:09 2001 @@ -17,7 +17,7 @@ // | Stig Bakken [EMAIL PROTECTED] | // +--+ // -// $Id: PEAR.php.in,v 1.12 2001/01/30 00:55:27 ssb Exp $ +// $Id: PEAR.php.in,v 1.13 2001/01/31 01:27:09 ssb Exp $ // define('PEAR_ERROR_RETURN', 1); @@ -60,14 +60,14 @@ */ class PEAR { - // {{{ properties +// {{{ properties - var $_debug = false; +var $_debug = false; var $_default_error_mode = null; var $_default_error_options = null; var $_default_error_handler = ''; - // }}} +// }}} // {{{ constructor @@ -75,33 +75,33 @@ * Constructor. Registers this object in * $_PEAR_destructor_object_list for destructor emulation. */ - function PEAR() { - global $_PEAR_destructor_object_list; - $_PEAR_destructor_object_list[] = $this; - if ($this-_debug) { - printf("PEAR constructor called, class=%s\n", - get_class($this)); - } - } +function PEAR() { +global $_PEAR_destructor_object_list; +$_PEAR_destructor_object_list[] = $this; +if ($this-_debug) { +printf("PEAR constructor called, class=%s\n", + get_class($this)); +} +} // }}} // {{{ destructor /** * Destructor (the emulated type of...). Does nothing right now, -* but is included for forward compatibility, so subclass -* destructors should always call it. + * but is included for forward compatibility, so subclass + * destructors should always call it. * * See the note in the class desciption about output from * destructors. -* -* @access public + * + * @access public */ function _PEAR() { - if ($this-_debug) { - printf("PEAR destructor called, class=%s\n", - get_class($this)); - } +if ($this-_debug) { +printf("PEAR destructor called, class=%s\n", + get_class($this)); +} } // }}} @@ -110,15 +110,15 @@ /** * Tell whether a value is a PEAR error. * - * @param $data the value to test - * @access public - * @return booltrue if $data is an error - */ - function isError($data) { - return (bool)(is_object($data) - (get_class($data) == "pear_error" || - is_subclass_of($data, "pear_error"))); - } + * @param $data the value to test + * @access public + * @return booltrue if $data is an error + */ +function isError($data) { +return (bool)(is_object($data) + (get_class($data) == "pear_error" || + is_subclass_of($data, "pear_error"))); +} // }}} // {{{ setErrorHandling() @@ -246,16 +246,16 @@ function _PEAR_call_destructors() { global $_PEAR_destructor_object_list; if (is_array($_PEAR_destructor_object_list) sizeof($_PEAR_destructor_object_list)) { - reset($_PEAR_destructor_object_list); - while (list($k, $objref) = each($_PEAR_destructor_object_list)) { - $destructor = "_".get_class($objref); - if (method_exists($objref, $destructor)) { - $objref-$destructor(); - } - } - // Empty the object list to ensure that destructors are - // not called more than once. - $_PEAR_destructor_object_list = array(); +reset($_PEAR_destructor_object_list); +while (list($k, $objref) = each($_PEAR_destructor_object_list)) { +$destructor = "_".get_class($objref); +if (method_exists($objref, $destructor)) { +$objref-$destructor(); +} +} +// Empty the object list to ensure that destructors are +// not called more than once. +$_PEAR_destructor_object_list = array(); } } @@ -265,235 +265,235 @@ { // {{{ properties - var $error_message_prefix = ''; - var $error_prepend= ''; - var $error_append = ''; - var $mode = PEAR_ERROR_RETURN; - var $level= E_USER_NOTICE; - var $code = -1; - var $message = ''; - var $debuginfo= ''; - - // Wait un
[PHP-CVS] cvs: php4 /pear PEAR.php.in /pear/tests pear_error.phpt pear_error3.phpt
ssb Mon Jan 29 16:55:27 2001 EDT Added files: /php4/pear/testspear_error3.phpt Modified files: /php4/pear PEAR.php.in /php4/pear/testspear_error.phpt Log: @Added raiseError and setErrorHandling methods to PEAR class (Stig, PEAR) # This allows all objects to have their own default error handling # or use a global default. Index: php4/pear/PEAR.php.in diff -u php4/pear/PEAR.php.in:1.11 php4/pear/PEAR.php.in:1.12 --- php4/pear/PEAR.php.in:1.11 Tue Jan 9 17:01:52 2001 +++ php4/pear/PEAR.php.in Mon Jan 29 16:55:27 2001 @@ -17,7 +17,7 @@ // | Stig Bakken [EMAIL PROTECTED] | // +--+ // -// $Id: PEAR.php.in,v 1.11 2001/01/10 01:01:52 ssb Exp $ +// $Id: PEAR.php.in,v 1.12 2001/01/30 00:55:27 ssb Exp $ // define('PEAR_ERROR_RETURN', 1); @@ -30,6 +30,9 @@ define('PEAR_INSTALL_DIR', '@PEAR_INSTALLDIR@'); define('PEAR_EXTENSION_DIR', '@EXTENSION_DIR@'); +$_PEAR_default_error_mode = PEAR_ERROR_RETURN; +$_PEAR_default_error_options = E_USER_NOTICE; +$_PEAR_default_error_callback = ''; $_PEAR_destructor_object_list = array(); // @@ -60,6 +63,9 @@ // {{{ properties var $_debug = false; +var $_default_error_mode = null; +var $_default_error_options = null; +var $_default_error_handler = ''; // }}} @@ -115,6 +121,124 @@ } // }}} +// {{{ setErrorHandling() + +/** + * Sets how errors generated by this DB object should be handled. + * Can be invoked both in objects and statically. If called + * statically, setErrorHandling sets the default behaviour for all + * PEAR objects. If called in an object, setErrorHandling sets + * the default behaviour for that object. + * + * @param $mode int + *one of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + *PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE or + *PEAR_ERROR_CALLBACK. + * + * @param $options mixed + *Ignored unless $mode is PEAR_ERROR_TRIGGER or + *PEAR_ERROR_CALLBACK. When $mode is PEAR_ERROR_TRIGGER, + *this parameter is expected to be an integer and one of + *E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR. When + *$mode is PEAR_ERROR_CALLBACK, this parameter is expected + *to be the callback function or method. A callback + *function is a string with the name of the function, a + *callback method is an array of two elements: the element + *at index 0 is the object, and the element at index 1 is + *the name of the method to call in the object. + * + * @see PEAR_ERROR_RETURN + * @see PEAR_ERROR_PRINT + * @see PEAR_ERROR_TRIGGER + * @see PEAR_ERROR_DIE + * @see PEAR_ERROR_CALLBACK + * + * @since PHP 4.0.5 + */ + +function setErrorHandling($mode, $options = null) +{ +if (isset($this)) { +$setmode = $this-_default_error_mode; +$setoptions = $this-_default_error_options; +$setcallback = $this-_default_error_callback; +} else { +$setmode = $GLOBALS['_PEAR_default_error_mode']; +$setoptions = $GLOBALS['_PEAR_default_error_options']; +$setcallback = $GLOBALS['_PEAR_default_error_callback']; +} + +switch ($mode) { +case PEAR_ERROR_RETURN: +case PEAR_ERROR_PRINT: +case PEAR_ERROR_TRIGGER: +case PEAR_ERROR_DIE: +case null: +$setmode = $mode; +$setoptions = $options; +break; + +case PEAR_ERROR_CALLBACK: +$setmode = $mode; +if (is_string($options) || +(is_array($options) sizeof($options) == 2 + is_object($options[0]) is_string($options[1]))) { +$setcallback = $options; +} else { +trigger_error(E_USER_WARNING, "invalid error callback"); +} +break; + +default: +trigger_error(E_USER_WARNING, "invalid error mode"); +break; +} +} + +// }}} +// {{{ raiseError() + +/** + * This method is called by DB to generate an error. + * + * @since PHP 4.0.5 + */ + +function raiseError($message = null, $code = null, $mode = null, + $options = null, $userinfo = null) +{ +if ($mode === null) { +$mode = $this-_default_error_mode; +if ($mode === null) { +$mode = $GLOBALS['_PEAR_default_error_mode']; +} +} + +if ($mode == PEAR_ERROR_TRIGGER $options === null) { +$options = $this-_d
[PHP-CVS] cvs: php4 /pear/HTML Form.php
ssb Wed Jan 24 03:04:34 2001 EDT Modified files: /php4/pear/HTML Form.php Log: typo Index: php4/pear/HTML/Form.php diff -u php4/pear/HTML/Form.php:1.7 php4/pear/HTML/Form.php:1.8 --- php4/pear/HTML/Form.php:1.7 Tue Jan 9 17:01:55 2001 +++ php4/pear/HTML/Form.php Wed Jan 24 03:04:33 2001 @@ -17,7 +17,7 @@ // | Urs Gehrig [EMAIL PROTECTED] | // +--+ // -// $Id: Form.php,v 1.7 2001/01/10 01:01:55 ssb Exp $ +// $Id: Form.php,v 1.8 2001/01/24 11:04:33 ssb Exp $ // // HTML form utility functions. // @@ -282,8 +282,8 @@ // }}} // {{{ displayResetRow() -function displayReset($title = 'Clear contents') { -print $this-returnReset($title); +function displayResetRow($title = 'Clear contents') { +print $this-returnResetRow($title); } // }}} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB/tests/odbc .cvsignore 001.phpt 002.phpt 003.phpt 004.phpt 006.phpt 007.phpt 010.phpt connect.inc dsn.inc mktable.inc skipif.inc
ssb Sun Jan 14 17:10:14 2001 EDT Added files: /php4/pear/DB/tests/odbc.cvsignore 002.phpt 003.phpt 004.phpt 006.phpt 007.phpt 010.phpt connect.inc dsn.inc mktable.inc Modified files: /php4/pear/DB/tests/odbc001.phpt skipif.inc Log: * defined a bunch of ODBC tests # unfortunately MyODBC 2.50.36 crashes on me as soon as I do a query # so these tests need to be run in another environment :-P Index: php4/pear/DB/tests/odbc/001.phpt diff -u php4/pear/DB/tests/odbc/001.phpt:1.1 php4/pear/DB/tests/odbc/001.phpt:1.2 --- php4/pear/DB/tests/odbc/001.phpt:1.1Tue Dec 5 18:53:15 2000 +++ php4/pear/DB/tests/odbc/001.phptSun Jan 14 17:10:14 2001 @@ -5,15 +5,7 @@ --FILE-- ?php require_once "DB.php"; -switch (ODBC_TYPE) { -case "solid": -$dsn = "tcp+localhost+1313"; -break; -default: -$dsn = "localhost/test"; -break; -} -$dbh = DB::connect("odbc://test:test@$dsn"); +require "connect.inc"; if (is_object($dbh)) { print "\$dbh is an object\n"; } Index: php4/pear/DB/tests/odbc/skipif.inc diff -u php4/pear/DB/tests/odbc/skipif.inc:1.1 php4/pear/DB/tests/odbc/skipif.inc:1.2 --- php4/pear/DB/tests/odbc/skipif.inc:1.1 Tue Dec 5 18:53:15 2000 +++ php4/pear/DB/tests/odbc/skipif.inc Sun Jan 14 17:10:14 2001 @@ -5,7 +5,6 @@ // with no username/password, AND // * we have create/drop privileges on the entire "test" // database -die("skip\n"); if (!extension_loaded("odbc")) { $dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so"; @dl("odbc$dlext"); @@ -13,16 +12,11 @@ if (!extension_loaded("odbc")) { die("skip\n"); } -switch (ODBC_TYPE) { -case "solid": - $dsn = "tcp localhost 1313"; - $user = $pass = "test"; - break; -default: - die("skip\n"); - break; +require "dsn.inc"; +if (!$nativedsn) { +die("skip\n"); } -$conn = @odbc_connect($dsn, $user, $pass); +$conn = @odbc_connect($nativedsn, $user, $pass); if (!is_resource($conn)) { die("skip\n"); } Index: php4/pear/DB/tests/odbc/.cvsignore +++ php4/pear/DB/tests/odbc/.cvsignore *.exp *.out *.php phpt.* Index: php4/pear/DB/tests/odbc/002.phpt +++ php4/pear/DB/tests/odbc/002.phpt --TEST-- DB_odbc fetch modes test --SKIPIF-- ?php include("skipif.inc"); ? --FILE-- ?php require_once "DB.php"; include("mktable.inc"); include("../fetchmodes.inc"); ? --EXPECT-- testing fetchrow default default 0 1 2 3 testing fetchinto default default 0 1 2 3 testing fetchrow ordered default 0 1 2 3 testing fetchrow assoc default a b c d testing fetchrow ordered default with assoc specified a b c d testing fetchrow assoc default with ordered specified 0 1 2 3 testing fetchinto ordered default 0 1 2 3 testing fetchinto assoc default a b c d testing fetchinto ordered default with assoc specified a b c d testing fetchinto assoc default with ordered specified 0 1 2 3 Index: php4/pear/DB/tests/odbc/003.phpt +++ php4/pear/DB/tests/odbc/003.phpt --TEST-- DB_odbc::simpleQuery test --SKIPIF-- ?php include("skipif.inc"); ? --FILE-- ?php require_once "DB.php"; include("mktable.inc"); include("../simplequery.inc"); ? --EXPECT-- resource Index: php4/pear/DB/tests/odbc/004.phpt +++ php4/pear/DB/tests/odbc/004.phpt --TEST-- DB_odbc::numCols test --SKIPIF-- ?php include("skipif.inc"); ? --FILE-- ?php require_once "DB.php"; include("mktable.inc"); include("../numcols.inc"); ? --EXPECT-- 1 2 3 4 Index: php4/pear/DB/tests/odbc/006.phpt +++ php4/pear/DB/tests/odbc/006.phpt --TEST-- DB_odbc::prepare/execute test --SKIPIF-- ?php include("skipif.inc"); ? --FILE-- ?php require_once "DB.php"; include("mktable.inc"); include("../prepexe.inc"); ? --EXPECT-- sth1,sth2,sth3 created sth1 executed sth2 executed sth3 executed results: 72 - - - 72 - bing - - 72 - gazonk - opaque placeholder test - Index: php4/pear/DB/tests/odbc/007.phpt +++ php4/pear/DB/tests/odbc/007.phpt --TEST-- DB_odbc::errorNative test --SKIPIF-- ?php include("skipif.inc"); ? --FILE-- ?php require_once "DB.php"; include("mktable.inc"); $dbh-query("syntax error please"); print "error code " . $dbh-errorNative() . "\n"; ? --EXPECT-- error code 1064 Index: php4/pear/DB/tests/odbc/010.phpt +++ php4/pear/DB/tests/odbc/010.phpt --TEST-- DB_mysql error mapping --SKIPIF-- ?php require "skipif.inc"; ? --FILE-- ?php require "connect.inc"; require "mktable.inc"; require "../errors.inc"; ? --EXPECT-- Trying to provoke DB_ERROR_NOSUCHTABLE DB Error: no such table Trying to provoke DB_ERROR_ALREADY_EXISTS DB Error: already exists Trying to provoke DB_ERROR_NOSUCHTABLE DB Error: no such table Trying to provoke DB_ERROR_CONSTRAINT Trying to provoke DB_ERROR_DIVZERO Trying to provoke DB_ERROR_INVALID_NUMBER Trying to provoke DB_ERROR_NOSUCHFIELD DB Error: no such field Trying to provoke DB_ERROR_SYNTAX DB Error: syntax error Index: php4/pear/DB/tests/odbc/connect.inc +++
[PHP-CVS] cvs: php4 /pear/DB odbc.php
ssb Sun Jan 14 17:14:59 2001 EDT Modified files: /php4/pear/DB odbc.php Log: * DB_odbc: added native error support Index: php4/pear/DB/odbc.php diff -u php4/pear/DB/odbc.php:1.24 php4/pear/DB/odbc.php:1.25 --- php4/pear/DB/odbc.php:1.24 Tue Jan 9 17:01:53 2001 +++ php4/pear/DB/odbc.php Sun Jan 14 17:14:59 2001 @@ -118,24 +118,12 @@ } else { $connect_function = 'odbc_connect'; } - if ($dbhost $user $pw) { - $conn = $connect_function($dbhost, $user, $pw); - } elseif ($dbhost $user) { - $conn = $connect_function($dbhost, $user); - } elseif ($dbhost) { - $conn = $connect_function($dbhost); - } else { - $conn = false; +$conn = @$connect_function($dbhost, $user, $pw); + if (!is_resource($conn)) { + return $this-raiseError(); } - if ($conn == false) { - return $this-raiseError(); // XXX ERRORMSG - } $this-connection = $conn; return DB_OK; - - - - $this-connection = odbc_connect($dsn, $user, $pw); } // }}} @@ -253,6 +241,27 @@ } // }}} +// {{{ errorNative() + +/** + * Get the native error code of the last error (if any) that + * occured on the current connection. + * + * @access public + * + * @return int ODBC error code + */ + +function errorNative() +{ +if (is_resource($this-connection)) { +return odbc_error($this-connection); +} else { +return odbc_error(); +} +} + +// }}} // {{{ autoCommit() function autoCommit($onoff = false) @@ -286,23 +295,24 @@ } // }}} - // {{{ odbcRaiseError() function odbcRaiseError($errno = null) { -if (is_string($errno) -ereg('SQL error: (\[.*\])(.*), SQL state (.)' - $errormsg, $data)) { -list($foo, $source, $message, $codecode) = $data; +if (is_resource($this-connection)) { +$message = odbc_errormsg($this-connection); +$code = odbc_error($this-connection); +} else { +$message = odbc_errormsg(); +$code = odbc_error(); +} if ($errno === null) { -return $this-raiseError($this-errorCode(mysql_errno($this-connection))); +return $this-raiseError($this-errorCode($code)); } return $this-raiseError($this-errorCode($errno)); } // }}} - } // Local variables: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB STATUS
ssb Sun Jan 14 17:19:29 2001 EDT Modified files: /php4/pear/DB STATUS Log: * status update: odbc now supports errorNative Index: php4/pear/DB/STATUS diff -u php4/pear/DB/STATUS:1.13 php4/pear/DB/STATUS:1.14 --- php4/pear/DB/STATUS:1.13Sun Jan 7 18:45:28 2001 +++ php4/pear/DB/STATUS Sun Jan 14 17:19:28 2001 @@ -9,17 +9,15 @@ "n" - returns "not capable" "-" - no implementation of this feature -Each symbol is uppercased as tests are written for the feature. - FEATURE ibase msqlmssql mysql oci8odbcpgsql sybase simpleQuery x x x T x x T x numCols x x x T x x T x numRows n x x T n n T n -errorNative n n n T x n T n +errorNative n n n T x x T n prepare/execute x e e E x e E e sequences n n n E n n T n affectedRows n n n T x n T n fetch modes x x x T x x T x transactions x n n n x x x n auto-commit x n n n x x x n -error mapping - - - T - x E - +error mapping - - - T - x E - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB/tests/ibase .cvsignore 001.phpt 002.phpt 003.phpt 004.phpt 006.phpt 010.phpt connect.inc mktable.inc skipif.inc
ssb Sat Jan 13 16:30:02 2001 EDT Added files: /php4/pear/DB/tests/ibase .cvsignore 001.phpt 002.phpt 003.phpt 004.phpt 006.phpt 010.phpt connect.inc mktable.inc skipif.inc Log: * defined some interbase tests, unable to run them yet Index: php4/pear/DB/tests/ibase/.cvsignore +++ php4/pear/DB/tests/ibase/.cvsignore *.exp *.out *.php phpt.* Index: php4/pear/DB/tests/ibase/001.phpt +++ php4/pear/DB/tests/ibase/001.phpt --TEST-- DB_ibase::connect test --SKIPIF-- ?php require "skipif.inc"; ? --FILE-- ?php require "connect.inc"; if (is_object($dbh)) { print "\$dbh is an object\n"; } if (is_resource($dbh-connection)) { print "\$dbh is connected\n"; } ? --EXPECT-- $dbh is an object $dbh is connected Index: php4/pear/DB/tests/ibase/002.phpt +++ php4/pear/DB/tests/ibase/002.phpt --TEST-- DB_ibase fetch modes test --SKIPIF-- ?php include("skipif.inc"); ? --FILE-- ?php require_once "DB.php"; include("mktable.inc"); include("../fetchmodes.inc"); ? --EXPECT-- testing fetchrow default default 0 1 2 3 testing fetchinto default default 0 1 2 3 testing fetchrow ordered default 0 1 2 3 testing fetchrow assoc default a b c d testing fetchrow ordered default with assoc specified a b c d testing fetchrow assoc default with ordered specified 0 1 2 3 testing fetchinto ordered default 0 1 2 3 testing fetchinto assoc default a b c d testing fetchinto ordered default with assoc specified a b c d testing fetchinto assoc default with ordered specified 0 1 2 3 Index: php4/pear/DB/tests/ibase/003.phpt +++ php4/pear/DB/tests/ibase/003.phpt --TEST-- DB_ibase::simpleQuery test --SKIPIF-- ?php include("skipif.inc"); ? --FILE-- ?php require_once "DB.php"; include("mktable.inc"); include("../simplequery.inc"); ? --EXPECT-- resource Index: php4/pear/DB/tests/ibase/004.phpt +++ php4/pear/DB/tests/ibase/004.phpt --TEST-- DB_ibase::numCols test --SKIPIF-- ?php include("skipif.inc"); ? --FILE-- ?php require_once "DB.php"; include("mktable.inc"); include("../numcols.inc"); ? --EXPECT-- 1 2 3 4 Index: php4/pear/DB/tests/ibase/006.phpt +++ php4/pear/DB/tests/ibase/006.phpt --TEST-- DB_ibase::prepare/execute test --SKIPIF-- ?php include("skipif.inc"); ? --FILE-- ?php require_once "DB.php"; include("mktable.inc"); include("../prepexe.inc"); ? --EXPECT-- sth1,sth2,sth3 created sth1 executed sth2 executed sth3 executed results: 72 - - - 72 - bing - - 72 - gazonk - opaque placeholder test - Index: php4/pear/DB/tests/ibase/010.phpt +++ php4/pear/DB/tests/ibase/010.phpt --TEST-- DB_ibase error mapping --SKIPIF-- ?php require "skipif.inc"; ? --FILE-- ?php require "connect.inc"; require "mktable.inc"; require "../errors.inc"; ? --EXPECT-- Trying to provoke DB_ERROR_NOSUCHTABLE DB Error: no such table Trying to provoke DB_ERROR_ALREADY_EXISTS DB Error: already exists Trying to provoke DB_ERROR_NOSUCHTABLE DB Error: no such table Trying to provoke DB_ERROR_CONSTRAINT Trying to provoke DB_ERROR_DIVZERO DB Error: division by zero Trying to provoke DB_ERROR_INVALID_NUMBER DB Error: invalid number Trying to provoke DB_ERROR_NOSUCHFIELD DB Error: no such field Trying to provoke DB_ERROR_SYNTAX DB Error: syntax error Index: php4/pear/DB/tests/ibase/connect.inc +++ php4/pear/DB/tests/ibase/connect.inc ?php require_once "DB.php"; $dbh = DB::connect("ibase://localhost/test"); ? Index: php4/pear/DB/tests/ibase/mktable.inc +++ php4/pear/DB/tests/ibase/mktable.inc ?php require "connect.inc"; $dbh-setErrorHandling(PEAR_ERROR_RETURN); $dbh-query("DROP TABLE phptest"); $dbh-setErrorHandling(PEAR_ERROR_TRIGGER); $dbh-query("CREATE TABLE phptest (a INTEGER, b VARCHAR(40), c TEXT, d DATE)"); $dbh-query("INSERT INTO phptest VALUES(42, 'bing', 'This is a test', '1999-11-21')"); $dbh-setErrorHandling(PEAR_ERROR_RETURN); ? Index: php4/pear/DB/tests/ibase/skipif.inc +++ php4/pear/DB/tests/ibase/skipif.inc ?php // This script prints "skip" unless: // * the ibase extension is built-in or loadable, AND // * there is a database called "test" accessible // with no username/password, AND if (!extension_loaded("interbase")) { $dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so"; @dl("interbase$dlext"); } if (!extension_loaded("interbase")) { die("skip\n"); } $conn = @ibase_connect("test"); if (!is_resource($conn)) { die("skip\n"); } ? -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]