mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-08 17:50:50 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86185a59e9 |
No files matched your search
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 3.01
|
||||
Copyright (c) 1999 - 2010 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2006 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+18
-3
@@ -5,7 +5,24 @@
|
||||
|
||||
lcov: lcov-html
|
||||
|
||||
lcov-test: lcov-clean-data test
|
||||
lcov-test: all
|
||||
@echo "Running test suite"
|
||||
@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
|
||||
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
NO_INTERACTION=1 \
|
||||
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(PHP_EXECUTABLE) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php -d 'extension_dir=modules/' -d `( . $(PHP_MODULES) ; echo extension=$$dlname)` tests/; \
|
||||
elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
|
||||
NO_INTERACTION=1 \
|
||||
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php $(TESTS); \
|
||||
else \
|
||||
echo "ERROR: Cannot run tests without CLI sapi."; \
|
||||
fi
|
||||
|
||||
php_lcov.info: lcov-test
|
||||
@echo "Generating data for $@"
|
||||
@@ -57,5 +74,3 @@ lcov-clean:
|
||||
rm -rf lcov_data/
|
||||
rm -rf lcov_html/
|
||||
|
||||
lcov-clean-data:
|
||||
@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
|
||||
@@ -1,165 +1,5 @@
|
||||
PHP NEWS
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
09 Dec 2010, PHP 5.2.15
|
||||
- Fixed extract() to do not overwrite $GLOBALS and $this when using
|
||||
EXTR_OVERWRITE. (jorto at redhat dot com)
|
||||
- Fixed crash in zip extract method (possible CWE-170).
|
||||
(Maksymilian Arciemowicz, Pierre)
|
||||
- Fixed a possible double free in imap extension (Identified by Mateusz
|
||||
Kocielski). (CVE-2010-4150). (Ilia)
|
||||
- Fixed possible flaw in open_basedir (CVE-2010-3436). (Pierre)
|
||||
- Fixed possible crash in mssql_fetch_batch(). (Kalle)
|
||||
- Fixed NULL pointer dereference in ZipArchive::getArchiveComment.
|
||||
(CVE-2010-3709). (Maksymilian Arciemowicz)
|
||||
|
||||
- Fixed bug #53492 (fix crash if anti-aliasing steps are invalid). (Pierre)
|
||||
- Fixed bug #53323 (pdo_firebird getAttribute() crash).
|
||||
(preeves at ibphoenix dot com)
|
||||
- Fixed bug #52929 (Segfault in filter_var with FILTER_VALIDATE_EMAIL with
|
||||
large amount of data). (CVE-2010-3709). (Adam)
|
||||
- Fixed bug #52879 (Objects unreferenced in __get, __set, __isset or __unset
|
||||
can be freed too early). (mail_ben_schmidt at yahoo dot com dot au, Dmitry)
|
||||
- Fixed bug #52772 (var_dump() doesn't check for the existence of
|
||||
get_class_name before calling it). (Kalle, Gustavo)
|
||||
- Fixed bug #52546 (pdo_dblib segmentation fault when iterating MONEY values).
|
||||
(Felipe, Adam)
|
||||
- Fixed bug #52436 (Compile error if systems do not have stdint.h)
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #52390 (mysqli_report() should be per-request setting). (Kalle)
|
||||
- Fixed bug #51008 (Zend/tests/bug45877.phpt fails). (Dmitry)
|
||||
- Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4).
|
||||
(Felipe)
|
||||
- Fixed bug #44248 (RFC2616 transgression while HTTPS request through proxy
|
||||
with SoapClient object). (Dmitry)
|
||||
|
||||
22 Jul 2010, PHP 5.2.14
|
||||
- Reverted bug fix #49521 (PDO fetchObject sets values before calling
|
||||
constructor). (Felipe)
|
||||
|
||||
- Updated timezone database to version 2010.5. (Derick)
|
||||
- Upgraded bundled PCRE to version 8.02. (Ilia)
|
||||
|
||||
- Rewrote var_export() to use smart_str rather than output buffering, prevents
|
||||
data disclosure if a fatal error occurs (CVE-2010-2531). (Scott)
|
||||
- Fixed a possible interruption array leak in strrchr(). Reported by
|
||||
Péter Veres. (CVE-2010-2484) (Felipe)
|
||||
- Fixed a possible interruption array leak in strchr(), strstr(), substr(),
|
||||
chunk_split(), strtok(), addcslashes(), str_repeat(), trim(). (Felipe)
|
||||
- Fixed a possible memory corruption in substr_replace() (Dmitry)
|
||||
- Fixed SplObjectStorage unserialization problems (CVE-2010-2225). (Stas)
|
||||
- Fixed a possible stack exaustion inside fnmatch(). Reporeted by Stefan
|
||||
Esser (Ilia)
|
||||
- Reset error state in PDO::beginTransaction() reset error state. (Ilia)
|
||||
- Fixed a NULL pointer dereference when processing invalid XML-RPC
|
||||
requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert)
|
||||
- Fixed handling of session variable serialization on certain prefix
|
||||
characters. Reported by Stefan Esser (Ilia)
|
||||
- Fixed a possible arbitrary memory access inside sqlite extension. Reported
|
||||
by Mateusz Kocielski. (Ilia)
|
||||
- Fixed a crash when calling an inexistent method of a class that inherits
|
||||
PDOStatement if instantiated directly instead of doing by the PDO methods.
|
||||
(Felipe)
|
||||
|
||||
- Fixed bug #52944 (Invalid write on second and subsequent reads with an
|
||||
inflate filter fed invalid data). (Gustavo)
|
||||
- Fixed bug #52317 (Segmentation fault when using mail() on a rhel 4.x (only 64
|
||||
bit)). (Adam)
|
||||
- Fixed bug #52238 (Crash when an Exception occured in iterator_to_array).
|
||||
(Johannes)
|
||||
- Fixed bug #52237 (Crash when passing the reference of the property of a
|
||||
non-object). (Dmitry)
|
||||
- Fixed bug #52163 (SplFileObject::fgetss() fails due to parameter that can't
|
||||
be set). (Felipe)
|
||||
- Fixed bug #52162 (custom request header variables with numbers are removed).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #52160 (Invalid E_STRICT redefined constructor error). (Felipe)
|
||||
- Fixed bug #52061 (memory_limit above 2G). (Felipe)
|
||||
- Fixed bug #52041 (Memory leak when writing on uninitialized variable returned
|
||||
from function). (Dmitry)
|
||||
- Fixed bug #52037 (Concurrent builds fail in install-programs). (seanius at
|
||||
debian dot org, Kalle)
|
||||
- Fixed bug #52019 (make lcov doesn't support TESTS variable anymore). (Patrick)
|
||||
- Fixed bug #52010 (open_basedir restrictions mismatch on vacuum command).
|
||||
(Ilia, Felipe)
|
||||
- Fixed bug #51943 (AIX: Several files are out of ANSI spec). (Kalle,
|
||||
coreystup at gmail dot com)
|
||||
- Fixed bug #51911 (ReflectionParameter::getDefaultValue() memory leaks with
|
||||
constant array). (Felipe)
|
||||
- Fixed bug #51905 (ReflectionParameter fails if default value is an array
|
||||
with an access to self::). (Felipe)
|
||||
- Fixed bug #51822 (Segfault with strange __destruct() for static class
|
||||
variables). (Dmitry)
|
||||
- Fixed bug #51671 (imagefill does not work correctly for small images).
|
||||
(Pierre)
|
||||
- Fixed bug #51670 (getColumnMeta causes segfault when re-executing query
|
||||
after calling nextRowset). (Pierrick)
|
||||
- Fixed bug #51629 (CURLOPT_FOLLOWLOCATION error message is misleading).
|
||||
(Pierre)
|
||||
- Fixed bug #51617 (PDO PGSQL still broken against PostGreSQL < 7.4).
|
||||
(Felipe, wdierkes at 5dollarwhitebox dot org)
|
||||
- Fixed bug #51615 (PHP crash with wrong HTML in SimpleXML). (Felipe)
|
||||
- Fixed bug #51609 (pg_copy_to: Invalid results when using fourth parameter).
|
||||
(Felipe)
|
||||
- Fixed bug #51608 (pg_copy_to: WARNING: nonstandard use of \\ in a string
|
||||
literal). (cbandy at jbandy dot com)
|
||||
- Fixed bug #51607 (pg_copy_from does not allow schema in the tablename
|
||||
argument). (cbandy at jbandy dot com)
|
||||
- Fixed bug #51604 (newline in end of header is shown in start of message).
|
||||
(Daniel Egeberg)
|
||||
- Fixed bug #51562 (query timeout in mssql can not be changed per query).
|
||||
(ejsmont dot artur at gmail dot com)
|
||||
- Fixed bug #51552 (debug_backtrace() causes segmentation fault and/or memory
|
||||
issues). (Dmitry)
|
||||
- Fixed bug #51532 (Wrong prototype for SplFileObject::fscanf()). (Etienne)
|
||||
- Fixed bug #51445 (var_dump() invalid/slow *RECURSION* detection). (Felipe)
|
||||
- Fixed bug #51393 (DateTime::createFromFormat() fails if format string contains
|
||||
timezone). (Adam)
|
||||
- Fixed bug #51374 (Wrongly initialized object properties). (Etienne)
|
||||
- Fixed bug #51338 (URL-Rewriter is still enabled if use_only_cookies is
|
||||
on). (Ilia, j dot jeising at gmail dot com)
|
||||
- Fixed bug #51273 (Faultstring property does not exist when the faultstring is
|
||||
empty) (Ilia, dennis at transip dot nl)
|
||||
- Fixed bug #51269 (zlib.output_compression Overwrites Vary Header). (Adam)
|
||||
- Fixed bug #51263 (imagettftext and rotated text uses wrong baseline)
|
||||
(cschneid at cschneid dot com, Takeshi Abe)
|
||||
- Fixed bug #51237 (milter SAPI crash on startup). (igmar at palsenberg dot com)
|
||||
- Fixed bug #51213 (pdo_mssql is trimming value of the money column). (Ilia,
|
||||
alexr at oplot dot com)
|
||||
- Fixed bug #51192 (FILTER_VALIDATE_URL will invalidate a hostname that
|
||||
includes '-'). (Adam, solar at azrael dot ws).
|
||||
- Fixed bug #51190 (ftp_put() returns false when transfer was successful).
|
||||
(Ilia)
|
||||
- Fixed bug #51183 (ext/date/php_date.c fails to compile with Sun Studio).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #51171 (curl_setopt() doesn't output any errors or warnings when
|
||||
an invalid option is provided). (Ilia)
|
||||
- Fixed bug #51128 (imagefill() doesn't work with large images). (Pierre)
|
||||
- Fixed bug #51086 (DBA DB4 doesn't work with Berkeley DB 4.8). (Chris Jones)
|
||||
- Fixed bug #51062 (DBA DB4 uses mismatched headers and libraries). (Chris
|
||||
Jones)
|
||||
- Fixed bug #51023 (filter doesn't detect int overflows with GCC 4.4).
|
||||
(Raphael Geissert)
|
||||
- Fixed bug #50762 (in WSDL mode Soap Header handler function only being called
|
||||
if defined in WSDL). (mephius at gmail dot com)
|
||||
- Fixed bug #50698 (SoapClient should handle wsdls with some incompatiable
|
||||
endpoints). (Justin Dearing)
|
||||
- Fixed bug #50383 (Exceptions thrown in __call() / __callStatic() do not
|
||||
include file and line in trace). (Felipe)
|
||||
- Fixed bug #49730 (Firebird - new PDO() returns NULL). (Felipe)
|
||||
- Fixed bug #49723 (LimitIterator with empty SeekableIterator). (Etienne)
|
||||
- Fixed bug #49687 (utf8_decode vulnerabilities and deficiencies in the number
|
||||
of reported malformed sequences). (CVE-2010-3870) (Gustavo)
|
||||
- Fixed bug #49576 (FILTER_VALIDATE_EMAIL filter needs updating) (Rasmus)
|
||||
- Fixed bug #49320 (PDO returns null when SQLite connection fails). (Felipe)
|
||||
- Fixed bug #49267 (Linking fails for iconv). (Moriyosh)
|
||||
- Fixed bug #48601 (xpath() returns FALSE for legitimate query). (Rob)
|
||||
- Fixed bug #48289 (iconv_mime_encode() quoted-printable scheme is broken).
|
||||
(Adam, patch from hiroaki dot kawai at gmail dot com).
|
||||
- Fixed bug #43314 (iconv_mime_encode(), broken Q scheme). (Rasmus)
|
||||
- Fixed bug #33210 (getimagesize() fails to detect width/height on certain
|
||||
JPEGs). (Ilia)
|
||||
- Fixed bug #23229 (syslog() truncates messages). (Adam)
|
||||
|
||||
25 Feb 2010, PHP 5.2.13
|
||||
- Updated timezone database to version 2010.2. (Derick)
|
||||
- Upgraded bundled PCRE to version 7.9. (Ilia)
|
||||
|
||||
@@ -12,16 +12,30 @@ var_dump($a);
|
||||
$a->x0->y1 = "ok\n";
|
||||
echo $a->x0;
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#%d (1) {
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["x0"]=>
|
||||
&object(stdClass)#%d (3) {
|
||||
&object(stdClass)#2 (3) {
|
||||
["y0"]=>
|
||||
string(1) "b"
|
||||
["y1"]=>
|
||||
*RECURSION*
|
||||
&object(stdClass)#2 (3) {
|
||||
["y0"]=>
|
||||
string(1) "b"
|
||||
["y1"]=>
|
||||
*RECURSION*
|
||||
["y2"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
["y2"]=>
|
||||
*RECURSION*
|
||||
&object(stdClass)#2 (3) {
|
||||
["y0"]=>
|
||||
string(1) "b"
|
||||
["y1"]=>
|
||||
*RECURSION*
|
||||
["y2"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
ok
|
||||
@@ -30,9 +30,7 @@ if (defined("pass3")) {
|
||||
set_error_handler('errorHandler');
|
||||
define("pass2", 1);
|
||||
include(__FILE__);
|
||||
print "ok\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
--EXPECTF--
|
||||
Error: Redefining already defined constructor for class TestClass (%sbug35634.php:12)
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Bug #45877 (Array key '2147483647' left as string)
|
||||
--INI--
|
||||
precision=16
|
||||
precision=20
|
||||
--FILE--
|
||||
<?php
|
||||
$keys = array(PHP_INT_MAX,
|
||||
@@ -18,6 +18,6 @@ array(3) {
|
||||
int(1)
|
||||
[-%d8]=>
|
||||
int(1)
|
||||
["%s"]=>
|
||||
["%d8"]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
--TEST--
|
||||
Bug #50383 (Exceptions thrown in __call / __callStatic do not include file and line in trace)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class myClass {
|
||||
public function __call($method, $args) {
|
||||
throw new Exception("Missing method '$method'\n");
|
||||
}
|
||||
}
|
||||
|
||||
function thrower2() {
|
||||
$x = new myClass;
|
||||
$x->foo();
|
||||
}
|
||||
|
||||
try {
|
||||
thrower2();
|
||||
} catch (Exception $e) {
|
||||
print $e->getMessage();
|
||||
print_r($e->getTrace());
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Missing method 'foo'
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[file] => %s
|
||||
[line] => 11
|
||||
[function] => __call
|
||||
[class] => myClass
|
||||
[type] => ->
|
||||
[args] => Array
|
||||
(
|
||||
[0] => foo
|
||||
[1] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[file] => %s
|
||||
[line] => 11
|
||||
[function] => foo
|
||||
[class] => myClass
|
||||
[type] => ->
|
||||
[args] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[file] => %s
|
||||
[line] => 15
|
||||
[function] => thrower2
|
||||
[args] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Bug #51822 (Segfault with strange __destruct() for static class variables)
|
||||
--FILE--
|
||||
<?php
|
||||
class DestructableObject
|
||||
{
|
||||
public function __destruct()
|
||||
{
|
||||
echo "2\n";
|
||||
}
|
||||
}
|
||||
|
||||
class DestructorCreator
|
||||
{
|
||||
public function __destruct()
|
||||
{
|
||||
$this->test = new DestructableObject;
|
||||
echo "1\n";
|
||||
}
|
||||
}
|
||||
|
||||
class Test
|
||||
{
|
||||
public static $mystatic;
|
||||
}
|
||||
|
||||
// Uncomment this to avoid segfault
|
||||
//Test::$mystatic = new DestructorCreator();
|
||||
|
||||
$x = new Test();
|
||||
|
||||
if (!isset(Test::$mystatic))
|
||||
Test::$mystatic = new DestructorCreator();
|
||||
|
||||
echo "bla\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
bla
|
||||
1
|
||||
2
|
||||
@@ -1,50 +0,0 @@
|
||||
--TEST--
|
||||
Bug #52041 (Memory leak when writing on uninitialized variable returned from function)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo() {
|
||||
return $x;
|
||||
}
|
||||
|
||||
foo()->a = 1;
|
||||
foo()->a->b = 2;
|
||||
foo()->a++;
|
||||
foo()->a->b++;
|
||||
foo()->a += 2;
|
||||
foo()->a->b += 2;
|
||||
|
||||
//foo()[0] = 1;
|
||||
//foo()[0][0] = 2;
|
||||
//foo()[0]++;
|
||||
//foo()[0][0]++;
|
||||
//foo()[0] += 2;
|
||||
//foo()[0][0] += 2;
|
||||
var_dump(foo());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value in %sbug52041.php on line 6
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value in %sbug52041.php on line 7
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value in %sbug52041.php on line 8
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value in %sbug52041.php on line 9
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value in %sbug52041.php on line 10
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value in %sbug52041.php on line 11
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
NULL
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Bug #52160 (Invalid E_STRICT redefined constructor error)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class bar {
|
||||
function __construct() { }
|
||||
static function bar() {
|
||||
var_dump(1);
|
||||
}
|
||||
}
|
||||
|
||||
bar::bar();
|
||||
|
||||
class foo {
|
||||
static function foo() {
|
||||
var_dump(2);
|
||||
}
|
||||
function __construct() { }
|
||||
}
|
||||
|
||||
foo::foo();
|
||||
|
||||
class baz {
|
||||
static function baz() {
|
||||
var_dump(3);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Redefining already defined constructor for class foo in %s on line %d
|
||||
|
||||
Fatal error: Constructor baz::baz() cannot be static in %s on line %d
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #52237 (Crash when passing the reference of the property of a non-object)
|
||||
--FILE--
|
||||
<?php
|
||||
$data = 'test';
|
||||
preg_match('//', '', $data->info);
|
||||
var_dump($data);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(4) "test"
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #52879 (Objects unreferenced in __get, __set, __isset or __unset can be freed too early)
|
||||
--FILE--
|
||||
<?php
|
||||
class MyClass {
|
||||
public $myRef;
|
||||
public function __set($property,$value) {
|
||||
$this->myRef = $value;
|
||||
}
|
||||
}
|
||||
$myGlobal=new MyClass($myGlobal);
|
||||
$myGlobal->myRef=&$myGlobal;
|
||||
$myGlobal->myNonExistentProperty="ok\n";
|
||||
echo $myGlobal;
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,11 +1,5 @@
|
||||
--TEST--
|
||||
Testing declare statement with several type values
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (in_array("detect_unicode", array_keys(ini_get_all()))) {
|
||||
die("skip");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -14,5 +14,6 @@ class test {
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
Strict Standards: Redefining already defined constructor for class test in %s on line %d
|
||||
Done
|
||||
+1
-1
@@ -952,7 +952,7 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
|
||||
} else {
|
||||
ALLOC_HASHTABLE_REL(object->properties);
|
||||
zend_hash_init(object->properties, zend_hash_num_elements(&class_type->default_properties), NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(object->properties, &class_type->default_properties, zval_copy_property_ctor(class_type), (void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(object->properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
}
|
||||
} else {
|
||||
Z_OBJVAL_P(arg) = class_type->create_object(class_type TSRMLS_CC);
|
||||
|
||||
+1
-1
@@ -1090,7 +1090,7 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers,
|
||||
mm_heap->large_free_buckets[i]->parent = &mm_heap->large_free_buckets[i];
|
||||
}
|
||||
}
|
||||
mm_heap->rest_buckets[0] = mm_heap->rest_buckets[1] = ZEND_MM_REST_BUCKET(mm_heap);
|
||||
mm_heap->rest_buckets[0]->next_free_block = mm_heap->rest_buckets[1]->prev_free_block = ZEND_MM_REST_BUCKET(mm_heap);
|
||||
|
||||
free(heap);
|
||||
heap = mm_heap;
|
||||
|
||||
@@ -1148,7 +1148,7 @@ ZEND_FUNCTION(get_included_files)
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto void trigger_error(string message [, int error_type])
|
||||
/* {{{ proto void trigger_error(string messsage [, int error_type])
|
||||
Generates a user-level error/warning/notice message */
|
||||
ZEND_FUNCTION(trigger_error)
|
||||
{
|
||||
@@ -1987,9 +1987,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
|
||||
while (prev) {
|
||||
if (prev->function_state.function &&
|
||||
prev->function_state.function->common.type != ZEND_USER_FUNCTION &&
|
||||
!(prev->function_state.function->common.type == ZEND_INTERNAL_FUNCTION &&
|
||||
(prev->function_state.function->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER))) {
|
||||
prev->function_state.function->common.type != ZEND_USER_FUNCTION) {
|
||||
break;
|
||||
}
|
||||
if (prev->op_array) {
|
||||
|
||||
+7
-11
@@ -1175,7 +1175,9 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
/* Improve after RC: cache the lowercase class name */
|
||||
|
||||
if ((short_class_name_length == name_len) && (!memcmp(short_class_name, lcname, name_len))) {
|
||||
if (!CG(active_class_entry)->constructor) {
|
||||
if (CG(active_class_entry)->constructor) {
|
||||
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
|
||||
} else {
|
||||
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
|
||||
}
|
||||
} else if ((name_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) {
|
||||
@@ -2009,16 +2011,13 @@ static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_fu
|
||||
{
|
||||
zend_uint i;
|
||||
|
||||
/* If it's a user function then arg_info == NULL means we don't have any parameters but
|
||||
* we still need to do the arg number checks. We are only willing to ignore this for internal
|
||||
* functions because extensions don't always define arg_info.
|
||||
*/
|
||||
/* If it's a user function then arg_info == NULL means we don't have any parameters but we still need to do the arg number checks. We are only willing to ignore this for internal functions because extensions don't always define arg_info. */
|
||||
if (!proto || (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Checks for constructors only if they are declared in an interface */
|
||||
if ((fe->common.fn_flags & ZEND_ACC_CTOR) && (proto->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0) {
|
||||
if ((fe->common.fn_flags & ZEND_ACC_CTOR) && !(proto->common.scope->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2298,9 +2297,6 @@ static int inherit_static_prop(zval **p, int num_args, va_list args, zend_hash_k
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
|
||||
#define zval_property_ctor(parent_ce, ce) \
|
||||
((copy_ctor_func_t) (((parent_ce)->type != (ce)->type) ? zval_shared_property_ctor : zval_add_ref))
|
||||
|
||||
ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC)
|
||||
{
|
||||
if ((ce->ce_flags & ZEND_ACC_INTERFACE)
|
||||
@@ -2316,7 +2312,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
|
||||
zend_do_inherit_interfaces(ce, parent_ce TSRMLS_CC);
|
||||
|
||||
/* Inherit properties */
|
||||
zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, zval_property_ctor(parent_ce, ce), NULL, sizeof(zval *), 0);
|
||||
zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, (void (*)(void *)) zval_add_ref, NULL, sizeof(zval *), 0);
|
||||
if (parent_ce->type != ce->type) {
|
||||
/* User class extends internal class */
|
||||
zend_update_class_constants(parent_ce TSRMLS_CC);
|
||||
@@ -2326,7 +2322,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
|
||||
}
|
||||
zend_hash_merge_ex(&ce->properties_info, &parent_ce->properties_info, (copy_ctor_func_t) (ce->type & ZEND_INTERNAL_CLASS ? zend_duplicate_property_info_internal : zend_duplicate_property_info), sizeof(zend_property_info), (merge_checker_func_t) do_inherit_property_access_check, ce);
|
||||
|
||||
zend_hash_merge(&ce->constants_table, &parent_ce->constants_table, zval_property_ctor(parent_ce, ce), NULL, sizeof(zval *), 0);
|
||||
zend_hash_merge(&ce->constants_table, &parent_ce->constants_table, (void (*)(void *)) zval_add_ref, NULL, sizeof(zval *), 0);
|
||||
zend_hash_merge_ex(&ce->function_table, &parent_ce->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
|
||||
do_inherit_parent_constructor(ce);
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_t
|
||||
|
||||
ALLOC_HASHTABLE(object->properties);
|
||||
zend_hash_init(object->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(object->properties, &class_type->default_properties, zval_copy_property_ctor(class_type), (void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(object->properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
ALLOC_ZVAL(trace);
|
||||
trace->is_ref = 0;
|
||||
|
||||
@@ -140,8 +140,6 @@ static inline int i_zend_is_true(zval *op)
|
||||
}
|
||||
|
||||
ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC);
|
||||
ZEND_API int zval_update_constant_inline_change(zval **pp, void *arg TSRMLS_DC);
|
||||
ZEND_API int zval_update_constant_no_inline_change(zval **pp, void *arg TSRMLS_DC);
|
||||
ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC);
|
||||
|
||||
/* dedicated Zend executor functions - do not use! */
|
||||
|
||||
+1
-11
@@ -584,22 +584,12 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco
|
||||
zend_hash_move_forward(Z_ARRVAL_P(p));
|
||||
zval_dtor(&const_value);
|
||||
}
|
||||
zend_hash_apply_with_argument(Z_ARRVAL_P(p), (apply_func_arg_t) zval_update_constant_inline_change, (void *) scope TSRMLS_CC);
|
||||
zend_hash_apply_with_argument(Z_ARRVAL_P(p), (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
|
||||
zend_hash_internal_pointer_reset(Z_ARRVAL_P(p));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ZEND_API int zval_update_constant_inline_change(zval **pp, void *scope TSRMLS_DC)
|
||||
{
|
||||
return zval_update_constant_ex(pp, (void*)1, scope TSRMLS_CC);
|
||||
}
|
||||
|
||||
ZEND_API int zval_update_constant_no_inline_change(zval **pp, void *scope TSRMLS_DC)
|
||||
{
|
||||
return zval_update_constant_ex(pp, (void*)0, scope TSRMLS_CC);
|
||||
}
|
||||
|
||||
ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
|
||||
{
|
||||
return zval_update_constant_ex(pp, arg, NULL TSRMLS_CC);
|
||||
|
||||
+1
-1
@@ -1379,7 +1379,7 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t co
|
||||
return 1;
|
||||
}
|
||||
} else { /* string index */
|
||||
if (zend_hash_quick_find(ht2, p1->arKey, p1->nKeyLength, p1->h, &pData2)==FAILURE) {
|
||||
if (zend_hash_find(ht2, p1->arKey, p1->nKeyLength, &pData2)==FAILURE) {
|
||||
HASH_UNPROTECT_RECURSION(ht1);
|
||||
HASH_UNPROTECT_RECURSION(ht2);
|
||||
return 1;
|
||||
|
||||
+4
-4
@@ -306,7 +306,7 @@ END_EXTERN_C()
|
||||
} \
|
||||
if (*tmp >= '0' && *tmp <= '9') { /* possibly a numeric index */ \
|
||||
const char *end = key + length - 1; \
|
||||
ulong idx; \
|
||||
long idx; \
|
||||
\
|
||||
if ((*end != '\0') /* not a null terminated string */ \
|
||||
|| (*tmp == '0' && length > 2) /* numbers with leading zeros */ \
|
||||
@@ -322,11 +322,11 @@ END_EXTERN_C()
|
||||
} \
|
||||
if (tmp == end) { \
|
||||
if (*key == '-') { \
|
||||
if (idx-1 > LONG_MAX) { /* overflow */ \
|
||||
idx = -idx; \
|
||||
if (idx > 0) { /* overflow */ \
|
||||
break; \
|
||||
} \
|
||||
idx = (ulong)(-(long)idx); \
|
||||
} else if (idx > LONG_MAX) { /* overflow */ \
|
||||
} else if (idx < 0) { /* overflow */ \
|
||||
break; \
|
||||
} \
|
||||
return func; \
|
||||
|
||||
@@ -329,9 +329,6 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC)
|
||||
!guard->in_get) {
|
||||
/* have getter - try with it! */
|
||||
ZVAL_ADDREF(object);
|
||||
if (PZVAL_IS_REF(object)) {
|
||||
SEPARATE_ZVAL(&object);
|
||||
}
|
||||
guard->in_get = 1; /* prevent circular getting */
|
||||
rv = zend_std_call_getter(object, member TSRMLS_CC);
|
||||
guard->in_get = 0;
|
||||
@@ -421,22 +418,22 @@ static void zend_std_write_property(zval *object, zval *member, zval *value TSRM
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int setter_done = 0;
|
||||
zend_guard *guard;
|
||||
|
||||
if (zobj->ce->__set &&
|
||||
zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS &&
|
||||
!guard->in_set) {
|
||||
ZVAL_ADDREF(object);
|
||||
if (PZVAL_IS_REF(object)) {
|
||||
SEPARATE_ZVAL(&object);
|
||||
}
|
||||
guard->in_set = 1; /* prevent circular setting */
|
||||
if (zend_std_call_setter(object, member, value TSRMLS_CC) != SUCCESS) {
|
||||
/* for now, just ignore it - __set should take care of warnings, etc. */
|
||||
}
|
||||
setter_done = 1;
|
||||
guard->in_set = 0;
|
||||
zval_ptr_dtor(&object);
|
||||
} else if (property_info) {
|
||||
}
|
||||
if (!setter_done && property_info) {
|
||||
zval **foo;
|
||||
|
||||
/* if we assign referenced variable, we should separate it */
|
||||
@@ -614,9 +611,6 @@ static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC)
|
||||
!guard->in_unset) {
|
||||
/* have unseter - try with it! */
|
||||
ZVAL_ADDREF(object);
|
||||
if (PZVAL_IS_REF(object)) {
|
||||
SEPARATE_ZVAL(&object);
|
||||
}
|
||||
guard->in_unset = 1; /* prevent circular unsetting */
|
||||
zend_std_call_unsetter(object, member TSRMLS_CC);
|
||||
guard->in_unset = 0;
|
||||
@@ -1048,9 +1042,6 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists
|
||||
|
||||
/* have issetter - try with it! */
|
||||
ZVAL_ADDREF(object);
|
||||
if (PZVAL_IS_REF(object)) {
|
||||
SEPARATE_ZVAL(&object);
|
||||
}
|
||||
guard->in_isset = 1; /* prevent circular getting */
|
||||
rv = zend_std_call_issetter(object, member TSRMLS_CC);
|
||||
if (rv) {
|
||||
|
||||
+2
-2
@@ -156,7 +156,7 @@ static void zval_add_ref_or_clone(zval **p)
|
||||
(*p)->value.obj = Z_OBJ_HT_PP(p)->clone_obj(orig TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
zval_shared_property_ctor(p);
|
||||
(*p)->refcount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_va
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref_or_clone, (void *) NULL /* Not used anymore */, sizeof(zval *));
|
||||
} else {
|
||||
zend_hash_copy(new_object->properties, old_object->properties, zval_copy_property_ctor(old_object->ce), (void *) NULL /* Not used anymore */, sizeof(zval *));
|
||||
zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *));
|
||||
}
|
||||
if (old_object->ce->clone) {
|
||||
zval *new_obj;
|
||||
|
||||
+1
-4
@@ -157,10 +157,7 @@ ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC)
|
||||
/* Note that only run-time accessed data need to be cleaned up, pre-defined data can
|
||||
not contain objects and thus are not probelmatic */
|
||||
zend_hash_apply(&(*pce)->function_table, (apply_func_t) zend_cleanup_function_data_full TSRMLS_CC);
|
||||
if ((*pce)->static_members) {
|
||||
zend_hash_clean((*pce)->static_members);
|
||||
(*pce)->static_members = NULL;
|
||||
}
|
||||
(*pce)->static_members = NULL;
|
||||
} else if (CE_STATIC_MEMBERS(*pce)) {
|
||||
zend_hash_destroy(CE_STATIC_MEMBERS(*pce));
|
||||
FREE_HASHTABLE(CE_STATIC_MEMBERS(*pce));
|
||||
|
||||
@@ -69,33 +69,6 @@ ZEND_API int zend_atoi(const char *str, int str_len)
|
||||
return retval;
|
||||
}
|
||||
|
||||
ZEND_API long zend_atol(const char *str, int str_len) /* {{{ */
|
||||
{
|
||||
long retval;
|
||||
|
||||
if (!str_len) {
|
||||
str_len = strlen(str);
|
||||
}
|
||||
retval = strtol(str, NULL, 0);
|
||||
if (str_len>0) {
|
||||
switch (str[str_len-1]) {
|
||||
case 'g':
|
||||
case 'G':
|
||||
retval *= 1024;
|
||||
/* break intentionally missing */
|
||||
case 'm':
|
||||
case 'M':
|
||||
retval *= 1024;
|
||||
/* break intentionally missing */
|
||||
case 'k':
|
||||
case 'K':
|
||||
retval *= 1024;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API double zend_string_to_double(const char *number, zend_uint length)
|
||||
{
|
||||
|
||||
@@ -303,7 +303,6 @@ ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC);
|
||||
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC);
|
||||
|
||||
ZEND_API int zend_atoi(const char *str, int str_len);
|
||||
ZEND_API long zend_atol(const char *str, int str_len);
|
||||
|
||||
ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC);
|
||||
END_EXTERN_C()
|
||||
|
||||
@@ -150,18 +150,6 @@ ZEND_API int zend_print_variable(zval *var) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zval_property_ctor(zval **p) /* {{{ */
|
||||
{
|
||||
zval *orig_ptr = *p;
|
||||
|
||||
ALLOC_ZVAL(*p);
|
||||
**p = *orig_ptr;
|
||||
zval_copy_ctor(*p);
|
||||
(*p)->refcount = 1;
|
||||
(*p)->is_ref = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API void _zval_copy_ctor_wrapper(zval *zvalue) /* {{{ */
|
||||
{
|
||||
|
||||
@@ -77,17 +77,6 @@ ZEND_API void _zval_internal_ptr_dtor_wrapper(zval **zvalue);
|
||||
|
||||
ZEND_API void zval_add_ref(zval **p);
|
||||
|
||||
ZEND_API void zval_property_ctor(zval **);
|
||||
|
||||
#ifdef ZTS
|
||||
# define zval_shared_property_ctor zval_property_ctor
|
||||
#else
|
||||
# define zval_shared_property_ctor zval_add_ref
|
||||
#endif
|
||||
|
||||
#define zval_copy_property_ctor(ce) ((copy_ctor_func_t) (((ce)->type == ZEND_INTERNAL_CLASS) ? zval_shared_property_ctor : zval_add_ref))
|
||||
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#define ZVAL_DESTRUCTOR (void (*)(void *)) zval_dtor_wrapper
|
||||
|
||||
+3
-16
@@ -2192,12 +2192,6 @@ ZEND_VM_C_LABEL(return_by_value):
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
|
||||
retval_ptr == &EG(uninitialized_zval)) {
|
||||
zval *ret;
|
||||
|
||||
ALLOC_INIT_ZVAL(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else {
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
retval_ptr->refcount++;
|
||||
@@ -2378,16 +2372,9 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (OP1_TYPE == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
|
||||
(*varptr_ptr)->refcount--;
|
||||
ALLOC_ZVAL(*varptr_ptr);
|
||||
INIT_ZVAL(**varptr_ptr);
|
||||
(*varptr_ptr)->refcount = 0;
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
|
||||
+6
-44
@@ -1809,12 +1809,6 @@ return_by_value:
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
|
||||
retval_ptr == &EG(uninitialized_zval)) {
|
||||
zval *ret;
|
||||
|
||||
ALLOC_INIT_ZVAL(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else {
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
retval_ptr->refcount++;
|
||||
@@ -4391,12 +4385,6 @@ return_by_value:
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
|
||||
retval_ptr == &EG(uninitialized_zval)) {
|
||||
zval *ret;
|
||||
|
||||
ALLOC_INIT_ZVAL(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else {
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
retval_ptr->refcount++;
|
||||
@@ -7447,12 +7435,6 @@ return_by_value:
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
|
||||
retval_ptr == &EG(uninitialized_zval)) {
|
||||
zval *ret;
|
||||
|
||||
ALLOC_INIT_ZVAL(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else {
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
retval_ptr->refcount++;
|
||||
@@ -7605,16 +7587,9 @@ static int ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (IS_VAR == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
|
||||
(*varptr_ptr)->refcount--;
|
||||
ALLOC_ZVAL(*varptr_ptr);
|
||||
INIT_ZVAL(**varptr_ptr);
|
||||
(*varptr_ptr)->refcount = 0;
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
@@ -19890,12 +19865,6 @@ return_by_value:
|
||||
INIT_PZVAL_COPY(ret, retval_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else if ((IS_CV == IS_CV || IS_CV == IS_VAR) &&
|
||||
retval_ptr == &EG(uninitialized_zval)) {
|
||||
zval *ret;
|
||||
|
||||
ALLOC_INIT_ZVAL(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
} else {
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
retval_ptr->refcount++;
|
||||
@@ -20048,16 +20017,9 @@ static int ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (IS_CV == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
|
||||
(*varptr_ptr)->refcount--;
|
||||
ALLOC_ZVAL(*varptr_ptr);
|
||||
INIT_ZVAL(**varptr_ptr);
|
||||
(*varptr_ptr)->refcount = 0;
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
|
||||
+1
-4
@@ -1095,7 +1095,7 @@ ifelse([$5],[],,[else $5])
|
||||
dnl
|
||||
dnl PHP_CHECK_SIZEOF(type, cross-value, extra-headers)
|
||||
dnl
|
||||
AC_DEFUN([PHP_CHECK_SIZEOF], [
|
||||
AC_DEFUN(PHP_CHECK_SIZEOF, [
|
||||
AC_MSG_CHECKING([size of $1])
|
||||
_PHP_CHECK_SIZEOF($1, $2, $3, [
|
||||
AC_DEFINE_UNQUOTED([SIZEOF_]translit($1,a-z,A-Z_), [$]php_cv_sizeof_[]$1, [Size of $1])
|
||||
@@ -2424,7 +2424,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
|
||||
echo > ext/iconv/php_have_libiconv.h
|
||||
echo > ext/iconv/php_have_iconv.h
|
||||
echo > ext/iconv/php_php_iconv_impl.h
|
||||
echo > ext/iconv/php_iconv_aliased_libiconv.h
|
||||
echo > ext/iconv/php_php_iconv_h_path.h
|
||||
echo > ext/iconv/php_iconv_supports_errno.h
|
||||
|
||||
@@ -2472,8 +2471,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
|
||||
found_iconv=yes
|
||||
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
|
||||
AC_DEFINE(HAVE_LIBICONV,1,[ ])
|
||||
PHP_DEFINE([ICONV_ALIASED_LIBICONV],1,[ext/iconv])
|
||||
AC_DEFINE([ICONV_ALIASED_LIBICONV],1,[iconv() is aliased to libiconv() in -liconv])
|
||||
], [
|
||||
PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
|
||||
found_iconv=yes
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=15
|
||||
PHP_RELEASE_VERSION=13
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
bcadd() incorrect argument count
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcadd();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for bcadd() in %s on line %d
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
bcadd() with non-integers
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=5
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcadd("2.2", "4.3", "2")."\n";
|
||||
echo bcadd("2.2", "-7.3", "1")."\n";
|
||||
echo bcadd("-4.27", "7.3");
|
||||
?>
|
||||
--EXPECTF--
|
||||
6.50
|
||||
-5.1
|
||||
3.03000
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
bccomp() with non-integers
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
echo bccomp("2.2", "2.2", "2")."\n";
|
||||
echo bccomp("2.32", "2.2", "2")."\n";
|
||||
echo bccomp("2.29", "2.3", "2");
|
||||
?>
|
||||
--EXPECTF--
|
||||
0
|
||||
1
|
||||
-1
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
bccomp() with negative value
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
echo bccomp("-2", "-2")."\n";
|
||||
echo bccomp("-2", "2", "1")."\n";
|
||||
echo bccomp("-2.29", "-2.3", "2");
|
||||
?>
|
||||
--EXPECTF--
|
||||
0
|
||||
-1
|
||||
1
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
bcmod() - mod by 0
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcmod("10", "0");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcmod(): Division by zero in %s on line %d
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
bcmul() incorrect argument count
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcmul();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for bcmul() in %s on line %d
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
bcpow() incorrect argument count
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcpow();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for bcpow() in %s on line %d
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
bcpow() with a negative exponent
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcpow("2", "-4");
|
||||
?>
|
||||
--EXPECTF--
|
||||
0
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
bcpowmod() - Raise an arbitrary precision number to another, reduced by a specified modulus
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcpowmod("5", "2", "7") . "\n";
|
||||
echo bcpowmod("-2", "5", "7") . "\n";
|
||||
echo bcpowmod("10", "2147483648", "2047");
|
||||
?>
|
||||
--EXPECT--
|
||||
4
|
||||
-4
|
||||
790
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
bcscale() with negative argument
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
bcscale(-4);
|
||||
echo bcdiv("20.56", "4");
|
||||
?>
|
||||
--EXPECTF--
|
||||
5
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
bcadd() incorrect argument count
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=-2
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcadd("-4.27", "7.3");
|
||||
?>
|
||||
--EXPECTF--
|
||||
3
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
bcsqrt() incorrect argument count
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcsqrt();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for bcsqrt() in %s on line %d
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
bcsqrt() with argument of 0
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcsqrt("0");
|
||||
?>
|
||||
--EXPECTF--
|
||||
0
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
bcsub() incorrect argument count
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcsub();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Wrong parameter count for bcsub() in %s on line %d
|
||||
@@ -1386,7 +1386,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
convert_to_long_ex(zvalue);
|
||||
if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
|
||||
if (Z_LVAL_PP(zvalue) != 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set");
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
}
|
||||
@@ -1772,10 +1772,6 @@ PHP_FUNCTION(curl_setopt)
|
||||
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
|
||||
|
||||
convert_to_long_ex(zoption);
|
||||
if (Z_LVAL_PP(zoption) <= 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid curl configuration option");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (!_php_curl_setopt(ch, Z_LVAL_PP(zoption), zvalue, return_value TSRMLS_CC)) {
|
||||
RETURN_TRUE;
|
||||
|
||||
@@ -17,7 +17,7 @@ if (!extension_loaded('curl')) print 'skip';
|
||||
|
||||
//SET URL AND OTHER OPTIONS
|
||||
curl_setopt($ch1, CURLOPT_URL, "http://php.net/robots.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
@@ -55,10 +55,5 @@ Disallow: /source.php
|
||||
Disallow: /search.php
|
||||
Disallow: /mod.php
|
||||
Disallow: /manual/add-note.php
|
||||
|
||||
Disallow: /harming/humans
|
||||
Disallow: /ignoring/human/orders
|
||||
Disallow: /harm/to/self
|
||||
|
||||
CURL2
|
||||
|
||||
@@ -16,8 +16,8 @@ if (!extension_loaded('curl')) print 'skip';
|
||||
$ch2=curl_init();
|
||||
|
||||
//SET URL AND OTHER OPTIONS
|
||||
curl_setopt($ch1, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata1.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata1.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ if (!extension_loaded('curl')) print 'skip';
|
||||
$ch2=curl_init();
|
||||
|
||||
//SET URL AND OTHER OPTIONS
|
||||
curl_setopt($ch1, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata1.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata1.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ if (!extension_loaded('curl')) print 'skip';
|
||||
$ch2=curl_init();
|
||||
|
||||
//SET URL AND OTHER OPTIONS
|
||||
curl_setopt($ch1, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata1.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata1.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ if (!extension_loaded('curl')) print 'skip';
|
||||
$ch2=curl_init();
|
||||
|
||||
//SET URL AND OTHER OPTIONS
|
||||
curl_setopt($ch1, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata1.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata1.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
|
||||
@@ -17,6 +17,6 @@ curl_close($ch);
|
||||
var_dump($succes);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when %r(safe_mode is enabled or an )?%ropen_basedir is set in %s.php on line %d
|
||||
Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when %r(in safe_mode or an )?%ropen_basedir is set in %s.php on line %d
|
||||
bool(false)
|
||||
|
||||
@@ -30,6 +30,6 @@ var_dump( $curl_content );
|
||||
--EXPECTF--
|
||||
*** Testing curl_setopt with CURLOPT_FOLLOWLOCATION in safemode
|
||||
|
||||
Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in %s on line %d
|
||||
Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -26,7 +26,7 @@
|
||||
{ "msd", 1, 4, "Europe/Moscow" },
|
||||
{ "gst", 0, 4, "Asia/Dubai" },
|
||||
{ "pkt", 0, 5, "Asia/Karachi" },
|
||||
{ "ist", 0, 5.5, "Asia/Kolkata" },
|
||||
{ "ist", 0, 5.5, "Asia/Calcutta" },
|
||||
{ "npt", 0, 5.75, "Asia/Katmandu" },
|
||||
{ "yekt", 1, 6, "Asia/Yekaterinburg" },
|
||||
{ "novst", 1, 7, "Asia/Novosibirsk" },
|
||||
|
||||
+4364
-5126
File diff suppressed because it is too large.
Load diff
@@ -86,8 +86,6 @@
|
||||
|
||||
#define TIMELIB_ERROR 999
|
||||
|
||||
/* Some compilers like AIX, defines uchar in sys/types.h */
|
||||
#undef uchar
|
||||
typedef unsigned char uchar;
|
||||
|
||||
#define BSIZE 8192
|
||||
@@ -469,7 +467,7 @@ static long timelib_parse_tz_cor(char **ptr)
|
||||
char *begin = *ptr, *end;
|
||||
long tmp;
|
||||
|
||||
while (isdigit(**ptr) || **ptr == ':') {
|
||||
while (**ptr != '\0') {
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
@@ -789,7 +787,7 @@ minutelz = [0-5][0-9];
|
||||
second = minute | "60";
|
||||
secondlz = minutelz | "60";
|
||||
meridian = ([AaPp] "."? [Mm] "."?) [\000\t ];
|
||||
tz = "("? [A-Za-z]{1,6} ")"? | [A-Z][a-z]+([_/-][A-Za-z]+)+;
|
||||
tz = "("? [A-Za-z]{1,6} ")"? | [A-Z][a-z]+([_/][A-Z][a-z]+)+;
|
||||
tzcorrection = [+-] hour24 ":"? minute?;
|
||||
|
||||
daysuf = "st" | "nd" | "rd" | "th";
|
||||
|
||||
+825
-786
File diff suppressed because it is too large.
Load diff
+6
-480
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -35,7 +35,7 @@ static __inline __int64 php_date_llabs( __int64 i ) { return i >= 0? i: -i; }
|
||||
#elif defined(__GNUC__) && __GNUC__ < 3
|
||||
static __inline __int64_t php_date_llabs( __int64_t i ) { return i >= 0 ? i : -i; }
|
||||
#else
|
||||
static inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i; }
|
||||
static __inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i; }
|
||||
#endif
|
||||
|
||||
/* {{{ arginfo */
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
--TEST--
|
||||
Bug #46111 (strtotime() returns false for some valid timezones)
|
||||
--FILE--
|
||||
<?php
|
||||
date_default_timezone_set('Asia/Calcutta');
|
||||
$timezones = timezone_identifiers_list();
|
||||
|
||||
# An empty list indicates no errors, but in this case some of them can not be
|
||||
# parsed. All of those are on the backwards compatible list though, so we'll
|
||||
# just accept those failures here.
|
||||
print "[strtotime(timezone) == false - Begin List]\n";
|
||||
foreach ($timezones as $zone) {
|
||||
$date_string = "2008-01-01 13:00:00 " . $zone;
|
||||
|
||||
if (!strtotime($date_string)) {
|
||||
echo $zone . "\n";
|
||||
}
|
||||
}
|
||||
print "[strtotime(timezone) == false - End List]\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
[strtotime(timezone) == false - Begin List]
|
||||
CST6CDT
|
||||
Cuba
|
||||
Egypt
|
||||
Eire
|
||||
EST5EDT
|
||||
Etc/GMT0
|
||||
Factory
|
||||
GB
|
||||
GB-Eire
|
||||
GMT0
|
||||
Greenwich
|
||||
Hongkong
|
||||
Iceland
|
||||
Iran
|
||||
Israel
|
||||
Jamaica
|
||||
Japan
|
||||
Kwajalein
|
||||
Libya
|
||||
MST7MDT
|
||||
Navajo
|
||||
NZ
|
||||
NZ-CHAT
|
||||
Poland
|
||||
Portugal
|
||||
PRC
|
||||
PST8PDT
|
||||
ROC
|
||||
ROK
|
||||
Singapore
|
||||
Turkey
|
||||
Universal
|
||||
US/Alaska
|
||||
US/Aleutian
|
||||
US/Arizona
|
||||
US/Central
|
||||
US/East-Indiana
|
||||
US/Eastern
|
||||
US/Hawaii
|
||||
US/Indiana-Starke
|
||||
US/Michigan
|
||||
US/Mountain
|
||||
US/Pacific
|
||||
US/Pacific-New
|
||||
US/Samoa
|
||||
W-SU
|
||||
Zulu
|
||||
[strtotime(timezone) == false - End List]
|
||||
@@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
Bug #51096: Test for "first day" vs "first day of".
|
||||
--FILE--
|
||||
<?php
|
||||
$tests = array(
|
||||
'first day',
|
||||
'last day',
|
||||
'next month',
|
||||
'first day next month',
|
||||
'last day next month',
|
||||
);
|
||||
|
||||
foreach ( $tests as $test )
|
||||
{
|
||||
$result = date_parse( $test );
|
||||
$rel = $result['relative'];
|
||||
echo $test, "\n- month: ", $rel['month'], '; day: ', $rel['day'],
|
||||
'; first-day-of: ', isset( $rel['first_day_of_month'] ) ? 'true' : 'false',
|
||||
'; last-day-of: ', isset( $rel['last_day_of_month'] ) ? 'true' : 'false', "\n";
|
||||
$date = new DateTime( '2010-03-06 15:21 UTC' );
|
||||
echo '- ', $date->format( DateTime::ISO8601 );
|
||||
$date->modify( $test );
|
||||
echo ' -> ', $date->format( DateTime::ISO8601 ), "\n\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
first day
|
||||
- month: 0; day: 1; first-day-of: false; last-day-of: false
|
||||
- 2010-03-06T15:21:00+0000 -> 2010-03-07T15:21:00+0000
|
||||
|
||||
last day
|
||||
- month: 0; day: -1; first-day-of: false; last-day-of: false
|
||||
- 2010-03-06T15:21:00+0000 -> 2010-03-05T15:21:00+0000
|
||||
|
||||
next month
|
||||
- month: 1; day: 0; first-day-of: false; last-day-of: false
|
||||
- 2010-03-06T15:21:00+0000 -> 2010-04-06T15:21:00+0000
|
||||
|
||||
first day next month
|
||||
- month: 1; day: 1; first-day-of: false; last-day-of: false
|
||||
- 2010-03-06T15:21:00+0000 -> 2010-04-07T15:21:00+0000
|
||||
|
||||
last day next month
|
||||
- month: 1; day: -1; first-day-of: false; last-day-of: false
|
||||
- 2010-03-06T15:21:00+0000 -> 2010-04-05T15:21:00+0000
|
||||
+4
-12
@@ -226,11 +226,11 @@ AC_DEFUN([PHP_DBA_DB_CHECK],[
|
||||
fi
|
||||
done
|
||||
if test -z "$THIS_LIBS"; then
|
||||
AC_MSG_CHECKING([for DB$1 major version])
|
||||
AC_MSG_CHECKING([for db$1 major version])
|
||||
AC_MSG_ERROR([Header contains different version])
|
||||
fi
|
||||
if test "$1" = "4"; then
|
||||
AC_MSG_CHECKING([for DB4 minor version and patch level])
|
||||
AC_MSG_CHECKING([for db4 minor version and patch level])
|
||||
AC_EGREP_CPP(yes,[
|
||||
#include "$THIS_INCLUDE"
|
||||
#if DB_VERSION_MINOR != 1 || DB_VERSION_PATCH >= 25
|
||||
@@ -275,19 +275,11 @@ AC_DEFUN([PHP_DBA_DB_CHECK],[
|
||||
if test "$PHP_DB4" != "no"; then
|
||||
PHP_DBA_STD_BEGIN
|
||||
dbdp="/usr/local/BerkeleyDB.4."
|
||||
for i in $PHP_DB4 ${dbdp}8 ${dbdp}7 ${dbdp}6 ${dbdp}5 ${dbdp}4 ${dbdp}3 ${dbdp}2 ${dbdp}1 ${dbdp}0 /usr/local /usr; do
|
||||
for i in $PHP_DB4 ${dbdp}6 ${dbdp}5 ${dbdp}4 ${dbdp}3 ${dbdp}2 ${dbdp}1 ${dbdp}0 /usr/local /usr; do
|
||||
if test -f "$i/db4/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/db4/db.h
|
||||
break
|
||||
elif test -f "$i/include/db4.8/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db4.8/db.h
|
||||
break
|
||||
elif test -f "$i/include/db4.7/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db4.7/db.h
|
||||
break
|
||||
elif test -f "$i/include/db4.6/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db4.6/db.h
|
||||
@@ -314,7 +306,7 @@ if test "$PHP_DB4" != "no"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
PHP_DBA_DB_CHECK(4, db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
PHP_DBA_DB_CHECK(4, db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
fi
|
||||
PHP_DBA_STD_RESULT(db4,Berkeley DB4)
|
||||
|
||||
|
||||
@@ -43,18 +43,6 @@ static void php_dba_db4_errcall_fcn(
|
||||
const char *errpfx, const char *msg)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 8 && DB_VERSION_PATCH <= 26)
|
||||
/* Bug 51086, Berkeley DB 4.8.26 */
|
||||
/* This code suppresses a BDB 4.8 error message that BDB incorrectly emits */
|
||||
{
|
||||
char *function = get_active_function_name(TSRMLS_C);
|
||||
if (function && (!strcmp(function,"dba_popen") || !strcmp(function,"dba_open"))
|
||||
&& !strncmp(msg, "fop_read_meta", sizeof("fop_read_meta")-1)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
|
||||
}
|
||||
@@ -79,7 +67,6 @@ DBA_OPEN_FUNC(db4)
|
||||
struct stat check_stat;
|
||||
int s = VCWD_STAT(info->path, &check_stat);
|
||||
|
||||
#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR <= 7) /* Bug 51086 */
|
||||
if (!s && !check_stat.st_size) {
|
||||
info->mode = DBA_TRUNC; /* force truncate */
|
||||
}
|
||||
@@ -93,20 +80,6 @@ DBA_OPEN_FUNC(db4)
|
||||
(info->mode == DBA_CREAT && !s) ? 0 :
|
||||
info->mode == DBA_WRITER ? 0 :
|
||||
info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1;
|
||||
#else
|
||||
if (!s && !check_stat.st_size) {
|
||||
info->mode = DBA_CREAT; /* force creation */
|
||||
}
|
||||
|
||||
type = info->mode == DBA_READER ? DB_UNKNOWN :
|
||||
(info->mode == DBA_TRUNC || info->mode == DBA_CREAT) ? DB_BTREE :
|
||||
s ? DB_BTREE : DB_UNKNOWN;
|
||||
|
||||
gmode = info->mode == DBA_READER ? DB_RDONLY :
|
||||
info->mode == DBA_CREAT ? DB_CREATE :
|
||||
info->mode == DBA_WRITER ? 0 :
|
||||
info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1;
|
||||
#endif
|
||||
|
||||
if (gmode == -1) {
|
||||
return FAILURE; /* not possible */
|
||||
|
||||
@@ -3,13 +3,13 @@ Bug #36436 (DBA problem with Berkeley DB4)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = 'db4';
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = 'db4';
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
|
||||
$db = dba_popen($db_filename, 'c', 'db4');
|
||||
|
||||
@@ -22,13 +22,10 @@ var_dump(dba_firstkey($db));
|
||||
var_dump(dba_nextkey($db));
|
||||
|
||||
dba_close($db);
|
||||
unlink($db_filename);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
resource(%d) of type (dba persistent)
|
||||
string(3) "XYZ"
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't read valid db)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = 'cdb_make';
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$db_file = dirname(__FILE__) .'/129php.cdb';
|
||||
|
||||
if (($db_make=dba_open($db_file, "n", 'cdb_make'))!==FALSE) {
|
||||
dba_insert(pack('i',129), "Booo!", $db_make);
|
||||
dba_close($db_make);
|
||||
// write md5 checksum of generated database file
|
||||
var_dump(md5_file($db_file));
|
||||
@unlink($db_file);
|
||||
} else {
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(32) "1f34b74bde3744265acfc21e0f30af95"
|
||||
===DONE===
|
||||
@@ -3,26 +3,23 @@ Bug #48240 (DBA Segmentation fault dba_nextkey)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = 'db4';
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = 'db4';
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
|
||||
$db = dba_open($db_filename, 'c', 'db4');
|
||||
|
||||
var_dump(dba_nextkey($db));
|
||||
|
||||
dba_close($db);
|
||||
unlink($db_filename);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -3,7 +3,7 @@ Bug #49125 (Error in dba_exists C code)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = 'db4';
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
@@ -11,7 +11,7 @@ Bug #49125 (Error in dba_exists C code)
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$handler = 'db4';
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
|
||||
$db = dba_popen($db_filename, 'c', 'db4');
|
||||
|
||||
@@ -21,10 +21,7 @@ var_dump(dba_exists('foo', $db));
|
||||
|
||||
dba_close($db);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
unlink($db_filename);
|
||||
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
$db_filename = dirname(__FILE__) .'/test0.dbm'; // see test.inc
|
||||
@unlink($db_filename);
|
||||
@unlink($db_filename.'.lck');
|
||||
?>
|
||||
@@ -2,12 +2,12 @@
|
||||
DBA File Creation Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
|
||||
echo "database file created\n";
|
||||
@@ -16,10 +16,6 @@ DBA File Creation Test
|
||||
echo "$db_file does not exist\n";
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: %s
|
||||
database file created
|
||||
@@ -2,12 +2,12 @@
|
||||
DBA Insert/Fetch Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
|
||||
dba_insert("key1", "This is a test insert", $db_file);
|
||||
@@ -17,10 +17,6 @@ DBA Insert/Fetch Test
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: %s
|
||||
This is a test insert
|
||||
@@ -2,12 +2,12 @@
|
||||
DBA Insert/Replace/Fetch Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
|
||||
dba_insert("key1", "This is a test insert", $db_file);
|
||||
@@ -19,10 +19,6 @@ DBA Insert/Replace/Fetch Test
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: %s
|
||||
This is the replacement text
|
||||
@@ -2,12 +2,12 @@
|
||||
DBA Multiple Insert/Fetch Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
|
||||
dba_insert("key1", "Content String 1", $db_file);
|
||||
@@ -23,10 +23,6 @@ DBA Multiple Insert/Fetch Test
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: %s
|
||||
Another Content String Content String 2
|
||||
@@ -2,12 +2,12 @@
|
||||
DBA FirstKey/NextKey Loop Test With 5 Items
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
|
||||
dba_insert("key1", "Content String 1", $db_file);
|
||||
@@ -30,10 +30,6 @@ DBA FirstKey/NextKey Loop Test With 5 Items
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: %s
|
||||
5YYYYY
|
||||
@@ -2,12 +2,12 @@
|
||||
DBA FirstKey/NextKey with 2 deletes
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
|
||||
dba_insert("key1", "Content String 1", $db_file);
|
||||
@@ -32,10 +32,6 @@ DBA FirstKey/NextKey with 2 deletes
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: %s
|
||||
3NYNYY
|
||||
@@ -2,16 +2,16 @@
|
||||
DBA Multiple File Creation Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
if (!function_exists('dba_list')) die('skip dba_list() not available');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
echo "database handler: $handler\n";
|
||||
$db_file1 = $db_filename1 = dirname(__FILE__).'/test1.dbm';
|
||||
$db_file2 = $db_filename2 = dirname(__FILE__).'/test2.dbm';
|
||||
$db_file1 = dirname(__FILE__).'/test1.dbm';
|
||||
$db_file2 = dirname(__FILE__).'/test2.dbm';
|
||||
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
|
||||
echo "database file created\n";
|
||||
} else {
|
||||
@@ -29,13 +29,6 @@ DBA Multiple File Creation Test
|
||||
}
|
||||
var_dump(dba_list());
|
||||
dba_close($db_file);
|
||||
|
||||
@unlink($db_filename1);
|
||||
@unlink($db_filename2);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: %s
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
DBA magic_quotes_runtime Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
|
||||
ini_set('magic_quotes_runtime', 0);
|
||||
@@ -24,10 +24,6 @@ DBA magic_quotes_runtime Test
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: %s
|
||||
string(1) """
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
DBA dba_popen Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
print("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
echo "database handler: $handler\n";
|
||||
if (($db=dba_popen($db_file, "n", $handler))!==FALSE) {
|
||||
echo "Opened\n";
|
||||
@@ -24,10 +24,6 @@ DBA dba_popen Test
|
||||
echo dba_fetch("a", $db)."\n";
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: %s
|
||||
Opened
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
DBA with array keys
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
|
||||
dba_insert(array("", "name0") , "Content String 1", $db_file);
|
||||
dba_insert(array("key1", "name1") , "Content String 1", $db_file);
|
||||
dba_insert(array("key2","name2"), "Content String 2", $db_file);
|
||||
dba_insert("[key3]name3", "Third Content String", $db_file);
|
||||
dba_insert(array("key4","name4"), "Another Content String", $db_file);
|
||||
dba_insert(array("key5","name5"), "The last content string", $db_file);
|
||||
$a = dba_firstkey($db_file);
|
||||
$i=0;
|
||||
while($a) {
|
||||
$a = dba_nextkey($db_file);
|
||||
$i++;
|
||||
}
|
||||
echo $i;
|
||||
echo dba_exists(array("","name0"), $db_file) ? "Y" : "N";
|
||||
for ($i=1; $i<5; $i++) {
|
||||
echo dba_exists("[key$i]name$i", $db_file) ? "Y" : "N";
|
||||
}
|
||||
echo dba_exists(array("key5","name5"), $db_file) ? "Y" : "N";
|
||||
echo "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: %s
|
||||
6YYYYYY
|
||||
@@ -3,20 +3,16 @@ DBA CDB handler test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = 'cdb';
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
die('info CDB does not support replace or delete');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$handler = 'cdb';
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once(dirname(__FILE__) .'/dba_handler.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
require_once dirname(__FILE__) .'/dba_handler.inc';
|
||||
?>
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
database handler: cdb
|
||||
5YYYYY
|
||||
|
||||
@@ -5,13 +5,13 @@ magic_quotes_runtime=1
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = 'cdb_make';
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
die('info CDB_MAKE does not support reading');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$handler = 'cdb_make';
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
echo "database handler: $handler\n";
|
||||
// print md5 checksum of test.cdb which is generated by cdb_make program
|
||||
var_dump(md5_file(dirname(__FILE__).'/test.cdb'));
|
||||
@@ -32,11 +32,7 @@ magic_quotes_runtime=1
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
database handler: cdb_make
|
||||
string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5"
|
||||
string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5"
|
||||
string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5"
|
||||
@@ -2,20 +2,16 @@
|
||||
DBA DB4 handler test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = 'db4';
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
$handler = 'db4';
|
||||
require_once dirname(__FILE__) .'/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$handler = 'db4';
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
require_once(dirname(__FILE__) .'/dba_handler.inc');
|
||||
$handler = 'db4';
|
||||
require_once dirname(__FILE__) .'/test.inc';
|
||||
require_once dirname(__FILE__) .'/dba_handler.inc';
|
||||
?>
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
database handler: db4
|
||||
3NYNYY
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 New File Creation open("c") & Insert Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file = dba_open($db_filename, "c", $handler)) !== FALSE) {
|
||||
echo "database file created\n";
|
||||
dba_insert("key1", "This is a test insert", $db_file);
|
||||
echo dba_fetch("key1", $db_file), "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
database file created
|
||||
This is a test insert
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 New File Creation open("n") & Insert Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file = dba_open($db_filename, "n", $handler)) !== FALSE) {
|
||||
echo "database file created\n";
|
||||
dba_insert("key1", "This is a test insert", $db_file);
|
||||
echo dba_fetch("key1", $db_file), "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
database file created
|
||||
This is a test insert
|
||||
@@ -1,41 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 File Creation open("c") with existing file
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
|
||||
var_dump(file_put_contents($db_filename, "Dummy contents"));
|
||||
|
||||
if (($db_file = dba_open($db_filename, "c", $handler)) !== FALSE) {
|
||||
if (file_exists($db_filename)) {
|
||||
echo "database file created\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "File did not get created\n";
|
||||
}
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
int(14)
|
||||
|
||||
Notice: dba_open(): %stest0.dbm: unexpected file type or format in %sdba_db4_003.php on line %d
|
||||
|
||||
Warning: dba_open(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_003.php on line %d
|
||||
Error creating %stest0.dbm
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 Truncate Existing File open("n")
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
|
||||
var_dump(file_put_contents($db_filename, "Dummy contents"));
|
||||
|
||||
if (($db_file = dba_open($db_filename, "n", $handler)) !== FALSE) {
|
||||
if (file_exists($db_filename)) {
|
||||
echo "database file created\n";
|
||||
dba_insert("key1", "This is a test insert", $db_file);
|
||||
echo dba_fetch("key1", $db_file), "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "File did not get created\n";
|
||||
}
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
int(14)
|
||||
database file created
|
||||
This is a test insert
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 New File Creation popen("c") & Insert Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
|
||||
echo "database file created\n";
|
||||
dba_insert("key1", "This is a test insert", $db_file);
|
||||
echo dba_fetch("key1", $db_file), "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
database file created
|
||||
This is a test insert
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 New File Creation popen("n") & Insert Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file = dba_popen($db_filename, "n", $handler)) !== FALSE) {
|
||||
echo "database file created\n";
|
||||
dba_insert("key1", "This is a test insert", $db_file);
|
||||
echo dba_fetch("key1", $db_file), "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
database file created
|
||||
This is a test insert
|
||||
@@ -1,41 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 File Creation popen("c") with existing invalid file
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
|
||||
var_dump(file_put_contents($db_filename, "Dummy contents"));
|
||||
|
||||
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
|
||||
if (file_exists($db_filename)) {
|
||||
echo "database file created\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "File did not get created\n";
|
||||
}
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
int(14)
|
||||
|
||||
Notice: dba_popen(): %stest0.dbm: unexpected file type or format in %sdba_db4_007.php on line %d
|
||||
|
||||
Warning: dba_popen(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_007.php on line %d
|
||||
Error creating %stest0.dbm
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 Truncate Existing File popen("n")
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
|
||||
var_dump(file_put_contents($db_filename, "Dummy contents"));
|
||||
|
||||
if (($db_file = dba_popen($db_filename, "n", $handler)) !== FALSE) {
|
||||
if (file_exists($db_filename)) {
|
||||
echo "database file created\n";
|
||||
dba_insert("key1", "This is a test insert", $db_file);
|
||||
echo dba_fetch("key1", $db_file), "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "File did not get created\n";
|
||||
}
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
int(14)
|
||||
database file created
|
||||
This is a test insert
|
||||
@@ -1,53 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 Multiple File Creation Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
$db_file1 = $db_filename1 = dirname(__FILE__).'/test1.dbm';
|
||||
$db_file2 = $db_filename2 = dirname(__FILE__).'/test2.dbm';
|
||||
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
|
||||
echo "database file created\n";
|
||||
} else {
|
||||
echo "$db_file does not exist\n";
|
||||
}
|
||||
if (($db_file1=dba_open($db_file1, "n", $handler))!==FALSE) {
|
||||
echo "database file created\n";
|
||||
} else {
|
||||
echo "$db_file does not exist\n";
|
||||
}
|
||||
if (($db_file2=dba_open($db_file2, "n", $handler))!==FALSE) {
|
||||
echo "database file created\n";
|
||||
} else {
|
||||
echo "$db_file does not exist\n";
|
||||
}
|
||||
var_dump(dba_list());
|
||||
dba_close($db_file);
|
||||
|
||||
@unlink($db_filename1);
|
||||
@unlink($db_filename2);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
database file created
|
||||
database file created
|
||||
database file created
|
||||
array(3) {
|
||||
[%d]=>
|
||||
string(%d) "%stest0.dbm"
|
||||
[%d]=>
|
||||
string(%d) "%stest1.dbm"
|
||||
[%d]=>
|
||||
string(%d) "%stest2.dbm"
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 magic_quotes_runtime Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
|
||||
ini_set('magic_quotes_runtime', 0);
|
||||
dba_insert("key1", '"', $db_file);
|
||||
var_dump(dba_fetch("key1", $db_file));
|
||||
ini_set('magic_quotes_runtime', 1);
|
||||
var_dump(dba_fetch("key1", $db_file));
|
||||
dba_replace("key1", '\"', $db_file);
|
||||
var_dump(dba_fetch("key1", $db_file));
|
||||
ini_set('magic_quotes_runtime', 0);
|
||||
var_dump(dba_fetch("key1", $db_file));
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
string(1) """
|
||||
string(2) "\""
|
||||
string(2) "\""
|
||||
string(1) """
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 with repeated key
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file=dba_open($db_filename, "c", $handler))!==FALSE) {
|
||||
var_dump(dba_insert("key1", "Content String 1", $db_file));
|
||||
var_dump(dba_insert("key2", "Content String 2", $db_file));
|
||||
var_dump(dba_insert("key2", "Same key", $db_file));
|
||||
echo dba_fetch("key1", $db_file), "\n";
|
||||
echo dba_fetch("key2", $db_file), "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
Content String 1
|
||||
Content String 2
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 New File Creation open("rl")
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
if (($db_file = dba_open($db_filename, "rl", $handler)) !== FALSE) {
|
||||
echo "database file created\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
|
||||
Warning: dba_open(%stest0.dbm,rl): Driver initialization failed for handler: db4: No such file or directory in %sdba_db4_012.php on line %d
|
||||
Error creating %stest0.dbm
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 File open("rl") & Insert Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
|
||||
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
|
||||
echo "database file created\n";
|
||||
dba_close($db_file);
|
||||
}
|
||||
|
||||
if (($db_file = dba_popen($db_filename, "rl", $handler)) !== FALSE) {
|
||||
echo "database file opened\n";
|
||||
dba_insert("key1", "This is a test insert", $db_file);
|
||||
echo dba_fetch("key1", $db_file), "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
database file created
|
||||
database file opened
|
||||
|
||||
Warning: dba_insert(): You cannot perform a modification to a database without proper access in %sdba_db4_013.php on line %d
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 File open("wl") & Insert Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
|
||||
if (($db_file = dba_open($db_filename, "wl", $handler)) !== FALSE) {
|
||||
echo "database file opened\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
|
||||
Warning: dba_open(%stest0.dbm,wl): Driver initialization failed for handler: db4: No such file or directory in %sdba_db4_014.php on line %d
|
||||
Error creating %stest0.dbm
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 File open("wl") & Insert Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
|
||||
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
|
||||
echo "database file created\n";
|
||||
dba_close($db_file);
|
||||
}
|
||||
|
||||
if (($db_file = dba_popen($db_filename, "wl", $handler)) !== FALSE) {
|
||||
echo "database file opened\n";
|
||||
dba_insert("key1", "This is a test insert", $db_file);
|
||||
echo dba_fetch("key1", $db_file), "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
database file created
|
||||
database file opened
|
||||
This is a test insert
|
||||
@@ -1,59 +0,0 @@
|
||||
--TEST--
|
||||
DBA DB4 File Creation popen("c") with existing valid file
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
die("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$handler = "db4";
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
|
||||
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
|
||||
if (file_exists($db_filename)) {
|
||||
echo "database file created\n";
|
||||
var_dump(dba_insert("key1", "This is a test insert", $db_file));
|
||||
echo dba_fetch("key1", $db_file), "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "File did not get created\n";
|
||||
}
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
// Now test reopening it
|
||||
if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
|
||||
if (file_exists($db_filename)) {
|
||||
echo "database file created\n";
|
||||
var_dump(dba_insert("key1", "second open test", $db_file));
|
||||
var_dump(dba_insert("key2", "second open test row 2", $db_file));
|
||||
echo dba_fetch("key1", $db_file), "\n";
|
||||
echo dba_fetch("key2", $db_file), "\n";
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "File did not get created\n";
|
||||
}
|
||||
} else {
|
||||
echo "Error creating $db_filename\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: db4
|
||||
database file created
|
||||
bool(true)
|
||||
This is a test insert
|
||||
database file created
|
||||
bool(false)
|
||||
bool(true)
|
||||
This is a test insert
|
||||
second open test row 2
|
||||
Loaded 100 of 309 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user