mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-15 13:06:38 +00:00
Compare commits
111
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1cb7036515 | ||
|
|
ba04122ae2 | ||
|
|
e6646ab7cf | ||
|
|
d4671b904d | ||
|
|
dec83ec4d2 | ||
|
|
d73094aed4 | ||
|
|
54ba44da0a | ||
|
|
93a16cf13a | ||
|
|
81761e636d | ||
|
|
ccb33c060f | ||
|
|
6d68dbc331 | ||
|
|
db256c502e | ||
|
|
3840317d40 | ||
|
|
79e1cf2fe0 | ||
|
|
c9fa89534c | ||
|
|
b44e08d1e5 | ||
|
|
a68f6c9c28 | ||
|
|
f403bd2128 | ||
|
|
25c47a2522 | ||
|
|
c3003002f7 | ||
|
|
3ca8e5ab0f | ||
|
|
f88d938dfb | ||
|
|
2498962223 | ||
|
|
6f429dfccb | ||
|
|
4b4283bdc0 | ||
|
|
e1ae933031 | ||
|
|
30fce08b23 | ||
|
|
c860c9896e | ||
|
|
bdc3d68061 | ||
|
|
f36cb429f4 | ||
|
|
aaae921225 | ||
|
|
b13ed4ea93 | ||
|
|
db129f6e54 | ||
|
|
e782d1820b | ||
|
|
5f2df5d064 | ||
|
|
68a3c3f952 | ||
|
|
9485cad688 | ||
|
|
ca1bda67f2 | ||
|
|
43f939fae0 | ||
|
|
ceac7e4370 | ||
|
|
307a90caa3 | ||
|
|
c8cb2b4e10 | ||
|
|
144ff4d6b3 | ||
|
|
6354376924 | ||
|
|
f03c5db12e | ||
|
|
b2bc4dd331 | ||
|
|
57b543ee6f | ||
|
|
8e972386f0 | ||
|
|
ac564608bd | ||
|
|
84940122a9 | ||
|
|
e01ff47c43 | ||
|
|
9f9895b34d | ||
|
|
2c924e2848 | ||
|
|
60835e3051 | ||
|
|
00d0ecda10 | ||
|
|
e67b4072e0 | ||
|
|
caf8d811ef | ||
|
|
c0aa23fd86 | ||
|
|
b8f295a6d3 | ||
|
|
4092360764 | ||
|
|
1f10584566 | ||
|
|
e583ce82ec | ||
|
|
a8e42c91b0 | ||
|
|
0fbf8cebd7 | ||
|
|
3aaaf77a0e | ||
|
|
e6f4ec2f07 | ||
|
|
0fa4242464 | ||
|
|
aded4474fc | ||
|
|
4d7e6edd63 | ||
|
|
f3d8a9ad0d | ||
|
|
83855c0ce7 | ||
|
|
85cb296a09 | ||
|
|
86eaa90955 | ||
|
|
96d5c5e931 | ||
|
|
6b3f0cfc54 | ||
|
|
f7b30e6578 | ||
|
|
220c68d54a | ||
|
|
3410350caa | ||
|
|
1f5e20c33e | ||
|
|
a1c1dd6ba1 | ||
|
|
8a2e38ebdf | ||
|
|
aa85d1dbc1 | ||
|
|
1c4dafd84d | ||
|
|
a7db554314 | ||
|
|
d1fb4d2da4 | ||
|
|
bc8e357482 | ||
|
|
58c717ff8f | ||
|
|
56d7a43f00 | ||
|
|
b3e9695a65 | ||
|
|
96be32d8ca | ||
|
|
c63b6f5d8a | ||
|
|
25715c7660 | ||
|
|
b293b35eaa | ||
|
|
6b107d99be | ||
|
|
ee726e4497 | ||
|
|
47be72139d | ||
|
|
0ce6b61e04 | ||
|
|
81e5787949 | ||
|
|
ef9c23468c | ||
|
|
f1c919496b | ||
|
|
c84e4181b4 | ||
|
|
c2131f8efb | ||
|
|
c25893731b | ||
|
|
97d35803d7 | ||
|
|
9fef343050 | ||
|
|
17459bac7d | ||
|
|
d976be4bda | ||
|
|
e64f0795e1 | ||
|
|
7c7dd8b712 | ||
|
|
9851acba7b | ||
|
|
1e119743a5 |
No files matched your search
@@ -198,13 +198,18 @@ Apache 1.3.x on Unix systems
|
||||
|
||||
13. Setup your php.ini file:
|
||||
|
||||
cp php.ini-dist /usr/local/lib/php.ini
|
||||
PHP will use the built-in default values if no php.ini file was
|
||||
placed in the configuration directory. The default location is
|
||||
/usr/local/lib, if you prefer your php.ini in another location, use
|
||||
--with-config-file-path=/some/path in step 10.
|
||||
|
||||
You may edit your .ini file to set PHP options. If you prefer your
|
||||
php.ini in another location, use --with-config-file-path=/some/path in
|
||||
step 10.
|
||||
The PHP distribution provides two sample php.ini files, you can use them
|
||||
by
|
||||
cp php.ini-development /usr/local/lib/php.ini
|
||||
or
|
||||
cp php.ini-production /usr/local/lib/php.ini
|
||||
|
||||
If you instead choose php.ini-recommended, be certain to read the list
|
||||
If you choose one of these php.ini files be certain to read the list
|
||||
of changes within, as they affect how PHP behaves.
|
||||
|
||||
14. Edit your httpd.conf to load the PHP module. The path on the right hand
|
||||
|
||||
@@ -0,0 +1,429 @@
|
||||
1. libmagic (ext/fileinfo) see ext/fileinfo/libmagic/LICENSE
|
||||
2. Oniguruma (ext/mbstring) see ext/mbstring/oniguruma/COPYING
|
||||
3. libmbfl (ext/mbstring) see ext/mbstring/libmbfl/LICENSE
|
||||
4. pcrelib (ext/pcre) see ext/pcre/pcrelib/LICENCE
|
||||
5. ext/standard crypt
|
||||
6. ext/standard crypt's blowfish implementation
|
||||
7. Sqlite/Sqlite3 ext/sqlite3 ext/sqlite
|
||||
8. ext/json/json_parser
|
||||
9. ext/standard/rand
|
||||
10. ext/standard/scanf
|
||||
11. ext/standard/strnatcmp.c
|
||||
12. ext/standard/uuencode
|
||||
13. libxmlrpc ext/xmlrpc
|
||||
14. libzip ext/zip
|
||||
15. main/snprintf.c
|
||||
16. main/strlcat
|
||||
17. main/strlcpy
|
||||
18. libgd see ext/gd/libgd/COPYING
|
||||
|
||||
5. ext/standard crypt
|
||||
|
||||
FreeSec: libcrypt for NetBSD
|
||||
|
||||
Copyright (c) 1994 David Burren
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the author nor the names of other contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
|
||||
6. ext/standard crypt's blowfish implementation
|
||||
|
||||
This code comes from John the Ripper password cracker, with reentrant
|
||||
and crypt(3) interfaces added, but optimizations specific to password
|
||||
cracking removed.
|
||||
|
||||
Written by Solar Designer <solar at openwall.com> in 1998-2002 and
|
||||
placed in the public domain.
|
||||
|
||||
There's absolutely no warranty.
|
||||
|
||||
It is my intent that you should be able to use this on your system,
|
||||
as a part of a software package, or anywhere else to improve security,
|
||||
ensure compatibility, or for any other purpose. I would appreciate
|
||||
it if you give credit where it is due and keep your modifications in
|
||||
the public domain as well, but I don't require that in order to let
|
||||
you place this code and any modifications you make under a license
|
||||
of your choice.
|
||||
|
||||
This implementation is compatible with OpenBSD bcrypt.c (version 2a)
|
||||
by Niels Provos <provos at citi.umich.edu>, and uses some of his
|
||||
ideas. The password hashing algorithm was designed by David Mazieres
|
||||
<dm at lcs.mit.edu>.
|
||||
|
||||
There's a paper on the algorithm that explains its design decisions:
|
||||
|
||||
http://www.usenix.org/events/usenix99/provos.html
|
||||
|
||||
Some of the tricks in BF_ROUND might be inspired by Eric Young's
|
||||
Blowfish library (I can't be sure if I would think of something if I
|
||||
hadn't seen his code).
|
||||
|
||||
|
||||
7. Sqlite/Sqlite3 ext/sqlite3 ext/sqlite
|
||||
|
||||
The author disclaims copyright to this source code. In place of
|
||||
a legal notice, here is a blessing:
|
||||
May you do good and not evil.
|
||||
May you find forgiveness for yourself and forgive others.
|
||||
May you share freely, never taking more than you give.
|
||||
|
||||
|
||||
8. ext/json/json_parser
|
||||
Copyright (c) 2005 JSON.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
The Software shall be used for Good, not Evil.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
9. ext/standard/rand
|
||||
The following php_mt_...() functions are based on a C++ class MTRand by
|
||||
Richard J. Wagner. For more information see the web page at
|
||||
http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html
|
||||
|
||||
Mersenne Twister random number generator -- a C++ class MTRand
|
||||
Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus
|
||||
Richard J. Wagner v1.0 15 May 2003 rjwagner@writeme.com
|
||||
|
||||
The Mersenne Twister is an algorithm for generating random numbers. It
|
||||
was designed with consideration of the flaws in various other generators.
|
||||
The period, 2^19937-1, and the order of equidistribution, 623 dimensions,
|
||||
are far greater. The generator is also fast; it avoids multiplication and
|
||||
division, and it benefits from caches and pipelines. For more information
|
||||
see the inventors' web page at http://www.math.keio.ac.jp/~matumoto/emt.html
|
||||
|
||||
Reference
|
||||
M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally
|
||||
Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions on
|
||||
Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30.
|
||||
|
||||
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
|
||||
Copyright (C) 2000 - 2003, Richard J. Wagner
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. The names of its contributors may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
10. ext/standard/scanf
|
||||
scanf.c --
|
||||
|
||||
This file contains the base code which implements sscanf and by extension
|
||||
fscanf. Original code is from TCL8.3.0 and bears the following copyright:
|
||||
|
||||
This software is copyrighted by the Regents of the University of
|
||||
California, Sun Microsystems, Inc., Scriptics Corporation,
|
||||
and other parties. The following terms apply to all files associated
|
||||
with the software unless explicitly disclaimed in individual files.
|
||||
|
||||
The authors hereby grant permission to use, copy, modify, distribute,
|
||||
and license this software and its documentation for any purpose, provided
|
||||
that existing copyright notices are retained in all copies and that this
|
||||
notice is included verbatim in any distributions. No written agreement,
|
||||
license, or royalty fee is required for any of the authorized uses.
|
||||
Modifications to this software may be copyrighted by their authors
|
||||
and need not follow the licensing terms described here, provided that
|
||||
the new terms are clearly indicated on the first page of each file where
|
||||
they apply.
|
||||
|
||||
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
|
||||
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
|
||||
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
|
||||
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
|
||||
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
|
||||
MODIFICATIONS.
|
||||
|
||||
GOVERNMENT USE: If you are acquiring this software on behalf of the
|
||||
U.S. government, the Government shall have only "Restricted Rights"
|
||||
in the software and related documentation as defined in the Federal
|
||||
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
|
||||
are acquiring the software on behalf of the Department of Defense, the
|
||||
software shall be classified as "Commercial Computer Software" and the
|
||||
Government shall have only "Restricted Rights" as defined in Clause
|
||||
252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
|
||||
authors grant the U.S. Government and others acting in its behalf
|
||||
permission to use and distribute the software in accordance with the
|
||||
terms specified in this license.
|
||||
|
||||
11. ext/standard/strnatcmp.c
|
||||
|
||||
strnatcmp.c -- Perform 'natural order' comparisons of strings in C.
|
||||
Copyright (C) 2000 by Martin Pool <mbp@humbug.org.au>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
12. ext/standard/uuencode
|
||||
Portions of this code are based on Berkeley's uuencode/uudecode
|
||||
implementation.
|
||||
|
||||
Copyright (c) 1983, 1993
|
||||
The Regents of the University of California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this software
|
||||
must display the following acknowledgement:
|
||||
This product includes software developed by the University of
|
||||
California, Berkeley and its contributors.
|
||||
4. Neither the name of the University nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
|
||||
13. libxmlrpc ext/xmlrpc
|
||||
|
||||
Copyright 2000 Epinions, Inc.
|
||||
|
||||
Subject to the following 3 conditions, Epinions, Inc. permits you, free
|
||||
of charge, to (a) use, copy, distribute, modify, perform and display this
|
||||
software and associated documentation files (the "Software"), and (b)
|
||||
permit others to whom the Software is furnished to do so as well.
|
||||
|
||||
1) The above copyright notice and this permission notice shall be included
|
||||
without modification in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF
|
||||
ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY
|
||||
IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE OR NONINFRINGEMENT.
|
||||
|
||||
3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT
|
||||
OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING
|
||||
NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
14. libzip ext/zip
|
||||
zip.h -- exported declarations.
|
||||
Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <libzip@nih.at>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. The names of the authors may not be used to endorse or promote
|
||||
products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
15. main/snprintf.c
|
||||
Copyright (c) 2002, 2006 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
|
||||
Permission to use, copy, modify, and distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
Sponsored in part by the Defense Advanced Research Projects
|
||||
Agency (DARPA) and Air Force Research Laboratory, Air Force
|
||||
Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
||||
|
||||
main/spprintf
|
||||
Copyright (c) 1995-1998 The Apache Group. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
3. All advertising materials mentioning features or use of this
|
||||
software must display the following acknowledgment:
|
||||
"This product includes software developed by the Apache Group
|
||||
for use in the Apache HTTP server project (http://www.apache.org/)."
|
||||
|
||||
4. The names "Apache Server" and "Apache Group" must not be used to
|
||||
endorse or promote products derived from this software without
|
||||
prior written permission.
|
||||
|
||||
5. Redistributions of any form whatsoever must retain the following
|
||||
acknowledgment:
|
||||
"This product includes software developed by the Apache Group
|
||||
for use in the Apache HTTP server project (http://www.apache.org/)."
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
|
||||
EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
|
||||
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
====================================================================
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals on behalf of the Apache Group and was originally based
|
||||
on public domain software written at the National Center for
|
||||
Supercomputing Applications, University of Illinois, Urbana-Champaign.
|
||||
For more information on the Apache Group and the Apache HTTP server
|
||||
project, please see <http://www.apache.org/>.
|
||||
|
||||
This code is based on, and used with the permission of, the
|
||||
SIO stdio-replacement strx_* functions by Panos Tsirigotis
|
||||
<panos@alumni.cs.colorado.edu> for xinetd.
|
||||
|
||||
16. main/strlcat
|
||||
17. main/strlcpy
|
||||
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
@@ -646,7 +646,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
memcpy(path, bucket->realpath, bucket->realpath_len + 1);
|
||||
return bucket->realpath_len;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
@@ -1099,7 +1099,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {
|
||||
new_state.cwd[0] = '\0';
|
||||
new_state.cwd_length = 0;
|
||||
}
|
||||
|
||||
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) {
|
||||
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
|
||||
|
||||
|
||||
@@ -21,11 +21,12 @@ UPGRADE NOTES - PHP 5.3
|
||||
a. New libraries
|
||||
b. New extensions
|
||||
c. New stream wrappers
|
||||
d. New functions
|
||||
e. New global constants
|
||||
f. New classes
|
||||
g. New methods
|
||||
h. New class constants
|
||||
d. New stream filters
|
||||
e. New functions
|
||||
f. New global constants
|
||||
g. New classes
|
||||
h. New methods
|
||||
i. New class constants
|
||||
|
||||
=============================
|
||||
1. Reserved words and classes
|
||||
@@ -39,70 +40,101 @@ UPGRADE NOTES - PHP 5.3
|
||||
2. Changes made to existing functions
|
||||
=====================================
|
||||
|
||||
- The HTTP stream wrapper now considers all status codes from 200 to 399 to be
|
||||
successful.
|
||||
|
||||
- The array functions natsort(), natcasesort(), usort(), uasort(), uksort(),
|
||||
array_flip() and array_unique(), no longer accept objects passed as arguments.
|
||||
If you need to access their properties using an object, you will need to cast
|
||||
the objects to arrays first.
|
||||
array_flip(), and array_unique() no longer accept objects passed as arguments.
|
||||
If you need to use them to access an object's properties, you must cast the
|
||||
object to an array first.
|
||||
|
||||
- var_dump() output now includes private object members.
|
||||
|
||||
- session_start() now returns FALSE when the session startup fails.
|
||||
|
||||
- property_exists() now checks the existence of a property independent of
|
||||
accessibility (like method_exists()).
|
||||
|
||||
- The $initial parameter for array_reduce can now be of any type.
|
||||
|
||||
- clearstatcache() no longer clears the realpath cache by default.
|
||||
|
||||
- realpath() is no longer system-dependent and works identically on all
|
||||
platforms.
|
||||
|
||||
- call_user_func() now propagates $this even if the callee is the parent class.
|
||||
|
||||
- The filesystem functions opendir(), scandir() and dir() now use the default
|
||||
context if no context is passed as an argument to them.
|
||||
- The filesystem functions opendir(), scandir(), and dir() now use the default
|
||||
context if no context argument is passed.
|
||||
|
||||
- The behaviour of functions with by-reference parameters called by value has
|
||||
changed. Where previously the function would accept the by-value argument, a
|
||||
warning is now emitted and all by-ref parameters are set to NULL.
|
||||
|
||||
- There is now native support for the following math functions: asinh(), acosh(),
|
||||
atanh(), log1p() and expm1().
|
||||
- There is now native support for the following math functions: asinh(),
|
||||
acosh(), atanh(), log1p(), and expm1().
|
||||
|
||||
- In the GD extension, there is now pixelation support available through
|
||||
the imagefilter() function.
|
||||
|
||||
- crypt() now has Blowfish and extended DES support, and crypt() features are now
|
||||
100% portable. PHP has its own internal crypt implementation which drops into
|
||||
place when support for crypt or crypt_r() is not found.
|
||||
- crypt() now has Blowfish and extended DES support, and crypt() features are
|
||||
now 100% portable. PHP has its own internal crypt implementation which drops
|
||||
into place when system support for crypt or crypt_r() is not found.
|
||||
|
||||
- get_cfg_var() is now able to return "array" INI options.
|
||||
|
||||
- Stream wrappers can now be used by include_path().
|
||||
- Stream wrappers can now be used by the include_path INI directive.
|
||||
|
||||
- There are new parameters in:
|
||||
clearstatcache(): clear_realpath_cache and filename.
|
||||
copy(): context.
|
||||
fgetcsv(): escape.
|
||||
ini_get_all(): details.
|
||||
json_encode(): options.
|
||||
nl2br(): is_xhtml.
|
||||
parse_ini_file(): scanner_mode.
|
||||
round(): mode.
|
||||
stream_context_create(): params.
|
||||
strstr(), stristr(): before_needle.
|
||||
- These functions now take new parameters:
|
||||
clearstatcache(): $clear_realpath_cache and $filename.
|
||||
copy(): $context
|
||||
fgetcsv(): $escape
|
||||
ini_get_all(): $details
|
||||
json_encode(): $options
|
||||
json_decode(): $depth
|
||||
nl2br(): $is_xhtml
|
||||
parse_ini_file(): $scanner_mode
|
||||
round(): $mode
|
||||
stream_context_create(): $params
|
||||
strstr(), stristr(): $before_needle
|
||||
sybase_connect(): $new
|
||||
|
||||
- And new mode option for fopen: 'n' (O_NONBLOCK)
|
||||
|
||||
- The new mysqlnd library necessitates using MySQL's newer 41-byte password
|
||||
format. Continued use of the old 16 byte passwords will cause mysql_connect()
|
||||
and other related functions to produce the following error message:
|
||||
"mysqlnd cannot connect to MySQL 4.1+ using old authentication"
|
||||
|
||||
- The dl() function is now disabled by default, and only available under the
|
||||
cli, cgi, and embed SAPIs.
|
||||
|
||||
- mail() now supports the logging of sent mail.
|
||||
|
||||
- stream_select(), stream_set_blocking(), stream_set_timeout(), and
|
||||
stream_set_write_buffer() now work with user-space stream wrappers.
|
||||
|
||||
- getopt() accepts "long options" now on all platforms.
|
||||
Optional values and using = as a separator for short options are now
|
||||
supported.
|
||||
|
||||
- The new mysqlnd library necessitates using MySQL's newer 41 byte password format.
|
||||
Continued use of the old 16 byte passwords will cause mysql_connect() to produce
|
||||
the following error message: "mysqlnd cannot connect to MySQL 4.1+ using old
|
||||
authentication"
|
||||
|
||||
===================================
|
||||
3. Changes made to existing methods
|
||||
===================================
|
||||
|
||||
- The magic methods __get(), __set(), __isset(), __unset() and __call() should
|
||||
- The magic methods __get(), __set(), __isset(), __unset(), and __call() should
|
||||
always be public and can no longer be static. Method signatures are enforced.
|
||||
|
||||
- The __call() magic method is now invoked on access to private and protected
|
||||
methods.
|
||||
|
||||
- The __toString() magic method can no longer accept arguments.
|
||||
|
||||
- There is a new magic method, __callStatic().
|
||||
|
||||
- count() vs count_elements() handler resolution rules have changed. (This could
|
||||
potentially break custom PHP extensions.)
|
||||
- Internal count() vs. count_elements() handler resolution rules have changed.
|
||||
(This could potentially break custom PHP extensions.)
|
||||
|
||||
- The trailing / has been removed from SplFileInfo and other related directory
|
||||
classes.
|
||||
@@ -110,7 +142,7 @@ UPGRADE NOTES - PHP 5.3
|
||||
- SplFileInfo::getpathinfo() now returns information about the path name.
|
||||
|
||||
- There are new parameters in:
|
||||
Exception::__construct(): previous.
|
||||
Exception::__construct(): $previous
|
||||
|
||||
===================================
|
||||
4. Changes made to existing classes
|
||||
@@ -125,10 +157,35 @@ UPGRADE NOTES - PHP 5.3
|
||||
|
||||
- define_syslog_variables() is deprecated.
|
||||
|
||||
- All ereg functions are deprecated and emit E_DEPRECATED errors.
|
||||
Use PCRE (preg_*()) instead.
|
||||
- set_socket_blocking() is deprecated.
|
||||
|
||||
- The following ini directives will now emit an E_DEPRECATED warning
|
||||
- call_user_method() and call_user_method_array() are now deprecated. Use
|
||||
call_user_func() and call_user_func_array() instead.
|
||||
|
||||
- dl() is deprecated.
|
||||
|
||||
- The set_magic_quotes_runtime() function is now deprecated.
|
||||
|
||||
- mysql_listtables(), mysql_dropdb(), mysql_createdb(), mysql_list_tables(),
|
||||
mysql_drop_db(), and mysql_create_db() are now deprecated.
|
||||
|
||||
- All ereg functions are now deprecated and emit E_DEPRECATED errors:
|
||||
sql_regcase(), spliti(), split(), ereg_replace(), eregi(),
|
||||
ereg_replace(), and ereg().
|
||||
Use the PCRE family of functions (preg_*()) instead.
|
||||
|
||||
- mcrypt_generic_end() is deprecated.
|
||||
|
||||
- mysql_db_query() is deprecated.
|
||||
|
||||
- mysql_escape_string() is deprecated.
|
||||
|
||||
- session_register(), session_unregister(), and session_is_registered() are now
|
||||
deprecated. Use the $_SESSION superglobal array instead.
|
||||
|
||||
- Comments starting with '#' are now deprecated in .INI files.
|
||||
|
||||
- The following INI directives will now emit an E_DEPRECATED warning
|
||||
upon startup if they are activated:
|
||||
|
||||
- define_syslog_variables
|
||||
@@ -139,11 +196,21 @@ UPGRADE NOTES - PHP 5.3
|
||||
- magic_quotes_runtime
|
||||
- magic_quotes_sybase
|
||||
|
||||
- The is_dst parameter to mktime() is deprecated.
|
||||
|
||||
- Assigning the return value of "new" by reference is deprecated
|
||||
|
||||
- Call-time pass-by-reference has been deprecated
|
||||
|
||||
- Usage of {} to access string offsets is deprecated
|
||||
|
||||
- Passing locale category name as string to setlocale() is deprecated.
|
||||
|
||||
===============
|
||||
6. Undeprecated
|
||||
===============
|
||||
|
||||
- By popular request, is_a() is no longer marked deprecated.
|
||||
- By popular request, is_a() is no longer deprecated.
|
||||
|
||||
==============
|
||||
7. Extensions:
|
||||
@@ -151,7 +218,7 @@ UPGRADE NOTES - PHP 5.3
|
||||
|
||||
a. moved out to PECL and actively maintained there
|
||||
|
||||
- fpdf
|
||||
- fdf
|
||||
- ming
|
||||
- ncurses
|
||||
|
||||
@@ -161,26 +228,51 @@ UPGRADE NOTES - PHP 5.3
|
||||
- fbsql
|
||||
- msql
|
||||
- sybase (use sybase_ct, which is still in PHP core)
|
||||
- mhash (hash has full BC layer)
|
||||
- mime_magic (use fileinfo, has full BC layer)
|
||||
|
||||
c. with changed behaviour
|
||||
|
||||
- hash: The SHA-224 hash algorithm is now supported.
|
||||
- dns: dns_check_record() will now return an extra "entries" index,
|
||||
containing the TXT elements.
|
||||
|
||||
- oci8a: Calling oci_close() on a persistent connection, or on a variable
|
||||
that references a persistent connection going out of scope, will now
|
||||
roll back any uncommitted transaction. You should explicitly commit or
|
||||
rollback as needed.
|
||||
Setting oci8.old_oci_close semantics=On in php.ini gives the old
|
||||
behaviour.
|
||||
- datetime: date/time functions will no longer use the TZ environment
|
||||
variable to guess which timezone should be used.
|
||||
|
||||
- openssl: There is now support for OpenSSL digest and cipher functions.
|
||||
- cURL now supports SSH
|
||||
|
||||
- hash: The SHA-224 and salsa hash algorithms are now supported.
|
||||
|
||||
- mbstring: Now supports CP850 encoding.
|
||||
|
||||
- oci8: Database Resident Connection Pooling (DRCP) and Fast Application
|
||||
Notification (FAN) are now supported.
|
||||
|
||||
Oracle External Authentication is now supported (except on Windows).
|
||||
|
||||
The oci8 function oci_bind_by_name() now supports SQLT_AFC (aka the
|
||||
CHAR datatype).
|
||||
|
||||
Calling oci_close() on a persistent connection, or when the variable
|
||||
that references a persistent connection goes out of scope, will now
|
||||
trigger a roll back of an uncommitted transaction. To avoid unexpected
|
||||
behavior explicitly issue a commit or roll back as needed. The old
|
||||
behavior can be enabled with the INI directive
|
||||
oci8.old_oci_close_semantics.
|
||||
|
||||
- openssl: OpenSSL digest and cipher functions are now supported.
|
||||
It is also now possible to access the internal values of DSA, RSA and
|
||||
DH keys.
|
||||
|
||||
- session: Sessions will no longer store session-files in "/tmp" where
|
||||
- session: Sessions will no longer store session-files in "/tmp" when
|
||||
open_basedir restrictions apply, unless "/tmp" is explicitly added to
|
||||
the list of allowed paths.
|
||||
|
||||
- SOAP: Now supports sending user-supplied HTTP headers.
|
||||
|
||||
- MySQLi: Now supports persistent connections by prepending the hostname
|
||||
with "p:".
|
||||
|
||||
d. no longer possible to disable
|
||||
|
||||
- PCRE
|
||||
@@ -191,6 +283,8 @@ UPGRADE NOTES - PHP 5.3
|
||||
8. Changes in SAPI support
|
||||
==========================
|
||||
|
||||
- A new "litespeed" SAPI is now available.
|
||||
|
||||
- FastCGI is now always enabled and can not be disabled. See sapi/cgi/CHANGES
|
||||
for more details.
|
||||
|
||||
@@ -198,19 +292,17 @@ UPGRADE NOTES - PHP 5.3
|
||||
repeated several times.
|
||||
|
||||
- CGI/FastCGI now has support for .htaccess style user-defined php.ini files.
|
||||
See the new user_ini.filename and user_ini.cache_ttl INI directives.
|
||||
|
||||
============================
|
||||
9. Changes in INI directives
|
||||
============================
|
||||
|
||||
- zend_extension_debug and zend_extension_ts have been removed.
|
||||
Instead use the zend_extension directive to load all Zend Extensions.
|
||||
- zend_extension_debug and zend_extension_ts have been removed. Always use the
|
||||
zend_extension directive to load Zend Extensions.
|
||||
|
||||
- zend.ze1_compatibility_mode has been removed. If this ini directive is set
|
||||
to on, then an E_ERROR is emitted at startup.
|
||||
|
||||
- A new user initialization mechanism and config variables have been added:
|
||||
user_ini.filename and user_ini.cache_ttl
|
||||
- zend.ze1_compatibility_mode has been removed. If this INI directive is set to
|
||||
on, then an E_ERROR is emitted at startup.
|
||||
|
||||
- There is now support for special sections: [PATH=/opt/httpd/www.example.com/]
|
||||
and [HOST=www.example.com]. Directives set in these sections cannot be
|
||||
@@ -222,18 +314,52 @@ UPGRADE NOTES - PHP 5.3
|
||||
- It is now possible to use the full path to load modules using the "extension"
|
||||
directive.
|
||||
|
||||
- "ini-variables" can now be used almost anywhere in a php.ini file.
|
||||
- "INI variables" can now be used almost anywhere in a php.ini file.
|
||||
|
||||
- It is now possible to use alphanumeric or variable indices in ini option
|
||||
- It is now possible to use alphanumeric or variable indices in INI option
|
||||
arrays.
|
||||
|
||||
- open_basedir is now PHP_INI_ALL
|
||||
|
||||
- Runtime tightening of open_basedir restrictions is now possible.
|
||||
|
||||
- The default value of session.use_only_cookies has changed to "1".
|
||||
|
||||
- The default value of oci8.default_prefetch has been changed from 10 to 100.
|
||||
|
||||
- A new directive, request_order, controls the behavior of $_REQUEST
|
||||
independently of variables_order.
|
||||
|
||||
- New INI directives:
|
||||
- mail.add_x_header
|
||||
- user_ini.filename
|
||||
- user_ini.cache_ttl
|
||||
- exit_on_timeout
|
||||
- mysqli.allow_persistent
|
||||
- mysqli.default_host
|
||||
- mysqli.default_socket
|
||||
- mysqli.allow_local_infile
|
||||
- mysqli.cache_size
|
||||
- oci8.connection_class
|
||||
- oci8.events
|
||||
- pdo_mysql.default_socket
|
||||
- pdo_mysql.cache_size
|
||||
- sqlite3.extension_dir
|
||||
- mysql.default_socket
|
||||
- mysql.allow_local_infile
|
||||
- mysql.cache_size
|
||||
- mysqlnd.collect_statistics
|
||||
- mysqlnd.collect_memory_statistics
|
||||
- mysqlnd.net_cmd_buffer_size
|
||||
- mysqlnd.net_read_buffer_size
|
||||
- mysqlnd.log_mask
|
||||
|
||||
|
||||
====================
|
||||
10. Syntax additions
|
||||
====================
|
||||
|
||||
- NOWDOC is like HEREDOC but with single quotes:
|
||||
- NOWDOC: Similar to HEREDOC, but with single quotes:
|
||||
|
||||
<<<'LABEL' ...
|
||||
|
||||
@@ -244,6 +370,11 @@ UPGRADE NOTES - PHP 5.3
|
||||
No variables here...
|
||||
LABEL;
|
||||
|
||||
- HEREDOC now supports wrapping the identifier with double-quotes, to complement
|
||||
the NOWDOC syntax:
|
||||
|
||||
<<<"LABEL" ...
|
||||
|
||||
- The ?: operator has been introduced:
|
||||
|
||||
var_dump(0 ?: 'Hello!');
|
||||
@@ -253,6 +384,23 @@ UPGRADE NOTES - PHP 5.3
|
||||
namespace my\name;
|
||||
$obj = new \my\name\MyClass;
|
||||
|
||||
- Dynamic access to static methods is now possible:
|
||||
|
||||
$foo::myFunc();
|
||||
|
||||
- Exceptions can now be nested:
|
||||
|
||||
class MyCustomException extends Exception {}
|
||||
try {
|
||||
throw new MyCustomException("Something happend", 112);
|
||||
} catch(Exception $e) {
|
||||
throw new InvalidArgumentException("You are doing it wrong!", 911, $e);
|
||||
}
|
||||
|
||||
- Exceptions can now be handled in destructors.
|
||||
|
||||
- A garbage collector has been added and is enabled by default.
|
||||
|
||||
===================
|
||||
11. Windows support
|
||||
===================
|
||||
@@ -262,28 +410,52 @@ UPGRADE NOTES - PHP 5.3
|
||||
|
||||
- PHP Windows binaries target i586 or later. i386 and i486 are not supported.
|
||||
|
||||
- Support for the IIS SAPI has been dropped. Use the FastCGI SAPI instead
|
||||
(available for IIS5 and later)). FastCGI is the recommended way to use PHP
|
||||
with IIS (see http://php.iis.net/).
|
||||
|
||||
- A new build is available based on the latest Visual C++ Compiler (VC9).
|
||||
Its use is recommended with FastCGI or CLI. Apache's Windows binaries are not
|
||||
compatible with VC9; however, you can use Apache Lounge's build
|
||||
(http://apachelounge.com).
|
||||
|
||||
- The x64 binaries are for experimental usage only. They are not meant to be
|
||||
used in production.
|
||||
|
||||
- A new site is available to download Windows releases as well as Windows-only
|
||||
releases: http://windows.php.net. Windows-specific releases will be made to
|
||||
fix security issues in the bundled libraries (libpng, openssl, etc.). Please
|
||||
note that this site does not replace the main PHP site as a source of PHP
|
||||
news, resources, or documentation.
|
||||
|
||||
- Windows support has been added for the following functions: getopt(),
|
||||
imagecolorclosesthwb(), mcrypt_create_iv(), inet_ntop(), inet_pton(),
|
||||
getmxrr(), checkdnsrr(), dns_get_record(), linkinfo(), readlink(),
|
||||
symlink(), link(), fnmatch(), stream_socket_pair(), time_nanosleep(),
|
||||
time_sleep_until() and socket_create_pair().
|
||||
time_sleep_until(), and socket_create_pair().
|
||||
|
||||
- Crypt supports now all available algorithms on Windows (blowfish included).
|
||||
|
||||
- Improved portability of stat(), touch(), filemtime(), filesize() and related
|
||||
functions (100% portable for the available data)
|
||||
functions (100% portable for the available data).
|
||||
|
||||
- It is now possible to create hard links on Windows using the link() function,
|
||||
and symbolic links using the symlink() function. Hard links are available
|
||||
as of Windows 2000 and symbolic links as of Windows Vista.
|
||||
|
||||
- The PDO_OCI php_pdo_oci8.dll library (for use with Oracle version 8 client
|
||||
libraries) is no longer being built. Instead, use php_pdo_oci.dll (note no '8')
|
||||
with Oracle 10 or 11 client libraries. Connection to other database versions
|
||||
is supported.
|
||||
libraries) is no longer being built. Instead, use php_pdo_oci.dll (note no
|
||||
'8') with Oracle 10 or 11 client libraries. Connection to other database
|
||||
versions is still supported.
|
||||
|
||||
- For the OCI8 extension, a new library php_oci8_11g.dll is available in addition to
|
||||
php_oci8.dll. Only one can be enabled at any time. Use php_oci8.dll with Oracle 10.2
|
||||
client libraries. Use php_oci8_11g.dll with Oracle 11 client libraries. Connection
|
||||
to other database versions is supported.
|
||||
- For the OCI8 extension, a new library php_oci8_11g.dll is available in
|
||||
addition to php_oci8.dll. Only one can be enabled at any time. Use
|
||||
php_oci8.dll with Oracle 10.2 client libraries. Use php_oci8_11g.dll with
|
||||
Oracle 11 client libraries. Connection to other database versions is still
|
||||
supported.
|
||||
|
||||
- It's now possible to use hardlinks on Windows using the link() function,
|
||||
and symbolic links via the symlink() function. Hardlinks are available
|
||||
as of Windows 2000 and symbolic links as of Windows Vista.
|
||||
- Firebird and SNMP support are no longer available on Windows. Firebird support
|
||||
may be reintroduced in the future.
|
||||
|
||||
===================
|
||||
12. New in PHP 5.3:
|
||||
@@ -292,11 +464,13 @@ UPGRADE NOTES - PHP 5.3
|
||||
a. New libraries
|
||||
|
||||
- mysqlnd is a new core library shipped with PHP. It is a PHP-specific
|
||||
replacement for libmysql.
|
||||
replacement for libmysql and is recommended for all installations for
|
||||
increased performance.
|
||||
|
||||
b. New extensions
|
||||
|
||||
- fileinfo
|
||||
- enchant
|
||||
- fileinfo (replaces mime_magic)
|
||||
- intl
|
||||
- Phar
|
||||
- SQLite3
|
||||
@@ -306,7 +480,12 @@ UPGRADE NOTES - PHP 5.3
|
||||
- glob:// stream wrapper
|
||||
- phar:// stream wrapper for accessing phar archives
|
||||
|
||||
d. New functions
|
||||
d. New stream filters
|
||||
|
||||
- "dechunk" (HTTP/1.1 chunked transfer encoding)
|
||||
- The bz2.decompress filter now supports concatenation
|
||||
|
||||
e. New functions
|
||||
|
||||
- Core: gc_collect_cycles()
|
||||
gc_enabled()
|
||||
@@ -314,7 +493,6 @@ UPGRADE NOTES - PHP 5.3
|
||||
gc_disable()
|
||||
class_alias()
|
||||
get_called_class()
|
||||
get_extension_funcs()
|
||||
forward_static_call()
|
||||
forward_static_call_array()
|
||||
str_getcsv()
|
||||
@@ -332,7 +510,11 @@ UPGRADE NOTES - PHP 5.3
|
||||
- INI: parse_ini_string()
|
||||
- GMP: gmp_testbit()
|
||||
- Hash: hash_copy()
|
||||
- IMAP: imap_gc()
|
||||
imap_utf8_to_mutf7()
|
||||
imap_mutf7_to_utf8()
|
||||
- JSON: json_last_error()
|
||||
- libxml: libxml_disable_entity_loader
|
||||
- MySQLi: mysqli_fetch_all()
|
||||
mysqli_get_connection_stats()
|
||||
mysqli_poll()
|
||||
@@ -346,24 +528,48 @@ UPGRADE NOTES - PHP 5.3
|
||||
pcntl_sigtimedwait()
|
||||
- PCRE: preg_filter()
|
||||
- SHM: msg_queue_exists()
|
||||
shm_has_var()
|
||||
- Streams: stream_supports_lock()
|
||||
stream_context_set_default()
|
||||
stream_context_get_params()
|
||||
- Userspace stream wrappers:
|
||||
stream_cast()
|
||||
stream_set_options()
|
||||
|
||||
e. New global constants
|
||||
f. New global constants
|
||||
|
||||
- Core: E_DEPRECATED
|
||||
E_USER_DEPRECATED
|
||||
__DIR__
|
||||
__NAMESPACE__
|
||||
PHP_MAXPATHLEN
|
||||
PHP_WINDOWS_VERSION_MAJOR
|
||||
PHP_WINDOWS_VERSION_MINOR
|
||||
PHP_WINDOWS_VERSION_BUILD
|
||||
PHP_WINDOWS_VERSION_PLATFORM
|
||||
PHP_WINDOWS_VERSION_SP_MAJOR
|
||||
PHP_WINDOWS_VERSION_SP_MINOR
|
||||
PHP_WINDOWS_VERSION_SUITEMASK
|
||||
PHP_WINDOWS_VERSION_PRODUCTTYPE
|
||||
PHP_WINDOWS_NT_DOMAIN_CONTROLLER
|
||||
PHP_WINDOWS_NT_SERVER
|
||||
PHP_WINDOWS_NT_WORKSTATION
|
||||
- INI: INI_SCANNER_NORMAL
|
||||
INI_SCANNER_RAW
|
||||
- cURL CURLOPT_PROGRESSFUNCTION
|
||||
- GD: IMG_FILTER_PIXELATE
|
||||
- JSON: JSON_ERROR_NONE
|
||||
JSON_ERROR_DEPTH
|
||||
JSON_ERROR_STATE_MISMATCH
|
||||
JSON_ERROR_CTRL_CHAR
|
||||
JSON_ERROR_SYNTAX
|
||||
JSON_FORCE_OBJECT
|
||||
JSON_HEX_TAG
|
||||
JSON_HEX_AMP
|
||||
JSON_HEX_APOS
|
||||
JSON_HEX_QUOT
|
||||
- LDAP: LDAP_OPT_NETWORK_TIMEOUT
|
||||
- libxml: LIBXML_LOADED_VERSION
|
||||
- PCRE: PREG_BAD_UTF8_OFFSET_ERROR
|
||||
- PCNTL: SIG_BLOCK
|
||||
SIG_UNBLOCK
|
||||
@@ -413,7 +619,7 @@ UPGRADE NOTES - PHP 5.3
|
||||
BUS_ADRERR
|
||||
BUS_OBJERR
|
||||
|
||||
f. New classes
|
||||
g. New classes
|
||||
|
||||
- Date: DateInterval
|
||||
DatePeriod
|
||||
@@ -434,13 +640,15 @@ UPGRADE NOTES - PHP 5.3
|
||||
RecursiveTreeIterator
|
||||
MultipleIterator
|
||||
|
||||
g. New methods
|
||||
h. New methods
|
||||
|
||||
- Date: DateTime::diff()
|
||||
DateTime::add()
|
||||
DateTime::sub()
|
||||
DateTime::createFromFormat()
|
||||
DateTime::getLastErrors()
|
||||
- DOM: DOMNode::getLineNo()
|
||||
- Exception: Exception::getPrevious()
|
||||
- PDO_Firebird: PDO::setAttribute()
|
||||
- Reflection: ReflectionProperty::setAccessible()
|
||||
ReflectionFunction::inNamespace()
|
||||
@@ -449,9 +657,11 @@ UPGRADE NOTES - PHP 5.3
|
||||
ReflectionClass::inNamespace()
|
||||
ReflectionClass::getNamespaceName()
|
||||
ReflectionClass::getShortName()
|
||||
- SPL SplObjectStorage::addAll()
|
||||
SplObjectStorage::removeAll()
|
||||
- XSL: XSLTProcessor::setProfiling()
|
||||
|
||||
h. New class constants
|
||||
i. New class constants
|
||||
|
||||
- PDO_Firebird: PDO::FB_ATTR_DATE_FORMAT
|
||||
PDO::FB_ATTR_TIME_FORMAT
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #48215 - parent::method() calls __construct, case sensitive test
|
||||
--FILE--
|
||||
<?php
|
||||
class a {
|
||||
public function __CONSTRUCT() { echo __METHOD__ . "\n"; }
|
||||
public function a() { echo __METHOD__ . "\n"; }
|
||||
}
|
||||
class b extends a {}
|
||||
class c extends b {
|
||||
function C() {
|
||||
b::b();
|
||||
}
|
||||
}
|
||||
$c = new c();
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
Strict Standards: Redefining already defined constructor for class a in %s on line %d
|
||||
|
||||
Fatal error: Call to undefined method b::b() in %s on line %d
|
||||
+1
-1
@@ -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, len);
|
||||
memset(tmp, 0, nmemb * len);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
/* The first number is the engine version and the rest is the date.
|
||||
* This way engine 2/3 API no. is always greater than engine 1 API no..
|
||||
*/
|
||||
#define ZEND_EXTENSION_API_NO 220090115
|
||||
#define ZEND_EXTENSION_API_NO 220090626
|
||||
|
||||
typedef struct _zend_extension_version_info {
|
||||
int zend_extension_api_no;
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC
|
||||
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
|
||||
|
||||
#define ZEND_MODULE_API_NO 20090115
|
||||
#define ZEND_MODULE_API_NO 20090626
|
||||
#ifdef ZTS
|
||||
#define USING_ZTS 1
|
||||
#else
|
||||
|
||||
@@ -942,8 +942,10 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
|
||||
|
||||
if (function_name_strlen == ce->name_length && ce->constructor) {
|
||||
lc_class_name = zend_str_tolower_dup(ce->name, ce->name_length);
|
||||
/* Only change the method to the constructor if a __construct() method doesn't exist */
|
||||
if (!memcmp(lc_class_name, function_name_strval, function_name_strlen) && memcmp(ce->constructor->common.function_name, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
|
||||
/* Only change the method to the constructor if the constructor isn't called __construct
|
||||
* we check for __ so we can be binary safe for lowering, we should use ZEND_CONSTRUCTOR_FUNC_NAME
|
||||
*/
|
||||
if (!memcmp(lc_class_name, function_name_strval, function_name_strlen) && memcmp(ce->constructor->common.function_name, "__", sizeof("__") - 1)) {
|
||||
fbc = ce->constructor;
|
||||
}
|
||||
efree(lc_class_name);
|
||||
|
||||
+5
-2
@@ -42,7 +42,7 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=0
|
||||
PHP_EXTRA_VERSION="RC4"
|
||||
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`
|
||||
|
||||
@@ -217,8 +217,11 @@ case $host_cpu in
|
||||
;;
|
||||
sparc*)
|
||||
if test "$SUNCC" = "yes"; then
|
||||
CFLAGS="$CFLAGS -xmemalign=8s"
|
||||
CFLAGS="$CFLAGS -xmemalign=8i"
|
||||
else
|
||||
CFLAGS=""
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl activate some gcc specific optimizations for gcc >= 4
|
||||
|
||||
@@ -2052,6 +2052,14 @@ 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 {
|
||||
|
||||
+11
-2
@@ -39,6 +39,10 @@
|
||||
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 */
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, format)
|
||||
@@ -331,6 +335,7 @@ ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_identifiers_list, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, what)
|
||||
ZEND_ARG_INFO(0, country)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_timezone_abbreviations_list, 0)
|
||||
@@ -1050,7 +1055,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%04ld", t->y < 0 ? "-" : "", llabs((timelib_sll) t->y)); break;
|
||||
case 'Y': length = slprintf(buffer, 32, "%s%04lld", t->y < 0 ? "-" : "", llabs((timelib_sll) t->y)); break;
|
||||
|
||||
/* time */
|
||||
case 'a': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break;
|
||||
@@ -2208,6 +2213,10 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
|
||||
props = intervalobj->std.properties;
|
||||
|
||||
if (!intervalobj->initialized) {
|
||||
return props;
|
||||
}
|
||||
|
||||
#define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \
|
||||
MAKE_STD_ZVAL(zv); \
|
||||
ZVAL_LONG(zv, intervalobj->diff->f); \
|
||||
@@ -3737,7 +3746,7 @@ static int check_id_allowed(char *id, long what)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* {{{ proto array timezone_identifiers_list([long what])
|
||||
/* {{{ proto array timezone_identifiers_list([long what[, string country]])
|
||||
Returns numerically index array with all timezone identifiers.
|
||||
*/
|
||||
PHP_FUNCTION(timezone_identifiers_list)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
--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"
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Bug #48678 DateInterval segfaults when unserialising
|
||||
--FILE--
|
||||
<?php
|
||||
$x = new dateinterval("P3Y6M4DT12H30M5S");
|
||||
print_r($x);
|
||||
$y = unserialize(serialize($x));
|
||||
print_r($y);
|
||||
--EXPECT--
|
||||
DateInterval Object
|
||||
(
|
||||
[y] => 3
|
||||
[m] => 6
|
||||
[d] => 4
|
||||
[h] => 12
|
||||
[i] => 30
|
||||
[s] => 5
|
||||
[invert] => 0
|
||||
[days] => 0
|
||||
)
|
||||
DateInterval Object
|
||||
(
|
||||
[y] => 3
|
||||
[m] => 6
|
||||
[d] => 4
|
||||
[h] => 12
|
||||
[i] => 30
|
||||
[s] => 5
|
||||
[invert] => 0
|
||||
[days] => 0
|
||||
)
|
||||
@@ -5,6 +5,9 @@ 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.utf8", "en_US")) {
|
||||
die("skip Locale en_US or en_US.utf8 is required to run this test");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -5,6 +5,9 @@ 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.utf8", "en_US")) {
|
||||
die("skip Locale en_US.utf8 or en_US is needed by test and is not available");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
Author: Christos Zoulas <christos@zoulas.com>
|
||||
Download: ftp://ftp.astron.com/pub/file/
|
||||
|
||||
Files: *
|
||||
Copyright:
|
||||
(C) 1985-1995 Ian F. Darwin
|
||||
(C) 1994-2009 Christos Zoulas <christos@zoulas.com>
|
||||
License: BSD
|
||||
This software is not subject to any export provision of the United States
|
||||
Department of Commerce, and may be exported to any country or planet.
|
||||
.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
.
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice immediately at the beginning of the file, without modification,
|
||||
this list of conditions, and the following disclaimer.
|
||||
.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
.
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
@@ -2010,7 +2010,6 @@ PHP_FUNCTION(imagegrabwindow)
|
||||
pPrintWindow(window, memDC, (UINT) client_area);
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows API too old");
|
||||
RETURN_FALSE;
|
||||
goto clean;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002 by Cold Spring Harbor Laboratory. Funded under Grant
|
||||
P41-RR02188 by the National Institutes of Health.
|
||||
|
||||
Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 by
|
||||
Boutell.Com, Inc.
|
||||
|
||||
Portions relating to GD2 format copyright 1999, 2000, 2001, 2002
|
||||
Philip Warner.
|
||||
|
||||
Portions relating to PNG copyright 1999, 2000, 2001, 2002 Greg
|
||||
Roelofs.
|
||||
|
||||
Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002 John
|
||||
Ellson (ellson@lucent.com).
|
||||
|
||||
Portions relating to gdft.c copyright 2001, 2002 John Ellson
|
||||
(ellson@lucent.com).
|
||||
|
||||
Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
||||
2008, 2009 Pierre-Alain Joye (pierre@libgd.org).
|
||||
|
||||
Portions relating to JPEG and to color quantization copyright 2000,
|
||||
2001, 2002, Doug Becker and copyright (C) 1994, 1995, 1996, 1997,
|
||||
1998, 1999, 2000, 2001, 2002, Thomas G. Lane. This software is
|
||||
based in part on the work of the Independent JPEG Group. See the
|
||||
file README-JPEG.TXT for more information.
|
||||
|
||||
Portions relating to WBMP copyright 2000, 2001, 2002 Maurice
|
||||
Szmurlo and Johan Van den Brande.
|
||||
|
||||
Permission has been granted to copy, distribute and modify gd in
|
||||
any context without fee, including a commercial application,
|
||||
provided that this notice is present in user-accessible supporting
|
||||
documentation.
|
||||
|
||||
This does not affect your ownership of the derived work itself, and
|
||||
the intent is to assure proper credit for the authors of gd, not to
|
||||
interfere with your productive use of gd. If you have questions,
|
||||
ask. "Derived works" includes all programs that utilize the
|
||||
library. Credit must be given in user-accessible documentation.
|
||||
|
||||
This software is provided "AS IS." The copyright holders disclaim
|
||||
all warranties, either express or implied, including but not
|
||||
limited to implied warranties of merchantability and fitness for a
|
||||
particular purpose, with respect to this code and accompanying
|
||||
documentation.
|
||||
|
||||
Although their code does not appear in gd, the authors wish to thank
|
||||
David Koblas, David Rowley, and Hutchison Avenue Software Corporation
|
||||
for their prior contributions.
|
||||
|
||||
+16
-13
@@ -784,6 +784,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
double cos_a = cos (angle);
|
||||
int len, i = 0, ch;
|
||||
int x1 = 0, y1 = 0;
|
||||
int xb = x, yb = y;
|
||||
font_t *font;
|
||||
fontkey_t fontkey;
|
||||
char *next;
|
||||
@@ -924,8 +925,8 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
/* carriage returns */
|
||||
if (ch == '\r') {
|
||||
penf.x = 0;
|
||||
x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64;
|
||||
y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64;
|
||||
x1 = (int)(- penf.y * sin_a + 32) / 64;
|
||||
y1 = (int)(- penf.y * cos_a + 32) / 64;
|
||||
pen.x = pen.y = 0;
|
||||
previous = 0; /* clear kerning flag */
|
||||
next++;
|
||||
@@ -937,8 +938,10 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
penf.x = 0;
|
||||
penf.y -= (long)(face->size->metrics.height * linespace);
|
||||
penf.y = (penf.y - 32) & -64; /* round to next pixel row */
|
||||
x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64;
|
||||
y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64;
|
||||
x1 = (int)(- penf.y * sin_a + 32) / 64;
|
||||
y1 = (int)(- penf.y * cos_a + 32) / 64;
|
||||
xb = x + x1;
|
||||
yb = y + y1;
|
||||
pen.x = pen.y = 0;
|
||||
previous = 0; /* clear kerning flag */
|
||||
next++;
|
||||
@@ -1088,7 +1091,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
|
||||
/* now, draw to our target surface */
|
||||
bm = (FT_BitmapGlyph) image;
|
||||
gdft_draw_bitmap(tc_cache, im, fg, bm->bitmap, x + x1 + ((pen.x + 31) >> 6) + bm->left, y - y1 + ((pen.y + 31) >> 6) - bm->top);
|
||||
gdft_draw_bitmap(tc_cache, im, fg, bm->bitmap, x + x1 + ((pen.x + 31) >> 6) + bm->left, y + y1 + ((pen.y + 31) >> 6) - bm->top);
|
||||
}
|
||||
|
||||
/* record current glyph index for kerning */
|
||||
@@ -1127,14 +1130,14 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
brect[7] = (int) (normbox.xMin * sin_a + normbox.yMax * cos_a);
|
||||
|
||||
/* scale, round and offset brect */
|
||||
brect[0] = x + gdroundupdown(brect[0], d2 > 0);
|
||||
brect[1] = y - gdroundupdown(brect[1], d1 < 0);
|
||||
brect[2] = x + gdroundupdown(brect[2], d1 > 0);
|
||||
brect[3] = y - gdroundupdown(brect[3], d2 > 0);
|
||||
brect[4] = x + gdroundupdown(brect[4], d2 < 0);
|
||||
brect[5] = y - gdroundupdown(brect[5], d1 > 0);
|
||||
brect[6] = x + gdroundupdown(brect[6], d1 < 0);
|
||||
brect[7] = y - gdroundupdown(brect[7], d2 < 0);
|
||||
brect[0] = xb + gdroundupdown(brect[0], d2 > 0);
|
||||
brect[1] = yb - gdroundupdown(brect[1], d1 < 0);
|
||||
brect[2] = xb + gdroundupdown(brect[2], d1 > 0);
|
||||
brect[3] = yb - gdroundupdown(brect[3], d2 > 0);
|
||||
brect[4] = xb + gdroundupdown(brect[4], d2 < 0);
|
||||
brect[5] = yb - gdroundupdown(brect[5], d1 > 0);
|
||||
brect[6] = xb + gdroundupdown(brect[6], d1 < 0);
|
||||
brect[7] = yb - gdroundupdown(brect[7], d2 < 0);
|
||||
}
|
||||
|
||||
if (tmpstr) {
|
||||
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #48555 (ImageFTBBox() differs from previous versions for texts with new lines)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
$font = "$cwd/Tuffy.ttf";
|
||||
$box = ImageFTBBox(13, 0, $font, "Text without line-break");
|
||||
echo 'Top without line-break: ' . $box[7] . "\n";
|
||||
$box = ImageFTBBox(13, 0, $font, "Text with\nline-break\none more");
|
||||
echo 'Top with line-break: ' . $box[7] . "\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Top without line-break: -15
|
||||
Top with line-break: -15
|
||||
+3
-3
@@ -3019,7 +3019,7 @@ PHP_FUNCTION(imap_sort)
|
||||
|
||||
slst = mail_sort(imap_le_struct->imap_stream, (argc == 6 ? charset : NIL), spg, mypgm, (argc >= 4 ? flags : NIL));
|
||||
|
||||
if (spg) {
|
||||
if (spg && !(flags & SE_FREE)) {
|
||||
mail_free_searchpgm(&spg);
|
||||
}
|
||||
|
||||
@@ -3995,7 +3995,7 @@ PHP_FUNCTION(imap_search)
|
||||
|
||||
mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? charset : NIL), pgm, flags);
|
||||
|
||||
if (pgm) {
|
||||
if (pgm && !(flags & SE_FREE)) {
|
||||
mail_free_searchpgm(&pgm);
|
||||
}
|
||||
|
||||
@@ -4611,7 +4611,7 @@ PHP_FUNCTION(imap_thread)
|
||||
|
||||
pgm = mail_criteria(criteria);
|
||||
top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL, pgm, flags);
|
||||
if (pgm) {
|
||||
if (pgm && !(flags & SE_FREE)) {
|
||||
mail_free_searchpgm(&pgm);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,5 +10,6 @@ if test "$PHP_JSON" != "no"; then
|
||||
AC_HEADER_STDC
|
||||
|
||||
PHP_NEW_EXTENSION(json, json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c, $ext_shared)
|
||||
PHP_INSTALL_HEADERS([ext/json], [php_json.h])
|
||||
PHP_SUBST(JSON_SHARED_LIBADD)
|
||||
fi
|
||||
@@ -486,6 +486,7 @@ PHPAPI void php_json_decode(zval *return_value, char *str, int str_len, zend_boo
|
||||
|
||||
if (depth <= 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must greater than zero");
|
||||
efree(utf16);
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -589,7 +589,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
|
||||
char *ldap_base_dn = NULL;
|
||||
char *ldap_filter = NULL;
|
||||
char **ldap_attrs = NULL;
|
||||
ldap_linkdata *ld;
|
||||
ldap_linkdata *ld = NULL;
|
||||
LDAPMessage *ldap_res;
|
||||
int ldap_attrsonly = 0;
|
||||
int ldap_sizelimit = -1;
|
||||
@@ -806,8 +806,10 @@ cleanup_parallel:
|
||||
}
|
||||
|
||||
cleanup:
|
||||
// Restoring previous options
|
||||
php_set_opts(ld->link, old_ldap_sizelimit, old_ldap_timelimit, old_ldap_deref, &ldap_sizelimit, &ldap_timelimit, &ldap_deref);
|
||||
if (ld) {
|
||||
/* Restoring previous options */
|
||||
php_set_opts(ld->link, old_ldap_sizelimit, old_ldap_timelimit, old_ldap_deref, &ldap_sizelimit, &ldap_timelimit, &ldap_deref);
|
||||
}
|
||||
if (ldap_attrs != NULL) {
|
||||
efree(ldap_attrs);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #48696 (ldap_read() segfaults with invalid parameters)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
ldap_read(1,1,1);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ldap_read(): supplied argument is not a valid ldap link resource in %s on line %d
|
||||
+38
-1
@@ -68,6 +68,7 @@ static PHP_FUNCTION(libxml_use_internal_errors);
|
||||
static PHP_FUNCTION(libxml_get_last_error);
|
||||
static PHP_FUNCTION(libxml_clear_errors);
|
||||
static PHP_FUNCTION(libxml_get_errors);
|
||||
static PHP_FUNCTION(libxml_disable_entity_loader);
|
||||
|
||||
static zend_class_entry *libxmlerror_class_entry;
|
||||
|
||||
@@ -91,7 +92,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_libxml_set_streams_context, 0)
|
||||
ZEND_ARG_INFO(0, context)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_libxml_use_internal_errors, 0)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_libxml_use_internal_errors, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, use_errors)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
@@ -104,6 +105,10 @@ ZEND_END_ARG_INFO()
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_libxml_clear_errors, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_libxml_disable_entity_loader, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, disable)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ extension definition structures */
|
||||
@@ -113,6 +118,7 @@ static const zend_function_entry libxml_functions[] = {
|
||||
PHP_FE(libxml_get_last_error, arginfo_libxml_get_last_error)
|
||||
PHP_FE(libxml_clear_errors, arginfo_libxml_clear_errors)
|
||||
PHP_FE(libxml_get_errors, arginfo_libxml_get_errors)
|
||||
PHP_FE(libxml_disable_entity_loader, arginfo_libxml_disable_entity_loader)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -343,6 +349,12 @@ static int php_libxml_streams_IO_close(void *context)
|
||||
return php_stream_close((php_stream*)context);
|
||||
}
|
||||
|
||||
static xmlParserInputBufferPtr
|
||||
php_libxml_input_buffer_noload(const char *URI, xmlCharEncoding enc)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static xmlParserInputBufferPtr
|
||||
php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
|
||||
{
|
||||
@@ -820,6 +832,31 @@ static PHP_FUNCTION(libxml_clear_errors)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool libxml_disable_entity_loader([boolean disable])
|
||||
Disable/Enable ability to load external entities */
|
||||
static PHP_FUNCTION(libxml_disable_entity_loader)
|
||||
{
|
||||
zend_bool disable = 1;
|
||||
xmlParserInputBufferCreateFilenameFunc old;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &disable) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (disable == 0) {
|
||||
old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_create_filename);
|
||||
} else {
|
||||
old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_noload);
|
||||
}
|
||||
|
||||
if (old == php_libxml_input_buffer_noload) {
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ Common functions shared by extensions */
|
||||
int php_libxml_xmlCheckUTF8(const unsigned char *s)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,8 @@ dnl config.m4 for mysqlnd driver
|
||||
|
||||
PHP_ARG_ENABLE(mysqlnd_threading, whether to enable threaded fetch in mysqlnd,
|
||||
[ --enable-mysqlnd-threading
|
||||
MYSQLND: Enable threaded fetch. Note: This forces ZTS on!], no, no)
|
||||
EXPERIMENTAL: Enable mysqlnd threaded fetch.
|
||||
Note: This forces ZTS on!], no, no)
|
||||
|
||||
dnl If some extension uses mysqlnd it will get compiled in PHP core
|
||||
if test "$PHP_MYSQLND_ENABLED" = "yes"; then
|
||||
@@ -23,7 +24,7 @@ if test "$PHP_MYSQLND_ENABLED" = "yes"; then
|
||||
dnl Windows uses config.w32 thus this code is safe for now
|
||||
if test "$PHP_MYSQLND_THREADING" = "yes"; then
|
||||
PHP_BUILD_THREAD_SAFE
|
||||
AC_DEFINE([MYSQLND_THREADED], 1, [EXPERIMENTAL: Use mysqlnd internal threading])
|
||||
AC_DEFINE([MYSQLND_THREADED], 1, [Use mysqlnd internal threading])
|
||||
fi
|
||||
|
||||
dnl This creates a file so it has to be after above macros
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
#ifndef MYSQLND_H
|
||||
#define MYSQLND_H
|
||||
|
||||
#define MYSQLND_VERSION "mysqlnd/PHP " PHP_VERSION " $Revision$"
|
||||
#define MYSQLND_VERSION_ID PHP_VERSION_ID
|
||||
#define MYSQLND_VERSION "mysqlnd 5.0.5-dev - 081106 - $Revision$"
|
||||
#define MYSQLND_VERSION_ID 50005
|
||||
|
||||
/* This forces inlining of some accessor functions */
|
||||
#define MYSQLND_USE_OPTIMISATIONS 1
|
||||
@@ -318,9 +318,11 @@ PHPAPI MYSQLND_THD_ZVAL_PCACHE * _mysqlnd_palloc_rinit(MYSQLND_ZVAL_PCACHE * cac
|
||||
PHPAPI void _mysqlnd_palloc_rshutdown(MYSQLND_THD_ZVAL_PCACHE * cache TSRMLS_DC);
|
||||
|
||||
|
||||
#define mysqlnd_palloc_init_thd_cache(cache) _mysqlnd_palloc_init_thd_cache((cache) TSRMLS_CC)
|
||||
#define mysqlnd_palloc_free_thd_cache_reference(cache) _mysqlnd_palloc_free_thd_cache_reference((cache) TSRMLS_CC)
|
||||
#define mysqlnd_palloc_get_thd_cache_reference(cache) _mysqlnd_palloc_get_thd_cache_reference((cache) TSRMLS_CC)
|
||||
|
||||
PHPAPI MYSQLND_THD_ZVAL_PCACHE* _mysqlnd_palloc_init_thd_cache(MYSQLND_ZVAL_PCACHE * const cache TSRMLS_DC);
|
||||
MYSQLND_THD_ZVAL_PCACHE* _mysqlnd_palloc_get_thd_cache_reference(MYSQLND_THD_ZVAL_PCACHE * const cache TSRMLS_DC);
|
||||
PHPAPI void _mysqlnd_palloc_free_thd_cache_reference(MYSQLND_THD_ZVAL_PCACHE **cache TSRMLS_DC);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ mysqlnd_mempool_free_contents(MYSQLND_MEMORY_POOL * pool TSRMLS_DC)
|
||||
DBG_ENTER("mysqlnd_mempool_dtor");
|
||||
for (i = 0; i < pool->free_chunk_list_elements; i++) {
|
||||
MYSQLND_MEMORY_POOL_CHUNK * chunk = pool->free_chunk_list[i];
|
||||
mysqlnd_mempool_free_chunk(chunk, FALSE TSRMLS_CC);
|
||||
chunk->free_chunk(chunk, FALSE TSRMLS_CC);
|
||||
}
|
||||
|
||||
DBG_VOID_RETURN;
|
||||
@@ -44,14 +44,11 @@ mysqlnd_mempool_free_contents(MYSQLND_MEMORY_POOL * pool TSRMLS_DC)
|
||||
|
||||
|
||||
/* {{{ mysqlnd_mempool_free_chunk */
|
||||
void
|
||||
static void
|
||||
mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, zend_bool cache_it TSRMLS_DC)
|
||||
{
|
||||
MYSQLND_MEMORY_POOL * pool = chunk->pool;
|
||||
DBG_ENTER("mysqlnd_mempool_free_chunk");
|
||||
if (!chunk) {
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
if (chunk->from_pool) {
|
||||
/* Try to back-off and guess if this is the last block allocated */
|
||||
if (chunk->ptr == (pool->arena + (pool->arena_size - pool->free_size - chunk->size))) {
|
||||
@@ -78,7 +75,7 @@ mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, zend_bool cache_it
|
||||
|
||||
|
||||
/* {{{ mysqlnd_mempool_resize_chunk */
|
||||
void
|
||||
static void
|
||||
mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC)
|
||||
{
|
||||
DBG_ENTER("mysqlnd_mempool_resize_chunk");
|
||||
@@ -138,6 +135,8 @@ MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool
|
||||
chunk = mnd_malloc(sizeof(MYSQLND_MEMORY_POOL_CHUNK));
|
||||
}
|
||||
|
||||
chunk->free_chunk = mysqlnd_mempool_free_chunk;
|
||||
chunk->resize_chunk = mysqlnd_mempool_resize_chunk;
|
||||
chunk->size = size;
|
||||
/*
|
||||
Should not go over MYSQLND_MAX_PACKET_SIZE, since we
|
||||
@@ -184,12 +183,10 @@ void
|
||||
mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool TSRMLS_DC)
|
||||
{
|
||||
DBG_ENTER("mysqlnd_mempool_destroy");
|
||||
if (pool) {
|
||||
/* mnd_free will reference LOCK_access and might crash, depending on the caller...*/
|
||||
mysqlnd_mempool_free_contents(pool TSRMLS_CC);
|
||||
mnd_free(pool->arena);
|
||||
mnd_free(pool);
|
||||
}
|
||||
/* mnd_free will reference LOCK_access and might crash, depending on the caller...*/
|
||||
mysqlnd_mempool_free_contents(pool TSRMLS_CC);
|
||||
mnd_free(pool->arena);
|
||||
mnd_free(pool);
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
|
||||
MYSQLND_MEMORY_POOL * mysqlnd_mempool_create(size_t arena_size TSRMLS_DC);
|
||||
void mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool TSRMLS_DC);
|
||||
void mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC);
|
||||
void mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, zend_bool cache_it TSRMLS_DC);
|
||||
|
||||
|
||||
#endif /* MYSQLND_BLOCK_ALLOC_H */
|
||||
|
||||
|
||||
@@ -830,9 +830,6 @@ void * _mysqlnd_perealloc(void *ptr, size_t new_size, zend_bool persistent MYSQL
|
||||
void _mysqlnd_efree(void *ptr MYSQLND_MEM_D)
|
||||
{
|
||||
DBG_ENTER(mysqlnd_efree_name);
|
||||
if (!ptr) {
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
#ifdef MYSQLND_THREADED
|
||||
if (MYSQLND_G(thread_id) != tsrm_thread_id()) {
|
||||
DBG_RETURN(_mysqlnd_pefree(ptr, 1 TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC));
|
||||
|
||||
@@ -142,6 +142,7 @@ typedef enum mysqlnd_option
|
||||
MYSQLND_OPT_NET_READ_BUFFER_SIZE = 203,
|
||||
} enum_mysqlnd_option;
|
||||
|
||||
|
||||
typedef enum mysqlnd_field_types
|
||||
{
|
||||
MYSQL_TYPE_DECIMAL,
|
||||
@@ -176,6 +177,7 @@ typedef enum mysqlnd_field_types
|
||||
/* Please update this if there is a new type after MYSQL_TYPE_GEOMETRY */
|
||||
#define MYSQL_TYPE_LAST MYSQL_TYPE_GEOMETRY
|
||||
|
||||
|
||||
typedef enum mysqlnd_server_option
|
||||
{
|
||||
MYSQL_OPTION_MULTI_STATEMENTS_ON,
|
||||
@@ -239,6 +241,7 @@ typedef enum mysqlnd_server_option
|
||||
/* see mysqlnd_charset.c for more information */
|
||||
#define MYSQLND_BINARY_CHARSET_NR 63
|
||||
|
||||
|
||||
/*
|
||||
/-----> CONN_CLOSE <---------------\
|
||||
| ^ \
|
||||
@@ -258,6 +261,7 @@ typedef enum mysqlnd_connection_state
|
||||
CONN_QUIT_SENT, /* object is "destroyed" at this stage */
|
||||
} enum_mysqlnd_connection_state;
|
||||
|
||||
|
||||
typedef enum mysqlnd_stmt_state
|
||||
{
|
||||
MYSQLND_STMT_INITTED = 0,
|
||||
@@ -268,11 +272,13 @@ typedef enum mysqlnd_stmt_state
|
||||
MYSQLND_STMT_USER_FETCHING, /* fetch_row_buff or fetch_row_unbuf */
|
||||
} enum_mysqlnd_stmt_state;
|
||||
|
||||
|
||||
typedef enum param_bind_flags
|
||||
{
|
||||
MYSQLND_PARAM_BIND_BLOB_USED = 1
|
||||
} enum_param_bind_flags;
|
||||
|
||||
|
||||
/* PS */
|
||||
enum mysqlnd_stmt_attr
|
||||
{
|
||||
@@ -280,6 +286,7 @@ enum mysqlnd_stmt_attr
|
||||
STMT_ATTR_CURSOR_TYPE,
|
||||
STMT_ATTR_PREFETCH_ROWS
|
||||
};
|
||||
|
||||
enum myslqnd_cursor_type
|
||||
{
|
||||
CURSOR_TYPE_NO_CURSOR= 0,
|
||||
@@ -287,6 +294,7 @@ enum myslqnd_cursor_type
|
||||
CURSOR_TYPE_FOR_UPDATE= 2,
|
||||
CURSOR_TYPE_SCROLLABLE= 4
|
||||
};
|
||||
|
||||
typedef enum mysqlnd_connection_close_type
|
||||
{
|
||||
MYSQLND_CLOSE_EXPLICIT = 0,
|
||||
@@ -295,6 +303,7 @@ typedef enum mysqlnd_connection_close_type
|
||||
MYSQLND_CLOSE_LAST /* for checking, should always be last */
|
||||
} enum_connection_close_type;
|
||||
|
||||
|
||||
typedef enum mysqlnd_collected_stats
|
||||
{
|
||||
STAT_BYTES_SENT,
|
||||
|
||||
@@ -82,7 +82,6 @@ PHPAPI MYSQLND_ZVAL_PCACHE* _mysqlnd_palloc_init_cache(unsigned int cache_size T
|
||||
|
||||
|
||||
/* {{{ mysqlnd_palloc_get_cache_reference */
|
||||
static inline
|
||||
MYSQLND_ZVAL_PCACHE* mysqlnd_palloc_get_cache_reference(MYSQLND_ZVAL_PCACHE * const cache)
|
||||
{
|
||||
if (cache) {
|
||||
@@ -95,20 +94,6 @@ MYSQLND_ZVAL_PCACHE* mysqlnd_palloc_get_cache_reference(MYSQLND_ZVAL_PCACHE * co
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ mysqlnd_palloc_release_cache_reference */
|
||||
static inline
|
||||
MYSQLND_ZVAL_PCACHE* mysqlnd_palloc_release_cache_reference(MYSQLND_ZVAL_PCACHE * const cache)
|
||||
{
|
||||
if (cache) {
|
||||
LOCK_PCACHE(cache);
|
||||
cache->references--;
|
||||
UNLOCK_PCACHE(cache);
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ mysqlnd_palloc_free_cache */
|
||||
/*
|
||||
As this call will happen on MSHUTDOWN(), then we don't need to copy the zvals with
|
||||
@@ -137,9 +122,9 @@ void _mysqlnd_palloc_free_cache(MYSQLND_ZVAL_PCACHE *cache TSRMLS_DC)
|
||||
|
||||
|
||||
/* {{{ _mysqlnd_palloc_init_thd_cache */
|
||||
MYSQLND_THD_ZVAL_PCACHE* mysqlnd_palloc_init_thd_cache(MYSQLND_ZVAL_PCACHE * const cache TSRMLS_DC)
|
||||
PHPAPI MYSQLND_THD_ZVAL_PCACHE* _mysqlnd_palloc_init_thd_cache(MYSQLND_ZVAL_PCACHE * const cache TSRMLS_DC)
|
||||
{
|
||||
MYSQLND_THD_ZVAL_PCACHE *ret = mnd_ecalloc(1, sizeof(MYSQLND_THD_ZVAL_PCACHE));
|
||||
MYSQLND_THD_ZVAL_PCACHE *ret = calloc(1, sizeof(MYSQLND_THD_ZVAL_PCACHE));
|
||||
DBG_ENTER("_mysqlnd_palloc_init_thd_cache");
|
||||
DBG_INF_FMT("ret = %p", ret);
|
||||
|
||||
@@ -161,7 +146,7 @@ MYSQLND_THD_ZVAL_PCACHE* mysqlnd_palloc_init_thd_cache(MYSQLND_ZVAL_PCACHE * con
|
||||
ret->references = 1;
|
||||
|
||||
/* 1. Initialize the GC list */
|
||||
ret->gc_list.ptr_line = mnd_ecalloc(cache->max_items, sizeof(mysqlnd_zval *));
|
||||
ret->gc_list.ptr_line = calloc(cache->max_items, sizeof(mysqlnd_zval *));
|
||||
/* Backward and forward looping is possible */
|
||||
ret->gc_list.last_added = ret->gc_list.ptr_line;
|
||||
ret->gc_list.canary1 = (void*)0xCAFE;
|
||||
@@ -178,18 +163,17 @@ MYSQLND_THD_ZVAL_PCACHE* _mysqlnd_palloc_get_thd_cache_reference(MYSQLND_THD_ZVA
|
||||
{
|
||||
DBG_ENTER("_mysqlnd_palloc_get_thd_cache_reference");
|
||||
if (cache) {
|
||||
++cache->references;
|
||||
DBG_INF_FMT("cache=%p new_refc=%d gc_list.canary1=%p gc_list.canary2=%p",
|
||||
cache, cache->references, cache->gc_list.canary1, cache->gc_list.canary2);
|
||||
mysqlnd_palloc_get_cache_reference(cache->parent);
|
||||
/* No concurrency here, we are in the same thread */
|
||||
++cache->references;
|
||||
}
|
||||
DBG_RETURN(cache);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ mysqlnd_palloc_free_thd_cache */
|
||||
/* {{{ mysqlnd_palloc_free_cache */
|
||||
/*
|
||||
As this call will happen on MSHUTDOWN(), then we don't need to copy the zvals with
|
||||
copy_ctor but scrap what they point to with zval_dtor() and then just free our
|
||||
@@ -233,8 +217,8 @@ void mysqlnd_palloc_free_thd_cache(MYSQLND_THD_ZVAL_PCACHE *thd_cache TSRMLS_DC)
|
||||
UNLOCK_PCACHE(global_cache);
|
||||
|
||||
}
|
||||
mnd_efree(thd_cache->gc_list.ptr_line);
|
||||
mnd_efree(thd_cache);
|
||||
mnd_free(thd_cache->gc_list.ptr_line);
|
||||
mnd_free(thd_cache);
|
||||
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
@@ -246,7 +230,7 @@ PHPAPI void _mysqlnd_palloc_free_thd_cache_reference(MYSQLND_THD_ZVAL_PCACHE **c
|
||||
{
|
||||
DBG_ENTER("_mysqlnd_palloc_free_thd_cache_reference");
|
||||
if (*cache) {
|
||||
mysqlnd_palloc_release_cache_reference((*cache)->parent);
|
||||
--(*cache)->parent->references;
|
||||
DBG_INF_FMT("cache=%p references_left=%d canary1=%p canary2=%p",
|
||||
*cache, (*cache)->references, (*cache)->gc_list.canary1, (*cache)->gc_list.canary2);
|
||||
|
||||
@@ -413,9 +397,6 @@ void mysqlnd_palloc_zval_ptr_dtor(zval **zv, MYSQLND_THD_ZVAL_PCACHE * const thd
|
||||
{
|
||||
MYSQLND_ZVAL_PCACHE *cache;
|
||||
DBG_ENTER("mysqlnd_palloc_zval_ptr_dtor");
|
||||
if (!*zv) {
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
if (thd_cache) {
|
||||
DBG_INF_FMT("cache=%p parent_block=%p last_in_block=%p *zv=%p refc=%d type=%d ",
|
||||
thd_cache,
|
||||
@@ -547,7 +528,7 @@ void mysqlnd_palloc_zval_ptr_dtor(zval **zv, MYSQLND_THD_ZVAL_PCACHE * const thd
|
||||
/* {{{ _mysqlnd_palloc_rinit */
|
||||
PHPAPI MYSQLND_THD_ZVAL_PCACHE * _mysqlnd_palloc_rinit(MYSQLND_ZVAL_PCACHE * cache TSRMLS_DC)
|
||||
{
|
||||
return mysqlnd_palloc_init_thd_cache(cache TSRMLS_CC);
|
||||
return mysqlnd_palloc_init_thd_cache(cache);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -871,7 +871,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES *result, void *param, unsigned int
|
||||
result->meta->fields[i].max_length = Z_STRLEN_P(data);
|
||||
}
|
||||
stmt->result_bind[i].zv->value = data->value;
|
||||
/* copied data, thus also the ownership. Thus null data */
|
||||
// copied data, thus also the ownership. Thus null data
|
||||
ZVAL_NULL(data);
|
||||
}
|
||||
}
|
||||
@@ -885,7 +885,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES *result, void *param, unsigned int
|
||||
the bound variables. Thus we need to do part of what it does or Zend will
|
||||
report leaks.
|
||||
*/
|
||||
mysqlnd_mempool_free_chunk(row_packet->row_buffer, TRUE TSRMLS_CC);
|
||||
row_packet->row_buffer->free_chunk(row_packet->row_buffer, TRUE TSRMLS_CC);
|
||||
row_packet->row_buffer = NULL;
|
||||
}
|
||||
} else if (ret == FAIL) {
|
||||
@@ -1047,7 +1047,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES *result, void *param, unsigned int fla
|
||||
result->meta->fields[i].max_length = Z_STRLEN_P(data);
|
||||
}
|
||||
stmt->result_bind[i].zv->value = data->value;
|
||||
/* copied data, thus also the ownership. Thus null data */
|
||||
// copied data, thus also the ownership. Thus null data
|
||||
ZVAL_NULL(data);
|
||||
}
|
||||
}
|
||||
@@ -1060,13 +1060,13 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES *result, void *param, unsigned int fla
|
||||
the bound variables. Thus we need to do part of what it does or Zend will
|
||||
report leaks.
|
||||
*/
|
||||
mysqlnd_mempool_free_chunk(row_packet->row_buffer, TRUE TSRMLS_CC);
|
||||
row_packet->row_buffer->free_chunk(row_packet->row_buffer, TRUE TSRMLS_CC);
|
||||
row_packet->row_buffer = NULL;
|
||||
}
|
||||
/* We asked for one row, the next one should be EOF, eat it */
|
||||
ret = PACKET_READ(row_packet, result->conn);
|
||||
if (row_packet->row_buffer) {
|
||||
mysqlnd_mempool_free_chunk(row_packet->row_buffer, TRUE TSRMLS_CC);
|
||||
row_packet->row_buffer->free_chunk(row_packet->row_buffer, TRUE TSRMLS_CC);
|
||||
row_packet->row_buffer = NULL;
|
||||
}
|
||||
MYSQLND_INC_CONN_STATISTIC(&stmt->conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR);
|
||||
|
||||
@@ -30,9 +30,6 @@
|
||||
#include "mysqlnd_debug.h"
|
||||
#include "ext/standard/basic_functions.h"
|
||||
|
||||
#define START_FREEING_AFTER_X_ROWS 10
|
||||
static void mysqlnd_buffered_free_previous_row(MYSQLND_RES *result, int which TSRMLS_DC);
|
||||
|
||||
#define MYSQLND_SILENT
|
||||
|
||||
#ifdef MYSQLND_THREADED
|
||||
@@ -104,18 +101,11 @@ void mysqlnd_res_initialize_result_set_rest(MYSQLND_RES * const result TSRMLS_DC
|
||||
unsigned int field_count = result->meta->field_count;
|
||||
unsigned int row_count = result->stored_data->row_count;
|
||||
DBG_ENTER("mysqlnd_res_initialize_result_set_rest");
|
||||
DBG_INF_FMT("before heap=%lu real=%lu", zend_memory_usage(FALSE TSRMLS_CC), zend_memory_usage(TRUE TSRMLS_CC));
|
||||
|
||||
if (!data_cursor || row_count == result->stored_data->initialized_rows) {
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
while ((data_cursor - data_begin) < (row_count * field_count)) {
|
||||
if (START_FREEING_AFTER_X_ROWS < ((data_cursor - data_begin) / result->field_count)) {
|
||||
zval **orig_data_cursor = result->stored_data->data_cursor;
|
||||
result->stored_data->data_cursor = data_cursor;
|
||||
mysqlnd_buffered_free_previous_row(result, START_FREEING_AFTER_X_ROWS TSRMLS_CC);
|
||||
result->stored_data->data_cursor = orig_data_cursor;
|
||||
}
|
||||
if (NULL == data_cursor[0]) {
|
||||
result->stored_data->initialized_rows++;
|
||||
result->m.row_decoder(
|
||||
@@ -140,7 +130,6 @@ void mysqlnd_res_initialize_result_set_rest(MYSQLND_RES * const result TSRMLS_DC
|
||||
}
|
||||
data_cursor += field_count;
|
||||
}
|
||||
DBG_INF_FMT("after heap=%lu real=%lu", zend_memory_usage(FALSE TSRMLS_CC), zend_memory_usage(TRUE TSRMLS_CC));
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -188,7 +177,7 @@ void mysqlnd_unbuffered_free_last_data(MYSQLND_RES *result TSRMLS_DC)
|
||||
if (unbuf->last_row_buffer) {
|
||||
DBG_INF("Freeing last row buffer");
|
||||
/* Nothing points to this buffer now, free it */
|
||||
mysqlnd_mempool_free_chunk(unbuf->last_row_buffer, TRUE TSRMLS_CC);
|
||||
unbuf->last_row_buffer->free_chunk(unbuf->last_row_buffer, TRUE TSRMLS_CC);
|
||||
unbuf->last_row_buffer = NULL;
|
||||
}
|
||||
|
||||
@@ -197,59 +186,6 @@ void mysqlnd_unbuffered_free_last_data(MYSQLND_RES *result TSRMLS_DC)
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ mysqlnd_buffered_free_previous_row */
|
||||
static
|
||||
void mysqlnd_buffered_free_previous_row(MYSQLND_RES *result, int which TSRMLS_DC)
|
||||
{
|
||||
return;
|
||||
#ifdef JOHANNES_0
|
||||
/* optimization currently disabled as this breaks fetching data with
|
||||
more than START_FREEING_AFTER_X_ROWS rows */
|
||||
|
||||
MYSQLND_RES_BUFFERED * set = result->stored_data;
|
||||
|
||||
DBG_ENTER("mysqlnd_buffered_free_previous_row");
|
||||
|
||||
if (!set) {
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
|
||||
DBG_INF_FMT("which=%d result->field_count=%d data=%p data_cursor=%p", which, result->field_count, set->data, set->data_cursor);
|
||||
if (set->data_cursor && ((set->data_cursor - (which * result->field_count) ) >= set->data)) {
|
||||
unsigned int i, ctor_called_count = 0;
|
||||
zend_bool copy_ctor_called;
|
||||
MYSQLND_STATS *global_stats = result->conn? &result->conn->stats:NULL;
|
||||
zval **current_row = set->data_cursor - (which * result->field_count);
|
||||
|
||||
DBG_INF_FMT("%u columns to free", result->field_count);
|
||||
for (i = 0; i < result->field_count; i++) {
|
||||
if (current_row[i]) {
|
||||
mysqlnd_palloc_zval_ptr_dtor(&(current_row[i]),
|
||||
result->zval_cache, result->type,
|
||||
©_ctor_called TSRMLS_CC);
|
||||
if (copy_ctor_called) {
|
||||
ctor_called_count++;
|
||||
}
|
||||
current_row[i] = NULL;
|
||||
}
|
||||
}
|
||||
DBG_INF_FMT("copy_ctor_called_count=%u", ctor_called_count);
|
||||
/* By using value3 macros we hold a mutex only once, there is no value2 */
|
||||
MYSQLND_INC_CONN_STATISTIC_W_VALUE3(global_stats,
|
||||
STAT_COPY_ON_WRITE_PERFORMED,
|
||||
ctor_called_count,
|
||||
STAT_COPY_ON_WRITE_SAVED,
|
||||
result->field_count - ctor_called_count,
|
||||
STAT_COPY_ON_WRITE_PERFORMED, 0);
|
||||
}
|
||||
|
||||
DBG_VOID_RETURN;
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
|
||||
/* {{{ mysqlnd_free_buffered_data */
|
||||
void mysqlnd_free_buffered_data(MYSQLND_RES *result TSRMLS_DC)
|
||||
{
|
||||
@@ -269,20 +205,21 @@ void mysqlnd_free_buffered_data(MYSQLND_RES *result TSRMLS_DC)
|
||||
|
||||
for (col = field_count - 1; col >= 0; --col) {
|
||||
zend_bool copy_ctor_called;
|
||||
if (current_row[col] != NULL) {
|
||||
mysqlnd_palloc_zval_ptr_dtor(&(current_row[col]), zval_cache,
|
||||
if (current_row[0] == NULL) {
|
||||
break;/* row that was never initialized */
|
||||
}
|
||||
mysqlnd_palloc_zval_ptr_dtor(&(current_row[col]), zval_cache,
|
||||
result->type, ©_ctor_called TSRMLS_CC);
|
||||
#if MYSQLND_DEBUG_MEMORY
|
||||
DBG_INF_FMT("Copy_ctor_called=%d", copy_ctor_called);
|
||||
DBG_INF_FMT("Copy_ctor_called=%d", copy_ctor_called);
|
||||
#endif
|
||||
MYSQLND_INC_GLOBAL_STATISTIC(copy_ctor_called? STAT_COPY_ON_WRITE_PERFORMED:
|
||||
STAT_COPY_ON_WRITE_SAVED);
|
||||
}
|
||||
MYSQLND_INC_GLOBAL_STATISTIC(copy_ctor_called? STAT_COPY_ON_WRITE_PERFORMED:
|
||||
STAT_COPY_ON_WRITE_SAVED);
|
||||
}
|
||||
#if MYSQLND_DEBUG_MEMORY
|
||||
DBG_INF("Freeing current_row & current_buffer");
|
||||
#endif
|
||||
mysqlnd_mempool_free_chunk(current_buffer, TRUE TSRMLS_CC);
|
||||
current_buffer->free_chunk(current_buffer, TRUE TSRMLS_CC);
|
||||
}
|
||||
DBG_INF("Freeing data & row_buffer");
|
||||
if (set->data) {
|
||||
@@ -1162,10 +1099,6 @@ mysqlnd_fetch_row_buffered(MYSQLND_RES *result, void *param, unsigned int flags,
|
||||
zval **current_row = set->data_cursor;
|
||||
MYSQLND_FIELD *field = result->meta->fields;
|
||||
struct mysqlnd_field_hash_key *zend_hash_key = result->meta->zend_hash_keys;
|
||||
DBG_INF_FMT("row_num=%u", (set->data_cursor - set->data) / result->meta->field_count);
|
||||
if (START_FREEING_AFTER_X_ROWS < ((set->data_cursor - set->data) / result->field_count)) {
|
||||
mysqlnd_buffered_free_previous_row(result, START_FREEING_AFTER_X_ROWS TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (NULL == current_row[0]) {
|
||||
uint64_t row_num = (set->data_cursor - set->data) / result->meta->field_count;
|
||||
@@ -1915,7 +1848,6 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES *result, unsigned int flags,
|
||||
|
||||
DBG_ENTER("mysqlnd_res::fetch_into");
|
||||
DBG_INF_FMT("flags=%u mysqlnd_extension=%d", flags, extension);
|
||||
DBG_INF_FMT("memory in use: heap_size=%lu real_size=%u", zend_memory_usage(FALSE TSRMLS_CC), zend_memory_usage(TRUE TSRMLS_CC));
|
||||
|
||||
if (!result->m.fetch_row) {
|
||||
RETVAL_NULL();
|
||||
@@ -1927,7 +1859,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES *result, unsigned int flags,
|
||||
*/
|
||||
mysqlnd_array_init(return_value, mysqlnd_num_fields(result) * 2);
|
||||
if (FAIL == result->m.fetch_row(result, (void *)return_value, flags, &fetched_anything TSRMLS_CC)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading/decoding a row");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading a row");
|
||||
RETVAL_FALSE;
|
||||
} else if (fetched_anything == FALSE) {
|
||||
zval_dtor(return_value);
|
||||
@@ -1945,7 +1877,6 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES *result, unsigned int flags,
|
||||
return_value is IS_NULL for no more data and an array for data. Thus it's ok
|
||||
to return here.
|
||||
*/
|
||||
DBG_INF_FMT("returning: heap_size=%lu real_size=%u", zend_memory_usage(FALSE TSRMLS_CC), zend_memory_usage(TRUE TSRMLS_CC));
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -45,10 +45,12 @@ struct st_mysqlnd_memory_pool
|
||||
|
||||
struct st_mysqlnd_memory_pool_chunk
|
||||
{
|
||||
uint32_t app;
|
||||
uint64_t app;
|
||||
MYSQLND_MEMORY_POOL *pool;
|
||||
zend_uchar *ptr;
|
||||
uint32_t size;
|
||||
unsigned int size;
|
||||
void (*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC);
|
||||
void (*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, zend_bool cache_it TSRMLS_DC);
|
||||
zend_bool from_pool;
|
||||
};
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "mysqlnd_statistics.h"
|
||||
#include "mysqlnd_palloc.h"
|
||||
#include "mysqlnd_debug.h"
|
||||
#include "mysqlnd_block_alloc.h"
|
||||
#include "ext/standard/sha1.h"
|
||||
#include "php_network.h"
|
||||
#include "zend_ini.h"
|
||||
@@ -42,6 +43,7 @@
|
||||
#define MYSQLND_DUMP_HEADER_N_BODY2
|
||||
#define MYSQLND_DUMP_HEADER_N_BODY_FULL2
|
||||
|
||||
|
||||
#define PACKET_READ_HEADER_AND_BODY(packet, conn, buf, buf_size, packet_type_as_text, packet_type) \
|
||||
{ \
|
||||
if (FAIL == mysqlnd_read_header((conn), &((packet)->header) TSRMLS_CC)) {\
|
||||
@@ -69,6 +71,7 @@
|
||||
1); \
|
||||
}
|
||||
|
||||
|
||||
extern mysqlnd_packet_methods packet_methods[];
|
||||
|
||||
static const char *unknown_sqlstate= "HY000";
|
||||
@@ -610,7 +613,7 @@ php_mysqlnd_greet_read(void *_packet, MYSQLND *conn TSRMLS_DC)
|
||||
/* pad2 */
|
||||
p+= 13;
|
||||
|
||||
if ((size_t)(p - buf) < packet->header.size) {
|
||||
if (p - buf < packet->header.size) {
|
||||
/* scramble_buf is split into two parts */
|
||||
memcpy(packet->scramble_buf + SCRAMBLE_LENGTH_323,
|
||||
p, SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323);
|
||||
@@ -624,7 +627,7 @@ php_mysqlnd_greet_read(void *_packet, MYSQLND *conn TSRMLS_DC)
|
||||
DBG_INF_FMT("server_capabilities=%d charset_no=%d server_status=%d",
|
||||
packet->server_capabilities, packet->charset_no, packet->server_status);
|
||||
|
||||
if ((size_t)(p - begin) > packet->header.size) {
|
||||
if (p - begin > packet->header.size) {
|
||||
DBG_ERR_FMT("GREET packet %d bytes shorter than expected", p - begin - packet->header.size);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "GREET packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
|
||||
p - begin - packet->header.size);
|
||||
@@ -809,7 +812,7 @@ php_mysqlnd_ok_read(void *_packet, MYSQLND *conn TSRMLS_DC)
|
||||
p+= 2;
|
||||
|
||||
/* There is a message */
|
||||
if (packet->header.size > (size_t) (p - buf) && (i = php_mysqlnd_net_field_length(&p))) {
|
||||
if (packet->header.size > p - buf && (i = php_mysqlnd_net_field_length(&p))) {
|
||||
packet->message = pestrndup((char *)p, MIN(i, sizeof(buf) - (p - buf)), conn->persistent);
|
||||
packet->message_len = i;
|
||||
} else {
|
||||
@@ -820,7 +823,7 @@ php_mysqlnd_ok_read(void *_packet, MYSQLND *conn TSRMLS_DC)
|
||||
packet->affected_rows, packet->last_insert_id, packet->server_status,
|
||||
packet->warning_count);
|
||||
|
||||
if ((size_t)(p - begin) > packet->header.size) {
|
||||
if (p - begin > packet->header.size) {
|
||||
DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "OK packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
|
||||
p - begin - packet->header.size);
|
||||
@@ -893,7 +896,7 @@ php_mysqlnd_eof_read(void *_packet, MYSQLND *conn TSRMLS_DC)
|
||||
packet->server_status = 0;
|
||||
}
|
||||
|
||||
if ((size_t)(p - begin) > packet->header.size) {
|
||||
if (p - begin > packet->header.size) {
|
||||
DBG_ERR_FMT("EOF packet %d bytes shorter than expected", p - begin - packet->header.size);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "EOF packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
|
||||
p - begin - packet->header.size);
|
||||
@@ -1043,7 +1046,7 @@ php_mysqlnd_rset_header_read(void *_packet, MYSQLND *conn TSRMLS_DC)
|
||||
packet->warning_count = uint2korr(p);
|
||||
p+=2;
|
||||
/* Check for additional textual data */
|
||||
if (packet->header.size > (size_t) (p - buf) && (len = php_mysqlnd_net_field_length(&p))) {
|
||||
if (packet->header.size > (p - buf) && (len = php_mysqlnd_net_field_length(&p))) {
|
||||
packet->info_or_local_file = mnd_pemalloc(len + 1, conn->persistent);
|
||||
memcpy(packet->info_or_local_file, p, len);
|
||||
packet->info_or_local_file[len] = '\0';
|
||||
@@ -1058,7 +1061,7 @@ php_mysqlnd_rset_header_read(void *_packet, MYSQLND *conn TSRMLS_DC)
|
||||
/* Result set */
|
||||
break;
|
||||
}
|
||||
if ((size_t)(p - begin) > packet->header.size) {
|
||||
if (p - begin > packet->header.size) {
|
||||
DBG_ERR_FMT("RSET_HEADER packet %d bytes shorter than expected", p - begin - packet->header.size);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "GREET packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
|
||||
p - begin - packet->header.size);
|
||||
@@ -1186,7 +1189,7 @@ php_mysqlnd_rset_field_read(void *_packet, MYSQLND *conn TSRMLS_DC)
|
||||
NULL_LENGTH (0xFB) comes from COM_FIELD_LIST when the default value is NULL.
|
||||
Otherwise the string is length encoded.
|
||||
*/
|
||||
if (packet->header.size > (size_t)(p - buf) &&
|
||||
if (packet->header.size > (p - buf) &&
|
||||
(len = php_mysqlnd_net_field_length(&p)) &&
|
||||
len != MYSQLND_NULL_LENGTH)
|
||||
{
|
||||
@@ -1198,7 +1201,7 @@ php_mysqlnd_rset_field_read(void *_packet, MYSQLND *conn TSRMLS_DC)
|
||||
p += len;
|
||||
}
|
||||
|
||||
if ((size_t)(p - begin) > packet->header.size) {
|
||||
if (p - begin > packet->header.size) {
|
||||
DBG_ERR_FMT("RSET field packet %d bytes shorter than expected", p - begin - packet->header.size);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result set field packet "MYSQLND_SZ_T_SPEC" bytes "
|
||||
"shorter than expected", p - begin - packet->header.size);
|
||||
@@ -1326,7 +1329,7 @@ php_mysqlnd_read_row_ex(MYSQLND *conn, MYSQLND_MEMORY_POOL_CHUNK **buffer,
|
||||
We need a trailing \0 for the last string, in case of text-mode,
|
||||
to be able to implement read-only variables.
|
||||
*/
|
||||
mysqlnd_mempool_resize_chunk((*buffer), *data_size + 1 TSRMLS_CC);
|
||||
(*buffer)->resize_chunk((*buffer), *data_size + 1 TSRMLS_CC);
|
||||
/* The position could have changed, recalculate */
|
||||
p = (*buffer)->ptr + (*data_size - header.size);
|
||||
}
|
||||
@@ -1342,8 +1345,8 @@ php_mysqlnd_read_row_ex(MYSQLND *conn, MYSQLND_MEMORY_POOL_CHUNK **buffer,
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ret == FAIL && (*buffer)) {
|
||||
mysqlnd_mempool_free_chunk(*buffer, TRUE TSRMLS_CC);
|
||||
if (ret == FAIL) {
|
||||
(*buffer)->free_chunk((*buffer), TRUE TSRMLS_CC);
|
||||
*buffer = NULL;
|
||||
}
|
||||
*data_size -= prealloc_more_bytes;
|
||||
@@ -1361,10 +1364,8 @@ void php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffe
|
||||
zend_uchar *null_ptr, bit;
|
||||
zval **current_field, **end_field, **start_field;
|
||||
zend_bool as_unicode = conn->options.numeric_and_datetime_as_unicode;
|
||||
#ifdef USE_ZVAL_CACHE
|
||||
zend_bool allocated;
|
||||
void *obj = NULL;
|
||||
#endif
|
||||
void *obj;
|
||||
|
||||
DBG_ENTER("php_mysqlnd_rowp_read_binary_protocol");
|
||||
|
||||
@@ -1473,7 +1474,7 @@ void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
|
||||
end_field = (current_field = start_field = fields) + field_count;
|
||||
for (i = 0; current_field < end_field; current_field++, i++) {
|
||||
/* Don't reverse the order. It is significant!*/
|
||||
void *obj;
|
||||
void *obj = NULL;
|
||||
zend_bool allocated = TRUE;
|
||||
zend_uchar *this_field_len_pos = p;
|
||||
/* php_mysqlnd_net_field_length() call should be after *this_field_len_pos = p; */
|
||||
@@ -1826,7 +1827,7 @@ void php_mysqlnd_rowp_free_mem(void *_packet, zend_bool alloca TSRMLS_DC)
|
||||
DBG_ENTER("php_mysqlnd_rowp_free_mem");
|
||||
p = (php_mysql_packet_row *) _packet;
|
||||
if (p->row_buffer) {
|
||||
mysqlnd_mempool_free_chunk(p->row_buffer, TRUE TSRMLS_CC);
|
||||
p->row_buffer->free_chunk(p->row_buffer, TRUE TSRMLS_CC);
|
||||
p->row_buffer = NULL;
|
||||
}
|
||||
DBG_INF_FMT("alloca=%d persistent=%d", (int)alloca, (int)p->header.persistent);
|
||||
@@ -1944,7 +1945,7 @@ php_mysqlnd_prepare_read(void *_packet, MYSQLND *conn TSRMLS_DC)
|
||||
DBG_INF_FMT("Prepare packet read: stmt_id=%d fields=%d params=%d",
|
||||
packet->stmt_id, packet->field_count, packet->param_count);
|
||||
|
||||
if ((size_t) (p - begin) > packet->header.size) {
|
||||
if (p - begin > packet->header.size) {
|
||||
DBG_ERR_FMT("PREPARE packet %d bytes shorter than expected", p - begin - packet->header.size);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PREPARE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
|
||||
p - begin - packet->header.size);
|
||||
@@ -2004,7 +2005,7 @@ php_mysqlnd_chg_user_read(void *_packet, MYSQLND *conn TSRMLS_DC)
|
||||
packet->error_info.sqlstate
|
||||
TSRMLS_CC);
|
||||
}
|
||||
if ((size_t)(p - begin) > packet->header.size) {
|
||||
if (p - begin > packet->header.size) {
|
||||
DBG_ERR_FMT("CHANGE_USER packet %d bytes shorter than expected", p - begin - packet->header.size);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CHANGE_USER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
|
||||
p - begin - packet->header.size);
|
||||
|
||||
@@ -46,13 +46,13 @@ PHPAPI void mysqlnd_minfo_print_hash(zval *values)
|
||||
|
||||
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(values), &pos_values);
|
||||
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(values),
|
||||
(void **)&values_entry, &pos_values) == SUCCESS) {
|
||||
(void **)&values_entry, &pos_values) == SUCCESS) {
|
||||
TSRMLS_FETCH();
|
||||
zstr string_key;
|
||||
uint string_key_len;
|
||||
ulong num_key;
|
||||
int s_len;
|
||||
char *s = NULL;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
zend_hash_get_current_key_ex(Z_ARRVAL_P(values), &string_key, &string_key_len, &num_key, 0, &pos_values);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Test preg_match_all() function : error conditions
|
||||
echo "*** Testing preg_match_all() : error conditions ***\n";
|
||||
$regex = '/[a-z]/';
|
||||
$subject = 'string';
|
||||
var_dump(preg_match_all($regex, $subject, test));
|
||||
var_dump(preg_match_all($regex, $subject, 'test'));
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
@@ -230,9 +230,11 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
#if PHP_DBLIB_IS_MSSQL
|
||||
if (DBSETOPT(H->link, DBTEXTLIMIT, "2147483647") == FAIL) {
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) {
|
||||
goto cleanup;
|
||||
|
||||
@@ -210,16 +210,28 @@ class PharCommand extends CLICommand
|
||||
*/
|
||||
static function cli_arg_typ_loader($arg, $cfg, $key)
|
||||
{
|
||||
if (($arg == '0' || $arg == '1') && !file_exists($arg)) {
|
||||
if (($arg == '0' || $arg == '1') && !file_exists($arg) && substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
$found = NULL;
|
||||
$apiver = `pear -q info PHP_Archive 2>/dev/null|grep 'API Version'`;
|
||||
$apiver = trim(substr($apiver, strlen('API Version')));
|
||||
$apiver = false;
|
||||
$path = explode(PATH_SEPARATOR, $_ENV['PATH']);
|
||||
$pear = false;
|
||||
foreach ($path as $component) {
|
||||
if (file_exists($component . DIRECTORY_SEPARATOR . 'pear')
|
||||
&& is_executable($component . DIRECTORY_SEPARATOR . 'pear')) {
|
||||
$pear = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($pear) {
|
||||
$apiver = `pear -q info PHP_Archive 2>/dev/null|grep 'API Version'`;
|
||||
$apiver = trim(substr($apiver, strlen('API Version')));
|
||||
}
|
||||
if ($apiver) {
|
||||
self::notice("Pear package PHP_Archive: API Version: $apiver.\n");
|
||||
self::notice("PEAR package PHP_Archive: API Version: $apiver.\n");
|
||||
$files = explode("\n", `pear list-files PHP_Archive`);
|
||||
$phpdir = `pear config-get php_dir 2>/dev/null`;
|
||||
$phpdir = trim($phpdir);
|
||||
self::notice("Pear package PHP_Archive: $phpdir.\n");
|
||||
self::notice("PEAR package PHP_Archive: $phpdir.\n");
|
||||
if (is_dir($phpdir)) {
|
||||
foreach($files as $ent) {
|
||||
$matches = NULL;
|
||||
@@ -234,13 +246,13 @@ class PharCommand extends CLICommand
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self::notice("Pear package PHP_Archive: corrupt or inaccessible base dir: $php_dir.\n");
|
||||
self::notice("PEAR package PHP_Archive: corrupt or inaccessible base dir: $php_dir.\n");
|
||||
}
|
||||
}
|
||||
if (isset($found)) {
|
||||
self::notice("Pear package PHP_Archive: $found.\n");
|
||||
self::notice("PEAR package PHP_Archive: $found.\n");
|
||||
} else {
|
||||
$msg = "Pear package PHP_Archive or Archive.php class file not found.\n";
|
||||
$msg = "PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.\n";
|
||||
if ($arg == '0') {
|
||||
self::notice($msg);
|
||||
} else {
|
||||
|
||||
+3
-1
@@ -21,7 +21,9 @@
|
||||
|
||||
#include "php.h"
|
||||
#if defined(PHP_WIN32)
|
||||
#include "win32/php_stdint.h"
|
||||
# include "win32/php_stdint.h"
|
||||
#elif defined(HAVE_STDINT_H)
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
+23
-2
@@ -1604,13 +1604,34 @@ static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TS
|
||||
switch (intern->type) {
|
||||
case SPL_FS_INFO:
|
||||
case SPL_FS_FILE:
|
||||
ZVAL_STRINGL(writeobj, intern->file_name, intern->file_name_len, 1);
|
||||
if (readobj == writeobj) {
|
||||
zval retval;
|
||||
zval *retval_ptr = &retval;
|
||||
|
||||
ZVAL_STRINGL(retval_ptr, intern->file_name, intern->file_name_len, 1);
|
||||
zval_dtor(readobj);
|
||||
ZVAL_ZVAL(writeobj, retval_ptr, 0, 0);
|
||||
} else {
|
||||
ZVAL_STRINGL(writeobj, intern->file_name, intern->file_name_len, 1);
|
||||
}
|
||||
return SUCCESS;
|
||||
case SPL_FS_DIR:
|
||||
ZVAL_STRING(writeobj, intern->u.dir.entry.d_name, 1);
|
||||
if (readobj == writeobj) {
|
||||
zval retval;
|
||||
zval *retval_ptr = &retval;
|
||||
|
||||
ZVAL_STRING(retval_ptr, intern->u.dir.entry.d_name, 1);
|
||||
zval_dtor(readobj);
|
||||
ZVAL_ZVAL(writeobj, retval_ptr, 0, 0);
|
||||
} else {
|
||||
ZVAL_STRING(writeobj, intern->u.dir.entry.d_name, 1);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
if (readobj == writeobj) {
|
||||
zval_dtor(readobj);
|
||||
}
|
||||
ZVAL_NULL(writeobj);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -2819,6 +2819,11 @@ static int sqlite_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
sqlite_object *obj = (sqlite_object*) zend_object_store_get_object(object TSRMLS_CC);
|
||||
|
||||
if (obj->u.res == NULL) {
|
||||
zend_throw_exception(sqlite_ce_exception, "Row count is not available for this query", 0 TSRMLS_CC);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (obj->u.res->buffered) {
|
||||
* count = obj->u.res->nrows;
|
||||
return SUCCESS;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #48679 (sqlite2 count on unbuffered query causes segfault)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("sqlite")) print "skip";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
$x = new sqliteunbuffered;
|
||||
count($x);
|
||||
} catch (SQLiteException $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
string(41) "Row count is not available for this query"
|
||||
Done
|
||||
@@ -589,10 +589,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_filter, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, callback)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_map, 0, 0, 3)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_map, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, callback)
|
||||
ZEND_ARG_INFO(0, arg1) /* ARRAY_INFO(0, arg1, 0) */
|
||||
ZEND_ARG_INFO(0, arg2) /* ARRAY_INFO(0, arg2, 0) */
|
||||
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
||||
ZEND_ARG_INFO(0, ...)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
ARG_WITH("config-file-scan-dir", "Dir to check for additional php ini files", "");
|
||||
|
||||
AC_DEFINE("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR);
|
||||
AC_DEFINE("HAVE_INET_PTON", 1);
|
||||
AC_DEFINE("HAVE_INET_NTOP", 1);
|
||||
|
||||
AC_DEFINE("PHP_USE_PHP_CRYPT_R", 1);
|
||||
|
||||
CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_STANDARD", "ext/date/lib");
|
||||
@@ -26,5 +23,5 @@ EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
|
||||
streamsfuncs.c http.c flock_compat.c", false /* never shared */);
|
||||
|
||||
if (PHP_MBREGEX != "no") {
|
||||
CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_STANDARD", PHP_MBREGEX + ";ext\\mbstring\\oniguruma")
|
||||
CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_STANDARD", PHP_MBREGEX + ";ext\\mbstring\\oniguruma")
|
||||
}
|
||||
+2
-2
@@ -869,8 +869,8 @@ PHP_NAMED_FUNCTION(php_if_tmpfile)
|
||||
{
|
||||
php_stream *stream;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
WRONG_PARAM_COUNT;
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
stream = php_stream_fopen_tmpfile();
|
||||
|
||||
+1
-1
@@ -241,7 +241,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
|
||||
php_basename(tmp, strlen(tmp), NULL, 0,&f, &f_len TSRMLS_CC);
|
||||
|
||||
if (headers != NULL) {
|
||||
spprintf(&hdr, 0, "%s\r\nX-PHP-Originating-Script: %ld:%s\n", headers, php_getuid(), f);
|
||||
spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\r\n%s", php_getuid(), f, headers);
|
||||
} else {
|
||||
spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n", php_getuid(), f);
|
||||
}
|
||||
|
||||
@@ -17,14 +17,6 @@ echo "*** Testing readdir() : usage variations ***\n";
|
||||
var_dump($fp = fopen(__FILE__, "r"));
|
||||
var_dump( readdir($fp) );
|
||||
|
||||
// get file length over 256 characters
|
||||
<<<EOT
|
||||
123456789012345678901234567890
|
||||
123456789012345678901234567890
|
||||
123456789012345678901234567890
|
||||
123456789012345678901234567890
|
||||
123456789012345678901234567890
|
||||
EOT;
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
@@ -16,8 +16,10 @@ output_handler=
|
||||
<?php
|
||||
mb_internal_encoding('Shift_JIS');
|
||||
print mb_internal_encoding()."\n";
|
||||
var_dump(htmlentities("\x81\x41\x81\x42\x81\x43", ENT_QUOTES, ''));
|
||||
var_dump(bin2hex(htmlentities("\x81\x41\x81\x42\x81\x43", ENT_QUOTES, '')));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
SJIS
|
||||
string(6) "、。,"
|
||||
string(12) "814181428143"
|
||||
===DONE===
|
||||
@@ -14,8 +14,10 @@ output_handler=
|
||||
<?php
|
||||
mb_internal_encoding('cp1251');
|
||||
$str = "\x88\xa9\xf0\xee\xf1\xea\xee\xf8\xed\xfb\xe9";
|
||||
var_dump($str, htmlentities($str, ENT_QUOTES, ''));
|
||||
var_dump(bin2hex($str), htmlentities($str, ENT_QUOTES, ''));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(11) "ˆ©ðîñêîøíûé"
|
||||
string(22) "88a9f0eef1eaeef8edfbe9"
|
||||
string(75) "€©роскошный"
|
||||
===DONE===
|
||||
@@ -0,0 +1,97 @@
|
||||
--TEST--
|
||||
Test htmlspecialchars() function : basic functionality
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : string htmlspecialchars ( string $string [, int $quote_style [, string $charset [, bool $double_encode ]]] )
|
||||
* Description: Convert special characters to HTML entities
|
||||
* Source code: ext/standard/string.c
|
||||
*/
|
||||
|
||||
echo "*** Testing htmlspecialchars() : basic functionality ***\n";
|
||||
|
||||
$s1 = "abc<>\"&\n";
|
||||
$s2 = "&&abc<>\"&\n";
|
||||
$s3 = "a>,\<bc<>\"&\n";
|
||||
$s4 = "a\'\'&bc<>\"&\n";
|
||||
$s5 = "&<\n";
|
||||
echo "Basic tests\n";
|
||||
echo "Test 1: " . htmlspecialchars ($s1);
|
||||
echo "Test 2: " . htmlspecialchars ($s2);
|
||||
echo "Test 3: " . htmlspecialchars ($s3);
|
||||
echo "Test 4: " . htmlspecialchars ($s4);
|
||||
echo "Test 5: " . htmlspecialchars ($s5);
|
||||
echo "Test 6: " . htmlspecialchars ($s1,ENT_NOQUOTES);
|
||||
echo "Test 7: " . htmlspecialchars ($s2,ENT_NOQUOTES);
|
||||
echo "Test 8: " . htmlspecialchars ($s3,ENT_NOQUOTES);
|
||||
echo "Test 9: " . htmlspecialchars ($s4,ENT_NOQUOTES);
|
||||
echo "Test 10: " . htmlspecialchars ($s5,ENT_NOQUOTES);
|
||||
echo "Test 11: " . htmlspecialchars ($s1,ENT_COMPAT);
|
||||
echo "Test 12: " . htmlspecialchars ($s2,ENT_COMPAT);
|
||||
echo "Test 13: " . htmlspecialchars ($s3,ENT_COMPAT);
|
||||
echo "Test 14: " . htmlspecialchars ($s4,ENT_COMPAT);
|
||||
echo "Test 15: " . htmlspecialchars ($s5,ENT_COMPAT);
|
||||
echo "Test 16: " . htmlspecialchars ($s1,ENT_QUOTES);
|
||||
echo "Test 17: " . htmlspecialchars ($s2,ENT_QUOTES);
|
||||
echo "Test 18: " . htmlspecialchars ($s3,ENT_QUOTES);
|
||||
echo "Test 19: " . htmlspecialchars ($s4,ENT_QUOTES);
|
||||
echo "Test 20: " . htmlspecialchars ($s5,ENT_QUOTES);
|
||||
|
||||
echo "\nTry with char set option - specify default ISO-8859-1\n";
|
||||
echo "Test 21: " . htmlspecialchars ($s1,ENT_NOQUOTES, "ISO-8859-1");
|
||||
echo "Test 22: " . htmlspecialchars ($s2,ENT_COMPAT, "ISO-8859-1");
|
||||
echo "Test 23: " . htmlspecialchars ($s3,ENT_QUOTES, "ISO-8859-1");
|
||||
echo "Test 24: " . htmlspecialchars ($s5,ENT_QUOTES, "ISO-8859-1");
|
||||
|
||||
echo "\nTry with double decode FALSE\n";
|
||||
$s1 = ""&xyz>abc"\n";
|
||||
$s2 = ""&123<456"\n";
|
||||
$s3 = "\"300 < 400\"\n";
|
||||
echo "Test 25: " . htmlspecialchars ($s1,ENT_NOQUOTES, "ISO-8859-1", false);
|
||||
echo "Test 26: " . htmlspecialchars ($s2,ENT_NOQUOTES, "ISO-8859-1", false);
|
||||
echo "Test 27: " . htmlspecialchars ($s3,ENT_NOQUOTES, "ISO-8859-1", false);
|
||||
|
||||
echo "\nTry with double decode TRUE\n";
|
||||
echo "Test 28: " . htmlspecialchars ($s1, ENT_NOQUOTES, "ISO-8859-1", true);
|
||||
echo "Test 29: " . htmlspecialchars ($s2, ENT_NOQUOTES, "ISO-8859-1", true);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
*** Testing htmlspecialchars() : basic functionality ***
|
||||
Basic tests
|
||||
Test 1: abc<>"&
|
||||
Test 2: &&abc<>"&
|
||||
Test 3: a>,\<bc<>"&
|
||||
Test 4: a\'\'&bc<>"&
|
||||
Test 5: &amp;&lt;
|
||||
Test 6: abc<>"&
|
||||
Test 7: &&abc<>"&
|
||||
Test 8: a>,\<bc<>"&
|
||||
Test 9: a\'\'&bc<>"&
|
||||
Test 10: &amp;&lt;
|
||||
Test 11: abc<>"&
|
||||
Test 12: &&abc<>"&
|
||||
Test 13: a>,\<bc<>"&
|
||||
Test 14: a\'\'&bc<>"&
|
||||
Test 15: &amp;&lt;
|
||||
Test 16: abc<>"&
|
||||
Test 17: &&abc<>"&
|
||||
Test 18: a>,\<bc<>"&
|
||||
Test 19: a\'\'&bc<>"&
|
||||
Test 20: &amp;&lt;
|
||||
|
||||
Try with char set option - specify default ISO-8859-1
|
||||
Test 21: abc<>"&
|
||||
Test 22: &&abc<>"&
|
||||
Test 23: a>,\<bc<>"&
|
||||
Test 24: &amp;&lt;
|
||||
|
||||
Try with double decode FALSE
|
||||
Test 25: "&xyz>abc"
|
||||
Test 26: "&123<456"
|
||||
Test 27: "300 < 400"
|
||||
|
||||
Try with double decode TRUE
|
||||
Test 28: &quot;&amp;xyz&gt;abc&quot;
|
||||
Test 29: &quot;&amp;123&lt;456&quot;
|
||||
===DONE===
|
||||
@@ -40,8 +40,8 @@ $values = array(
|
||||
// float data
|
||||
10.5,
|
||||
-10.5,
|
||||
10.5e10,
|
||||
10.6E-10,
|
||||
10.1234567e10,
|
||||
10.7654321E-10,
|
||||
.5,
|
||||
|
||||
// array data
|
||||
@@ -89,8 +89,8 @@ foreach($values as $value) {
|
||||
// close the file resource used
|
||||
fclose($file_handle);
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing htmlspecialchars_decode() : usage variations ***
|
||||
-- Iterator 1 --
|
||||
@@ -106,9 +106,9 @@ string(4) "10.5"
|
||||
-- Iterator 6 --
|
||||
string(5) "-10.5"
|
||||
-- Iterator 7 --
|
||||
string(12) "105000000000"
|
||||
string(12) "101234567000"
|
||||
-- Iterator 8 --
|
||||
string(7) "1.06E-9"
|
||||
string(13) "1.07654321E-9"
|
||||
-- Iterator 9 --
|
||||
string(3) "0.5"
|
||||
-- Iterator 10 --
|
||||
@@ -157,4 +157,5 @@ string(0) ""
|
||||
|
||||
Warning: htmlspecialchars_decode() expects parameter 1 to be string, resource given in %s on line %d
|
||||
NULL
|
||||
Done
|
||||
===DONE===
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,76 @@
|
||||
--TEST--
|
||||
Test parse_str() function : basic functionality
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* Prototype : void parse_str ( string $str [, array &$arr ] )
|
||||
* Description: Parses the string into variables
|
||||
* Source code: ext/standard/string.c
|
||||
*/
|
||||
|
||||
echo "*** Testing parse_str() : basic functionality ***\n";
|
||||
|
||||
echo "Basic test WITHOUT result arg\n";
|
||||
$s1 = "first=val1&second=val2&third=val3";
|
||||
var_dump(parse_str($s1));
|
||||
var_dump($first, $second, $third);
|
||||
|
||||
echo "\nBasic test WITH undefined var for result arg\n";
|
||||
$s1 = "first=val1&second=val2&third=val3";
|
||||
var_dump(parse_str($s1, $res1));
|
||||
var_dump($res1);
|
||||
|
||||
echo "\nBasic test WITH existing non-array var for result arg\n";
|
||||
$res2 =99;
|
||||
$s1 = "first=val1&second=val2&third=val3";
|
||||
var_dump(parse_str($s1, $res2));
|
||||
var_dump($res2);
|
||||
|
||||
echo "\nBasic test with an existing array as results array\n";
|
||||
$res3_array = array(1,2,3,4);
|
||||
var_dump(parse_str($s1, $res3_array));
|
||||
var_dump($res3_array);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing parse_str() : basic functionality ***
|
||||
Basic test WITHOUT result arg
|
||||
NULL
|
||||
string(4) "val1"
|
||||
string(4) "val2"
|
||||
string(4) "val3"
|
||||
|
||||
Basic test WITH undefined var for result arg
|
||||
NULL
|
||||
array(3) {
|
||||
["first"]=>
|
||||
string(4) "val1"
|
||||
["second"]=>
|
||||
string(4) "val2"
|
||||
["third"]=>
|
||||
string(4) "val3"
|
||||
}
|
||||
|
||||
Basic test WITH existing non-array var for result arg
|
||||
NULL
|
||||
array(3) {
|
||||
["first"]=>
|
||||
string(4) "val1"
|
||||
["second"]=>
|
||||
string(4) "val2"
|
||||
["third"]=>
|
||||
string(4) "val3"
|
||||
}
|
||||
|
||||
Basic test with an existing array as results array
|
||||
NULL
|
||||
array(3) {
|
||||
["first"]=>
|
||||
string(4) "val1"
|
||||
["second"]=>
|
||||
string(4) "val2"
|
||||
["third"]=>
|
||||
string(4) "val3"
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Test parse_str() function : non-default arg_separator.input specified
|
||||
--INI--
|
||||
arg_separator.input = "/"
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : void parse_str ( string $str [, array &$arr ] )
|
||||
* Description: Parses the string into variables
|
||||
* Source code: ext/standard/string.c
|
||||
*/
|
||||
|
||||
echo "*** Testing parse_str() : non-default arg_separator.input specified ***\n";
|
||||
|
||||
$s1 = "first=val1/second=val2/third=val3";
|
||||
var_dump(parse_str($s1));
|
||||
var_dump($first, $second, $third);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing parse_str() : non-default arg_separator.input specified ***
|
||||
NULL
|
||||
string(4) "val1"
|
||||
string(4) "val2"
|
||||
string(4) "val3"
|
||||
===DONE===
|
||||
@@ -0,0 +1,266 @@
|
||||
--TEST--
|
||||
Test parse_str() function : basic functionality
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : void parse_str ( string $str [, array &$arr ] )
|
||||
* Description: Parses the string into variables
|
||||
* Source code: ext/standard/string.c
|
||||
*/
|
||||
echo "*** Testing parse_str() : basic functionality ***\n";
|
||||
|
||||
echo "\nTest string with array values\n";
|
||||
$s1 = "first=abc&a[]=123&a[]=false&b[]=str&c[]=3.5&a[]=last";
|
||||
var_dump(parse_str($s1));
|
||||
var_dump($first, $a, $b, $c);
|
||||
|
||||
echo "\nTest string with array values and results array\n";
|
||||
$s1 = "first=abc&a[]=123&a[]=false&b[]=str&c[]=3.5&a[]=last";
|
||||
var_dump(parse_str($s1, $res3_array));
|
||||
var_dump($res3_array);
|
||||
|
||||
echo "\nTest string containing numerical array keys\n";
|
||||
$str = "arr[1]=sid&arr[4]=bill";
|
||||
var_dump(parse_str($str, $res));
|
||||
var_dump($res);
|
||||
|
||||
echo "\nTest string containing associative keys\n";
|
||||
$str = "arr[first]=sid&arr[forth]=bill";
|
||||
var_dump(parse_str($str, $res));
|
||||
var_dump($res);
|
||||
|
||||
echo "\nTest string with array values with same name as existing variable\n";
|
||||
$a = 9999;
|
||||
$s1 = "a[]=123&a[]=false&a[]=last";
|
||||
var_dump(parse_str($s1));
|
||||
var_dump($a);
|
||||
|
||||
echo "\nTest string with non-array value with same name as existing array variable\n";
|
||||
$a = array(10,11,12,13);
|
||||
$s1 = "a=999";
|
||||
parse_str($s1);
|
||||
var_dump($a);
|
||||
|
||||
echo "\nTest string with encoded data\n";
|
||||
$s1 = "a=%3c%3d%3d%20%20foo+bar++%3d%3d%3e&b=%23%23%23Hello+World%23%23%23";
|
||||
parse_str($s1);
|
||||
var_dump($a, $b);
|
||||
|
||||
echo "\nTest string with single quotes characters\n";
|
||||
$s1 = "firstname=Bill&surname=O%27Reilly";
|
||||
var_dump(parse_str($s1));
|
||||
var_dump($firstname, $surname);
|
||||
|
||||
echo "\nTest string with backslash characters\n";
|
||||
$s1 = "sum=10%5c2%3d5";
|
||||
var_dump(parse_str($s1));
|
||||
var_dump($sum);
|
||||
|
||||
echo "\nTest string with double quotes data\n";
|
||||
$s1 = "str=A+string+with+%22quoted%22+strings";
|
||||
var_dump(parse_str($s1));
|
||||
var_dump($str);
|
||||
|
||||
echo "\nTest string with nulls\n";
|
||||
$s1 = "str=A%20string%20with%20containing%20%00%00%00%20nulls";
|
||||
var_dump(parse_str($s1));
|
||||
var_dump($str);
|
||||
|
||||
echo "\nTest string with 2-dim array with numeric keys\n";
|
||||
$str = "arr[3][4]=sid&arr[3][6]=fred";
|
||||
var_dump(parse_str($str, $res));
|
||||
var_dump($res);
|
||||
|
||||
echo "\nTest string with 2-dim array with null keys\n";
|
||||
$str = "arr[][]=sid&arr[][]=fred";
|
||||
var_dump(parse_str($str, $res));
|
||||
var_dump($res);
|
||||
|
||||
echo "\nTest string with 2-dim array with non-numeric keys\n";
|
||||
$str = "arr[one][four]=sid&arr[three][six]=fred";
|
||||
var_dump(parse_str($str, $res));
|
||||
var_dump($res);
|
||||
|
||||
echo "\nTest string with 3-dim array with numeric keys\n";
|
||||
$str = "arr[1][2][3]=sid&arr[1][2][6]=fred";
|
||||
var_dump(parse_str($str, $res));
|
||||
var_dump($res);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing parse_str() : basic functionality ***
|
||||
|
||||
Test string with array values
|
||||
NULL
|
||||
string(3) "abc"
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(3) "123"
|
||||
[1]=>
|
||||
string(5) "false"
|
||||
[2]=>
|
||||
string(4) "last"
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "str"
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "3.5"
|
||||
}
|
||||
|
||||
Test string with array values and results array
|
||||
NULL
|
||||
array(4) {
|
||||
["first"]=>
|
||||
string(3) "abc"
|
||||
["a"]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(3) "123"
|
||||
[1]=>
|
||||
string(5) "false"
|
||||
[2]=>
|
||||
string(4) "last"
|
||||
}
|
||||
["b"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "str"
|
||||
}
|
||||
["c"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "3.5"
|
||||
}
|
||||
}
|
||||
|
||||
Test string containing numerical array keys
|
||||
NULL
|
||||
array(1) {
|
||||
["arr"]=>
|
||||
array(2) {
|
||||
[1]=>
|
||||
string(3) "sid"
|
||||
[4]=>
|
||||
string(4) "bill"
|
||||
}
|
||||
}
|
||||
|
||||
Test string containing associative keys
|
||||
NULL
|
||||
array(1) {
|
||||
["arr"]=>
|
||||
array(2) {
|
||||
["first"]=>
|
||||
string(3) "sid"
|
||||
["forth"]=>
|
||||
string(4) "bill"
|
||||
}
|
||||
}
|
||||
|
||||
Test string with array values with same name as existing variable
|
||||
NULL
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(3) "123"
|
||||
[1]=>
|
||||
string(5) "false"
|
||||
[2]=>
|
||||
string(4) "last"
|
||||
}
|
||||
|
||||
Test string with non-array value with same name as existing array variable
|
||||
string(3) "999"
|
||||
|
||||
Test string with encoded data
|
||||
string(17) "<== foo bar ==>"
|
||||
string(17) "###Hello World###"
|
||||
|
||||
Test string with single quotes characters
|
||||
NULL
|
||||
string(4) "Bill"
|
||||
string(9) "O\'Reilly"
|
||||
|
||||
Test string with backslash characters
|
||||
NULL
|
||||
string(7) "10\\2=5"
|
||||
|
||||
Test string with double quotes data
|
||||
NULL
|
||||
string(32) "A string with \"quoted\" strings"
|
||||
|
||||
Test string with nulls
|
||||
NULL
|
||||
string(37) "A string with containing \0\0\0 nulls"
|
||||
|
||||
Test string with 2-dim array with numeric keys
|
||||
NULL
|
||||
array(1) {
|
||||
["arr"]=>
|
||||
array(1) {
|
||||
[3]=>
|
||||
array(2) {
|
||||
[4]=>
|
||||
string(3) "sid"
|
||||
[6]=>
|
||||
string(4) "fred"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Test string with 2-dim array with null keys
|
||||
NULL
|
||||
array(1) {
|
||||
["arr"]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "sid"
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(4) "fred"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Test string with 2-dim array with non-numeric keys
|
||||
NULL
|
||||
array(1) {
|
||||
["arr"]=>
|
||||
array(2) {
|
||||
["one"]=>
|
||||
array(1) {
|
||||
["four"]=>
|
||||
string(3) "sid"
|
||||
}
|
||||
["three"]=>
|
||||
array(1) {
|
||||
["six"]=>
|
||||
string(4) "fred"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Test string with 3-dim array with numeric keys
|
||||
NULL
|
||||
array(1) {
|
||||
["arr"]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
array(1) {
|
||||
[2]=>
|
||||
array(2) {
|
||||
[3]=>
|
||||
string(3) "sid"
|
||||
[6]=>
|
||||
string(4) "fred"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,76 @@
|
||||
--TEST--
|
||||
Test parse_str() function : test with badly formed strings
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : void parse_str ( string $str [, array &$arr ] )
|
||||
* Description: Parses the string into variables
|
||||
* Source code: ext/standard/string.c
|
||||
*/
|
||||
|
||||
echo "\nTest string with badly formed strings\n";
|
||||
$str = "arr[1=sid&arr[4][2=fred";
|
||||
var_dump(parse_str($str, $res));
|
||||
var_dump($res);
|
||||
|
||||
$str = "arr1]=sid&arr[4]2]=fred";
|
||||
var_dump(parse_str($str, $res));
|
||||
var_dump($res);
|
||||
|
||||
$str = "arr[one=sid&arr[4][two=fred";
|
||||
var_dump(parse_str($str, $res));
|
||||
var_dump($res);
|
||||
|
||||
echo "\nTest string with non-binary safe name\n";
|
||||
$str = "arr.test[1]=sid&arr test[4][two]=fred";
|
||||
var_dump(parse_str($str, $res));
|
||||
var_dump($res);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Test string with badly formed strings
|
||||
NULL
|
||||
array(2) {
|
||||
["arr_1"]=>
|
||||
string(3) "sid"
|
||||
["arr"]=>
|
||||
array(1) {
|
||||
[4]=>
|
||||
string(4) "fred"
|
||||
}
|
||||
}
|
||||
NULL
|
||||
array(2) {
|
||||
["arr1]"]=>
|
||||
string(3) "sid"
|
||||
["arr"]=>
|
||||
array(1) {
|
||||
[4]=>
|
||||
string(4) "fred"
|
||||
}
|
||||
}
|
||||
NULL
|
||||
array(2) {
|
||||
["arr_one"]=>
|
||||
string(3) "sid"
|
||||
["arr"]=>
|
||||
array(1) {
|
||||
[4]=>
|
||||
string(4) "fred"
|
||||
}
|
||||
}
|
||||
|
||||
Test string with non-binary safe name
|
||||
NULL
|
||||
array(1) {
|
||||
["arr_test"]=>
|
||||
array(2) {
|
||||
[1]=>
|
||||
string(3) "sid"
|
||||
[4]=>
|
||||
array(1) {
|
||||
["two"]=>
|
||||
string(4) "fred"
|
||||
}
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Test parse_str() function : non-default arg_separator.input specified
|
||||
--INI--
|
||||
arg_separator.input = "/"
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : void parse_str ( string $str [, array &$arr ] )
|
||||
* Description: Parses the string into variables
|
||||
* Source code: ext/standard/string.c
|
||||
*/
|
||||
|
||||
echo "*** Testing parse_str() : error conditions ***\n";
|
||||
|
||||
echo "\n-- Testing htmlentities() function with less than expected no. of arguments --\n";
|
||||
parse_str();
|
||||
echo "\n-- Testing htmlentities() function with more than expected no. of arguments --\n";
|
||||
$s1 = "first=val1&second=val2&third=val3";
|
||||
parse_str($s1, $res_array, true);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing parse_str() : error conditions ***
|
||||
|
||||
-- Testing htmlentities() function with less than expected no. of arguments --
|
||||
|
||||
Warning: parse_str() expects at least 1 parameter, 0 given in %s on line %d
|
||||
|
||||
-- Testing htmlentities() function with more than expected no. of arguments --
|
||||
|
||||
Warning: parse_str() expects at most 2 parameters, 3 given in %s on line %d
|
||||
===DONE===
|
||||
@@ -0,0 +1,99 @@
|
||||
--TEST--
|
||||
Test strptime() function : basic functionality
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!function_exists('strptime')) {
|
||||
die("skip - strptime() function not available in this build");
|
||||
}
|
||||
?>
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : array strptime ( string $date , string $format )
|
||||
* Description: Parse a time/date generated with strftime()
|
||||
* Source code: ext/standard/datetime.c
|
||||
*/
|
||||
|
||||
$orig = setlocale(LC_ALL, 'C');
|
||||
date_default_timezone_set("GMT");
|
||||
|
||||
echo "*** Testing strptime() : basic functionality ***\n";
|
||||
|
||||
$input = "10:00:00 AM July 2 1963";
|
||||
$tstamp = strtotime($input);
|
||||
|
||||
$str = strftime("%r %B%e %Y %Z", $tstamp);
|
||||
var_dump(strptime($str, '%H:%M:%S %p %B %d %Y %Z'));
|
||||
|
||||
$str = strftime("%T %D", $tstamp);
|
||||
var_dump(strptime($str, '%H:%M:%S %m/%d/%y'));
|
||||
|
||||
$str = strftime("%A %B %e %R", $tstamp);
|
||||
var_dump(strptime($str, '%A %B %e %R'));
|
||||
|
||||
setlocale(LC_ALL, $orig);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing strptime() : basic functionality ***
|
||||
array(9) {
|
||||
["tm_sec"]=>
|
||||
int(0)
|
||||
["tm_min"]=>
|
||||
int(0)
|
||||
["tm_hour"]=>
|
||||
int(10)
|
||||
["tm_mday"]=>
|
||||
int(2)
|
||||
["tm_mon"]=>
|
||||
int(6)
|
||||
["tm_year"]=>
|
||||
int(63)
|
||||
["tm_wday"]=>
|
||||
int(2)
|
||||
["tm_yday"]=>
|
||||
int(182)
|
||||
["unparsed"]=>
|
||||
string(3) "GMT"
|
||||
}
|
||||
array(9) {
|
||||
["tm_sec"]=>
|
||||
int(0)
|
||||
["tm_min"]=>
|
||||
int(0)
|
||||
["tm_hour"]=>
|
||||
int(10)
|
||||
["tm_mday"]=>
|
||||
int(2)
|
||||
["tm_mon"]=>
|
||||
int(6)
|
||||
["tm_year"]=>
|
||||
int(163)
|
||||
["tm_wday"]=>
|
||||
int(1)
|
||||
["tm_yday"]=>
|
||||
int(182)
|
||||
["unparsed"]=>
|
||||
string(0) ""
|
||||
}
|
||||
array(9) {
|
||||
["tm_sec"]=>
|
||||
int(0)
|
||||
["tm_min"]=>
|
||||
int(0)
|
||||
["tm_hour"]=>
|
||||
int(10)
|
||||
["tm_mday"]=>
|
||||
int(2)
|
||||
["tm_mon"]=>
|
||||
int(6)
|
||||
["tm_year"]=>
|
||||
int(0)
|
||||
["tm_wday"]=>
|
||||
int(2)
|
||||
["tm_yday"]=>
|
||||
int(182)
|
||||
["unparsed"]=>
|
||||
string(0) ""
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,55 @@
|
||||
--TEST--
|
||||
Test localtime() function : error conditions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!function_exists('strptime')) {
|
||||
echo "SKIP strptime function not available in build";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : array strptime ( string $date , string $format )
|
||||
* Description: Parse a time/date generated with strftime()
|
||||
* Source code: ext/standard/datetime.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
//Set the default time zone
|
||||
date_default_timezone_set("Europe/London");
|
||||
|
||||
echo "*** Testing strptime() : error conditions ***\n";
|
||||
|
||||
echo "\n-- Testing strptime() function with Zero arguments --\n";
|
||||
var_dump( strptime() );
|
||||
|
||||
echo "\n-- Testing strptime() function with less than expected no. of arguments --\n";
|
||||
$format = '%b %d %Y %H:%M:%S';
|
||||
$timestamp = mktime(8, 8, 8, 8, 8, 2008);
|
||||
$date = strftime($format, $timestamp);
|
||||
var_dump( strptime($date) );
|
||||
|
||||
echo "\n-- Testing strptime() function with more than expected no. of arguments --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( strptime($date, $format, $extra_arg) );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing strptime() : error conditions ***
|
||||
|
||||
-- Testing strptime() function with Zero arguments --
|
||||
|
||||
Warning: strptime() expects exactly 2 parameters, 0 given in %s on line %d
|
||||
NULL
|
||||
|
||||
-- Testing strptime() function with less than expected no. of arguments --
|
||||
|
||||
Warning: strptime() expects exactly 2 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
-- Testing strptime() function with more than expected no. of arguments --
|
||||
|
||||
Warning: strptime() expects exactly 2 parameters, 3 given in %s on line %d
|
||||
NULL
|
||||
===DONE===
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
#include <dmalloc.h>
|
||||
#endif
|
||||
|
||||
#define PHP_API_VERSION 20041225
|
||||
#define PHP_API_VERSION 20090626
|
||||
#define PHP_HAVE_STREAMS
|
||||
#define YYDEBUG 0
|
||||
|
||||
|
||||
+2
-2
@@ -3,6 +3,6 @@
|
||||
#define PHP_MAJOR_VERSION 5
|
||||
#define PHP_MINOR_VERSION 3
|
||||
#define PHP_RELEASE_VERSION 0
|
||||
#define PHP_EXTRA_VERSION "RC4"
|
||||
#define PHP_VERSION "5.3.0RC4"
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "5.3.0"
|
||||
#define PHP_VERSION_ID 50300
|
||||
+126
-4
@@ -641,7 +641,7 @@ html_errors = On
|
||||
; Data Handling ;
|
||||
;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Note - track_vars is ALWAYS enabled as of PHP 4.0.3
|
||||
; Note - track_vars is ALWAYS enabled
|
||||
|
||||
; The separator used in PHP generated URLs to separate arguments.
|
||||
; PHP's default setting is "&".
|
||||
@@ -763,7 +763,7 @@ auto_prepend_file =
|
||||
; http://php.net/auto-append-file
|
||||
auto_append_file =
|
||||
|
||||
; As of 4.0b4, PHP always outputs a character encoding by default in
|
||||
; By default, PHP will output a character encoding using
|
||||
; the Content-type: header. To disable sending of the charset, simply
|
||||
; set it to be empty.
|
||||
;
|
||||
@@ -958,7 +958,6 @@ default_socket_timeout = 60
|
||||
;extension=php_interbase.dll
|
||||
;extension=php_ldap.dll
|
||||
;extension=php_mbstring.dll
|
||||
;extension=php_mime_magic.dll
|
||||
;extension=php_ming.dll
|
||||
;extension=php_mssql.dll
|
||||
;extension=php_mysql.dll
|
||||
@@ -1048,6 +1047,18 @@ default_socket_timeout = 60
|
||||
; http://php.net/pdo-odbc.connection-pooling
|
||||
;pdo_odbc.connection_pooling=strict
|
||||
|
||||
;pdo_odbc.db2_instance_name
|
||||
|
||||
[Pdo_mysql]
|
||||
; If mysqlnd is used: Number of cache slots for the internal result set cache
|
||||
; http://php.net/pdo_mysql.cache_size
|
||||
pdo_mysql.cache_size = 2000
|
||||
|
||||
; Default socket name for local MySQL connects. If empty, uses the built-in
|
||||
; MySQL defaults.
|
||||
; http://php.net/pdo_mysql.default-socket
|
||||
pdo_mysql.default_socket=
|
||||
|
||||
[Phar]
|
||||
; http://php.net/phar.readonly
|
||||
;phar.readonly = On
|
||||
@@ -1104,6 +1115,10 @@ sql.safe_mode = Off
|
||||
; http://php.net/odbc.default-pw
|
||||
;odbc.default_pw = Not yet implemented
|
||||
|
||||
; Controls the ODBC cursor model.
|
||||
; Default: SQL_CURSOR_STATIC (default).
|
||||
;odbc.default_cursortype
|
||||
|
||||
; Allow or prevent persistent links.
|
||||
; http://php.net/odbc.allow-persistent
|
||||
odbc.allow_persistent = On
|
||||
@@ -1133,11 +1148,50 @@ odbc.defaultbinmode = 1
|
||||
|
||||
;birdstep.max_links = -1
|
||||
|
||||
[Interbase]
|
||||
; Allow or prevent persistent links.
|
||||
ibase.allow_persistent = 1
|
||||
|
||||
; Maximum number of persistent links. -1 means no limit.
|
||||
ibase.max_persistent = -1
|
||||
|
||||
; Maximum number of links (persistent + non-persistent). -1 means no limit.
|
||||
ibase.max_links = -1
|
||||
|
||||
; Default database name for ibase_connect().
|
||||
;ibase.default_db =
|
||||
|
||||
; Default username for ibase_connect().
|
||||
;ibase.default_user =
|
||||
|
||||
; Default password for ibase_connect().
|
||||
;ibase.default_password =
|
||||
|
||||
; Default charset for ibase_connect().
|
||||
;ibase.default_charset =
|
||||
|
||||
; Default timestamp format.
|
||||
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
|
||||
|
||||
; Default date format.
|
||||
ibase.dateformat = "%Y-%m-%d"
|
||||
|
||||
; Default time format.
|
||||
ibase.timeformat = "%H:%M:%S"
|
||||
|
||||
[MySQL]
|
||||
; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
|
||||
; http://php.net/mysql.allow_local_infile
|
||||
mysql.allow_local_infile = On
|
||||
|
||||
; Allow or prevent persistent links.
|
||||
; http://php.net/mysql.allow-persistent
|
||||
mysql.allow_persistent = On
|
||||
|
||||
; If mysqlnd is used: Number of cache slots for the internal result set cache
|
||||
; http://php.net/mysql.cache_size
|
||||
mysql.cache_size = 2000
|
||||
|
||||
; Maximum number of persistent links. -1 means no limit.
|
||||
; http://php.net/mysql.max-persistent
|
||||
mysql.max_persistent = -1
|
||||
@@ -1185,10 +1239,18 @@ mysql.trace_mode = Off
|
||||
|
||||
[MySQLi]
|
||||
|
||||
; Maximum number of persistent links. -1 means no limit.
|
||||
; http://php.net/mysqli.max-persistent
|
||||
mysqli.max_persistent = -1
|
||||
|
||||
; Maximum number of links. -1 means no limit.
|
||||
; http://php.net/mysqli.max-links
|
||||
mysqli.max_links = -1
|
||||
|
||||
; If mysqlnd is used: Number of cache slots for the internal result set cache
|
||||
; http://php.net/mysqli.cache_size
|
||||
mysqli.cache_size = 2000
|
||||
|
||||
; Default port number for mysqli_connect(). If unset, mysqli_connect() will use
|
||||
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
|
||||
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
|
||||
@@ -1220,6 +1282,26 @@ mysqli.default_pw =
|
||||
; Allow or prevent reconnect
|
||||
mysqli.reconnect = Off
|
||||
|
||||
[mysqlnd]
|
||||
; Enable / Disable collection of general statstics by mysqlnd which can be
|
||||
; used to tune and monitor MySQL operations.
|
||||
; http://php.net/mysqlnd.collect_statistics
|
||||
mysqlnd.collect_statistics = On
|
||||
|
||||
; Enable / Disable collection of memory usage statstics by mysqlnd which can be
|
||||
; used to tune and monitor MySQL operations.
|
||||
; http://php.net/mysqlnd.collect_memory_statistics
|
||||
mysqlnd.collect_memory_statistics = On
|
||||
|
||||
; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.
|
||||
; http://php.net/mysqlnd.net_cmd_buffer_size
|
||||
;mysqlnd.net_cmd_buffer_size = 2048
|
||||
|
||||
; Size of a pre-allocated buffer used for reading data sent by the server in
|
||||
; bytes.
|
||||
; http://php.net/mysqlnd.net_read_buffer_size
|
||||
;mysqlnd.net_read_buffer_size = 32768
|
||||
|
||||
[OCI8]
|
||||
|
||||
; Connection: Enables privileged connections using external
|
||||
@@ -1328,6 +1410,18 @@ sybct.min_client_severity = 10
|
||||
|
||||
;sybct.packet_size
|
||||
|
||||
; The maximum time in seconds to wait for a connection attempt to succeed before returning failure.
|
||||
; Default: one minute
|
||||
;sybct.login_timeout=
|
||||
|
||||
; The name of the host you claim to be connecting from, for display by sp_who.
|
||||
; Default: none
|
||||
;sybct.hostname=
|
||||
|
||||
; Allows you to define how often deadlocks are to be retried. -1 means "forever".
|
||||
; Default: 0
|
||||
;sybct.deadlock_retry_count=
|
||||
|
||||
[bcmath]
|
||||
; Number of decimal digits for all bcmath functions.
|
||||
; http://php.net/bcmath.scale
|
||||
@@ -1346,7 +1440,7 @@ session.save_handler = files
|
||||
; where data files are stored. Note: Windows users have to change this
|
||||
; variable in order to use PHP's session functions.
|
||||
;
|
||||
; As of PHP 4.0.1, you can define the path as:
|
||||
; The path can be defined as:
|
||||
;
|
||||
; session.save_path = "N;/path"
|
||||
;
|
||||
@@ -1641,6 +1735,10 @@ mssql.secure_connection = Off
|
||||
; http://php.net/com.autoregister-verbose
|
||||
;com.autoregister_verbose = true
|
||||
|
||||
; The default character set code-page to use when passing strings to and from COM objects.
|
||||
; Default: system ANSI code page
|
||||
;com.code_page=
|
||||
|
||||
[mbstring]
|
||||
; language for internal character representation.
|
||||
; http://php.net/mbstring.language
|
||||
@@ -1698,6 +1796,10 @@ mssql.secure_connection = Off
|
||||
; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)
|
||||
;mbstring.http_output_conv_mimetype=
|
||||
|
||||
; Allows to set script encoding. Only affects if PHP is compiled with --enable-zend-multibyte
|
||||
; Default: ""
|
||||
;mbstring.script_encoding=
|
||||
|
||||
[gd]
|
||||
; Tell the jpeg decode to ignore warnings and try to create
|
||||
; a gd image. The warning will then be displayed as notices
|
||||
@@ -1754,10 +1856,30 @@ soap.wsdl_cache_dir="/tmp"
|
||||
; http://php.net/soap.wsdl-cache-ttl
|
||||
soap.wsdl_cache_ttl=86400
|
||||
|
||||
; Sets the size of the cache limit. (Max. number of WSDL files to cache)
|
||||
soap.wsdl_cache_limit = 5
|
||||
|
||||
[sysvshm]
|
||||
; A default size of the shared memory segment
|
||||
;sysvshm.init_mem = 10000
|
||||
|
||||
[ldap]
|
||||
; Sets the maximum number of open links or -1 for unlimited.
|
||||
ldap.max_links = -1
|
||||
|
||||
[mcrypt]
|
||||
; For more information about mcrypt settings see http://php.net/mcrypt-module-open
|
||||
|
||||
; Directory where to load mcrypt algorithms
|
||||
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
|
||||
;mcrypt.algorithms_dir=
|
||||
|
||||
; Directory where to load mcrypt modes
|
||||
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
|
||||
;mcrypt.modes_dir=
|
||||
|
||||
[dba]
|
||||
;dba.default_handler=
|
||||
|
||||
; Local Variables:
|
||||
; tab-width: 4
|
||||
|
||||
+134
-4
@@ -641,7 +641,7 @@ html_errors = Off
|
||||
; Data Handling ;
|
||||
;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Note - track_vars is ALWAYS enabled as of PHP 4.0.3
|
||||
; Note - track_vars is ALWAYS enabled
|
||||
|
||||
; The separator used in PHP generated URLs to separate arguments.
|
||||
; PHP's default setting is "&".
|
||||
@@ -763,7 +763,7 @@ auto_prepend_file =
|
||||
; http://php.net/auto-append-file
|
||||
auto_append_file =
|
||||
|
||||
; As of 4.0b4, PHP always outputs a character encoding by default in
|
||||
; By default, PHP will output a character encoding using
|
||||
; the Content-type: header. To disable sending of the charset, simply
|
||||
; set it to be empty.
|
||||
;
|
||||
@@ -958,7 +958,6 @@ default_socket_timeout = 60
|
||||
;extension=php_interbase.dll
|
||||
;extension=php_ldap.dll
|
||||
;extension=php_mbstring.dll
|
||||
;extension=php_mime_magic.dll
|
||||
;extension=php_ming.dll
|
||||
;extension=php_mssql.dll
|
||||
;extension=php_mysql.dll
|
||||
@@ -1048,6 +1047,18 @@ default_socket_timeout = 60
|
||||
; http://php.net/pdo-odbc.connection-pooling
|
||||
;pdo_odbc.connection_pooling=strict
|
||||
|
||||
;pdo_odbc.db2_instance_name
|
||||
|
||||
[Pdo_mysql]
|
||||
; If mysqlnd is used: Number of cache slots for the internal result set cache
|
||||
; http://php.net/pdo_mysql.cache_size
|
||||
pdo_mysql.cache_size = 2000
|
||||
|
||||
; Default socket name for local MySQL connects. If empty, uses the built-in
|
||||
; MySQL defaults.
|
||||
; http://php.net/pdo_mysql.default-socket
|
||||
pdo_mysql.default_socket=
|
||||
|
||||
[Phar]
|
||||
; http://php.net/phar.readonly
|
||||
;phar.readonly = On
|
||||
@@ -1104,6 +1115,10 @@ sql.safe_mode = Off
|
||||
; http://php.net/odbc.default-pw
|
||||
;odbc.default_pw = Not yet implemented
|
||||
|
||||
; Controls the ODBC cursor model.
|
||||
; Default: SQL_CURSOR_STATIC (default).
|
||||
;odbc.default_cursortype
|
||||
|
||||
; Allow or prevent persistent links.
|
||||
; http://php.net/odbc.allow-persistent
|
||||
odbc.allow_persistent = On
|
||||
@@ -1133,11 +1148,50 @@ odbc.defaultbinmode = 1
|
||||
|
||||
;birdstep.max_links = -1
|
||||
|
||||
[Interbase]
|
||||
; Allow or prevent persistent links.
|
||||
ibase.allow_persistent = 1
|
||||
|
||||
; Maximum number of persistent links. -1 means no limit.
|
||||
ibase.max_persistent = -1
|
||||
|
||||
; Maximum number of links (persistent + non-persistent). -1 means no limit.
|
||||
ibase.max_links = -1
|
||||
|
||||
; Default database name for ibase_connect().
|
||||
;ibase.default_db =
|
||||
|
||||
; Default username for ibase_connect().
|
||||
;ibase.default_user =
|
||||
|
||||
; Default password for ibase_connect().
|
||||
;ibase.default_password =
|
||||
|
||||
; Default charset for ibase_connect().
|
||||
;ibase.default_charset =
|
||||
|
||||
; Default timestamp format.
|
||||
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
|
||||
|
||||
; Default date format.
|
||||
ibase.dateformat = "%Y-%m-%d"
|
||||
|
||||
; Default time format.
|
||||
ibase.timeformat = "%H:%M:%S"
|
||||
|
||||
[MySQL]
|
||||
; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
|
||||
; http://php.net/mysql.allow_local_infile
|
||||
mysql.allow_local_infile = On
|
||||
|
||||
; Allow or prevent persistent links.
|
||||
; http://php.net/mysql.allow-persistent
|
||||
mysql.allow_persistent = On
|
||||
|
||||
; If mysqlnd is used: Number of cache slots for the internal result set cache
|
||||
; http://php.net/mysql.cache_size
|
||||
mysql.cache_size = 2000
|
||||
|
||||
; Maximum number of persistent links. -1 means no limit.
|
||||
; http://php.net/mysql.max-persistent
|
||||
mysql.max_persistent = -1
|
||||
@@ -1185,10 +1239,26 @@ mysql.trace_mode = Off
|
||||
|
||||
[MySQLi]
|
||||
|
||||
; Maximum number of persistent links. -1 means no limit.
|
||||
; http://php.net/mysqli.max-persistent
|
||||
mysqli.max_persistent = -1
|
||||
|
||||
; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
|
||||
; http://php.net/mysqli.allow_local_infile
|
||||
;mysqli.allow_local_infile = On
|
||||
|
||||
; Allow or prevent persistent links.
|
||||
; http://php.net/mysqli.allow-persistent
|
||||
mysqli.allow_persistent = On
|
||||
|
||||
; Maximum number of links. -1 means no limit.
|
||||
; http://php.net/mysqli.max-links
|
||||
mysqli.max_links = -1
|
||||
|
||||
; If mysqlnd is used: Number of cache slots for the internal result set cache
|
||||
; http://php.net/mysqli.cache_size
|
||||
mysqli.cache_size = 2000
|
||||
|
||||
; Default port number for mysqli_connect(). If unset, mysqli_connect() will use
|
||||
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
|
||||
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
|
||||
@@ -1220,6 +1290,26 @@ mysqli.default_pw =
|
||||
; Allow or prevent reconnect
|
||||
mysqli.reconnect = Off
|
||||
|
||||
[mysqlnd]
|
||||
; Enable / Disable collection of general statstics by mysqlnd which can be
|
||||
; used to tune and monitor MySQL operations.
|
||||
; http://php.net/mysqlnd.collect_statistics
|
||||
mysqlnd.collect_statistics = On
|
||||
|
||||
; Enable / Disable collection of memory usage statstics by mysqlnd which can be
|
||||
; used to tune and monitor MySQL operations.
|
||||
; http://php.net/mysqlnd.collect_memory_statistics
|
||||
mysqlnd.collect_memory_statistics = Off
|
||||
|
||||
; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.
|
||||
; http://php.net/mysqlnd.net_cmd_buffer_size
|
||||
;mysqlnd.net_cmd_buffer_size = 2048
|
||||
|
||||
; Size of a pre-allocated buffer used for reading data sent by the server in
|
||||
; bytes.
|
||||
; http://php.net/mysqlnd.net_read_buffer_size
|
||||
;mysqlnd.net_read_buffer_size = 32768
|
||||
|
||||
[OCI8]
|
||||
|
||||
; Connection: Enables privileged connections using external
|
||||
@@ -1328,6 +1418,18 @@ sybct.min_client_severity = 10
|
||||
|
||||
;sybct.packet_size
|
||||
|
||||
; The maximum time in seconds to wait for a connection attempt to succeed before returning failure.
|
||||
; Default: one minute
|
||||
;sybct.login_timeout=
|
||||
|
||||
; The name of the host you claim to be connecting from, for display by sp_who.
|
||||
; Default: none
|
||||
;sybct.hostname=
|
||||
|
||||
; Allows you to define how often deadlocks are to be retried. -1 means "forever".
|
||||
; Default: 0
|
||||
;sybct.deadlock_retry_count=
|
||||
|
||||
[bcmath]
|
||||
; Number of decimal digits for all bcmath functions.
|
||||
; http://php.net/bcmath.scale
|
||||
@@ -1346,7 +1448,7 @@ session.save_handler = files
|
||||
; where data files are stored. Note: Windows users have to change this
|
||||
; variable in order to use PHP's session functions.
|
||||
;
|
||||
; As of PHP 4.0.1, you can define the path as:
|
||||
; The path can be defined as:
|
||||
;
|
||||
; session.save_path = "N;/path"
|
||||
;
|
||||
@@ -1641,6 +1743,10 @@ mssql.secure_connection = Off
|
||||
; http://php.net/com.autoregister-verbose
|
||||
;com.autoregister_verbose = true
|
||||
|
||||
; The default character set code-page to use when passing strings to and from COM objects.
|
||||
; Default: system ANSI code page
|
||||
;com.code_page=
|
||||
|
||||
[mbstring]
|
||||
; language for internal character representation.
|
||||
; http://php.net/mbstring.language
|
||||
@@ -1698,6 +1804,10 @@ mssql.secure_connection = Off
|
||||
; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)
|
||||
;mbstring.http_output_conv_mimetype=
|
||||
|
||||
; Allows to set script encoding. Only affects if PHP is compiled with --enable-zend-multibyte
|
||||
; Default: ""
|
||||
;mbstring.script_encoding=
|
||||
|
||||
[gd]
|
||||
; Tell the jpeg decode to ignore warnings and try to create
|
||||
; a gd image. The warning will then be displayed as notices
|
||||
@@ -1754,10 +1864,30 @@ soap.wsdl_cache_dir="/tmp"
|
||||
; http://php.net/soap.wsdl-cache-ttl
|
||||
soap.wsdl_cache_ttl=86400
|
||||
|
||||
; Sets the size of the cache limit. (Max. number of WSDL files to cache)
|
||||
soap.wsdl_cache_limit = 5
|
||||
|
||||
[sysvshm]
|
||||
; A default size of the shared memory segment
|
||||
;sysvshm.init_mem = 10000
|
||||
|
||||
[ldap]
|
||||
; Sets the maximum number of open links or -1 for unlimited.
|
||||
ldap.max_links = -1
|
||||
|
||||
[mcrypt]
|
||||
; For more information about mcrypt settings see http://php.net/mcrypt-module-open
|
||||
|
||||
; Directory where to load mcrypt algorithms
|
||||
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
|
||||
;mcrypt.algorithms_dir=
|
||||
|
||||
; Directory where to load mcrypt modes
|
||||
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
|
||||
;mcrypt.modes_dir=
|
||||
|
||||
[dba]
|
||||
;dba.default_handler=
|
||||
|
||||
; Local Variables:
|
||||
; tab-width: 4
|
||||
|
||||
+1
-1
@@ -754,7 +754,7 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha
|
||||
to find more user.ini, if not we only scan the current path.
|
||||
*/
|
||||
if (strncmp(s1, s2, s_len) == 0) {
|
||||
ptr = s1 + start; /* start is the point where doc_root ends! */
|
||||
ptr = s2 + start; /* start is the point where doc_root ends! */
|
||||
while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) {
|
||||
*ptr = 0;
|
||||
php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC);
|
||||
|
||||
+2
-7
@@ -1,4 +1,4 @@
|
||||
.TH PHP 1 "2008" "The PHP Group" "Scripting Language"
|
||||
.TH PHP 1 "2009" "The PHP Group" "Scripting Language"
|
||||
.SH NAME
|
||||
.TP 15
|
||||
php \- PHP Command Line Interface 'CLI'
|
||||
@@ -366,17 +366,12 @@ such a first line as shown below:
|
||||
.PD 1
|
||||
.P
|
||||
.SH SEE ALSO
|
||||
For a more or less complete description of PHP look here:
|
||||
For a description of PHP see:
|
||||
.PD 0
|
||||
.P
|
||||
.B http://www.php.net/manual/
|
||||
.PD 1
|
||||
.P
|
||||
A nice introduction to PHP by Stig Bakken can be found here:
|
||||
.PD 0
|
||||
.P
|
||||
.B http://www.zend.com/zend/art/intro.php
|
||||
.PD 1
|
||||
.SH BUGS
|
||||
You can view the list of known bugs or report any new bug you
|
||||
found at:
|
||||
|
||||
+2
-2
@@ -121,7 +121,7 @@ phpize_check_autotools()
|
||||
test -z "$PHP_AUTOCONF" && PHP_AUTOCONF=autoconf
|
||||
test -z "$PHP_AUTOHEADER" && PHP_AUTOHEADER=autoheader
|
||||
|
||||
if ! test -x "$PHP_AUTOCONF" && ! test -x "`$php_shtool path $PHP_AUTOCONF`"; then
|
||||
if test ! -x "$PHP_AUTOCONF" && test ! -x "`$php_shtool path $PHP_AUTOCONF`"; then
|
||||
cat <<EOF
|
||||
Cannot find autoconf. Please check your autoconf installation and the
|
||||
\$PHP_AUTOCONF environment variable. Then, rerun this script.
|
||||
@@ -129,7 +129,7 @@ Cannot find autoconf. Please check your autoconf installation and the
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
if ! test -x "$PHP_AUTOHEADER" && ! test -x "`$php_shtool path $PHP_AUTOHEADER`"; then
|
||||
if test ! -x "$PHP_AUTOHEADER" && test ! -x "`$php_shtool path $PHP_AUTOHEADER`"; then
|
||||
cat <<EOF
|
||||
Cannot find autoheader. Please check your autoconf installation and the
|
||||
\$PHP_AUTOHEADER environment variable. Then, rerun this script.
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Test pass by reference semantics
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_STRICT | E_NOTICE);
|
||||
|
||||
// Simplified array_shift_variation5.phpt
|
||||
// Showing warning:
|
||||
// "Only variables should be passed by reference in %s on line %d"
|
||||
$stack = array ( array ( 'two' ));
|
||||
var_dump(array_shift(array_shift($stack)));
|
||||
|
||||
// This should show the identical warning
|
||||
$original = array ( array ( 'one' ));
|
||||
$stack = $original;
|
||||
var_dump(array_shift(array_shift($stack)));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Strict Standards: Only variables should be passed by reference in %s on line %d
|
||||
string(3) "two"
|
||||
|
||||
Strict Standards: Only variables should be passed by reference in %s on line %d
|
||||
string(3) "one"
|
||||
===DONE===
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
String conversion with multiple decimal points
|
||||
--FILE--
|
||||
<?php
|
||||
function test($str) {
|
||||
echo "\n--> Testing $str:\n";
|
||||
var_dump((int)$str);
|
||||
var_dump((float)$str);
|
||||
var_dump($str > 0);
|
||||
}
|
||||
|
||||
test("..9");
|
||||
test(".9.");
|
||||
test("9..");
|
||||
test("9.9.");
|
||||
test("9.9.9");
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
--> Testing ..9:
|
||||
int(0)
|
||||
float(0)
|
||||
bool(false)
|
||||
|
||||
--> Testing .9.:
|
||||
int(0)
|
||||
float(0.9)
|
||||
bool(true)
|
||||
|
||||
--> Testing 9..:
|
||||
int(9)
|
||||
float(9)
|
||||
bool(true)
|
||||
|
||||
--> Testing 9.9.:
|
||||
int(9)
|
||||
float(9.9)
|
||||
bool(true)
|
||||
|
||||
--> Testing 9.9.9:
|
||||
int(9)
|
||||
float(9.9)
|
||||
bool(true)
|
||||
===DONE===
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Test to catch early assignment of $this
|
||||
--FILE--
|
||||
<?php
|
||||
class first {
|
||||
|
||||
function me() { echo "first"; }
|
||||
|
||||
function who() {
|
||||
global $a,$b;
|
||||
$this->me();
|
||||
$a->me();
|
||||
$b->me();
|
||||
$b = new second();
|
||||
$this->me();
|
||||
$a->me();
|
||||
$b->me();
|
||||
}
|
||||
}
|
||||
|
||||
class second {
|
||||
|
||||
function who() {
|
||||
global $a,$b;
|
||||
$this->me();
|
||||
$a->me();
|
||||
$b->me();
|
||||
}
|
||||
function me() { echo "second"; }
|
||||
}
|
||||
|
||||
$a = new first();
|
||||
$b = &$a;
|
||||
|
||||
$a->who();
|
||||
$b->who();
|
||||
|
||||
echo "\n";
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
firstfirstfirstfirstsecondsecondsecondsecondsecond
|
||||
===DONE===
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
output buffering - fatalism
|
||||
--XFAIL--
|
||||
This test will fail until the fix in version 1.178 of ext/main/output.c
|
||||
is backported from php 6
|
||||
--FILE--
|
||||
<?php
|
||||
function obh($s)
|
||||
{
|
||||
return ob_get_flush();
|
||||
}
|
||||
ob_start("obh");
|
||||
echo "foo\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: ob_get_flush(): Cannot use output buffering in output buffering display handlers in %sob_011.php on line %d
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
output buffering - multiple
|
||||
--FILE--
|
||||
<?php
|
||||
echo 0;
|
||||
ob_start();
|
||||
ob_start();
|
||||
ob_start();
|
||||
ob_start();
|
||||
echo 1;
|
||||
ob_end_flush();
|
||||
echo 2;
|
||||
$ob = ob_get_clean();
|
||||
echo 3;
|
||||
ob_flush();
|
||||
ob_end_clean();
|
||||
echo 4;
|
||||
ob_end_flush();
|
||||
echo $ob;
|
||||
?>
|
||||
--EXPECT--
|
||||
03412
|
||||
@@ -0,0 +1,103 @@
|
||||
--TEST--
|
||||
output buffering - handlers/status
|
||||
--FILE--
|
||||
<?php
|
||||
function a($s){return $s;}
|
||||
function b($s){return $s;}
|
||||
function c($s){return $s;}
|
||||
function d($s){return $s;}
|
||||
|
||||
ob_start();
|
||||
ob_start('a');
|
||||
ob_start('b');
|
||||
ob_start('c');
|
||||
ob_start('d');
|
||||
ob_start();
|
||||
|
||||
echo "foo\n";
|
||||
|
||||
ob_flush();
|
||||
ob_end_clean();
|
||||
ob_flush();
|
||||
|
||||
print_r(ob_list_handlers());
|
||||
print_r(ob_get_status());
|
||||
print_r(ob_get_status(true));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
foo
|
||||
Array
|
||||
(
|
||||
[0] => default output handler
|
||||
[1] => a
|
||||
[2] => b
|
||||
[3] => c
|
||||
[4] => d
|
||||
)
|
||||
Array
|
||||
(
|
||||
[level] => 5
|
||||
[type] => 1
|
||||
[status] => 1
|
||||
[name] => d
|
||||
[del] => 1
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[chunk_size] => 0
|
||||
[size] => 40960
|
||||
[block_size] => 10240
|
||||
[type] => 1
|
||||
[status] => 0
|
||||
[name] => default output handler
|
||||
[del] => 1
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[chunk_size] => 0
|
||||
[size] => 40960
|
||||
[block_size] => 10240
|
||||
[type] => 1
|
||||
[status] => 0
|
||||
[name] => a
|
||||
[del] => 1
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[chunk_size] => 0
|
||||
[size] => 40960
|
||||
[block_size] => 10240
|
||||
[type] => 1
|
||||
[status] => 0
|
||||
[name] => b
|
||||
[del] => 1
|
||||
)
|
||||
|
||||
[3] => Array
|
||||
(
|
||||
[chunk_size] => 0
|
||||
[size] => 40960
|
||||
[block_size] => 10240
|
||||
[type] => 1
|
||||
[status] => 0
|
||||
[name] => c
|
||||
[del] => 1
|
||||
)
|
||||
|
||||
[4] => Array
|
||||
(
|
||||
[chunk_size] => 0
|
||||
[size] => 40960
|
||||
[block_size] => 10240
|
||||
[type] => 1
|
||||
[status] => 1
|
||||
[name] => d
|
||||
[del] => 1
|
||||
)
|
||||
|
||||
)
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
output buffering - failure
|
||||
--FILE--
|
||||
<?php
|
||||
ob_start("str_rot13");
|
||||
echo "foo\n";
|
||||
// str_rot13 expects 1 param and returns NULL when passed 2 params.
|
||||
// It is invoked with 2 params when used as an OB callback.
|
||||
// Therefore, there will be no data in the buffer. This is expected: see bug 46900.
|
||||
ob_end_flush();
|
||||
|
||||
// Show the error.
|
||||
print_r(error_get_last());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Array
|
||||
(
|
||||
[type] => 2
|
||||
[message] => str_rot13() expects exactly 1 parameter, 2 given
|
||||
[file] => %s
|
||||
[line] => 7
|
||||
)
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
output buffering - failure
|
||||
--FILE--
|
||||
<?php
|
||||
ob_start("str_rot13", 1);
|
||||
echo "foo\n";
|
||||
// str_rot13 expects 1 param and returns NULL when passed 2 params.
|
||||
// It is invoked with 2 params when used as an OB callback.
|
||||
// Therefore, there will be no data in the buffer. This is expected: see bug 46900.
|
||||
ob_end_flush();
|
||||
|
||||
// Show the error.
|
||||
print_r(error_get_last());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Array
|
||||
(
|
||||
[type] => 2
|
||||
[message] => str_rot13() expects exactly 1 parameter, 2 given
|
||||
[file] => %s
|
||||
[line] => 7
|
||||
)
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
output buffering - stati
|
||||
--FILE--
|
||||
<?php
|
||||
$stati = array();
|
||||
function oh($str, $flags) {
|
||||
global $stati;
|
||||
$stati[] = "$flags: $str";
|
||||
return $str;
|
||||
}
|
||||
ob_start("oh", 3);
|
||||
echo "yes";
|
||||
echo "!\n";
|
||||
ob_flush();
|
||||
echo "no";
|
||||
ob_clean();
|
||||
echo "yes!\n";
|
||||
echo "no";
|
||||
ob_end_clean();
|
||||
print_r($stati);
|
||||
?>
|
||||
--EXPECT--
|
||||
yes!
|
||||
yes!
|
||||
Array
|
||||
(
|
||||
[0] => 3: yes
|
||||
[1] => 2: !
|
||||
|
||||
[2] => 2: no
|
||||
[3] => 2: yes!
|
||||
|
||||
[4] => 4: no
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
output buffering - error message nirvana bug #37714
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("zlib")) die("skip need ext/zlib");
|
||||
?>
|
||||
--ENV--
|
||||
HTTP_ACCEPT_ENCODING=gzip,deflate
|
||||
--INI--
|
||||
display_errors=1
|
||||
zlib.output_compression=1
|
||||
--FILE--
|
||||
<?php
|
||||
ob_start('ob_gzhandler');
|
||||
?>
|
||||
--EXPECTF--
|
||||
‹%a
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
output buffering - ob_list_handlers
|
||||
--FILE--
|
||||
<?php
|
||||
print_r(ob_list_handlers());
|
||||
|
||||
ob_start();
|
||||
print_r(ob_list_handlers());
|
||||
|
||||
ob_start();
|
||||
print_r(ob_list_handlers());
|
||||
|
||||
ob_end_flush();
|
||||
print_r(ob_list_handlers());
|
||||
|
||||
ob_end_flush();
|
||||
print_r(ob_list_handlers());
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => default output handler
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => default output handler
|
||||
[1] => default output handler
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => default output handler
|
||||
)
|
||||
Array
|
||||
(
|
||||
)
|
||||
@@ -146,7 +146,7 @@ dist: all build-dist
|
||||
snap: build-snap build-dist
|
||||
|
||||
$(BUILD_DIR)\deplister.exe: win32\build\deplister.c
|
||||
$(CL) /Fo$(BUILD_DIR)\ /Fd$(BUILD_DIR)\ /Fp$(BUILD_DIR)\ /FR$(BUILD_DIR) -o$(BUILD_DIR)\deplister.exe win32\build\deplister.c imagehlp.lib
|
||||
$(CL) /Fo$(BUILD_DIR)\ /Fd$(BUILD_DIR)\ /Fp$(BUILD_DIR)\ /FR$(BUILD_DIR) /Fe$(BUILD_DIR)\deplister.exe win32\build\deplister.c imagehlp.lib
|
||||
|
||||
msi-installer: dist
|
||||
$(BUILD_DIR)\php.exe ..\php-installer\build-installer.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(PECL_TARGETS)"
|
||||
|
||||
@@ -156,6 +156,10 @@
|
||||
/* Win32 support proc_open */
|
||||
#define PHP_CAN_SUPPORT_PROC_OPEN 1
|
||||
|
||||
/* inet_ntop() / inet_pton() */
|
||||
#define HAVE_INET_PTON 1
|
||||
#define HAVE_INET_NTOP 1
|
||||
|
||||
#define HAVE_MBLEN
|
||||
|
||||
#undef HAVE_ATOF_ACCEPTS_NAN
|
||||
|
||||
+33
-21
@@ -227,11 +227,12 @@ if(sizeof($pecl_targets)) {
|
||||
|
||||
/* populate reading material */
|
||||
$text_files = array(
|
||||
"LICENSE" => "license.txt",
|
||||
"NEWS" => "news.txt",
|
||||
"php.ini-development" => "php.ini-development",
|
||||
"LICENSE" => "license.txt",
|
||||
"NEWS" => "news.txt",
|
||||
"README.REDIST.BINS" => "readme-redist-bins.txt",
|
||||
"php.ini-development" => "php.ini-development",
|
||||
"php.ini-production" => "php.ini-production",
|
||||
"win32/install.txt" => "install.txt",
|
||||
"win32/install.txt" => "install.txt",
|
||||
"win32/pws-php5cgi.reg" => "pws-php5cgi.reg",
|
||||
"win32/pws-php5isapi.reg" => "pws-php5isapi.reg",
|
||||
);
|
||||
@@ -381,7 +382,9 @@ function copy_test_dir($directory, $dest)
|
||||
$full_path = $directory . '/' . $file;
|
||||
if($file != '.' && $file != '..' && $file != 'CVS' && is_dir($full_path)) {
|
||||
if ($file == 'tests') {
|
||||
mkdir($dest . '/' . $full_path , 0775, true);
|
||||
if (!is_dir($dest . '/' . $full_path)) {
|
||||
mkdir($dest . '/' . $full_path , 0775, true);
|
||||
}
|
||||
copy_dir($full_path, $dest . '/' . $full_path . '/');
|
||||
continue;
|
||||
} else {
|
||||
@@ -395,23 +398,32 @@ function copy_test_dir($directory, $dest)
|
||||
|
||||
function make_phar_dot_phar($dist_dir)
|
||||
{
|
||||
if (!extension_loaded('phar')) return;
|
||||
$path_to_php = $dist_dir;
|
||||
$path_to_phar = realpath(__DIR__ . '/../../ext/phar');
|
||||
echo "Generating pharcommand.phar\n";
|
||||
$phar = new Phar($path_to_php . '/pharcommand.phar', 0, 'pharcommand');
|
||||
foreach (new DirectoryIterator($path_to_phar . '/phar') as $file) {
|
||||
if ($file->isDir() || $file == 'phar.php') continue;
|
||||
echo 'adding ', $file, "\n";
|
||||
$phar[(string) $file] = file_get_contents($path_to_phar. '/phar/' . $file);
|
||||
}
|
||||
$phar->setSignatureAlgorithm(Phar::SHA1);
|
||||
$stub = file($path_to_phar . '/phar/phar.php');
|
||||
unset($stub[0]); // remove hashbang
|
||||
$phar->setStub(implode('', $stub));
|
||||
if (!extension_loaded('phar')) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo "Creating phar.phar.bat\n";
|
||||
file_put_contents($path_to_php . '/phar.phar.bat', "%~dp0php.exe %~dp0pharcommand.phar %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n");
|
||||
$path_to_phar = realpath(__DIR__ . '/../../ext/phar');
|
||||
|
||||
echo "Generating pharcommand.phar\n";
|
||||
$phar = new Phar($dist_dir . '/pharcommand.phar', 0, 'pharcommand');
|
||||
|
||||
foreach (new DirectoryIterator($path_to_phar . '/phar') as $file) {
|
||||
if ($file->isDir() || $file == 'phar.php') {
|
||||
continue;
|
||||
}
|
||||
|
||||
echo 'adding ', $file, "\n";
|
||||
$phar[(string) $file] = file_get_contents($path_to_phar. '/phar/' . $file);
|
||||
}
|
||||
|
||||
$phar->setSignatureAlgorithm(Phar::SHA1);
|
||||
$stub = file($path_to_phar . '/phar/phar.php');
|
||||
|
||||
unset($stub[0]); // remove hashbang
|
||||
$phar->setStub(implode('', $stub));
|
||||
|
||||
echo "Creating phar.phar.bat\n";
|
||||
file_put_contents($dist_dir . '/phar.phar.bat', "%~dp0php.exe %~dp0pharcommand.phar %*\r\n");
|
||||
}
|
||||
|
||||
if (!is_dir($test_dir)) {
|
||||
|
||||
Reference in new issue
Block a user