Compare commits

..
950 changed files with 5420 additions and 26333 deletions

No files matched your search

-19
View File
@@ -12,25 +12,6 @@ document ____executor_globals
ZTS detection is automatically based on ext/standard module struct
end
define print_cvs
____executor_globals
set $p = $eg.current_execute_data.CVs
set $c = $eg.current_execute_data.op_array.last_var
set $v = $eg.current_execute_data.op_array.vars
set $i = 0
printf "Compiled variables count: %d\n", $c
while $i < $c
printf "%d = %s\n", $i, $v[$i].name
if $p[$i] != 0
printzv *$p[$i]
else
printf "*uninitialized*\n"
end
set $i = $i + 1
end
end
define dump_bt
set $t = $arg0
while $t
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>php-5.2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
+2 -2
View File
@@ -58,8 +58,8 @@ Exceptions:
calling.
[7] When commenting out code using a #if statement, do NOT use 0 only. Instead
use "<svn username here>_0". For example, #if FOO_0, where FOO is your
svn user foo. This allows easier tracking of why code was commented out,
use "<cvs username here>_0". For example, #if FOO_0, where FOO is your
cvs user foo. This allows easier tracking of why code was commented out,
especially in bundled libraries.
[8] Do not define functions that are not available. For instance, if a
+10 -7
View File
@@ -386,7 +386,7 @@ Apache 2.0 on Unix systems
http://snaps.php.net/php5-latest.tar.gz or download binaries for
Windows http://snaps.php.net/win32/php5-win32-latest.zip.
* a prerelease version downloadable from http://qa.php.net/.
* you have always the option to obtain PHP through SVN.
* you have always the option to obtain PHP through anonymous CVS.
These versions of PHP are compatible to Apache 2.0.40 and later.
@@ -1303,8 +1303,8 @@ Introduction to PECL Installations
When building PHP modules, it's important to have known-good versions
of the required tools (autoconf, automake, libtool, etc.) See the
SVN Instructions for details on the required tools, and required
versions.
Anonymous CVS Instructions for details on the required tools, and
required versions.
__________________________________________________________________
Downloading PECL extensions
@@ -1320,11 +1320,14 @@ Downloading PECL extensions
PECL extensions that have releases listed on the PECL web site are
available for download and installation using the pecl command.
Specific revisions may also be specified.
* SVN
All PECL files reside in SVN. A web-based view may be seen at
http://svn.php.net/pecl/. To download straight from SVN, use:
* CVS
Most PECL extensions also reside in CVS. A web-based view may be
seen at http://cvs.php.net/pecl/. To download straight from CVS,
the following sequence of commands may be used. Note that phpfi is
the password for user cvsread:
$ svn co http://svn.php.net/repository/pecl/<extname>/trunk <extname>
$ cvs -d:pserver:cvsread@cvs.php.net:/repository login
$ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/extname
* Windows downloads
Windows users may find compiled PECL binaries by downloading the
+2 -1
View File
@@ -115,8 +115,9 @@ clean:
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
distclean: clean
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
find . -name Makefile | xargs rm -f
.PHONY: all clean install distclean test
.NOEXPORT:
+3 -135
View File
@@ -1,135 +1,5 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 Sep 2009, PHP 5.2.11RC3
- Updated timezone database to version 2009.13 (2009m) (Derick)
- Fixed bug #49470 (FILTER_SANITIZE_EMAIL allows disallowed characters).
- Fixed bug #49447 (php engine needs to correctly check for socket API return
status on windows). (Sriram Natarajan)
- Fixed bug #48060 (pdo_pgsql - large objects are returned as empty). (Matteo)
03 Sep 2009, PHP 5.2.11RC2
- Added missing sanity checks around exif processing. (Ilia)
- Fixed sanity check for the color index in imagecolortransparent. (Pierre)
- Fixed zlib.deflate compress filter to actually accept level parameter. (Jani)
- Fixed leak on error in popen/exec (and related functions) on Windows.
(Pierre)
- Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
(Ilia, code-it at mail dot ru)
- Fixed bug #49289 (bcmath module doesn't compile with phpize configure).
(Jani)
- Fixed bug #49286 (php://input (php_stream_input_read) is broken). (Jani)
- Fixed bug #49269 (Ternary operator fails on Iterator object when used inside
foreach declaration). (Etienne, Dmitry)
- Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani)
- Fixed bug #49144 (Import of schema from different host transmits original
authentication details). (Dmitry)
- Fixed bug #49000 (PHP CLI in Interactive mode (php -a) crashes when including
files from function). (Stas)
- Fixed bug #48696 (ldap_read() segfaults with invalid parameters). (Felipe)
- Fixed bug #47273 (Encoding bug in SoapServer->fault). (Dmitry)
- Fixed bug #28038 (Sent incorrect RCPT TO commands to SMTP server) (Garrett)
13 Aug 2009, PHP 5.2.11RC1
- Fixed regression in cURL extension that prevented flush of data to output
defined as a file handle. (Ilia)
- Fixed memory leak in stream_is_local(). (Felipe, Tony)
- Fixed bug #49372 (segfault in php_curl_option_curl). (Pierre)
- Fixed bug #49132 (posix_times returns false without error).
(phpbugs at gunnu dot us)
- Fixed bug #49125 (Error in dba_exists C code). (jdornan at stanford dot edu)
- Fixed bug #49095 (proc_get_status['exitcode'] fails on win32). (Felipe)
- Fixed bug #49074 (private class static fields can be modified by using
reflection). (Jani)
- Fixed bug #49072 (feof never returns true for damaged file in zip). (Pierre)
- Fixed bug #49052 (context option headers freed too early when using
--with-curlwrappers). (Jani)
- Fixed bug #49032 (SplFileObject::fscanf() variables passed by reference).
(Jani)
- Fixed bug #49026 (proc_open() can bypass safe_mode_protected_env_vars
restrictions). (Ilia)
- Fixed bug #48994 (zlib.output_compression does not output HTTP headers when
set to a string value). (Jani)
- Fixed bug #48980 (Crash when compiling with pdo_firebird). (Felipe)
- Fixed bug #48962 (cURL does not upload files with specified filename).
(Ilia)
- Fixed bug #48929 (Double \r\n after HTTP headers when "header" context
option is an array). (David Zülke)
- Fixed bug #48913 (Too long error code strings in pdo_odbc driver).
(naf at altlinux dot ru, Felipe)
- Fixed bug #48802 (printf() returns incorrect outputted length). (Jani)
- Fixed bug #48801 (Problem with imagettfbbox). (Takeshi Abe)
- Fixed bug #48788 (RecursiveDirectoryIterator doesn't descend into symlinked
directories). (Ilia)
- Fixed bug #48774 (SIGSEGVs when using curl_copy_handle()).
(Sriram Natarajan)
- Fixed bug #48763 (ZipArchive produces corrupt archive). (dani dot church at
gmail dot com, Pierre)
- Fixed bug #48762 (IPv6 address filter still rejects valid address). (Felipe)
- Fixed bug #48733 (CURLOPT_WRITEHEADER|CURLOPT_FILE|CURLOPT_STDERR warns on
files that have been opened with r+). (Ilia)
- Fixed bug #48732 (TTF Bounding box wrong for letters below baseline).
(Takeshi Abe)
- Fixed bug #48718 (FILTER_VALIDATE_EMAIL does not allow numbers in domain
components). (Ilia)
- Fixed bug #48709 (metaphone and 'wh'). (brettz9 at yahoo dot com, Felipe)
- Fixed bug #48693 (Double declaration of __lambda_func when lambda wrongly
formatted). (peter at lvp-media dot com, Felipe)
- Fixed bug #48661 (phpize is broken with non-bash shells). (Jani)
- Fixed bug #48645 (mb_convert_encoding() doesn't understand hexadecimal
html-entities). (Moriyoshi)
- Fixed bug #48637 ("file" fopen wrapper is overwritten when using
--with-curlwrappers). (Jani)
- Fixed bug #48636 (Error compiling of ext/date on netware). (guenter at
php.net, Ilia)
- Fixed bug #48629 (get_defined_constants() ignores categorize parameter).
(Felipe)
- Fixed bug #48619 (imap_search ALL segfaults). (Pierre)
- Fixed bug #48608 (Invalid libreadline version not detected during configure).
(Jani)
- Fixed bug #48555 (ImageFTBBox() differs from previous versions for texts
with new lines) (Takeshi Abe)
- Fixed bug #48539 (pdo_dblib fails to connect, throws empty PDOException
"SQLSTATE[] (null)"). (Felipe)
- Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using
TMPDIR). (Ilia)
- Fixed bug #48450 (Compile failure under IRIX 6.5.30 building gd.c). (Kalle)
- Fixed bug #48400 (imap crashes when closing stream opened with
OP_PROTOTYPE flag). (Jani)
- Fixed bug #48284 (hash "adler32" byte order is reversed). (Scott)
- Fixed bug #48276 (date("Y") on big endian machines produces the
wrong result). (Scott)
- Fixed bug #48247 (Infinite loop and possible crash during startup with
errors when errors are logged). (Jani)
- Fixed bug #48116 (Fixed build with Openssl 1.0). (Pierre,
Al dot Smith at aeschi dot ch dot eu dot org)
- Fixed bug #48182 (ssl handshake fails during asynchronous socket connection).
(Sriram Natarajan)
- Fixed bug #48057 (Only the date fields of the first row are fetched,
others are empty). (info at programmiernutte dot net)
- Fixed bug #47481 (natcasesort() does not sort extended ASCII characters
correctly). (Herman Radtke)
- Fixed bug #47351 (Memory leak in DateTime). (Derick, Tobias John)
- Fixed bug #46020 (with Sun Java System Web Server 7.0 on HPUX, #define HPUX).
(Uwe Schindler)
- Fixed bug #45905 (imagefilledrectangle() clipping error).
(markril at hotmail dot com, Pierre)
- Fixed bug #45280 (Reflection of instantiated COM classes causes PHP to crash)
(Paul Richards, Kalle)
- Fixed bug #45141 (setcookie will output expires years of >4 digits). (Ilia)
- Fixed bug #44683 (popen crashes when an invalid mode is passed). (Pierre)
- Fixed bug #44144 (spl_autoload_functions() should return object instance
when appropriate). (Hannes, Etienne)
- Fixed bug #43510 (stream_get_meta_data() does not return same mode as used
in fopen). (Jani)
- Fixed bug #42434 (ImageLine w/ antialias = 1px shorter). (wojjie at gmail dot
com, Kalle)
17 Jun 2009, PHP 5.2.10
- Updated timezone database to version 2009.9 (2009i) (Derick)
@@ -423,9 +293,6 @@ PHP NEWS
either disable or change the compile time ini scan directory (FR #45114).
(Jani)
- Reverted fix for bug #44197 due to behaviour change in minor version.
(Felipe)
- Fixed missing initialization of BG(page_uid) and BG(page_gid),
reported by Maksymilian Arciemowicz. (Stas)
- Fixed memory leak inside sqlite_create_aggregate(). (Felipe)
@@ -471,6 +338,8 @@ PHP NEWS
attribute.(Scott)
- Fixed a crash on invalid method in ReflectionParameter constructor.
(Christian Seiler)
- Reverted fix for bug #44197 due to behaviour change in minor version.
(Felipe)
- Fixed bug #46732 (mktime.year description is wrong). (Derick)
- Fixed bug #46696 (cURL fails in upload files with specified content-type).
@@ -718,8 +587,6 @@ PHP NEWS
01 May 2008, PHP 5.2.6
- Upgraded PCRE to version 7.6 (Nuno)
- Fixed two possible crashes inside posix extension (Tony)
- Fixed incorrect heredoc handling when label is used within the block.
(Matt)
@@ -739,6 +606,7 @@ PHP NEWS
- Fixed segfault in filter extension when using callbacks. (Arnar Mar Sig,
Felipe)
- Fixed faulty fix for bug #40189 (endless loop in zlib.inflate stream filter). (Greg)
- Upgraded PCRE to version 7.6 (Nuno)
- Fixed bug #44742 (timezone_offset_get() causes segmentation faults). (Derick)
- Fixed bug #44720 (Prevent crash within session_register()). (Scott)
+41 -62
View File
@@ -1,31 +1,24 @@
====================
SVN Commit Rules
====================
This is the first file you should be reading after you get your SVN account.
We'll assume you're basically familiar with SVN, but feel free to post
your questions on the mailing list. Please have a look at
http://svnbook.red-bean.com/ for more detailed information on SVN.
This is the first file you should be reading after you get your CVS account.
We'll assume you're basically familiar with CVS, but feel free to post
your questions on the mailing list. Please have a look at
http://cvsbook.red-bean.com/ for more detailed information on CVS.
PHP is developed through the efforts of a large number of people.
Collaboration is a Good Thing(tm), and SVN lets us do this. Thus, following
some basic rules with regards to SVN usage will::
Collaboration is a Good Thing(tm), and CVS lets us do this. Thus, following
some basic rules with regards to CVS usage will:
a. Make everybody happier, especially those responsible for maintaining
the SVN itself.
the CVS itself.
b. Keep the changes consistently well documented and easily trackable.
c. Prevent some of those 'Oops' moments.
d. Increase the general level of good will on planet Earth.
Having said that, here are the organizational rules::
Having said that, here are the organizational rules:
1. Respect other people working on the project.
2. Discuss any significant changes on the list before committing and get
confirmation from the release manager for the given branch.
2. Discuss any significant changes on the list before committing.
3. Look at EXTENSIONS file to see who is the primary maintainer of
the code you want to contribute to.
@@ -37,54 +30,45 @@ Having said that, here are the organizational rules::
6. Test your changes before committing them. We mean it. Really.
To do so use "make test".
7. For development use the --enable-maintainer-zts switch to ensure your
code handles TSRM correctly and doesn't break for thos who need that.
Currently we have the following branches in use::
Currently we have the following branches in use:
HEAD Will become PHP 6.0. This CVS branch is for active development.
PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature
enhancements may go in here, but please keep that as infrequent as
possible.
PHP_5_1 This branch is closed.
PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted
on this branch (Consult the releasemaster prior to commit).
PHP_4_3 This branch is closed.
trunk Will become PHP 6.0. This CVS branch is for active development.
The next few rules are more of a technical nature.
branches/PHP_5_3 Is used to release the PHP 5.3.x series. It still allows for
larger enhancements.
branches/PHP_5_2 Is used to release the PHP 5.2.x series. Only bugfixes are permitted
on this branch (Consult the releasemaster prior to commit).
branches/PHP_5_1 This branch is closed.
branches/PHP_4_4 This branch is closed.
The next few rules are more of a technical nature::
1. All changes should first go to trunk and then get merged from trunk
(aka MFH'ed) to all other relevant branches.
2. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
1. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
messages every day. Woe be to those who attempt to mess with it.
3. All news updates intended for public viewing, such as new features,
bug fixes, improvements, etc., should go into the NEWS file of the
*first* to be released version with the given change. In other words
any NEWS file change only needs to done in one branch.
2. All news updates intended for public viewing, such as new features,
bug fixes, improvements, etc., should go into the NEWS file.
NB! Lines, starting with @ will go automagically into NEWS file, but
this is NOT recommended, though. Please, add news entries directly to
this is NOT recommended, though. Please, add news entries directly to
NEWS file and don't forget to keep them adjusted and sorted.
4. Do not commit multiple file and dump all messages in one commit. If you
3. Do not commit multiple file and dump all messages in one commit. If you
modified several unrelated files, commit each group separately and
provide a nice commit message for each one. See example below.
5. Do write your commit message in such a way that it makes sense even
4. Do write your commit message in such a way that it makes sense even
without the corresponding diff. One should be able to look at it, and
immediately know what was modified. Definitely include the function name
in the message as shown below.
6. In your commit messages, keep each line shorter than 80 characters. And
5. In your commit messages, keep each line shorter than 80 characters. And
try to align your lines vertically, if they wrap. It looks bad otherwise.
7. If you modified a function that is callable from PHP, prepend PHP to
6. If you modified a function that is callable from PHP, prepend PHP to
the function name as shown below.
@@ -96,7 +80,7 @@ If a line begins with #, it is taken to be a comment and will not appear
in the ChangeLog. Everything else goes into the ChangeLog.
It is important to note that if your comment or news logline spans multiple
lines, you have to put # at the beginning of **every** such line.
lines, you have to put # at the beginning of _every_ such line.
Example. Say you modified two files, datetime.c and string.c. In datetime.c you
added a new format option for the date() function, and in string.c you fixed a
@@ -104,15 +88,13 @@ memory leak in php_trim(). Don't commit both of these at once. Commit them
separately and try to make sure your commit messages look something like the
following.
For datetime.c::
For datetime.c:
- Added new 'K' format modifier to date() for printing out number of days until
New Year's Eve.
- Added new 'K' format modifier to date() for printing out number of days
until New Year's Eve.
For string.c::
- Fixed a memory leak in php_trim() resulting from improper use of zval_dtor().
#- Man, that thing was leaking all over the place!
For string.c:
- Fixed a memory leak in php_trim() resulting from improper use of zval_dtor().
#- Man, that thing was leaking all over the place!
The # lines will be omitted from the ChangeLog automagically.
@@ -124,19 +106,16 @@ If you fix some bugs, you should note the bug ID numbers in your
commit message. Bug ID should be prefixed by "#" for easier access to
bug report when developers are browsing CVS via LXR or Bonsai.
Example::
Example:
Fixed bug #14016 (pgsql notice handler double free crash bug.)
Fixed bug #14016 (pgsql notice handler double free crash bug.)
If you don't see your messages in ChangeLog right away, don't worry!
These files are updated once a day, so your stuff will not show up until
somewhat later.
When you change the NEWS file for a bug fix, then please keep the bugs
sorted in decreasing order under the fixed version.
somewhat later.
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
to look at PHP SVN repository in various ways.
to look at PHP CVS repository in various ways.
To receive daily updates to ChangeLog and NEWS, send an empty message to
php-cvs-daily-subscribe@lists.php.net.
+30 -10
View File
@@ -8,11 +8,11 @@ part is making it acceptable for inclusion into our repository. :-)
How to create patch?
--------------------
We use Subversion (SVN) for revision control. You need to get the
source from SVN in order to create a patch. Read
http://www.php.net/svn.php for help on using SVN. You can check out
older branches, but make sure you get trunk as well and make your
patch work there.
We are working with CVS. You need to get CVS source to create a patch
that we accept. Visit http://www.php.net/anoncvs.php to get CVS
source. You can check out older versions, but make sure you get
the default branch (i.e. Do not use -r option when you check out the
CVS source)
Read CODING_STANDARDS file before you start working.
@@ -21,7 +21,7 @@ add a new feature to PHP. After you finished editing, please test your
patch. Read README.TESTING for testing.
After you finish testing your patch, take diff file using
"svn diff > your.patch" command.
"cvs diff > your.patch" command.
Read README.TESTING for submitting a test script for your patch. This is
not strictly required, but it is preferred to submit a test script along
@@ -41,8 +41,25 @@ maintainer and/or internals@lists.php.net, or pear-dev@lists.php.net if
you are patching PEAR. Official module maintainers can be found in
EXTENSIONS file in PHP source.
If you are new to SVN (Subversion), visit
http://svnbook.red-bean.com/ for details.
If you are new to CVS (Concurrent Versions System), visit
http://cvshome.org/ for details.
Recommended CVS client settings for creating patch file
------------------------------------------------------
Recommended ~/.cvsrc file setting is:
------
cvs -z3
update -d -P
checkout -P
diff -u
------
diff -u means:
-u Use the unified output format.
With this CVS setting, you don't have to worry about adding/deleting
newlines and spaces.
Check list for submitting patch
@@ -53,7 +70,10 @@ Check list for submitting patch
web server error logs when you test your patch?
- Did you build PHP for multi-threaded web servers. (Optional)
- Did you create test script for "make test"? (Recommended)
- Did you update SVN source before you take final patch?
- Did you check your patch is unified format and it does not
contain white space changes? (If you are not using recommended
cvs setting)
- Did you update CVS source before you take final patch?
- Did you read the patch again?
@@ -98,7 +118,7 @@ these questions:
What happens when your patch is applied?
----------------------------------------
Your name will be included together with your email address in the SVN
Your name will be included together with your email address in the CVS
commit log. If your patch affects end-users, a brief description
and your name might be added to the NEWS file.
+4 -24
View File
@@ -179,39 +179,20 @@ TSRM_API FILE *popen(const char *command, const char *type)
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env)
{
FILE *stream = NULL;
int fno, type_len = strlen(type), read, mode;
int fno, str_len = strlen(type), read, mode;
STARTUPINFO startup;
PROCESS_INFORMATION process;
SECURITY_ATTRIBUTES security;
HANDLE in, out;
process_pair *proc;
char *cmd;
int i;
char *ptype = (char *)type;
process_pair *proc;
TSRMLS_FETCH();
if (!type) {
return NULL;
}
/*The following two checks can be removed once we drop XP support */
type_len = strlen(type);
if (type_len <1 || type_len > 2) {
return NULL;
}
for (i=0; i < type_len; i++) {
if (!(*ptype == 'r' || *ptype == 'w' || *ptype == 'b' || *ptype == 't')) {
return NULL;
}
ptype++;
}
security.nLength = sizeof(SECURITY_ATTRIBUTES);
security.bInheritHandle = TRUE;
security.lpSecurityDescriptor = NULL;
if (!type_len || !CreatePipe(&in, &out, &security, 2048L)) {
if (!str_len || !CreatePipe(&in, &out, &security, 2048L)) {
return NULL;
}
@@ -223,7 +204,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
startup.hStdError = GetStdHandle(STD_ERROR_HANDLE);
read = (type[0] == 'r') ? TRUE : FALSE;
mode = ((type_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT;
mode = ((str_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT;
if (read) {
@@ -239,7 +220,6 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c "));
sprintf(cmd, "%s /c %s", TWG(comspec), command);
if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env, cwd, &startup, &process)) {
free(cmd);
return NULL;
}
free(cmd);
+3 -3
View File
@@ -381,12 +381,12 @@ ext/pfpro not actively maintained
ext/w32api pecl/ffi
ext/yp not actively maintained
sapi/activescript http://pecl4win.php.net/ext.php/php5activescript.dll (PECL package)
or pecl/activescript (SVN)
or pecl/activescript (CVS)
Modules in PECL that are not actively maintained (i.e. have not been supported
for some time, have no active maintainer working on them currently, and do not
have any PECL package releases), are still available in SVN at
http://svn.php.net/pecl/. However, unreleased PHP modules are by their nature
have any PECL package releases), are still available in CVS at
http://cvs.php.net/pecl/. However, unreleased PHP modules are by their nature
unsupported, and your mileage may vary when attempting to install or use them.
9b. Class constants in new PHP 5.1 extensions
+1 -1
View File
@@ -60,7 +60,7 @@ int(%d)
Warning: get_loaded_extensions() expects at most 1 parameter, 2 given in %s on line %d
NULL
Warning: get_defined_constants() expects at most 1 parameter, 2 given in %s on line %d
Warning: Wrong parameter count for get_defined_constants() in %s on line %d
NULL
string(5) "array"
string(5) "array"
+11 -12
View File
@@ -359,8 +359,7 @@ var_dump($global_var);
//Note: No error conditions relating to passing arugments can be tested
// because these are not functions but statements, it will result in syntax error.
?>
===DONE===
echo "Done\n";
--EXPECTF--
*** Testing unset(), empty() & isset() with scalar variables ***
-- Iteration 1 --
@@ -1186,11 +1185,11 @@ bool(true)
*** Testing unset(), emtpy() & isset() with resource variables ***
-- Iteration 1 --
resource(%d) of type (stream)
resource(5) of type (stream)
bool(true)
bool(false)
bool(true)
resource(%d) of type (stream)
resource(5) of type (stream)
bool(false)
bool(true)
bool(false)
@@ -1199,11 +1198,11 @@ bool(false)
Notice: Undefined variable: resource in %s on line %d
NULL
-- Iteration 2 --
resource(%d) of type (stream)
resource(6) of type (stream)
bool(true)
bool(false)
bool(true)
resource(%d) of type (stream)
resource(6) of type (stream)
bool(false)
bool(true)
bool(false)
@@ -1218,7 +1217,7 @@ bool(false)
bool(true)
*** Testing unset(), empty() & isset() with objects ***
object(Point)#%d (3) {
object(Point)#1 (3) {
["x"]=>
int(30)
["y"]=>
@@ -1240,7 +1239,7 @@ bool(false)
Notice: Undefined variable: lable in %s on line %d
bool(true)
object(Point)#%d (3) {
object(Point)#1 (3) {
["x"]=>
int(30)
["y"]=>
@@ -1248,7 +1247,7 @@ object(Point)#%d (3) {
["lable"]=>
string(6) "Point1"
}
object(Point)#%d (2) {
object(Point)#1 (2) {
["y"]=>
int(40)
["lable"]=>
@@ -1256,7 +1255,7 @@ object(Point)#%d (2) {
}
bool(false)
bool(true)
object(Point)#%d (0) {
object(Point)#1 (0) {
}
bool(true)
bool(false)
@@ -1277,7 +1276,7 @@ array(3) {
[2]=>
string(9) "testPoint"
}
object(Point)#%d (3) {
object(Point)#1 (3) {
["x"]=>
int(5)
["y"]=>
@@ -1330,4 +1329,4 @@ bool(false)
bool(false)
bool(true)
int(10)
===DONE===
Done
+1 -3
View File
@@ -41,14 +41,12 @@ $db = new hariCow;
var_dump($db);
?>
===DONE===
--EXPECTF--
Notice: Undefined variable: db in %sbug30162.php on line 35
NULL
object(hariCow)#%d (2) {
object(hariCow)#1 (2) {
["x"]=>
string(1) "x"
["y"]=>
string(1) "y"
}
===DONE===
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted)
--FILE--
<?php
$x = create_function('', 'return 1; }');
$y = create_function('', 'function a() { }; return 2;');
$z = create_function('', '{');
$w = create_function('', 'return 3;');
var_dump(
$x,
$y(),
$z,
$w(),
$y != $z
);
?>
--EXPECTF--
Parse error: syntax error, unexpected '}' in %s(%d) : runtime-created function on line 1
Parse error: syntax error, unexpected $end in %s(%d) : runtime-created function on line 1
bool(false)
int(2)
bool(false)
int(3)
bool(true)
-51
View File
@@ -1,51 +0,0 @@
--TEST--
Bug #48770 (call_user_func_array() fails to call parent from inheriting class)
--FILE--
<?php
class A {
public function func($str) {
var_dump(__METHOD__ .': '. $str);
}
private function func2($str) {
var_dump(__METHOD__ .': '. $str);
}
protected function func3($str) {
var_dump(__METHOD__ .': '. $str);
}
private function func22($str) {
var_dump(__METHOD__ .': '. $str);
}
}
class B extends A {
public function func($str) {
static $avoid_crash = 0;
if ($avoid_crash++ == 1) {
print "This method shouldn't be called when using parent::func!\n";
return;
}
call_user_func_array(array($this, 'parent::func'), array($str));
}
private function func2($str) {
var_dump(__METHOD__ .': '. $str);
}
protected function func3($str) {
var_dump(__METHOD__ .': '. $str);
}
}
class C extends B {
public function func($str) {
parent::func($str);
}
}
$c = new C;
$c->func('This should work!');
?>
--EXPECTF--
%unicode|string%(26) "A::func: This should work!"
-26
View File
@@ -1,26 +0,0 @@
--TEST--
Bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration).
--FILE--
<?php
class TestObject implements Iterator
{
public $n = 0;
function valid()
{
return ($this->n < 3);
}
function current() {return $this->n;}
function next() {$this->n++;}
function key() { }
function rewind() {$this->n = 0;}
}
$array_object = new TestObject();
foreach ((true ? $array_object : $array_object) as $item) echo "$item\n";
?>
--EXPECT--
0
1
2
+1
View File
@@ -1,5 +1,6 @@
--TEST--
Test function_exists() function : error conditions
--INI--
--FILE--
<?php
/*
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Check if get_required_files works
--CREDITS--
Sebastian Schürmann
sschuermann@chip.de
Testfest 2009 Munich
--FILE--
<?php
$files = get_required_files();
var_dump($files);
?>
--EXPECTF--
array(1) {
[0]=>
%string|unicode%(%d)%s
}
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Crash when function parameter modified via unexpected reference
--FILE--
<?php
function my_errorhandler($errno,$errormsg) {
global $my_var;
$my_var = 0;
return true;
}
set_error_handler("my_errorhandler");
$my_var = str_repeat("A",64);
$data = call_user_func_array("explode",array(new StdClass(), &$my_var));
$my_var=array(1,2,3);
$data = call_user_func_array("implode",array(&$my_var, new StdClass()));
echo "Done.\n";
?>
--EXPECTF--
Done.
+2
View File
@@ -1,5 +1,7 @@
--TEST--
unset() CV 7 (indirect unset() of global variable in import_request_variables())
--SKIPIF--
<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
--GET--
x=2
--FILE--
+10 -10
View File
@@ -901,21 +901,21 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
zend_hash_get_current_key_ex(&class_type->default_static_members, &str_index, &str_length, &num_index, 0, &pos);
if ((*p)->is_ref &&
class_type->parent &&
zend_hash_find(&class_type->parent->default_static_members, str_index, str_length, (void**)&q) == SUCCESS &&
*p == *q &&
zend_hash_find(CE_STATIC_MEMBERS(class_type->parent), str_index, str_length, (void**)&q) == SUCCESS) {
class_type->parent &&
zend_hash_find(&class_type->parent->default_static_members, str_index, str_length, (void**)&q) == SUCCESS &&
*p == *q &&
zend_hash_find(CE_STATIC_MEMBERS(class_type->parent), str_index, str_length, (void**)&q) == SUCCESS) {
(*q)->refcount++;
(*q)->is_ref = 1;
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)q, sizeof(zval*), NULL);
} else {
zval *r;
zval *q;
ALLOC_ZVAL(r);
*r = **p;
INIT_PZVAL(r);
zval_copy_ctor(r);
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)&r, sizeof(zval*), NULL);
ALLOC_ZVAL(q);
*q = **p;
INIT_PZVAL(q);
zval_copy_ctor(q);
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)&q, sizeof(zval*), NULL);
}
zend_hash_move_forward_ex(&class_type->default_static_members, &pos);
}
+1 -1
View File
@@ -89,7 +89,7 @@ inline static void * __zend_malloc(size_t len)
inline static void * __zend_calloc(size_t nmemb, size_t len)
{
void *tmp = _safe_malloc(nmemb, len, 0);
memset(tmp, 0, nmemb * len);
memset(tmp, 0, len);
return tmp;
}
+7 -8
View File
@@ -33,7 +33,7 @@ static ZEND_FUNCTION(zend_version);
static ZEND_FUNCTION(func_num_args);
static ZEND_FUNCTION(func_get_arg);
static ZEND_FUNCTION(func_get_args);
static ZEND_FUNCTION(strlen);
static ZEND_NAMED_FUNCTION(zend_if_strlen);
static ZEND_FUNCTION(strcmp);
static ZEND_FUNCTION(strncmp);
static ZEND_FUNCTION(strcasecmp);
@@ -93,7 +93,7 @@ static zend_function_entry builtin_functions[] = {
ZEND_FE(func_num_args, NULL)
ZEND_FE(func_get_arg, NULL)
ZEND_FE(func_get_args, NULL)
ZEND_FE(strlen, NULL)
{ "strlen", zend_if_strlen, NULL },
ZEND_FE(strcmp, NULL)
ZEND_FE(strncmp, NULL)
ZEND_FE(strcasecmp, NULL)
@@ -275,7 +275,7 @@ ZEND_FUNCTION(func_get_args)
/* {{{ proto int strlen(string str)
Get string length */
ZEND_FUNCTION(strlen)
ZEND_NAMED_FUNCTION(zend_if_strlen)
{
zval **str;
@@ -1516,7 +1516,6 @@ ZEND_FUNCTION(create_function)
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
RETURN_STRINGL(function_name, function_name_length, 0);
} else {
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
RETURN_FALSE;
}
}
@@ -1619,15 +1618,15 @@ ZEND_FUNCTION(get_loaded_extensions)
Return an array containing the names and values of all defined constants */
ZEND_FUNCTION(get_defined_constants)
{
zend_bool categorize = 0;
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &categorize) == FAILURE) {
return;
if (argc != 0 && argc != 1) {
ZEND_WRONG_PARAM_COUNT();
}
array_init(return_value);
if (categorize) {
if (argc) {
HashPosition pos;
zend_constant *val;
int module_number;
-13
View File
@@ -921,12 +921,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
for (i=0; i<fci->param_count; i++) {
zval *param;
if(EX(function_state).function->type == ZEND_INTERNAL_FUNCTION
&& !ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
&& PZVAL_IS_REF(*fci->params[i])) {
SEPARATE_ZVAL(fci->params[i]);
}
if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i+1)
&& !PZVAL_IS_REF(*fci->params[i])) {
if ((*fci->params[i])->refcount>1) {
@@ -1212,16 +1206,13 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSR
zval *local_retval_ptr=NULL;
zval **original_return_value_ptr_ptr = EG(return_value_ptr_ptr);
zend_op **original_opline_ptr = EG(opline_ptr);
int orig_interactive = CG(interactive);
EG(return_value_ptr_ptr) = &local_retval_ptr;
EG(active_op_array) = new_op_array;
EG(no_extensions)=1;
CG(interactive) = 0;
zend_execute(new_op_array TSRMLS_CC);
CG(interactive) = orig_interactive;
if (local_retval_ptr) {
if (retval_ptr) {
COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr);
@@ -1268,7 +1259,6 @@ void execute_new_code(TSRMLS_D)
zend_op *opline, *end;
zend_op *ret_opline;
zval *local_retval=NULL;
int orig_interactive;
if (!(CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE)
|| CG(active_op_array)->backpatch_count>0
@@ -1318,10 +1308,7 @@ void execute_new_code(TSRMLS_D)
EG(return_value_ptr_ptr) = &local_retval;
EG(active_op_array) = CG(active_op_array);
orig_interactive = CG(interactive);
CG(interactive) = 0;
zend_execute(CG(active_op_array) TSRMLS_CC);
CG(interactive) = orig_interactive;
if (local_retval) {
zval_ptr_dtor(&local_retval);
}
+3 -12
View File
@@ -46,21 +46,15 @@ static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number
static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS_DC) /* {{{ */
{
int result = FAILURE;
if (ini_entry->modified) {
if (ini_entry->on_modify) {
zend_try {
/* even if on_modify bails out, we have to continue on with restoring,
since there can be allocated variables that would be freed on MM shutdown
and would lead to memory corruption later ini entry is modified again */
result = ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
} zend_end_try();
}
if (stage == ZEND_INI_STAGE_RUNTIME && result == FAILURE) {
/* runtime failure is OK */
return 1;
}
if (ini_entry->value != ini_entry->orig_value) {
efree(ini_entry->value);
}
@@ -316,11 +310,8 @@ ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage) /*
}
if (EG(modified_ini_directives)) {
if (zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC) == 0) {
zend_hash_del(EG(modified_ini_directives), name, name_length);
} else {
return FAILURE;
}
zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC);
zend_hash_del(EG(modified_ini_directives), name, name_length);
}
return SUCCESS;
+3 -14
View File
@@ -2371,10 +2371,6 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
}
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;
varptr->refcount++;
@@ -3200,22 +3196,15 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
ALLOC_ZVAL(tmp);
INIT_PZVAL_COPY(tmp, array_ptr);
array_ptr = tmp;
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (ce && ce->get_iterator) {
array_ptr->refcount--;
}
}
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (!ce || !ce->get_iterator) {
array_ptr->refcount++;
}
} else {
if (OP1_TYPE == IS_CONST ||
((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
!array_ptr->is_ref &&
array_ptr->refcount > 1)) {
array_ptr->refcount > 1) {
zval *tmp;
ALLOC_ZVAL(tmp);
@@ -3228,7 +3217,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
}
}
if (ce && ce->get_iterator) {
if (OP1_TYPE != IS_TMP_VAR && ce && ce->get_iterator) {
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
if (iter && !EG(exception)) {
+12 -48
View File
@@ -2230,22 +2230,15 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ALLOC_ZVAL(tmp);
INIT_PZVAL_COPY(tmp, array_ptr);
array_ptr = tmp;
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (ce && ce->get_iterator) {
array_ptr->refcount--;
}
}
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (!ce || !ce->get_iterator) {
array_ptr->refcount++;
}
} else {
if (IS_CONST == IS_CONST ||
((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
!array_ptr->is_ref &&
array_ptr->refcount > 1)) {
array_ptr->refcount > 1) {
zval *tmp;
ALLOC_ZVAL(tmp);
@@ -2258,7 +2251,7 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (ce && ce->get_iterator) {
if (IS_CONST != IS_TMP_VAR && ce && ce->get_iterator) {
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
if (iter && !EG(exception)) {
@@ -4812,22 +4805,15 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ALLOC_ZVAL(tmp);
INIT_PZVAL_COPY(tmp, array_ptr);
array_ptr = tmp;
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (ce && ce->get_iterator) {
array_ptr->refcount--;
}
}
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (!ce || !ce->get_iterator) {
array_ptr->refcount++;
}
} else {
if (IS_TMP_VAR == IS_CONST ||
((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
!array_ptr->is_ref &&
array_ptr->refcount > 1)) {
array_ptr->refcount > 1) {
zval *tmp;
ALLOC_ZVAL(tmp);
@@ -4840,7 +4826,7 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (ce && ce->get_iterator) {
if (IS_TMP_VAR != IS_TMP_VAR && ce && ce->get_iterator) {
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
if (iter && !EG(exception)) {
@@ -7584,10 +7570,6 @@ 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 (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;
varptr->refcount++;
@@ -7972,22 +7954,15 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ALLOC_ZVAL(tmp);
INIT_PZVAL_COPY(tmp, array_ptr);
array_ptr = tmp;
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (ce && ce->get_iterator) {
array_ptr->refcount--;
}
}
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (!ce || !ce->get_iterator) {
array_ptr->refcount++;
}
} else {
if (IS_VAR == IS_CONST ||
((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
!array_ptr->is_ref &&
array_ptr->refcount > 1)) {
array_ptr->refcount > 1) {
zval *tmp;
ALLOC_ZVAL(tmp);
@@ -8000,7 +7975,7 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (ce && ce->get_iterator) {
if (IS_VAR != IS_TMP_VAR && ce && ce->get_iterator) {
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
if (iter && !EG(exception)) {
@@ -20013,10 +19988,6 @@ 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 (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;
varptr->refcount++;
@@ -20393,22 +20364,15 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ALLOC_ZVAL(tmp);
INIT_PZVAL_COPY(tmp, array_ptr);
array_ptr = tmp;
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (ce && ce->get_iterator) {
array_ptr->refcount--;
}
}
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
if (!ce || !ce->get_iterator) {
array_ptr->refcount++;
}
} else {
if (IS_CV == IS_CONST ||
((IS_CV == IS_CV || IS_CV == IS_VAR) &&
if ((IS_CV == IS_CV || IS_CV == IS_VAR) &&
!array_ptr->is_ref &&
array_ptr->refcount > 1)) {
array_ptr->refcount > 1) {
zval *tmp;
ALLOC_ZVAL(tmp);
@@ -20421,7 +20385,7 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (ce && ce->get_iterator) {
if (IS_CV != IS_TMP_VAR && ce && ce->get_iterator) {
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
if (iter && !EG(exception)) {
+1 -1
View File
@@ -2780,7 +2780,7 @@ AC_DEFUN([PHP_DETECT_SUNCC],[
AC_MSG_RESULT([no]),
SUNCC="yes"
GCC="no"
test -n "$auto_cflags" && CFLAGS="-O -xs -xstrconst -zlazyload"
test -n "$auto_cflags" && CFLAGS="-fsimple=2 -xnorunpath -xO4 -xalias_level=basic -xipo=1 -xlibmopt -xprefetch_level=1 -xprefetch=auto -xstrconst -xtarget=native -zlazyload"
GCC=""
AC_MSG_RESULT([yes])
)
+10 -18
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP Version 5 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2006 The PHP Group |
# | Copyright (c) 1997-2007 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 3.01 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -20,7 +20,9 @@
# Makefile to generate build tools
#
SUBDIRS = Zend TSRM
ZENDDIR = Zend
SUBDIRS = $(ZENDDIR) TSRM
STAMP = buildmk.stamp
@@ -31,10 +33,11 @@ all: $(STAMP) $(ALWAYS)
@$(MAKE) -s -f build/build2.mk
generated_lists:
@echo makefile_am_files = Zend/Makefile.am TSRM/Makefile.am > $@
@echo config_h_files = Zend/acconfig.h TSRM/acconfig.h >> $@
@echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
Zend/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@
@echo makefile_am_files = $(ZENDDIR)/Makefile.am \
TSRM/Makefile.am > $@
@echo config_h_files = $(ZENDDIR)/acconfig.h TSRM/acconfig.h >> $@
@echo config_m4_files = $(ZENDDIR)/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
$(ZENDDIR)/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@
$(STAMP): build/buildcheck.sh
@build/buildcheck.sh $(STAMP)
@@ -64,18 +67,7 @@ snapshot:
cvsclean-work:
@for i in `find . -name .cvsignore`; do \
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep -v config.nice | sed 's/[[:space:]]/ /g'` *.o *.a *.lo *.la *.gcno *.gcda .libs || true); \
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep -v config.nice | sed 's/[\r\n]/ /g'` *.o *.a .libs || true); \
done
svnclean-work:
@for i in `find . -type d -not -path '*/.svn/*' | grep -v '.svn'`; do \
(cd $$i 2>/dev/null && rm -rf `svn propget svn:ignore . | grep -v config.nice` *.o *.a *.lo *.la *.gcno *.gcda .libs || true); \
done
gitclean-work:
@if (test ! -f '.git/info/exclude' || grep -s "git-ls-files" .git/info/exclude); then \
(echo "Rebuild .git/info/exclude" && echo '*.o' > .git/info/exclude && git svn propget svn:ignore | grep -v config.nice >> .git/info/exclude); \
fi; \
git clean -X -f -d;
.PHONY: $(ALWAYS) snapshot
+2 -2
View File
@@ -48,9 +48,9 @@ fi
if test "$1" = "2" && test "$2" -ge "50"; then
echo "buildconf: Your version of autoconf likely contains buggy cache code."
echo " Running vcsclean for you."
echo " Running cvsclean for you."
echo " To avoid this, install autoconf-2.13."
./vcsclean
./cvsclean
stamp=
fi
+29 -2
View File
@@ -32,11 +32,38 @@ if test "$dev" = "0" -a "$devok" = "0"; then
echo "use buildconf --force to override this check."
exit 1
fi
if test -z "$ZENDDIR"; then
if grep "PHP_MAJOR_VERSION 5" main/php_version.h >/dev/null; then
v=5
else
v=4
fi
if test "$v" = "5"; then
if test -r "Zend/OBJECTS2_HOWTO"; then
:
else
mv Zend ZendEngine1 2>/dev/null
mv ZendEngine2 Zend
fi
else
if test -r "Zend/zend_execute_globals.h"; then
:
else
mv Zend ZendEngine2 2>/dev/null
mv ZendEngine1 Zend
fi
fi
ZENDDIR=Zend
echo "using default Zend directory"
fi
rm -f generated_lists
if test "$debug" = "yes"; then
${MAKE:-make} -s -f build/build.mk SUPPRESS_WARNINGS=""
${MAKE:-make} -s -f build/build.mk ZENDDIR="$ZENDDIR" SUPPRESS_WARNINGS=""
else
${MAKE:-make} -s -f build/build.mk
${MAKE:-make} -s -f build/build.mk ZENDDIR="$ZENDDIR"
fi
+7 -12
View File
@@ -31,7 +31,7 @@ dnl Basic autoconf + automake initialization, generation of config.nice.
dnl -------------------------------------------------------------------------
AC_PREREQ(2.13)
AC_INIT(README.SVN-RULES)
AC_INIT(README.CVS-RULES)
PHP_CONFIG_NICE(config.nice)
@@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h)
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=2
PHP_RELEASE_VERSION=11
PHP_EXTRA_VERSION="RC3"
PHP_RELEASE_VERSION=10
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`
@@ -171,7 +171,7 @@ dnl Check if bison generated files exist when bison does not..
case $php_cv_bison_version in
""|invalid[)]
if ! test -f "$abs_srcdir/Zend/zend_language_parser.h" || ! test -f "$abs_srcdir/Zend/zend_language_parser.c" ; then
AC_MSG_ERROR([bison is required to build PHP/Zend when building a SVN checkout!])
AC_MSG_ERROR([bison is required to build PHP/Zend when building a CVS checkout!])
fi
;;
esac
@@ -1556,18 +1556,13 @@ X
fi
if test "$PHP_SIGCHILD" != "yes"; then
if test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then
cat <<X
+--------------------------------------------------------------------+
| Notice: |
| If you encounter <defunc> processes when using a local Oracle |
| database, set the value BEQUEATH_DETACH=YES in Oracle Net's |
| sqlnet.ora file on the PHP host, or set the environment variable |
| BEQUEATH_DETACH to YES before starting Apache. If the problem |
| still occurs, then recompile PHP and specify --enable-sigchild |
| when configuring. |
| If you encounter <defunc> processes when using a local Oracle-DB |
| please recompile PHP and specify --enable-sigchild when configuring|
| (This problem has been reported under Linux using Oracle >= 8.1.5) |
X
fi
fi
fi
Executable
+3
View File
@@ -0,0 +1,3 @@
#! /bin/sh
${MAKE:-make} -f build/build.mk cvsclean-work
View File
File renamed without changes.
+11 -3
View File
@@ -21,6 +21,8 @@
#ifndef PHP_BCMATH_H
#define PHP_BCMATH_H
#if HAVE_BCMATH
#include "libbcmath/src/bcmath.h"
extern zend_module_entry bcmath_module_entry;
@@ -48,12 +50,18 @@ ZEND_BEGIN_MODULE_GLOBALS(bcmath)
long bc_precision;
ZEND_END_MODULE_GLOBALS(bcmath)
#ifdef ZTS
# define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v)
#if ZTS
#define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v)
#else
# define BCG(v) (bcmath_globals.v)
#define BCG(v) (bcmath_globals.v)
#endif
ZEND_EXTERN_MODULE_GLOBALS(bcmath)
#else
#define phpext_bcmath_ptr NULL
#endif
#endif /* PHP_BCMATH_H */
-14
View File
@@ -1,14 +0,0 @@
--TEST--
bcdiv — Divide two arbitrary precision numbers
--CREDITS--
TestFest2009
Antoni Torrents
antoni@solucionsinternet.com
--SKIPIF--
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
--FILE--
<?php
echo bcdiv('10.99', '0');
?>
--EXPECTF--
Warning: bcdiv(): Division by zero in %s.php on line %d
-13
View File
@@ -1,13 +0,0 @@
--TEST--
bcdiv — Divide two arbitrary precision numbers
--CREDITS--
Antoni Torrents
antoni@solucionsinternet.com
--SKIPIF--
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
--FILE--
<?php
echo bcdiv('1', '2', '3', '4');
?>
--EXPECTF--
Warning: Wrong parameter count for bcdiv() in %s.php on line %d
-13
View File
@@ -1,13 +0,0 @@
--TEST--
bcmod — Get modulus of an arbitrary precision number
--CREDITS--
Antoni Torrents
antoni@solucionsinternet.com
--SKIPIF--
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
--FILE--
<?php
echo bcmod('1', '2', '3');
?>
--EXPECTF--
Warning: Wrong parameter count for bcmod() in %s.php on line %d
-13
View File
@@ -1,13 +0,0 @@
--TEST--
bcpowmod — Raise an arbitrary precision number to another, reduced by a specified modulus
--CREDITS--
Antoni Torrents
antoni@solucionsinternet.com
--SKIPIF--
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
--FILE--
<?php
echo bcpowmod('1');
?>
--EXPECTF--
Warning: bcpowmod() expects at least 3 parameters, 1 given in %s.php on line %d
-13
View File
@@ -1,13 +0,0 @@
--TEST--
bcpowmod — Raise an arbitrary precision number to another, reduced by a specified modulus
--CREDITS--
Antoni Torrents
antoni@solucionsinternet.com
--SKIPIF--
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
--FILE--
<?php
echo bcpowmod('1', '2');
?>
--EXPECTF--
Warning: bcpowmod() expects at least 3 parameters, 2 given in %s.php on line %d
-13
View File
@@ -1,13 +0,0 @@
--TEST--
bcpowmod — Raise an arbitrary precision number to another, reduced by a specified modulus
--CREDITS--
Antoni Torrents
antoni@solucionsinternet.com
--SKIPIF--
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
--FILE--
<?php
echo bcpowmod('1', '2', '3', '4', '5');
?>
--EXPECTF--
Warning: bcpowmod() expects at most 4 parameters, 5 given in %s.php on line %d
-13
View File
@@ -1,13 +0,0 @@
--TEST--
bcsqrt — Get the square root of an arbitrary precision number
--CREDITS--
Antoni Torrents
antoni@solucionsinternet.com
--SKIPIF--
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
--FILE--
<?php
echo bcsqrt('-9');
?>
--EXPECTF--
Warning: bcsqrt(): Square root of negative number in %s.php on line %d
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #45280 (Reflection of instantiated COM classes causes PHP to crash)
--SKIPIF--
<?php
if (!extension_loaded("reflection")){ echo "skip, no reflection support present"; }
if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; }
?>
--FILE--
<?php
$dict = new COM("Scripting.Dictionary");
ob_start();
ReflectionObject::export($dict);
ob_get_clean();
echo 'done';
?>
--EXPECT--
done
+1 -1
View File
@@ -7,7 +7,7 @@ PHP_ARG_WITH(curl, for cURL support,
dnl Temporary option while we develop this aspect of the extension
PHP_ARG_WITH(curlwrappers, if we should use cURL for url streams,
[ --with-curlwrappers EXPERIMENTAL: Use cURL for url streams], no, no)
[ --with-curlwrappers Use cURL for url streams], no, no)
if test "$PHP_CURL" != "no"; then
if test -r $PHP_CURL/include/curl/easy.h; then
+25 -60
View File
@@ -183,7 +183,7 @@ static int php_curl_option_url(php_curl *ch, const char *url, const int len) /*
return 0;
}
if (uri->scheme && !strncasecmp("file", uri->scheme, sizeof("file"))) {
if (!strncasecmp("file", uri->scheme, sizeof("file"))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol 'file' disabled in cURL");
php_url_free(uri);
return 0;
@@ -696,24 +696,13 @@ PHP_MINIT_FUNCTION(curl)
char **p = (char **)info->protocols;
while (*p != NULL) {
/* Do not enable cURL "file" protocol and make sure cURL is always used when --with-curlwrappers is enabled */
if (strncasecmp(*p, "file", sizeof("file")-1) != 0) {
php_unregister_url_stream_wrapper(*p TSRMLS_CC);
php_register_url_stream_wrapper(*p, &php_curl_wrapper TSRMLS_CC);
}
(void) *p++;
php_register_url_stream_wrapper(*p++, &php_curl_wrapper TSRMLS_CC);
}
}
# else
php_unregister_url_stream_wrapper("http");
php_register_url_stream_wrapper("http", &php_curl_wrapper TSRMLS_CC);
php_unregister_url_stream_wrapper("https");
php_register_url_stream_wrapper("https", &php_curl_wrapper TSRMLS_CC);
php_unregister_url_stream_wrapper("ftp");
php_register_url_stream_wrapper("ftp", &php_curl_wrapper TSRMLS_CC);
php_unregister_url_stream_wrapper("ftps");
php_register_url_stream_wrapper("ftps", &php_curl_wrapper TSRMLS_CC);
php_unregister_url_stream_wrapper("ldap");
php_register_url_stream_wrapper("ldap", &php_curl_wrapper TSRMLS_CC);
# endif
#endif
@@ -1142,7 +1131,6 @@ PHP_FUNCTION(curl_init)
{
php_curl *ch;
zval **url;
zval *clone;
CURL *cp;
int argc = ZEND_NUM_ARGS();
@@ -1172,9 +1160,6 @@ PHP_FUNCTION(curl_init)
ch->uses = 0;
MAKE_STD_ZVAL(clone);
ch->clone = clone;
curl_easy_setopt(ch->cp, CURLOPT_NOPROGRESS, 1);
curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0);
curl_easy_setopt(ch->cp, CURLOPT_ERRORBUFFER, ch->err.str);
@@ -1270,10 +1255,6 @@ PHP_FUNCTION(curl_copy_handle)
zend_llist_copy(&dupch->to_free.slist, &ch->to_free.slist);
zend_llist_copy(&dupch->to_free.post, &ch->to_free.post);
/* Keep track of cloned copies to avoid invoking curl destructors for every clone */
ch->clone->refcount++;
dupch->clone = ch->clone;
ZEND_REGISTER_RESOURCE(return_value, dupch, le_curl);
dupch->id = Z_LVAL_P(return_value);
}
@@ -1455,7 +1436,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
error = CURLE_OK;
switch (option) {
case CURLOPT_FILE:
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
if (((php_stream *) what)->mode[0] != 'r') {
zend_list_addref(Z_LVAL_PP(zvalue));
ch->handlers->write->fp = fp;
ch->handlers->write->method = PHP_CURL_FILE;
@@ -1466,7 +1447,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
}
break;
case CURLOPT_WRITEHEADER:
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
if (((php_stream *) what)->mode[0] != 'r') {
zend_list_addref(Z_LVAL_PP(zvalue));
ch->handlers->write_header->fp = fp;
ch->handlers->write_header->method = PHP_CURL_FILE;
@@ -1482,7 +1463,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
ch->handlers->read->fd = Z_LVAL_PP(zvalue);
break;
case CURLOPT_STDERR:
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
if (((php_stream *) what)->mode[0] != 'r') {
if (ch->handlers->std_err) {
zval_ptr_dtor(&ch->handlers->std_err);
}
@@ -1592,32 +1573,35 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
* must be explicitly cast to long in curl_formadd
* use since curl needs a long not an int. */
if (*postval == '@') {
char *type, *filename;
char *type;
++postval;
if ((type = php_memnstr(postval, ";type=", sizeof(";type=") - 1, postval + Z_STRLEN_PP(current)))) {
if ((type = php_memnstr(postval, ";type=", sizeof(";type=") - 1, postval + strlen(postval)))) {
*type = '\0';
}
if ((filename = php_memnstr(postval, ";filename=", sizeof(";filename=") - 1, postval + Z_STRLEN_PP(current)))) {
*filename = '\0';
}
/* safe_mode / open_basedir check */
if (php_check_open_basedir(postval TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(postval, "rb+", CHECKUID_CHECK_MODE_PARAM))) {
if (type) {
*type = ';';
}
RETVAL_FALSE;
return 1;
}
error = curl_formadd(&first, &last,
CURLFORM_COPYNAME, string_key,
CURLFORM_NAMELENGTH, (long)string_key_len - 1,
CURLFORM_FILENAME, filename ? filename : postval,
CURLFORM_CONTENTTYPE, type ? type + sizeof(";type=") - 1 : "application/octet-stream",
CURLFORM_FILE, postval,
CURLFORM_END);
if (type) {
error = curl_formadd(&first, &last,
CURLFORM_COPYNAME, string_key,
CURLFORM_NAMELENGTH, (long)string_key_len - 1,
CURLFORM_FILE, postval,
CURLFORM_CONTENTTYPE, type + sizeof(";type=") - 1,
CURLFORM_END);
*type = ';';
}
if (filename) {
*filename = ';';
} else {
error = curl_formadd(&first, &last,
CURLFORM_COPYNAME, string_key,
CURLFORM_NAMELENGTH, (long)string_key_len - 1,
CURLFORM_FILE, postval,
CURLFORM_END);
}
} else {
error = curl_formadd(&first, &last,
@@ -1845,14 +1829,6 @@ PHP_FUNCTION(curl_exec)
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
}
/* flush the file handle, so any remaining data is synched to disk */
if (ch->handlers->write->method == PHP_CURL_FILE && ch->handlers->write->fp) {
fflush(ch->handlers->write->fp);
}
if (ch->handlers->write_header->method == PHP_CURL_FILE && ch->handlers->write_header->fp) {
fflush(ch->handlers->write_header->fp);
}
if (ch->handlers->write->method == PHP_CURL_RETURN) {
RETURN_EMPTY_STRING();
} else {
@@ -2092,19 +2068,8 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
#if LIBCURL_VERSION_NUM < 0x071101
zend_llist_clean(&ch->to_free.str);
#endif
/* cURL destructors should be invoked only by last curl handle */
if (ch->clone->refcount <= 1) {
zend_llist_clean(&ch->to_free.slist);
zend_llist_clean(&ch->to_free.post);
FREE_ZVAL(ch->clone);
} else {
ch->clone->refcount--;
ch->to_free.slist.dtor = NULL;
ch->to_free.post.dtor = NULL;
zend_llist_clean(&ch->to_free.slist);
zend_llist_clean(&ch->to_free.post);
}
zend_llist_clean(&ch->to_free.slist);
zend_llist_clean(&ch->to_free.post);
if (ch->handlers->write->buf.len > 0) {
smart_str_free(&ch->handlers->write->buf);
-1
View File
@@ -132,7 +132,6 @@ typedef struct {
long id;
unsigned int uses;
zend_bool in_callback;
zval *clone;
} php_curl;
typedef struct {
+7 -17
View File
@@ -129,7 +129,7 @@ static int on_progress_avail(php_stream *stream, double dltotal, double dlnow, d
/* our notification system only works in a single direction; we should detect which
* direction is important and use the correct values in this call */
php_stream_notify_progress(stream->context, (size_t) dlnow, (size_t) dltotal);
php_stream_notify_progress(stream->context, dlnow, dltotal);
return 0;
}
@@ -167,8 +167,7 @@ static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count T
tv.tv_sec = 15; /* TODO: allow this to be configured from the script */
/* wait for data */
switch ((curlstream->maxfd < 0) ? 1 :
select(curlstream->maxfd + 1, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &tv)) {
switch (select(curlstream->maxfd + 1, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &tv)) {
case -1:
/* error */
return 0;
@@ -181,8 +180,7 @@ static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count T
curlstream->mcode = curl_multi_perform(curlstream->multi, &curlstream->pending);
} while (curlstream->mcode == CURLM_CALL_MULTI_PERFORM);
}
} while (curlstream->maxfd >= 0 &&
curlstream->readbuffer.readpos >= curlstream->readbuffer.writepos && curlstream->pending > 0);
} while (curlstream->readbuffer.readpos >= curlstream->readbuffer.writepos && curlstream->pending > 0);
}
@@ -471,7 +469,8 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
#else
php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error mcode=%d", m);
#endif
goto exit_fail;
php_stream_close(stream);
return NULL;
}
/* we have only one curl handle here, even though we use multi syntax,
@@ -489,23 +488,14 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
}
}
if (msg_found) {
goto exit_fail;
php_stream_close(stream);
return NULL;
}
}
/* context headers are not needed anymore */
if (slist) {
curl_easy_setopt(curlstream->curl, CURLOPT_HTTPHEADER, NULL);
curl_slist_free_all(slist);
}
return stream;
exit_fail:
php_stream_close(stream);
if (slist) {
curl_slist_free_all(slist);
}
return NULL;
}
static php_stream_wrapper_ops php_curl_wrapper_ops = {
+3
View File
@@ -5,6 +5,9 @@ Bug #46739 (array returned by curl_getinfo should contain content_type key)
if (!extension_loaded("curl")) {
exit("skip curl extension not loaded");
}
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
}
?>
--FILE--
<?php
-47
View File
@@ -1,47 +0,0 @@
--TEST--
Test curl_setopt() CURLOPT_FILE readonly file handle
--CREDITS--
Mark van der Velden
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
/*
* Description : Adds a file which stores the received data from curl_exec();
* Source code : ext/curl/multi.c
* Test documentation: http://wiki.php.net/qa/temp/ext/curl
*/
// Figure out what handler to use
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
if(!empty($host)) {
// Use the set Environment variable
$url = "$host/get.php";
} else {
// Create a temporary file for the test
$tempname = tempnam(sys_get_temp_dir(), 'CURL_HANDLE');
$url = 'file://'. $tempname;
// add the test data to the file
file_put_contents($tempname, "Hello World!\nHello World!");
}
$tempfile = tempnam(sys_get_temp_dir(), 'CURL_FILE_HANDLE');
$ch = curl_init($url);
$fp = fopen($tempfile, "r"); // Opening 'fubar' with the incorrect readonly flag
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
curl_close($ch);
is_file($tempfile) and @unlink($tempfile);
isset($tempname) and is_file($tempname) and @unlink($tempname);
?>
--EXPECTF--
Warning: curl_setopt(): the provided file handle is not writable in %s on line %d
Hello World!
Hello World!
-44
View File
@@ -1,44 +0,0 @@
--TEST--
Test CURLOPT_READDATA without a callback function
--CREDITS--
Mattijs Hoitink mattijshoitink@gmail.com
#Testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
// The URL to POST to
$url = getenv('PHP_CURL_HTTP_REMOTE_SERVER') . '/get.php?test=post';
// Create a temporary file to read the data from
$tempname = tempnam(sys_get_temp_dir(), 'CURL_DATA');
$datalen = file_put_contents($tempname, "hello=world&smurf=blue");
ob_start();
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_READDATA, fopen($tempname, 'rb'));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:', "Content-Length: {$datalen}"));
if (false === $response = curl_exec($ch)) {
echo 'Error #' . curl_errno($ch) . ': ' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
// Clean the temporary file
@unlink($tempname);
--EXPECT--
array(2) {
["hello"]=>
string(5) "world"
["smurf"]=>
string(4) "blue"
}
-19
View File
@@ -1,19 +0,0 @@
--TEST--
curl_close
--CREDITS--
Stefan Koopmanschap <stefan@php.net>
#testfest Utrecht 2009
--SKIPIF--
<?php
if (!extension_loaded('curl')) print 'skip';
?>
--FILE--
<?php
$ch = curl_init();
curl_close($ch);
var_dump($ch);
?>
===DONE===
--EXPECTF--
resource(%d) of type (Unknown)
===DONE===
@@ -1,30 +0,0 @@
--TEST--
Test curl_copy_handle() function with basic functionality
--CREDITS--
Francesco Fullone ff@ideato.it
#PHPTestFest Cesena Italia on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
?>
--FILE--
<?php
echo "*** Testing curl_copy_handle(): basic ***\n";
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/');
curl_setopt($ch, CURLOPT_HEADER, 0);
// copy the handle
$ch2 = curl_copy_handle($ch);
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
?>
===DONE===
--EXPECTF--
*** Testing curl_copy_handle(): basic ***
bool(true)
===DONE===
@@ -1,42 +0,0 @@
--TEST--
Test curl_copy_handle() with simple get
--CREDITS--
Rick Buitenman <rick@meritos.nl>
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
echo '*** Testing curl copy handle with simple GET ***' . "\n";
$url = "{$host}/get.php?test=getpost&get_param=Hello%20World";
$ch = curl_init();
ob_start(); // start output buffering
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
$copy = curl_copy_handle($ch);
curl_close($ch);
$curl_content = curl_exec($copy);
curl_close($copy);
var_dump( $curl_content );
?>
===DONE===
--EXPECTF--
*** Testing curl copy handle with simple GET ***
string(106) "array(2) {
["test"]=>
string(7) "getpost"
["get_param"]=>
string(11) "Hello World"
}
array(0) {
}
"
===DONE===
@@ -1,49 +0,0 @@
--TEST--
Test curl_copy_handle() with simple POST
--CREDITS--
Rick Buitenman <rick@meritos.nl>
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
echo '*** Testing curl copy handle with simple POST ***' . "\n";
$url = "{$host}/get.php?test=getpost";
$ch = curl_init();
ob_start(); // start output buffering
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Person=John%20Doe");
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
$copy = curl_copy_handle($ch);
curl_close($ch);
$curl_content = curl_exec($copy);
curl_close($copy);
var_dump( $curl_content );
?>
===DONE===
--XFAIL--
This test fails, the copy seems to be missing the CURLOPT_POSTFIELDS after the original is closed
--EXPECTF--
*** Testing curl copy handle with simple POST ***
string(163) "array(1) {
["test"]=>
string(7) "getpost"
}
array(3) {
["Hello"]=>
string(5) "World"
["Foo"]=>
string(3) "Bar"
["Person"]=>
string(8) "John Doe"
}
"
===DONE===
@@ -1,44 +0,0 @@
--TEST--
Test curl_copy_handle() after exec()
--CREDITS--
Rick Buitenman <rick@meritos.nl>
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
echo '*** Test curl_copy_handle() after exec() ***' . "\n";
$url = "{$host}/get.php?test=getpost&get_param=Hello%20World";
$ch = curl_init();
ob_start(); // start output buffering
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
$curl_content = curl_exec($ch);
$copy = curl_copy_handle($ch);
curl_close($ch);
$curl_content_copy = curl_exec($copy);
curl_close($copy);
var_dump( $curl_content_copy );
?>
===DONE===
--EXPECTF--
*** Test curl_copy_handle() after exec() ***
string(106) "array(2) {
["test"]=>
string(7) "getpost"
["get_param"]=>
string(11) "Hello World"
}
array(0) {
}
"
===DONE===
@@ -1,52 +0,0 @@
--TEST--
Test curl_copy_handle() after exec() with POST
--CREDITS--
Rick Buitenman <rick@meritos.nl>
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
echo '*** Test curl_copy_handle() after exec() with POST ***' . "\n";
$url = "{$host}/get.php?test=getpost";
$ch = curl_init();
ob_start(); // start output buffering
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Person=John%20Doe");
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
$curl_content = curl_exec($ch);
$copy = curl_copy_handle($ch);
curl_close($ch);
$curl_content_copy = curl_exec($copy);
curl_close($copy);
var_dump( $curl_content_copy );
?>
===DONE===
--XFAIL--
This test fails, the output of the copy seems to be corrupted if the original is closed after exec()
--EXPECTF--
*** Test curl_copy_handle() after exec() with POST ***
string(163) "array(1) {
["test"]=>
string(7) "getpost"
}
array(3) {
["Hello"]=>
string(5) "World"
["Foo"]=>
string(3) "Bar"
["Person"]=>
string(8) "John Doe"
}
"
===DONE===
@@ -1,37 +0,0 @@
--TEST--
Test curl_copy_handle() with User Agent
--CREDITS--
Rick Buitenman <rick@meritos.nl>
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
echo '*** Testing curl copy handle with User Agent ***' . "\n";
$url = "{$host}/get.php?test=useragent";
$ch = curl_init();
ob_start(); // start output buffering
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'cURL phpt');
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
$copy = curl_copy_handle($ch);
var_dump( curl_exec($ch) );
var_dump( curl_exec($copy) );
curl_close($ch); // can not close original handle before curl_exec($copy) since it causes char * inputs to be invalid (see also: http://curl.haxx.se/libcurl/c/curl_easy_duphandle.html)
curl_close($copy);
?>
===DONE===
--EXPECTF--
*** Testing curl copy handle with User Agent ***
string(9) "cURL phpt"
string(9) "cURL phpt"
===DONE===
@@ -1,45 +0,0 @@
--TEST--
Test curl_copy_handle() with simple POST
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
echo '*** Testing curl copy handle with simple POST using array as arguments ***' . "\n";
$url = "{$host}/get.php?test=getpost";
$ch = curl_init();
ob_start(); // start output buffering
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array("Hello" => "World", "Foo" => "Bar", "Person" => "John Doe"));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); // Disable Expect: header (lighttpd does not support it :)
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
$copy = curl_copy_handle($ch);
curl_close($ch);
$curl_content = curl_exec($copy);
curl_close($copy);
var_dump( $curl_content );
?>
===DONE===
--EXPECTF--
*** Testing curl copy handle with simple POST using array as arguments ***
string(163) "array(1) {
["test"]=>
string(7) "getpost"
}
array(3) {
["Hello"]=>
string(5) "World"
["Foo"]=>
string(3) "Bar"
["Person"]=>
string(8) "John Doe"
}
"
===DONE===
@@ -1,32 +0,0 @@
--TEST--
Test curl_copy_handle() change options in one handle
--CREDITS--
Francesco Fullone ff@ideato.it
#PHPTestFest Cesena Italia on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
?>
--FILE--
<?php
echo "*** Testing curl_copy_handle(): basic ***\n";
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/');
// copy the handle
$ch2 = curl_copy_handle($ch);
// change the CURLOPT_URL for the second handle
curl_setopt($ch2, CURLOPT_URL, 'http://www.bar.com/');
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
?>
===DONE===
--EXPECTF--
*** Testing curl_copy_handle(): basic ***
bool(false)
===DONE===
@@ -1,44 +0,0 @@
--TEST--
Test curl_copy_handle() add options to the handles
--CREDITS--
Francesco Fullone ff@ideato.it
#PHPTestFest Cesena Italia on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
?>
--COMMENT--
the only way to test if a option is setten on a curl handle is using the curl_getinfo() function.
but this can only check on a limited amount of options...
--FILE--
<?php
echo "*** Testing curl_copy_handle(): add options after copy ***\n";
// create a new cURL resource
$ch = curl_init();
// copy the handle
$ch2 = curl_copy_handle($ch);
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
// add some CURLOPT to the second handle
curl_setopt($ch2, CURLOPT_URL, 'http://www.example.com/');
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
// add same CURLOPT to the first handle
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/');
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
// change a CURLOPT in the second handle
curl_setopt($ch2, CURLOPT_URL, 'http://www.bar.com/');
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
?>
===DONE===
--EXPECTF--
*** Testing curl_copy_handle(): add options after copy ***
bool(true)
bool(false)
bool(true)
bool(false)
===DONE===
-33
View File
@@ -1,33 +0,0 @@
--TEST--
curl_error() function - basic test for curl_error using a fake url
--CREDITS--
Mattijs Hoitink mattijshoitink@gmail.com
#Testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
/*
* Prototype: string curl_error(resource $ch)
* Description: Returns a clear text error message for the last cURL operation.
* Source: ext/curl/interface.c
* Documentation: http://wiki.php.net/qa/temp/ext/curl
*/
// Fake URL to trigger an error
$url = "fakeURL";
echo "== Testing curl_error with a fake URL ==\n";
// cURL handler
$ch = curl_init($url);
ob_start(); // start output buffering
curl_exec($ch);
echo "Error: " . curl_error($ch);
curl_close($ch);
?>
--EXPECT--
== Testing curl_error with a fake URL ==
Error: Couldn't resolve host 'fakeURL'
@@ -1,19 +0,0 @@
--TEST--
curl_multi_close
--CREDITS--
Stefan Koopmanschap <stefan@php.net>
#testfest Utrecht 2009
--SKIPIF--
<?php
if (!extension_loaded('curl')) print 'skip';
?>
--FILE--
<?php
$ch = curl_multi_init();
curl_multi_close($ch);
var_dump($ch);
?>
===DONE===
--EXPECTF--
resource(%d) of type (Unknown)
===DONE===
@@ -1,59 +0,0 @@
--TEST--
Curl_multi_getcontent() basic test with different sources (local file/http)
--CREDITS--
Rein Velt (rein@velt.org)
#TestFest Utrecht 20090509
--SKIPIF--
<?php
if (!extension_loaded('curl')) print 'skip';
?>
--FILE--
<?php
//CURL_MULTI_GETCONTENT TEST
//CREATE RESOURCES
$ch1=curl_init();
$ch2=curl_init();
//SET URL AND OTHER OPTIONS
curl_setopt($ch1, CURLOPT_URL, "http://php.net/robots.txt");
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata2.txt");
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
//CREATE MULTIPLE CURL HANDLE
$mh=curl_multi_init();
//ADD THE 2 HANDLES
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);
//EXECUTE
$running=0;
do {
curl_multi_exec($mh,$running);
} while ($running>0);
$results1=curl_multi_getcontent($ch1);
$results2=curl_multi_getcontent($ch2);
//CLOSE
curl_multi_remove_handle($mh,$ch1);
curl_multi_remove_handle($mh,$ch2);
curl_multi_close($mh);
echo $results1;
echo $results2;
?>
--EXPECT--
User-agent: *
Disallow: /backend/
Disallow: /distributions/
Disallow: /stats/
Disallow: /source.php
Disallow: /search.php
Disallow: /mod.php
Disallow: /manual/add-note.php
CURL2
@@ -1,51 +0,0 @@
--TEST--
Curl_multi_getcontent() error test
--CREDITS--
Rein Velt (rein@velt.org)
#TestFest Utrecht 20090509
--SKIPIF--
<?php
if (!extension_loaded('curl')) print 'skip';
?>
--FILE--
<?php
//CURL_MULTI_GETCONTENT TEST
//CREATE RESOURCES
$ch1=curl_init();
$ch2=curl_init();
//SET URL AND OTHER OPTIONS
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);
//CREATE MULTIPLE CURL HANDLE
$mh=curl_multi_init();
//ADD THE 2 HANDLES
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);
//EXECUTE
$running=0;
do {
curl_multi_exec($mh,$running);
} while ($running>0);
$results1=curl_multi_getcontent(); //no parameter
$results2=curl_multi_getcontent($ch2);
//CLOSE
curl_multi_remove_handle($mh,$ch1);
curl_multi_remove_handle($mh,$ch2);
curl_multi_close($mh);
echo $results1;
echo $results2;
?>
--EXPECTF--
Warning: curl_multi_getcontent() expects exactly 1 parameter, 0 given in %s on line %d
CURL2
@@ -1,51 +0,0 @@
--TEST--
Curl_multi_getcontent() error test
--CREDITS--
Rein Velt (rein@velt.org)
#TestFest Utrecht 20090509
--SKIPIF--
<?php
if (!extension_loaded('curl')) print 'skip';
?>
--FILE--
<?php
//CURL_MULTI_GETCONTENT TEST
//CREATE RESOURCES
$ch1=curl_init();
$ch2=curl_init();
//SET URL AND OTHER OPTIONS
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);
//CREATE MULTIPLE CURL HANDLE
$mh=curl_multi_init();
//ADD THE 2 HANDLES
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);
//EXECUTE
$running=0;
do {
curl_multi_exec($mh,$running);
} while ($running>0);
$results1=curl_multi_getcontent($ch1,$ch2); //no parameter
$results2=curl_multi_getcontent($ch2);
//CLOSE
curl_multi_remove_handle($mh,$ch1);
curl_multi_remove_handle($mh,$ch2);
curl_multi_close($mh);
echo $results1;
echo $results2;
?>
--EXPECTF--
Warning: curl_multi_getcontent() expects exactly 1 parameter, 2 given in %s on line %d
CURL2
@@ -1,53 +0,0 @@
--TEST--
Curl_multi_getcontent() error test
--CREDITS--
Rein Velt (rein@velt.org)
#TestFest Utrecht 20090509
--SKIPIF--
<?php
if (!extension_loaded('curl')) print 'skip';
?>
--FILE--
<?php
//CURL_MULTI_GETCONTENT TEST
//CREATE RESOURCES
$ch1=curl_init();
$ch2=curl_init();
//SET URL AND OTHER OPTIONS
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);
//CREATE MULTIPLE CURL HANDLE
$mh=curl_multi_init();
//ADD THE 2 HANDLES
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);
//EXECUTE
$running=0;
do {
curl_multi_exec($mh,$running);
} while ($running>0);
$ch1="string";
$results1=curl_multi_getcontent($ch1); //incorrect parameter type
$results2=curl_multi_getcontent($ch2);
//CLOSE
//curl_multi_remove_handle($mh,$ch1);
curl_multi_remove_handle($mh,$ch2);
curl_multi_close($mh);
echo $results1;
echo $results2;
?>
--EXPECTF--
Warning: curl_multi_getcontent() expects parameter 1 to be resource, %unicode_string_optional% given in %s on line %d
CURL2
@@ -1,66 +0,0 @@
--TEST--
Curl_multi_getcontent() error test with undefined handle
--CREDITS--
Rein Velt (rein@velt.org)
#TestFest Utrecht 20090509
--SKIPIF--
<?php
if (!extension_loaded('curl')) print 'skip';
?>
--FILE--
<?php
//CURL_MULTI_GETCONTENT TEST
//CREATE RESOURCES
//$ch1=undefined;
$ch2=curl_init();
//SET URL AND OTHER OPTIONS
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);
//CREATE MULTIPLE CURL HANDLE
$mh=curl_multi_init();
//ADD THE 2 HANDLES
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);
//EXECUTE
$running=0;
do {
curl_multi_exec($mh,$running);
} while ($running>0);
$results1=curl_multi_getcontent($ch1); //incorrect parameter type
$results2=curl_multi_getcontent($ch2);
//CLOSE
//curl_multi_remove_handle($mh,$ch1);
curl_multi_remove_handle($mh,$ch2);
curl_multi_close($mh);
echo $results1;
echo $results2;
?>
--EXPECTF--
Notice: Undefined variable: ch1 in %s on line %d
Warning: curl_setopt(): supplied argument is not a valid cURL handle resource in %s on line %d
Notice: Undefined variable: ch1 in %s on line %d
Warning: curl_setopt(): supplied argument is not a valid cURL handle resource in %s on line %d
Notice: Undefined variable: ch1 in %s on line %d
Warning: curl_multi_add_handle() expects parameter 2 to be resource, null given in %s on line %d
Notice: Undefined variable: ch1 in %s on line %d
Warning: curl_multi_getcontent() expects parameter 1 to be resource, null given in %s on line %d
CURL2
-31
View File
@@ -1,31 +0,0 @@
--TEST--
Test curl_multi_init()
--CREDITS--
Mark van der Velden
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
/* Prototype : resource curl_multi_init(void)
* Description : Returns a new cURL multi handle
* Source code : ext/curl/multi.c
* Test documentation: http://wiki.php.net/qa/temp/ext/curl
*/
// start testing
echo "*** Testing curl_multi_init(void); ***\n";
//create the multiple cURL handle
$mh = curl_multi_init();
var_dump($mh);
curl_multi_close($mh);
var_dump($mh);
?>
===DONE===
--EXPECTF--
*** Testing curl_multi_init(void); ***
resource(%d) of type (curl_multi)
resource(%d) of type (Unknown)
===DONE===
@@ -1,27 +0,0 @@
--TEST--
Test curl_multi_select()
--CREDITS--
Ivo Jansch <ivo@ibuildings.com>
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
/* Prototype : resource curl_multi_select($mh, $timeout=1.0])
* Description : Get all the sockets associated with the cURL extension, which can then be
* "selected"
* Source code : ?
* Test documentation: http://wiki.php.net/qa/temp/ext/curl
*/
//create the multiple cURL handle
$mh = curl_multi_init();
echo curl_multi_select($mh)."\n";
curl_multi_close($mh);
?>
===DONE===
--EXPECTF--
%r(0|-1)%r
===DONE===
@@ -1,22 +0,0 @@
--TEST--
CURLOPT_FOLLOWLOCATION case check safe_mode and open_basedir
--CREDITS--
WHITE new media architects - Dennis
--INI--
open_basedir = DIRECTORY_SEPARATOR."tmp";
--SKIPIF--
<?php
if (!extension_loaded("curl")) print "skip cURL not loaded";
?>
--FILE--
<?php
print (ini_get("OPEN_BASEDIR"));
$ch = curl_init();
$succes = curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_close($ch);
var_dump($succes);
?>
--EXPECTF--
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)
@@ -1,54 +0,0 @@
--TEST--
cURL option CURLOPT_READFUNCTION
--CREDITS--
WHITE new media architects - Jeroen Vermeulen
#testfest Utrecht 2009
--SKIPIF--
<?php
if (!extension_loaded("curl")) print "skip cURL extension not loaded";
?>
--FILE--
<?php
function custom_readfunction($oCurl, $hReadHandle, $iMaxOut)
{
$sData = fread($hReadHandle,$iMaxOut-10); # -10 to have space to add "custom:"
if (!empty($sData))
{
$sData = "custom:".$sData;
}
return $sData;
}
$sFileBase = dirname(__FILE__).DIRECTORY_SEPARATOR.'curl_opt_CURLOPT_READFUNCTION';
$sReadFile = $sFileBase.'_in.tmp';
$sWriteFile = $sFileBase.'_out.tmp';
$sWriteUrl = 'file://'.$sWriteFile;
file_put_contents($sReadFile,'contents of tempfile');
$hReadHandle = fopen($sReadFile, 'r');
$oCurl = curl_init();
curl_setopt($oCurl, CURLOPT_URL, $sWriteUrl);
curl_setopt($oCurl, CURLOPT_UPLOAD, 1);
curl_setopt($oCurl, CURLOPT_READFUNCTION, "custom_readfunction" );
curl_setopt($oCurl, CURLOPT_INFILE, $hReadHandle );
curl_exec($oCurl);
curl_close($oCurl);
fclose ($hReadHandle);
$sOutput = file_get_contents($sWriteFile);
var_dump($sOutput);
?>
===DONE===
--CLEAN--
<?php
$sFileBase = dirname(__FILE__).DIRECTORY_SEPARATOR.'curl_opt_CURLOPT_READFUNCTION';
$sReadFile = $sFileBase.'_in.tmp';
$sWriteFile = $sFileBase.'_out.tmp';
unlink($sReadFile);
unlink($sWriteFile);
?>
--EXPECT--
string(27) "custom:contents of tempfile"
===DONE===
@@ -1,55 +0,0 @@
--TEST--
curl_setopt_array() function - tests setting multiple cURL options with curl_setopt_array()
--CREDITS--
Mattijs Hoitink mattijshoitink@gmail.com
#Testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
/*
* Prototype: bool curl_setopt_array(resource $ch, array $options)
* Description: Sets multiple options for a cURL session.
* Source: ext/curl/interface.c
* Documentation: http://wiki.php.net/qa/temp/ext/curl
*/
// Figure out what handler to use
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
if (!empty($host)) {
// Use the set Environment variable
$url = "{$host}/get.php?test=get";
} else {
// Create a temporary file for the test
$tempname = tempnam(sys_get_temp_dir(), 'CURL_HANDLE');
$url = 'file://'. $tempname;
// add the test data to the file
file_put_contents($tempname, "Hello World!\nHello World!");
}
// Start the test
echo '== Starting test curl_setopt_array($ch, $options); ==' . "\n";
// curl handler
$ch = curl_init();
// options for the curl handler
$options = array (
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => 1
);
ob_start(); // start output buffering
curl_setopt_array($ch, $options);
$returnContent = curl_exec($ch);
curl_close($ch);
var_dump($returnContent);
?>
--EXPECT--
== Starting test curl_setopt_array($ch, $options); ==
string(25) "Hello World!
Hello World!"
-35
View File
@@ -1,35 +0,0 @@
--TEST--
curl_setopt basic tests.
--CREDITS--
Paul Sohier
#phptestfest utrecht
--INI--
safe_mode=On
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
// start testing
echo "*** Testing curl_setopt with CURLOPT_FOLLOWLOCATION in safemode\n";
$url = "{$host}/";
$ch = curl_init();
ob_start(); // start output buffering
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$curl_content = curl_exec($ch);
curl_close($ch);
var_dump( $curl_content );
?>
===DONE===
--EXPECTF--
*** Testing curl_setopt with CURLOPT_FOLLOWLOCATION in safemode
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===
-50
View File
@@ -1,50 +0,0 @@
--TEST--
curl_setopt basic tests with CURLOPT_STDERR.
--CREDITS--
Paul Sohier
#phptestfest utrecht
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
// start testing
echo "*** Testing curl_setopt with CURLOPT_STDERR\n";
$temp_file = tempnam(sys_get_temp_dir(), 'CURL_STDERR');
$handle = fopen($temp_file, 'w');
$url = "{$host}/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_STDERR, $handle);
$curl_content = curl_exec($ch);
fclose($handle);
unset($handle);
var_dump( file_get_contents($temp_file) );
@unlink($temp_file);
ob_start(); // start output buffering
$handle = fopen($temp_file, 'w');
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
curl_setopt($ch, CURLOPT_STDERR, $handle);
$data = curl_exec($ch);
ob_end_clean();
fclose($handle);
unset($handle);
var_dump( file_get_contents($temp_file) );
@unlink($temp_file);
curl_close($ch);
?>
--EXPECTF--
*** Testing curl_setopt with CURLOPT_STDERR
string(%d) "%S"
string(%d) "%S"
-43
View File
@@ -1,43 +0,0 @@
--TEST--
curl_setopt() call with CURLOPT_HTTPHEADER
--CREDITS--
Paul Sohier
#phptestfest utrecht
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
// start testing
echo "*** curl_setopt() call with CURLOPT_HTTPHEADER\n";
$url = "{$host}/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, 1);
$curl_content = curl_exec($ch);
curl_close($ch);
var_dump( $curl_content );
$ch = curl_init();
ob_start(); // start output buffering
curl_setopt($ch, CURLOPT_HTTPHEADER, array());
curl_setopt($ch, CURLOPT_URL, $host);
$curl_content = curl_exec($ch);
ob_end_clean();
curl_close($ch);
var_dump( $curl_content );
?>
--EXPECTF--
*** curl_setopt() call with CURLOPT_HTTPHEADER
Warning: curl_setopt(): You must pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE, CURLOPT_HTTP200ALIASES and CURLOPT_POSTQUOTE arguments in %s on line %d
bool(false)
bool(true)
-44
View File
@@ -1,44 +0,0 @@
--TEST--
curl_setopt() call with CURLOPT_RETURNTRANSFER
--CREDITS--
Paul Sohier
#phptestfest utrecht
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
// start testing
echo "*** curl_setopt() call with CURLOPT_RETURNTRANSFER set to 1\n";
$url = "{$host}/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$curl_content = curl_exec($ch);
curl_close($ch);
var_dump( $curl_content );
echo "*** curl_setopt() call with CURLOPT_RETURNTRANSFER set to 0\n";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
ob_start();
$curl_content = curl_exec($ch);
ob_end_clean();
curl_close($ch);
var_dump( $curl_content );
?>
--EXPECTF--
*** curl_setopt() call with CURLOPT_RETURNTRANSFER set to 1
string(%d) "%a"
*** curl_setopt() call with CURLOPT_RETURNTRANSFER set to 0
bool(true)
-41
View File
@@ -1,41 +0,0 @@
--TEST--
curl_setopt() basic parameter test
--CREDITS--
Paul Sohier
#phptestfest utrecht
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
echo "*** curl_setopt() call with incorrect parameters\n";
$ch = curl_init();
curl_setopt();
curl_setopt(false);
curl_setopt($ch);
curl_setopt($ch, false);
curl_setopt($ch, -1);
curl_setopt($ch, '');
curl_setopt($ch, 1, false);
curl_setopt(false, false, false);
curl_setopt($ch, '', false);
curl_setopt($ch, 1, '');
curl_setopt($ch, -1, 0);
?>
--EXPECTF--
*** curl_setopt() call with incorrect parameters
Warning: Wrong parameter count for curl_setopt() in %s on line %d
Warning: Wrong parameter count for curl_setopt() in %s on line %d
Warning: Wrong parameter count for curl_setopt() in %s on line %d
Warning: Wrong parameter count for curl_setopt() in %s on line %d
Warning: Wrong parameter count for curl_setopt() in %s on line %d
Warning: Wrong parameter count for curl_setopt() in %s on line %d
Warning: curl_setopt(): supplied argument is not a valid cURL handle resource in %s on line %d
-1
View File
@@ -1 +0,0 @@
CURL1
-1
View File
@@ -1 +0,0 @@
CURL2
-32
View File
@@ -1,32 +0,0 @@
--TEST--
Test curl_version() function : error conditions
--SKIPIF--
<?php
if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
die('skip - curl extension not available in this build');
}
?>
--FILE--
<?php
/* Prototype : array curl_version ([ int $age ] )
* Description: Returns information about the cURL version.
* Source code: ext/curl/interface.c
*/
echo "*** Testing curl_version() : error conditions ***\n";
echo "\n-- Testing curl_version() function with more than expected no. of arguments --\n";
$extra_arg = 10;
var_dump( curl_version(1, $extra_arg) );
?>
===Done===
--EXPECTF--
*** Testing curl_version() : error conditions ***
-- Testing curl_version() function with more than expected no. of arguments --
Warning: curl_version() expects at most 1 parameter, 2 given in %s on line %d
NULL
===Done===
-162
View File
@@ -1,162 +0,0 @@
--TEST--
Test curl_version() function : usage variations - test values for $ascii argument
--SKIPIF--
<?php
if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
die('skip - curl extension not available in this build');
}
?>
--FILE--
<?php
/* Prototype : array curl_version ([ int $age ] )
* Description: Returns information about the cURL version.
* Source code: ext/curl/interface.c
*/
echo "*** Testing curl_version() function: with unexpected inputs for 'age' argument ***\n";
//get an unset variable
$unset_var = 'string_val';
unset($unset_var);
//defining a class
class sample {
public function __toString() {
return "sample object";
}
}
//getting the resource
$file_handle = fopen(__FILE__, "r");
// array with different values for $input
$inputs = array (
// integer values
0,
1,
255,
256,
PHP_INT_MAX,
-PHP_INT_MAX,
// float values
10.5,
-20.5,
10.1234567e10,
// array values
array(),
array(0),
array(1, 2),
//string values
"ABC",
'abc',
"2abc",
// boolean values
true,
false,
TRUE,
FALSE,
// null values
NULL,
null,
// objects
new sample(),
// resource
$file_handle,
// undefined variable
@$undefined_var,
// unset variable
@$unset_var
);
// loop through with each element of the $inputs array to test curl_version() function
$count = 1;
foreach($inputs as $input) {
echo "-- Iteration $count --\n";
var_dump( is_array(curl_version($input)) );
$count ++;
}
fclose($file_handle); //closing the file handle
?>
===Done===
--EXPECTF--
*** Testing curl_version() function: with unexpected inputs for 'age' argument ***
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Iteration 5 --
bool(true)
-- Iteration 6 --
bool(true)
-- Iteration 7 --
bool(true)
-- Iteration 8 --
bool(true)
-- Iteration 9 --
bool(true)
-- Iteration 10 --
Warning: curl_version() expects parameter 1 to be long, array given in %s on line %d
bool(false)
-- Iteration 11 --
Warning: curl_version() expects parameter 1 to be long, array given in %s on line %d
bool(false)
-- Iteration 12 --
Warning: curl_version() expects parameter 1 to be long, array given in %s on line %d
bool(false)
-- Iteration 13 --
Warning: curl_version() expects parameter 1 to be long, string given in %s on line %d
bool(false)
-- Iteration 14 --
Warning: curl_version() expects parameter 1 to be long, string given in %s on line %d
bool(false)
-- Iteration 15 --
Notice: A non well formed numeric value encountered in %s on line %d
bool(true)
-- Iteration 16 --
bool(true)
-- Iteration 17 --
bool(true)
-- Iteration 18 --
bool(true)
-- Iteration 19 --
bool(true)
-- Iteration 20 --
bool(true)
-- Iteration 21 --
bool(true)
-- Iteration 22 --
Warning: curl_version() expects parameter 1 to be long, object given in %s on line %d
bool(false)
-- Iteration 23 --
Warning: curl_version() expects parameter 1 to be long, resource given in %s on line %d
bool(false)
-- Iteration 24 --
bool(true)
-- Iteration 25 --
bool(true)
===Done===
-36
View File
@@ -1,36 +0,0 @@
--TEST--
Test curl option CURLOPT_WRITEFUNCTION
--CREDITS--
Mathieu Kooiman <mathieuk@gmail.com>
Dutch UG, TestFest 2009, Utrecht
--DESCRIPTION--
Writes the value 'test' to a temporary file. Use curl to access this file, passing the output into a callback. Tests the PHP_CURL_USER case in curl_write.
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
function curl_callback($curl_handle, $received_data)
{
echo $received_data;
return strlen($received_data);
}
$log_file = tempnam(sys_get_temp_dir(), 'php-curl-test');
$fp = fopen($log_file, 'w+');
fwrite($fp, "test");
fclose($fp);
$ch = curl_init();
curl_setopt($ch, CURLOPT_WRITEFUNCTION, 'curl_callback');
curl_setopt($ch, CURLOPT_URL, 'file://' . $log_file);
curl_exec($ch);
curl_close($ch);
// cleanup
unlink($log_file);
?>
--EXPECT--
test
-38
View File
@@ -1,38 +0,0 @@
--TEST--
Test curl option CURLOPT_FILE
--CREDITS--
Mathieu Kooiman <mathieuk@gmail.com>
Dutch UG, TestFest 2009, Utrecht
--DESCRIPTION--
Writes the value 'test' to a temporary file. Use curl to access this file and store the output in another temporary file. Tests the PHP_CURL_FILE case in curl_write().
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
$test_file = tempnam(sys_get_temp_dir(), 'php-curl-test');
$log_file = tempnam(sys_get_temp_dir(), 'php-curl-test');
$fp = fopen($log_file, 'w+');
fwrite($fp, "test");
fclose($fp);
$testfile_fp = fopen($test_file, 'w+');
$ch = curl_init();
curl_setopt($ch, CURLOPT_FILE, $testfile_fp);
curl_setopt($ch, CURLOPT_URL, 'file://' . $log_file);
curl_exec($ch);
curl_close($ch);
fclose($testfile_fp);
echo file_get_contents($test_file);
// cleanup
unlink($test_file);
unlink($log_file);
?>
--EXPECT--
test
-33
View File
@@ -1,33 +0,0 @@
--TEST--
Test curl option CURLOPT_RETURNTRANSFER
--CREDITS--
Mathieu Kooiman <mathieuk@gmail.com>
Dutch UG, TestFest 2009, Utrecht
--DESCRIPTION--
Writes the value 'test' to a temporary file. Use curl to access this file and have it return the content from curl_exec(). Tests the PHP_CURL_RETURN case
of curl_write().
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
$log_file = tempnam(sys_get_temp_dir(), 'php-curl-test');
$fp = fopen($log_file, 'w+');
fwrite($fp, "test");
fclose($fp);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, 'file://' . $log_file);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
// cleanup
unlink($log_file);
?>
--EXPECT--
test
-30
View File
@@ -1,30 +0,0 @@
--TEST--
Test curl option CURLOPT_FILE with STDOUT handle
--CREDITS--
Mathieu Kooiman <mathieuk@gmail.com>
Dutch UG, TestFest 2009, Utrecht
--DESCRIPTION--
Writes the value 'test' to a temporary file. Use curl to access this file and store the output in another temporary file. Tests the PHP_CURL_FILE case in curl_write().
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
$log_file = tempnam(sys_get_temp_dir(), 'php-curl-test');
$fp = fopen($log_file, 'w+');
fwrite($fp, "test");
fclose($fp);
$ch = curl_init();
curl_setopt($ch, CURLOPT_FILE, STDOUT);
curl_setopt($ch, CURLOPT_URL, 'file://' . $log_file);
curl_exec($ch);
curl_close($ch);
// cleanup
unlink($log_file);
?>
--EXPECT--
test
@@ -1,30 +0,0 @@
--TEST--
Test curl option CURLOPT_HEADERFUNCTION
--CREDITS--
Mathieu Kooiman <mathieuk@gmail.com>
Dutch UG, TestFest 2009, Utrecht
--DESCRIPTION--
Hit the host identified by PHP_CURL_HTTP_REMOTE_SERVER and determine that the headers are sent to the callback specified for CURLOPT_HEADERFUNCTION. Different test servers specified for PHP_CURL_HTTP_REMOTE_SERVER might return different sets of headers. Just test for HTTP/1.1 200 OK.
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
function curl_header_callback($curl_handle, $data)
{
if (strtolower(substr($data,0, 4)) == 'http')
echo $data;
}
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'curl_header_callback');
curl_setopt($ch, CURLOPT_URL, $host);
curl_exec($ch);
curl_close($ch);
?>
--EXPECTF--
HTTP/1.1 %d %s
-3
View File
@@ -1,8 +1,5 @@
<?php
switch($_GET['test']) {
case 'post':
var_dump($_POST);
break;
case 'getpost':
var_dump($_GET);
var_dump($_POST);
+693 -675
View File
File diff suppressed because it is too large. Load diff
+3 -7
View File
@@ -38,10 +38,6 @@ static __inline __int64 llabs( __int64 i ) { return i >= 0? i: -i; }
static __inline __int64_t llabs( __int64_t i ) { return i >= 0 ? i : -i; }
#endif
#if defined(NETWARE) && defined(__MWERKS__)
static __inline long long llabs( long long i ) { return i >= 0 ? i : -i; }
#endif
/* {{{ arginfo */
static
ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1)
@@ -802,7 +798,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
/* year */
case 'L': length = slprintf(buffer, 32, "%d", timelib_is_leap((int) t->y)); break;
case 'y': length = slprintf(buffer, 32, "%02d", (int) t->y % 100); break;
case 'Y': length = slprintf(buffer, 32, "%s%04lld", t->y < 0 ? "-" : "", llabs(t->y)); break;
case 'Y': length = slprintf(buffer, 32, "%s%04ld", t->y < 0 ? "-" : "", llabs(t->y)); break;
/* time */
case 'a': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break;
@@ -1752,7 +1748,7 @@ static int date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int
}
timelib_unixtime2local(now, (timelib_sll) time(NULL));
timelib_fill_holes(dateobj->time, now, TIMELIB_NO_CLONE);
timelib_fill_holes(dateobj->time, now, 0);
timelib_update_ts(dateobj->time, tzi);
dateobj->time->have_weekday_relative = dateobj->time->have_relative = 0;
@@ -2280,7 +2276,7 @@ PHP_FUNCTION(timezone_transitions_get)
{
zval *object, *element;
php_timezone_obj *tzobj;
unsigned int i;
int i;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
-9
View File
@@ -1,9 +0,0 @@
--TEST--
Bug #48276 (date("Y") prints wrong year on Big Endian machines)
--INI--
date.timezone=UTC
--FILE--
<?php
var_dump(date("Y", 1245623227));
--EXPECT--
string(4) "2009"
@@ -1,16 +0,0 @@
--TEST--
cal_days_in_month: test invalid parameter
--CREDITS--
Havard Eide <nucleuz@gmail.com>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php if (!extension_loaded("calendar")) { echo "skip extension not available"; } ?>
--INI--
date.timezone=UTC
--FILE--
<?php
echo cal_days_in_month(99,0, 2009);
?>
--EXPECTF--
Warning: cal_days_in_month(): invalid calendar ID 99. in %s on line %d
@@ -1,16 +0,0 @@
--TEST--
cal_days_in_month: test invalid parameter
--CREDITS--
Havard Eide <nucleuz@gmail.com>
#PHPTestFest2009 Norway 2009-06-09 \o/
--SKIPIF--
<?php if (!extension_loaded("calendar")) { echo "skip extension not available"; } ?>
--INI--
date.timezone=UTC
--FILE--
<?php
echo cal_days_in_month(CAL_GREGORIAN,0, 2009);
?>
--EXPECTF--
Warning: cal_days_in_month(): invalid date. in %s on line %d
@@ -5,10 +5,6 @@ Test gmstrftime() function : usage variation - Checking Preferred date and time
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
die("skip Test is not valid for Windows");
}
if (!setlocale(LC_ALL, "en_US")) {
die("skip Locale en_US not available");
}
?>
--FILE--
<?php
-3
View File
@@ -5,9 +5,6 @@ Test strftime() function : usage variation - Checking Preferred date and time re
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
die("skip Test is not valid for Windows");
}
if (!setlocale(LC_ALL, "en_US")) {
die("skip The en_US locale is not available");
}
?>
--FILE--
<?php
-8
View File
@@ -175,15 +175,7 @@ DBA_EXISTS_FUNC(db4)
DB4_GKEY;
memset(&gval, 0, sizeof(gval));
if (info->flags & DBA_PERSISTENT) {
gval.flags |= DB_DBT_MALLOC;
}
if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) {
if (info->flags & DBA_PERSISTENT) {
free(gval.data);
}
return SUCCESS;
}
return FAILURE;
+2 -2
View File
@@ -3,13 +3,13 @@ Bug #36436 (DBA problem with Berkeley DB4)
--SKIPIF--
<?php
$handler = 'db4';
require_once dirname(__FILE__) .'/skipif.inc';
require_once('skipif.inc');
?>
--FILE--
<?php
$handler = 'db4';
require_once dirname(__FILE__) .'/test.inc';
require_once('test.inc');
$db = dba_popen($db_filename, 'c', 'db4');
+2 -2
View File
@@ -3,13 +3,13 @@ Bug #48240 (DBA Segmentation fault dba_nextkey)
--SKIPIF--
<?php
$handler = 'db4';
require_once dirname(__FILE__) .'/skipif.inc';
require_once('skipif.inc');
?>
--FILE--
<?php
$handler = 'db4';
require_once dirname(__FILE__) .'/test.inc';
require_once('test.inc');
$db = dba_open($db_filename, 'c', 'db4');
-27
View File
@@ -1,27 +0,0 @@
--TEST--
Bug #49125 (Error in dba_exists C code)
--SKIPIF--
<?php
$handler = 'db4';
require_once dirname(__FILE__) .'/skipif.inc';
?>
--FILE--
<?php
error_reporting(E_ALL);
$handler = 'db4';
require_once dirname(__FILE__) .'/test.inc';
$db = dba_popen($db_filename, 'c', 'db4');
dba_insert('foo', 'foo', $db);
var_dump(dba_exists('foo', $db));
dba_close($db);
unlink($db_filename);
--EXPECT--
bool(true)
+3 -3
View File
@@ -2,12 +2,12 @@
DBA File Creation Test
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
require_once('skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once dirname(__FILE__) .'/test.inc';
require_once('test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
echo "database file created\n";
@@ -18,4 +18,4 @@ DBA File Creation Test
?>
--EXPECTF--
database handler: %s
database file created
database file created
+2 -2
View File
@@ -2,12 +2,12 @@
DBA Insert/Fetch Test
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
require_once('skipif.inc');
die("info $HND handler used");
?>
--FILE--
<?php
require_once dirname(__FILE__) .'/test.inc';
require_once('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);
Loaded 100 of 950 files, more files were not shown because too many files have changed in this diff. Show more