Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

This commit was manufactured by cvs2svn to create tag 'BEFORE_FD_REAP…

…PLY'.
  • Loading branch information...
commit f2a5877a2a11e3eca376be128e5f690e3b11b109 1 parent 873f321
SVN Migration authored

Showing 28 changed files with 0 additions and 1,497 deletions. Show diff stats Hide diff stats

  1. +0 2  ext/bz2/CREDITS
  2. +0 529 ext/bz2/bz2.c
  3. +0 108 ext/bz2/bz2.dsp
  4. +0 33 ext/bz2/config.m4
  5. +0 35 ext/bz2/package.xml
  6. +0 72 ext/bz2/php_bz2.h
  7. +0 25 ext/bz2/tests/with_files.phpt
  8. +0 29 ext/bz2/tests/with_strings.phpt
  9. +0 2  ext/sqlite/CREDITS
  10. +0 14 ext/sqlite/README
  11. +0 22 ext/sqlite/TODO
  12. +0 37 ext/sqlite/libsqlite/README
  13. +0 8 ext/sqlite/libsqlite/src/sqlite_config.w32.h
  14. +0 33 ext/sqlite/sqlite.php
  15. +0 11 ext/sqlite/tests/blankdb.inc
  16. +0 17 ext/sqlite/tests/sqlite_001.phpt
  17. +0 31 ext/sqlite/tests/sqlite_002.phpt
  18. +0 51 ext/sqlite/tests/sqlite_003.phpt
  19. +0 46 ext/sqlite/tests/sqlite_004.phpt
  20. +0 47 ext/sqlite/tests/sqlite_005.phpt
  21. +0 52 ext/sqlite/tests/sqlite_006.phpt
  22. +0 51 ext/sqlite/tests/sqlite_007.phpt
  23. +0 43 ext/sqlite/tests/sqlite_008.phpt
  24. +0 43 ext/sqlite/tests/sqlite_009.phpt
  25. +0 78 ext/sqlite/tests/sqlite_010.phpt
  26. +0 27 ext/sqlite/tests/sqlite_011.phpt
  27. +0 35 ext/sqlite/tests/sqlite_012.phpt
  28. +0 16 tests/lang/bug17115.phpt
2  ext/bz2/CREDITS
... ... @@ -1,2 +0,0 @@
1   -Bzip2
2   -Sterling Hughes
529 ext/bz2/bz2.c
... ... @@ -1,529 +0,0 @@
1   -/*
2   - +----------------------------------------------------------------------+
3   - | PHP version 4.0 |
4   - +----------------------------------------------------------------------+
5   - | Copyright (c) 1997-2003 The PHP Group |
6   - +----------------------------------------------------------------------+
7   - | This source file is subject to version 2.02 of the PHP license, |
8   - | that is bundled with this package in the file LICENSE, and is |
9   - | available at through the world-wide-web at |
10   - | http://www.php.net/license/2_02.txt. |
11   - | If you did not receive a copy of the PHP license and are unable to |
12   - | obtain it through the world-wide-web, please send a note to |
13   - | license@php.net so we can mail you a copy immediately. |
14   - +----------------------------------------------------------------------+
15   - | Author: Sterling Hughes <sterling@php.net> |
16   - +----------------------------------------------------------------------+
17   - */
18   -
19   -/* $Id$ */
20   -
21   -#ifdef HAVE_CONFIG_H
22   -#include "config.h"
23   -#endif
24   -
25   -#include "php.h"
26   -#include "php_bz2.h"
27   -
28   -#if HAVE_BZ2
29   -
30   -/* PHP Includes */
31   -#include "ext/standard/file.h"
32   -#include "ext/standard/info.h"
33   -#include "ext/standard/php_string.h"
34   -
35   -/* for fileno() */
36   -#include <stdio.h>
37   -
38   -/* Internal error constants */
39   -#define PHP_BZ_ERRNO 0
40   -#define PHP_BZ_ERRSTR 1
41   -#define PHP_BZ_ERRBOTH 2
42   -
43   -/* Blocksize of the decompression buffer */
44   -#define PHP_BZ_DECOMPRESS_SIZE 4096
45   -
46   -function_entry bz2_functions[] = {
47   - PHP_FE(bzopen, NULL)
48   - PHP_FE(bzread, NULL)
49   - PHP_FALIAS(bzwrite, fwrite, NULL)
50   - PHP_FALIAS(bzflush, fflush, NULL)
51   - PHP_FALIAS(bzclose, fclose, NULL)
52   - PHP_FE(bzerrno, NULL)
53   - PHP_FE(bzerrstr, NULL)
54   - PHP_FE(bzerror, NULL)
55   - PHP_FE(bzcompress, NULL)
56   - PHP_FE(bzdecompress, NULL)
57   - {NULL, NULL, NULL}
58   -};
59   -
60   -zend_module_entry bz2_module_entry = {
61   - STANDARD_MODULE_HEADER,
62   - "bz2",
63   - bz2_functions,
64   - PHP_MINIT(bz2),
65   - PHP_MSHUTDOWN(bz2),
66   - NULL,
67   - NULL,
68   - PHP_MINFO(bz2),
69   - NO_VERSION_YET,
70   - STANDARD_MODULE_PROPERTIES
71   -};
72   -
73   -#ifdef COMPILE_DL_BZ2
74   -ZEND_GET_MODULE(bz2)
75   -#endif
76   -
77   -struct php_bz2_stream_data_t {
78   - BZFILE *bz_file;
79   - php_stream *stream;
80   -};
81   -
82   -/* {{{ BZip2 stream implementation */
83   -
84   -static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
85   -{
86   - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract;
87   - size_t ret;
88   -
89   - ret = BZ2_bzread(self->bz_file, buf, count);
90   -
91   - if (ret == 0) {
92   - stream->eof = 1;
93   - }
94   -
95   - return ret;
96   -}
97   -
98   -static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
99   -{
100   - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract;
101   -
102   - return BZ2_bzwrite(self->bz_file, (char*)buf, count);
103   -}
104   -
105   -static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC)
106   -{
107   - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
108   - int ret = EOF;
109   -
110   - if (close_handle) {
111   - BZ2_bzclose(self->bz_file);
112   - }
113   -
114   - if (self->stream) {
115   - php_stream_free(self->stream, PHP_STREAM_FREE_CLOSE | (close_handle == 0 ? PHP_STREAM_FREE_PRESERVE_HANDLE : 0));
116   - }
117   -
118   - efree(self);
119   -
120   - return ret;
121   -}
122   -
123   -static int php_bz2iop_flush(php_stream *stream TSRMLS_DC)
124   -{
125   - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
126   - return BZ2_bzflush(self->bz_file);
127   -}
128   -/* }}} */
129   -
130   -php_stream_ops php_stream_bz2io_ops = {
131   - php_bz2iop_write, php_bz2iop_read,
132   - php_bz2iop_close, php_bz2iop_flush,
133   - "BZip2",
134   - NULL, /* seek */
135   - NULL, /* cast */
136   - NULL, /* stat */
137   - NULL /* set_option */
138   -};
139   -
140   -/* {{{ Bzip2 stream openers */
141   -PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz,
142   - char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC)
143   -{
144   - struct php_bz2_stream_data_t *self;
145   -
146   - self = emalloc(sizeof(*self));
147   -
148   - self->stream = innerstream;
149   - self->bz_file = bz;
150   -
151   - return php_stream_alloc_rel(&php_stream_bz2io_ops, self, 0, mode);
152   -}
153   -
154   -PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
155   - char *path,
156   - char *mode,
157   - int options,
158   - char **opened_path,
159   - php_stream_context *context STREAMS_DC TSRMLS_DC)
160   -{
161   - php_stream *retstream = NULL, *stream = NULL;
162   - char *path_copy = NULL;
163   - BZFILE *bz_file = NULL;
164   -
165   - if (strncasecmp("compress.bzip2://", path, 17) == 0) {
166   - path += 17;
167   - }
168   -
169   -#ifdef VIRTUAL_DIR
170   - virtual_filepath(path, &path_copy TSRMLS_CC);
171   -#else
172   - path_copy = path;
173   -#endif
174   -
175   - /* try and open it directly first */
176   - bz_file = BZ2_bzopen(path_copy, mode);
177   -
178   - if (opened_path && bz_file) {
179   - *opened_path = estrdup(path_copy);
180   - }
181   - path_copy = NULL;
182   -
183   - if (bz_file == NULL) {
184   - /* that didn't work, so try and get something from the network/wrapper */
185   - stream = php_stream_open_wrapper(path, mode, options, opened_path);
186   -
187   - if (stream) {
188   - int fd;
189   - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) {
190   - bz_file = BZ2_bzdopen(fd, mode);
191   - }
192   - }
193   - }
194   -
195   - if (bz_file) {
196   - retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC TSRMLS_CC);
197   - if (retstream) {
198   - return retstream;
199   - }
200   -
201   - BZ2_bzclose(bz_file);
202   - }
203   -
204   - if (stream) {
205   - php_stream_close(stream);
206   - }
207   -
208   - return NULL;
209   -}
210   -
211   -/* }}} */
212   -
213   -static php_stream_wrapper_ops bzip2_stream_wops = {
214   - _php_stream_bz2open,
215   - NULL, /* close */
216   - NULL, /* fstat */
217   - NULL, /* stat */
218   - NULL, /* opendir */
219   - "BZip2",
220   - NULL /* unlink */
221   -};
222   -
223   -php_stream_wrapper php_stream_bzip2_wrapper = {
224   - &bzip2_stream_wops,
225   - NULL,
226   - 0 /* is_url */
227   -};
228   -
229   -static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int);
230   -
231   -PHP_MINIT_FUNCTION(bz2)
232   -{
233   - php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper TSRMLS_CC);
234   -
235   - return SUCCESS;
236   -}
237   -
238   -PHP_MSHUTDOWN_FUNCTION(bz2)
239   -{
240   - php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC);
241   -
242   - return SUCCESS;
243   -}
244   -
245   -PHP_MINFO_FUNCTION(bz2)
246   -{
247   - php_info_print_table_start();
248   - php_info_print_table_row(2, "BZip2 Support", "Enabled");
249   - php_info_print_table_row(2, "BZip2 Version", (char *) BZ2_bzlibVersion());
250   - php_info_print_table_end();
251   -}
252   -
253   -/* {{{ proto string bzread(int bz[, int length])
254   - Reads up to length bytes from a BZip2 stream, or 1024 bytes if length is not specified */
255   -PHP_FUNCTION(bzread)
256   -{
257   - zval *bz;
258   - long len = 1024;
259   - php_stream *stream;
260   -
261   - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) {
262   - RETURN_FALSE;
263   - }
264   -
265   - php_stream_from_zval(stream, &bz);
266   -
267   - if (len < 0) {
268   - php_error_docref(NULL TSRMLS_CC, E_WARNING, "length may not be negative");
269   - RETURN_FALSE;
270   - }
271   -
272   - Z_STRVAL_P(return_value) = emalloc(len + 1);
273   - Z_STRLEN_P(return_value) = php_stream_read(stream, Z_STRVAL_P(return_value), len);
274   -
275   - if (Z_STRLEN_P(return_value) < 0) {
276   - efree(Z_STRVAL_P(return_value));
277   - php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not read valid bz2 data from stream");
278   - RETURN_FALSE;
279   - }
280   -
281   - Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0;
282   -
283   - if (PG(magic_quotes_runtime)) {
284   - Z_STRVAL_P(return_value) = php_addslashes( Z_STRVAL_P(return_value),
285   - Z_STRLEN_P(return_value),
286   - &Z_STRLEN_P(return_value), 1 TSRMLS_CC);
287   - }
288   -
289   - Z_TYPE_P(return_value) = IS_STRING;
290   -}
291   -/* }}} */
292   -
293   -/* {{{ proto resource bzopen(string|int file|fp, string mode)
294   - Opens a new BZip2 stream */
295   -PHP_FUNCTION(bzopen)
296   -{
297   - zval **file, /* The file to open */
298   - **mode; /* The mode to open the stream with */
299   - BZFILE *bz; /* The compressed file stream */
300   - php_stream *stream = NULL;
301   -
302   - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &file, &mode) == FAILURE) {
303   - WRONG_PARAM_COUNT;
304   - }
305   - convert_to_string_ex(mode);
306   -
307   - /* If it's not a resource its a string containing the filename to open */
308   - if (Z_TYPE_PP(file) != IS_RESOURCE) {
309   - convert_to_string_ex(file);
310   - stream = php_stream_bz2open(NULL,
311   - Z_STRVAL_PP(file),
312   - Z_STRVAL_PP(mode),
313   - ENFORCE_SAFE_MODE | REPORT_ERRORS,
314   - NULL);
315   - } else {
316   - /* If it is a resource, than its a stream resource */
317   - int fd;
318   -
319   - php_stream_from_zval(stream, file);
320   -
321   - if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void *) &fd, REPORT_ERRORS)) {
322   - RETURN_FALSE;
323   - }
324   -
325   - bz = BZ2_bzdopen(fd, Z_STRVAL_PP(mode));
326   -
327   - stream = php_stream_bz2open_from_BZFILE(bz, Z_STRVAL_PP(mode), stream);
328   - }
329   -
330   - if (stream) {
331   - php_stream_to_zval(stream, return_value);
332   - } else {
333   - RETURN_FALSE;
334   - }
335   -}
336   -/* }}} */
337   -
338   -/* {{{ proto int bzerrno(resource bz)
339   - Returns the error number */
340   -PHP_FUNCTION(bzerrno)
341   -{
342   - php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRNO);
343   -}
344   -/* }}} */
345   -
346   -/* {{{ proto string bzerrstr(resource bz)
347   - Returns the error string */
348   -PHP_FUNCTION(bzerrstr)
349   -{
350   - php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRSTR);
351   -}
352   -/* }}} */
353   -
354   -/* {{{ proto array bzerror(resource bz)
355   - Returns the error number and error string in an associative array */
356   -PHP_FUNCTION(bzerror)
357   -{
358   - php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRBOTH);
359   -}
360   -/* }}} */
361   -
362   -/* {{{ proto string bzcompress(string source [, int blocksize100k [, int workfactor]])
363   - Compresses a string into BZip2 encoded data */
364   -PHP_FUNCTION(bzcompress)
365   -{
366   - zval **source, /* Source data to compress */
367   - **zblock_size, /* Optional block size to use */
368   - **zwork_factor; /* Optional work factor to use */
369   - char *dest = NULL; /* Destination to place the compressed data into */
370   - int error, /* Error Container */
371   - block_size = 4, /* Block size for compression algorithm */
372   - work_factor = 0, /* Work factor for compression algorithm */
373   - argc; /* Argument count */
374   - unsigned int source_len, /* Length of the source data */
375   - dest_len; /* Length of the destination buffer */
376   -
377   - argc = ZEND_NUM_ARGS();
378   -
379   - if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &source, &zblock_size, &zwork_factor) == FAILURE) {
380   - WRONG_PARAM_COUNT;
381   - }
382   -
383   - convert_to_string_ex(source);
384   -
385   - /* Assign them to easy to use variables, dest_len is initially the length of the data
386   - + .01 x length of data + 600 which is the largest size the results of the compression
387   - could possibly be, at least that's what the libbz2 docs say (thanks to jeremy@nirvani.net
388   - for pointing this out). */
389   - source_len = Z_STRLEN_PP(source);
390   - dest_len = Z_STRLEN_PP(source) + (0.01 * Z_STRLEN_PP(source)) + 600;
391   -
392   - /* Allocate the destination buffer */
393   - dest = emalloc(dest_len + 1);
394   -
395   - /* Handle the optional arguments */
396   - if (argc > 1) {
397   - convert_to_long_ex(zblock_size);
398   - block_size = Z_LVAL_PP(zblock_size);
399   - }
400   -
401   - if (argc > 2) {
402   - convert_to_long_ex(zwork_factor);
403   - work_factor = Z_LVAL_PP(zwork_factor);
404   - }
405   -
406   - error = BZ2_bzBuffToBuffCompress(dest, &dest_len, Z_STRVAL_PP(source), source_len, block_size, 0, work_factor);
407   - if (error != BZ_OK) {
408   - efree(dest);
409   - RETURN_LONG(error);
410   - } else {
411   - /* Copy the buffer, we have perhaps allocate alot more than we need,
412   - so we erealloc() the buffer to the proper size */
413   - dest = erealloc(dest, dest_len + 1);
414   - dest[dest_len] = 0;
415   - RETURN_STRINGL(dest, dest_len, 0);
416   - }
417   -}
418   -/* }}} */
419   -
420   -/* {{{ proto string bzdecompress(string source [, int small])
421   - Decompresses BZip2 compressed data */
422   -PHP_FUNCTION(bzdecompress)
423   -{
424   - zval **source, /* Source data to decompress */
425   - **zsmall; /* (Optional) user specified small */
426   - char *dest; /* Destination buffer, initially allocated */
427   - int error, /* Error container */
428   - iter = 1, /* Iteration count for the compression loop */
429   - size, /* Current size to realloc the dest buffer to */
430   - dest_len = PHP_BZ_DECOMPRESS_SIZE, /* Size of the destination length */
431   - small = 0, /* The actual small */
432   - argc = ZEND_NUM_ARGS(); /* Argument count */
433   -
434   - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &source, &zsmall) == FAILURE) {
435   - WRONG_PARAM_COUNT;
436   - }
437   -
438   - convert_to_string_ex(source);
439   -
440   - /* optional small argument handling */
441   - if (argc > 1) {
442   - convert_to_long_ex(zsmall);
443   - small = Z_LVAL_PP(zsmall);
444   - }
445   -
446   - /* Depending on the size of the source buffer, either allocate
447   - the length of the source buffer or the a default decompression
448   - size */
449   - dest = emalloc(PHP_BZ_DECOMPRESS_SIZE > Z_STRLEN_PP(source) ? PHP_BZ_DECOMPRESS_SIZE : Z_STRLEN_PP(source));
450   -
451   - /* (de)Compression Loop */
452   - do {
453   - /* Handle the (re)allocation of the buffer */
454   - size = dest_len * iter;
455   - if (iter > 1) {
456   - dest = erealloc(dest, size);
457   - }
458   - ++iter;
459   -
460   - /* Perform the decompression */
461   - error = BZ2_bzBuffToBuffDecompress(dest, &size, Z_STRVAL_PP(source), Z_STRLEN_PP(source), small, 0);
462   - } while (error == BZ_OUTBUFF_FULL);
463   -
464   - if (error != BZ_OK) {
465   - efree(dest);
466   - RETURN_LONG(error);
467   - } else {
468   - /* we might have allocated a little to much, so erealloc the buffer
469   - down to size, before returning it */
470   - dest = erealloc(dest, size + 1);
471   - dest[size] = 0;
472   - RETURN_STRINGL(dest, size, 0);
473   - }
474   -}
475   -/* }}} */
476   -
477   -/* {{{ php_bz2_error()
478   - The central error handling interface, does the work for bzerrno, bzerrstr and bzerror */
479   -static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt)
480   -{
481   - zval **bzp; /* BZip2 Resource Pointer */
482   - php_stream *stream;
483   - const char *errstr; /* Error string */
484   - int errnum; /* Error number */
485   - struct php_bz2_stream_data_t *self;
486   -
487   - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &bzp) == FAILURE) {
488   - WRONG_PARAM_COUNT;
489   - }
490   -
491   - php_stream_from_zval(stream, bzp);
492   -
493   - if (!php_stream_is(stream, PHP_STREAM_IS_BZIP2)) {
494   - RETURN_FALSE;
495   - }
496   -
497   - self = (struct php_bz2_stream_data_t *) stream->abstract;
498   -
499   - /* Fetch the error information */
500   - errstr = BZ2_bzerror(self->bz_file, &errnum);
501   -
502   - /* Determine what to return */
503   - switch (opt) {
504   - case PHP_BZ_ERRNO:
505   - RETURN_LONG(errnum);
506   - break;
507   - case PHP_BZ_ERRSTR:
508   - RETURN_STRING((char*)errstr, 1);
509   - break;
510   - case PHP_BZ_ERRBOTH:
511   - array_init(return_value);
512   -
513   - add_assoc_long (return_value, "errno", errnum);
514   - add_assoc_string(return_value, "errstr", (char*)errstr, 1);
515   - break;
516   - }
517   -}
518   -/* }}} */
519   -
520   -#endif
521   -
522   -/*
523   - * Local variables:
524   - * tab-width: 4
525   - * c-basic-offset: 4
526   - * End:
527   - * vim600: fdm=marker
528   - * vim: noet sw=4 ts=4
529   - */
108 ext/bz2/bz2.dsp
... ... @@ -1,108 +0,0 @@
1   -# Microsoft Developer Studio Project File - Name="bz2" - Package Owner=<4>
2   -# Microsoft Developer Studio Generated Build File, Format Version 6.00
3   -# ** DO NOT EDIT **
4   -
5   -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
6   -
7   -CFG=bz2 - Win32 Debug_TS
8   -!MESSAGE This is not a valid makefile. To build this project using NMAKE,
9   -!MESSAGE use the Export Makefile command and run
10   -!MESSAGE
11   -!MESSAGE NMAKE /f "bz2.mak".
12   -!MESSAGE
13   -!MESSAGE You can specify a configuration when running NMAKE
14   -!MESSAGE by defining the macro CFG on the command line. For example:
15   -!MESSAGE
16   -!MESSAGE NMAKE /f "bz2.mak" CFG="bz2 - Win32 Debug_TS"
17   -!MESSAGE
18   -!MESSAGE Possible choices for configuration are:
19   -!MESSAGE
20   -!MESSAGE "bz2 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
21   -!MESSAGE "bz2 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
22   -!MESSAGE
23   -
24   -# Begin Project
25   -# PROP AllowPerConfigDependencies 0
26   -# PROP Scc_ProjName ""
27   -# PROP Scc_LocalPath ""
28   -CPP=cl.exe
29   -MTL=midl.exe
30   -RSC=rc.exe
31   -
32   -!IF "$(CFG)" == "bz2 - Win32 Release_TS"
33   -
34   -# PROP BASE Use_MFC 0
35   -# PROP BASE Use_Debug_Libraries 0
36   -# PROP BASE Output_Dir "Release_TS"
37   -# PROP BASE Intermediate_Dir "Release_TS"
38   -# PROP BASE Ignore_Export_Lib 0
39   -# PROP BASE Target_Dir ""
40   -# PROP Use_MFC 0
41   -# PROP Use_Debug_Libraries 0
42   -# PROP Output_Dir "Release_TS"
43   -# PROP Intermediate_Dir "Release_TS"
44   -# PROP Ignore_Export_Lib 0
45   -# PROP Target_Dir ""
46   -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /c
47   -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /FR /YX /FD /c
48   -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
49   -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
50   -# ADD BASE RSC /l 0x407 /d "NDEBUG"
51   -# ADD RSC /l 0x407 /d "NDEBUG"
52   -BSC32=bscmake.exe
53   -# ADD BASE BSC32 /nologo
54   -# ADD BSC32 /nologo
55   -LINK32=link.exe
56   -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
57   -# ADD LINK32 libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_bz2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release"
58   -
59   -!ELSEIF "$(CFG)" == "bz2 - Win32 Debug_TS"
60   -
61   -# PROP BASE Use_MFC 0
62   -# PROP BASE Use_Debug_Libraries 1
63   -# PROP BASE Output_Dir "Debug_TS"
64   -# PROP BASE Intermediate_Dir "Debug_TS"
65   -# PROP BASE Target_Dir ""
66   -# PROP Use_MFC 0
67   -# PROP Use_Debug_Libraries 1
68   -# PROP Output_Dir "Debug_TS"
69   -# PROP Intermediate_Dir "Debug_TS"
70   -# PROP Ignore_Export_Lib 0
71   -# PROP Target_Dir ""
72   -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /GZ /c
73   -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /YX /FD /GZ /c
74   -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
75   -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
76   -# ADD BASE RSC /l 0x407 /d "_DEBUG"
77   -# ADD RSC /l 0x407 /d "_DEBUG"
78   -BSC32=bscmake.exe
79   -# ADD BASE BSC32 /nologo
80   -# ADD BSC32 /nologo
81   -LINK32=link.exe
82   -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
83   -# ADD LINK32 php4ts_debug.lib libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_bz2.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release"
84   -
85   -!ENDIF
86   -
87   -# Begin Target
88   -
89   -# Name "bz2 - Win32 Release_TS"
90   -# Name "bz2 - Win32 Debug_TS"
91   -# Begin Group "Source Files"
92   -
93   -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
94   -# Begin Source File
95   -
96   -SOURCE=.\bz2.c
97   -# End Source File
98   -# End Group
99   -# Begin Group "Header Files"
100   -
101   -# PROP Default_Filter "h;hpp;hxx;hm;inl"
102   -# Begin Source File
103   -
104   -SOURCE=.\php_bz2.h
105   -# End Source File
106   -# End Group
107   -# End Target
108   -# End Project
33 ext/bz2/config.m4
... ... @@ -1,33 +0,0 @@
1   -dnl
2   -dnl $Id$
3   -dnl
4   -
5   -PHP_ARG_WITH(bz2, for BZip2 support,
6   -[ --with-bz2[=DIR] Include BZip2 support])
7   -
8   -if test "$PHP_BZ2" != "no"; then
9   - if test -r $PHP_BZ2/include/bzlib.h; then
10   - BZIP_DIR=$PHP_BZ2
11   - else
12   - AC_MSG_CHECKING(for BZip2 in default path)
13   - for i in /usr/local /usr; do
14   - if test -r $i/include/bzlib.h; then
15   - BZIP_DIR=$i
16   - AC_MSG_RESULT(found in $i)
17   - fi
18   - done
19   - fi
20   -
21   - if test -z "$BZIP_DIR"; then
22   - AC_MSG_RESULT(not found)
23   - AC_MSG_ERROR(Please reinstall the BZip2 distribution)
24   - fi
25   -
26   - PHP_ADD_INCLUDE($BZIP_DIR/include)
27   -
28   - PHP_SUBST(BZ2_SHARED_LIBADD)
29   - PHP_ADD_LIBRARY_WITH_PATH(bz2, $BZIP_DIR/lib, BZ2_SHARED_LIBADD)
30   - AC_CHECK_LIB(bz2, BZ2_bzerror, [AC_DEFINE(HAVE_BZ2,1,[ ])], [AC_MSG_ERROR(bz2 module requires libbz2 >= 1.0.0)],)
31   -
32   - PHP_NEW_EXTENSION(bz2, bz2.c, $ext_shared)
33   -fi
35 ext/bz2/package.xml
... ... @@ -1,35 +0,0 @@
1   -<?xml version="1.0" encoding="ISO-8859-1" ?>
2   -<!-- do not use the "Type" attribute here, that one is only for
3   - generated package.xml files -->
4   -<package>
5   - <name>bz2</name>
6   - <summary>A Bzip2 management extension</summary>
7   - <description>
8   -Bz2 is an extension to create and parse bzip2 compressed data.
9   - </description>
10   - <license>PHP License</license>
11   - <maintainers>
12   - <maintainer>
13   - <user>sterling</user>
14   - <name>Sterling Hughes</name>
15   - <email>sterling@php.net</email>
16   - </maintainer>
17   - </maintainers>
18   - <release>
19   - <version>1.0</version>
20   - <date>2003-05-17</date>
21   - <state>stable</state>
22   - <notes>
23   - Initial Release in PECL
24   - </notes>
25   - </release>
26   - <filelist>
27   - <dir role="src" name="/">
28   - <file role="doc">CREDITS</file>
29   - <file role="src">config.m4</file>
30   - <file role="doc">php_bz2.h</file>
31   - <file role="src">bz2.c</file>
32   - <file role="src">bz2.dsp</file>
33   - </dir>
34   - </filelist>
35   -</package>
72 ext/bz2/php_bz2.h
... ... @@ -1,72 +0,0 @@
1   -/*
2   - +----------------------------------------------------------------------+
3   - | PHP Version 4 |
4   - +----------------------------------------------------------------------+
5   - | Copyright (c) 1997-2003 The PHP Group |
6   - +----------------------------------------------------------------------+
7   - | This source file is subject to version 2.02 of the PHP license, |
8   - | that is bundled with this package in the file LICENSE, and is |
9   - | available at through the world-wide-web at |
10   - | http://www.php.net/license/2_02.txt. |
11   - | If you did not receive a copy of the PHP license and are unable to |
12   - | obtain it through the world-wide-web, please send a note to |
13   - | license@php.net so we can mail you a copy immediately. |
14   - +----------------------------------------------------------------------+
15   - | Author: Sterling Hughes <sterling@php.net> |
16   - +----------------------------------------------------------------------+
17   - */
18   -
19   -#ifndef PHP_BZ2_H
20   -#define PHP_BZ2_H
21   -
22   -#if HAVE_BZ2
23   -
24   -extern zend_module_entry bz2_module_entry;
25   -#define phpext_bz2_ptr &bz2_module_entry
26   -
27   -/* Bzip2 includes */
28   -#include <bzlib.h>
29   -
30   -PHP_MINIT_FUNCTION(bz2);
31   -PHP_MSHUTDOWN_FUNCTION(bz2);
32   -PHP_MINFO_FUNCTION(bz2);
33   -PHP_FUNCTION(bzopen);
34   -PHP_FUNCTION(bzread);
35   -PHP_FUNCTION(bzerrno);
36   -PHP_FUNCTION(bzerrstr);
37   -PHP_FUNCTION(bzerror);
38   -PHP_FUNCTION(bzcompress);
39   -PHP_FUNCTION(bzdecompress);
40   -
41   -#else
42   -#define phpext_bz2_ptr NULL
43   -#endif
44   -
45   -#ifdef PHP_WIN32
46   -# ifdef PHP_BZ2_EXPORTS
47   -# define PHP_BZ2_API __declspec(dllexport)
48   -# else
49   -# define PHP_BZ2_API __declspec(dllimport)
50   -# endif
51   -#else
52   -# define PHP_BZ2_API
53   -#endif
54   -
55   -PHP_BZ2_API PHPAPI php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
56   -PHP_BZ2_API PHPAPI php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC);
57   -
58   -#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC)
59   -#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC)
60   -
61   -php_stream_ops php_stream_bz2io_ops;
62   -#define PHP_STREAM_IS_BZIP2 &php_stream_bz2io_ops
63   -
64   -#endif
65   -
66   -
67   -/*
68   - * Local variables:
69   - * tab-width: 4
70   - * c-basic-offset: 4
71   - * End:
72   - */
25 ext/bz2/tests/with_files.phpt
... ... @@ -1,25 +0,0 @@
1   ---TEST--
2   -BZ2 with files
3   ---SKIPIF--
4   -<?php if (!extension_loaded("bz2")) print "skip"; ?>
5   ---POST--
6   ---GET--
7   ---FILE--
8   -<?php // $Id$
9   -
10   -error_reporting(E_ALL);
11   -
12   -$filename = "testfile.bz2";
13   -$str = "This is a test string.\n";
14   -$bz = bzopen($filename, "w");
15   -bzwrite($bz, $str);
16   -bzclose($bz);
17   -
18   -$bz = bzopen($filename, "r");
19   -print bzread($bz, 10);
20   -print bzread($bz);
21   -bzclose($bz);
22   -unlink($filename);
23   -
24   ---EXPECT--
25   -This is a test string.
29 ext/bz2/tests/with_strings.phpt
... ... @@ -1,29 +0,0 @@
1   ---TEST--
2   -BZ2 with strings
3   ---SKIPIF--
4   -<?php if (!extension_loaded("bz2")) print "skip"; ?>
5   ---POST--
6   ---GET--
7   ---FILE--
8   -<?php // $Id$
9   -
10   -error_reporting(E_ALL);
11   -
12   -# This FAILS
13   -$blaat = <<<HEREDOC
14   -This is some random data
15   -HEREDOC;
16   -
17   -# This Works: (so, is heredoc related)
18   -#$blaat= 'This is some random data';
19   -
20   -$blaat2 = bzdecompress(bzcompress($blaat));
21   -
22   -$tests = <<<TESTS
23   - \$blaat === \$blaat2
24   -TESTS;
25   -
26   - include('tests/quicktester.inc');
27   -
28   ---EXPECT--
29   -OK
2  ext/sqlite/CREDITS
... ... @@ -1,2 +0,0 @@
1   -sqlite
2   -Wez Furlong, Tal Peer, Marcus B�rger
14 ext/sqlite/README
... ... @@ -1,14 +0,0 @@
1   -This is an extension for the SQLite Embeddable SQL Database Engine.
2   -http://www.sqlite.org/
3   -
4   -SQLite is a C library that implements an embeddable SQL database engine.
5   -Programs that link with the SQLite library can have SQL database access
6   -without running a separate RDBMS process.
7   -
8   -SQLite is not a client library used to connect to a big database server.
9   -SQLite is the server. The SQLite library reads and writes directly to and from
10   -the database files on disk
11   -
12   -
13   -
14   -vim:tw=78:et
22 ext/sqlite/TODO
... ... @@ -1,22 +0,0 @@
1   -- Transparent binary encoding of return values from PHP callback functions.
2   -
3   -- Add user-space callback for the authorizer function (this is potentially
4   - very slow, so it needs to be implemented carefully).
5   -
6   -- Add user-space callback to handle busy databases.
7   -
8   -- Test-suite
9   -
10   - o Test how robust we are when a user-space function is registered as
11   - a callback for a persistent connection in script A, then script B is
12   - called that doesn't register the callback but does make use of the
13   - function in an SQL query.
14   - --> Our test suite doesn't allow us to test persistent connections
15   - at this time :/
16   -
17   -- If building a ZTS build, -DTHREADSAFE while compiling libsqlite
18   -
19   -- If building a non-debug build, -DNDEBUG will disable the expensive
20   - asserts in the inner loop. (and double performance)
21   -
22   -vim:tw=78
37 ext/sqlite/libsqlite/README
... ... @@ -1,37 +0,0 @@
1   -This directory contains source code to
2   -
3   - SQLite: An Embeddable SQL Database Engine
4   -
5   -To compile the project, first create a directory in which to place
6   -the build products. It is recommended, but not required, that the
7   -build directory be separate from the source directory. Cd into the
8   -build directory and then from the build directory run the configure
9   -script found at the root of the source tree. Then run "make".
10   -
11   -For example:
12   -
13   - tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite"
14   - mkdir bld ;# Build will occur in a sibling directory
15   - cd bld ;# Change to the build directory
16   - ../sqlite/configure ;# Run the configure script
17   - make ;# Run the makefile.
18   -
19   -The configure script uses autoconf 2.50 and libtool. If the configure
20   -script does not work out for you, there is a generic makefile named
21   -"Makefile.linux-gcc" in the top directory of the source tree that you
22   -can copy and edit to suite your needs. Comments on the generic makefile
23   -show what changes are needed.
24   -
25   -The linux binaries on the website are created using the generic makefile,
26   -not the configure script. The configure script is unmaintained. (You
27   -can volunteer to take over maintenance of the configure script, if you want!)
28   -The windows binaries on the website are created using MinGW32 configured
29   -as a cross-compiler running under Linux. For details, see the ./publish.sh
30   -script at the top-level of the source tree.
31   -
32   -Contacts:
33   -
34   - http://www.sqlite.org/
35   - http://www.hwaci.com/sw/sqlite/
36   - http://groups.yahoo.com/group/sqlite/
37   - drh@hwaci.com
8 ext/sqlite/libsqlite/src/sqlite_config.w32.h
... ... @@ -1,8 +0,0 @@
1   -#include "config.w32.h"
2   -#if ZTS
3   -# define THREADSAFE 1
4   -#endif
5   -#if !ZEND_DEBUG && !defined(NDEBUG)
6   -# define NDEBUG
7   -#endif
8   -#define SQLITE_PTR_SZ 4
33 ext/sqlite/sqlite.php
... ... @@ -1,33 +0,0 @@
1   -<?php
2   -if (!extension_loaded("sqlite")) {
3   - dl("sqlite.so");
4   -}
5   -
6   -debug_zval_dump(sqlite_libversion());
7   -debug_zval_dump(sqlite_libencoding());
8   -
9   -$s = sqlite_open("weztest.sqlite", 0666, $err);
10   -
11   -debug_zval_dump($err);
12   -debug_zval_dump($s);
13   -
14   -$r = sqlite_query("create table foo (a INTEGER PRIMARY KEY, b INTEGER )", $s);
15   -debug_zval_dump(sqlite_last_error($s));
16   -debug_zval_dump(sqlite_error_string(sqlite_last_error($s)));
17   -
18   -$r = sqlite_query("select *, php('md5', sql) as o from sqlite_master", $s);
19   -debug_zval_dump($r);
20   -debug_zval_dump(sqlite_num_rows($r));
21   -debug_zval_dump(sqlite_num_fields($r));
22   -
23   -for ($j = 0; $j < sqlite_num_fields($r); $j++) {
24   - echo "Field $j is " . sqlite_field_name($r, $j) . "\n";
25   -}
26   -
27   -while ($row = sqlite_fetch_array($r, SQLITE_ASSOC)) {
28   - print_r($row);
29   -}
30   -
31   -sqlite_close($s);
32   -
33   -?>
11 ext/sqlite/tests/blankdb.inc
... ... @@ -1,11 +0,0 @@
1   -<?php #vim:ft=php
2   -$dbname = tempnam(dirname(__FILE__), "phpsql");
3   -function cleanup() {
4   - if ($GLOBALS['db']) {
5   - sqlite_close($GLOBALS['db']);
6   - }
7   - unlink($GLOBALS['dbname']);
8   -}
9   -register_shutdown_function("cleanup");
10   -$db = sqlite_open($dbname);
11   -?>
17 ext/sqlite/tests/sqlite_001.phpt
... ... @@ -1,17 +0,0 @@
1   ---TEST--
2   -sqlite: sqlite_open/close
3   ---INI--
4   -sqlite.assoc_case=0
5   ---SKIPIF--
6   -<?php if (!extension_loaded("sqlite")) print "skip"; ?>
7   ---FILE--
8   -<?php
9   -require_once('blankdb.inc');
10   -echo "$db\n";
11   -sqlite_close($db);
12   -$db = NULL;
13   -echo "Done\n";
14   -?>
15   ---EXPECTF--
16   -Resource id #%d
17   -Done
31 ext/sqlite/tests/sqlite_002.phpt
... ... @@ -1,31 +0,0 @@
1   ---TEST--
2   -sqlite: Simple insert/select
3   ---INI--
4   -sqlite.assoc_case=0
5   ---SKIPIF--
6   -<?php # vim:ft=php
7   -if (!extension_loaded("sqlite")) print "skip"; ?>
8   ---FILE--
9   -<?php
10   -include "blankdb.inc";
11   -
12   -sqlite_query("CREATE TABLE foo(c1 date, c2 time, c3 varchar(64))", $db);
13   -sqlite_query("INSERT INTO foo VALUES ('2002-01-02', '12:49:00', NULL)", $db);
14   -$r = sqlite_query("SELECT * from foo", $db);
15   -var_dump(sqlite_fetch_array($r));
16   -?>
17   ---EXPECT--
18   -array(6) {
19   - [0]=>
20   - string(10) "2002-01-02"
21   - ["c1"]=>
22   - string(10) "2002-01-02"
23   - [1]=>
24   - string(8) "12:49:00"
25   - ["c2"]=>
26   - string(8) "12:49:00"
27   - [2]=>
28   - NULL
29   - ["c3"]=>
30   - NULL
31   -}
51 ext/sqlite/tests/sqlite_003.phpt
... ... @@ -1,51 +0,0 @@
1   ---TEST--
2   -sqlite: Simple insert/select, different result represenatation
3   ---INI--
4   -sqlite.assoc_case=0
5   ---SKIPIF--
6   -<?php
7   -if (!extension_loaded("sqlite")) print "skip"; ?>
8   ---FILE--
9   -<?php
10   -include "blankdb.inc";
11   -
12   -sqlite_query("CREATE TABLE foo(c1 date, c2 time, c3 varchar(64))", $db);
13   -sqlite_query("INSERT INTO foo VALUES ('2002-01-02', '12:49:00', NULL)", $db);
14   -$r = sqlite_query("SELECT * from foo", $db);
15   -var_dump(sqlite_fetch_array($r, SQLITE_BOTH));
16   -$r = sqlite_query("SELECT * from foo", $db);
17   -var_dump(sqlite_fetch_array($r, SQLITE_NUM));
18   -$r = sqlite_query("SELECT * from foo", $db);
19   -var_dump(sqlite_fetch_array($r, SQLITE_ASSOC));
20   -?>
21   ---EXPECT--
22   -array(6) {
23   - [0]=>
24   - string(10) "2002-01-02"
25   - ["c1"]=>
26   - string(10) "2002-01-02"
27   - [1]=>
28   - string(8) "12:49:00"
29   - ["c2"]=>
30   - string(8) "12:49:00"
31   - [2]=>
32   - NULL
33   - ["c3"]=>
34   - NULL
35   -}
36   -array(3) {
37   - [0]=>
38   - string(10) "2002-01-02"
39   - [1]=>
40   - string(8) "12:49:00"
41   - [2]=>
42   - NULL
43   -}
44   -array(3) {
45   - ["c1"]=>
46   - string(10) "2002-01-02"
47   - ["c2"]=>
48   - string(8) "12:49:00"
49   - ["c3"]=>
50   - NULL
51   -}
46 ext/sqlite/tests/sqlite_004.phpt
... ... @@ -1,46 +0,0 @@
1   ---TEST--
2   -sqlite: binary encoding
3   ---INI--
4   -sqlite.assoc_case=0
5   ---SKIPIF--
6   -<?php # vim:ft=php
7   -if (!extension_loaded("sqlite")) print "skip"; ?>
8   ---FILE--
9   -<?php
10   -include "blankdb.inc";
11   -
12   -$strings = array(
13   - "hello",
14   - "hello\x01o",
15   - "\x01hello there",
16   - "hello\x00there",
17   - ""
18   -);
19   -
20   -sqlite_query("CREATE TABLE strings(a)", $db);
21   -
22   -foreach ($strings as $str) {
23   - sqlite_query("INSERT INTO strings VALUES('" . sqlite_escape_string($str) . "')", $db);
24   -}
25   -
26   -$i = 0;
27   -$r = sqlite_query("SELECT * from strings", $db);
28   -while ($row = sqlite_fetch_array($r, SQLITE_NUM)) {
29   - if ($row[0] !== $strings[$i]) {
30   - echo "FAIL!\n";
31   - var_dump($row[0]);
32   - var_dump($strings[$i]);
33   - } else {
34   - echo "OK!\n";
35   - }
36   - $i++;
37   -}
38   -echo "DONE!\n";
39   -?>
40   ---EXPECT--
41   -OK!
42   -OK!
43   -OK!
44   -OK!
45   -OK!
46   -DONE!
47 ext/sqlite/tests/sqlite_005.phpt
... ... @@ -1,47 +0,0 @@
1   ---TEST--
2   -sqlite: aggregate functions
3   ---INI--
4   -sqlite.assoc_case=0
5   ---SKIPIF--
6   -<?php # vim:ft=php
7   -if (!extension_loaded("sqlite")) print "skip"; ?>
8   ---FILE--
9   -<?php
10   -include "blankdb.inc";
11   -
12   -$data = array(
13   - "one",
14   - "two",
15   - "three"
16   - );
17   -
18   -sqlite_query("CREATE TABLE strings(a)", $db);
19   -
20   -foreach ($data as $str) {
21   - sqlite_query("INSERT INTO strings VALUES('" . sqlite_escape_string($str) . "')", $db);
22   -}
23   -
24   -function cat_step(&$context, $string)
25   -{
26   - $context .= $string;
27   -}
28   -
29   -function cat_fin(&$context)
30   -{
31   - return $context;
32   -}
33   -
34   -sqlite_create_aggregate($db, "cat", "cat_step", "cat_fin");
35   -
36   -$r = sqlite_query("SELECT cat(a) from strings", $db);
37   -while ($row = sqlite_fetch_array($r, SQLITE_NUM)) {
38   - var_dump($row);
39   -}
40   -echo "DONE!\n";
41   -?>
42   ---EXPECT--
43   -array(1) {
44   - [0]=>
45   - string(11) "onetwothree"
46   -}
47   -DONE!
52 ext/sqlite/tests/sqlite_006.phpt
... ... @@ -1,52 +0,0 @@
1   ---TEST--
2   -sqlite: regular functions
3   ---INI--
4   -sqlite.assoc_case=0
5   ---SKIPIF--
6   -<?php # vim:ft=php
7   -if (!extension_loaded("sqlite")) print "skip"; ?>
8   ---FILE--
9   -<?php
10   -include "blankdb.inc";
11   -
12   -$data = array(
13   - array("one", "uno"),
14   - array("two", "dos"),
15   - array("three", "tres&