Skip to content

Commit 1a069d5

Browse files
committed
Revert "Merge pull request #3 from weltling/string_size_refactor_take_2"
This reverts commit 2d63270, reversing changes made to 1db6694.
1 parent 2d63270 commit 1a069d5

File tree

729 files changed

+6513
-16942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

729 files changed

+6513
-16942
lines changed

CODING_STANDARDS

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,7 @@ The file labelled 'EXPERIMENTAL' should include the following
259259
information::
260260

261261
Any authoring information (known bugs, future directions of the module).
262-
Ongoing status notes which may not be appropriate for Git comments.
263-
264-
In general new features should go to PECL or experimental branches until
265-
there are specific reasons for directly adding it to the core distribution.
262+
Ongoing status notes which may not be appropriate for SVN comments.
266263

267264
Aliases & Legacy Documentation
268265
-----------------------------------

INSTALL

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ Installation
18191819
set of HTTP headers. The headers it did return are:
18201820
10. Windows: I've followed all the instructions, but still can't get
18211821
PHP and IIS to work together!
1822-
11. When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get
1822+
11. When running PHP as CGI with IIS, PWS, OmniHTTPD or Xitami, I get
18231823
the following error: Security Alert! PHP CGI cannot be accessed
18241824
directly..
18251825
12. How do I know if my php.ini is being found and read? It seems like
@@ -2007,7 +2007,7 @@ cgi error:
20072007
And for IIS4 you need to tell it that PHP is a script engine.
20082008
Also, you will want to read this faq.
20092009

2010-
When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get the
2010+
When running PHP as CGI with IIS, PWS, OmniHTTPD or Xitami, I get the
20112011
following error: Security Alert! PHP CGI cannot be accessed
20122012
directly..
20132013
You must set the cgi.force_redirect directive to 0. It defaults

Makefile.global

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ all: $(all_targets)
1010
@echo "Build complete."
1111
@echo "Don't forget to run 'make test'."
1212
@echo
13-
13+
1414
build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
1515

1616
build-binaries: $(PHP_BINARIES)
@@ -115,19 +115,10 @@ clean:
115115
find . -name \*.la -o -name \*.a | xargs rm -f
116116
find . -name \*.so | xargs rm -f
117117
find . -name .libs -a -type d|xargs rm -rf
118-
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
118+
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
119119

120120
distclean: clean
121-
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
122-
rm -f php5.spec main/build-defs.h scripts/phpize
123-
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
124-
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
125-
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
126-
rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h ext/iconv/php_php_iconv_impl.h
127-
rm -f ext/phar/phar.phar ext/phar/phar.php
128-
if test "$(srcdir)" != "$(builddir)"; then \
129-
rm -f ext/phar/phar/phar.inc; \
130-
fi
121+
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
131122
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
132123

133124
.PHONY: all clean install distclean test

NEWS

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ PHP NEWS
77
. Implemented internal operator overloading
88
(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)
99

10-
- Session:
11-
. Fixed Bug #65315 (session.hash_function silently fallback to default md5)
12-
(Yasuo)
13-
. Implemented Request #54649 (Create session_serializer_name()). (Yasuo)
14-
. Implemented Request #17860 (Session write short circuit). (Yasuo)
15-
. Implemented Request #20421 (session_abort() and session_reset() function).
16-
(Yasuo)
17-
. Implemented Request #11100 (session_gc() function). (Yasuo)
18-
19-
- mysqlnd:
20-
. Disabled flag for SP OUT variables for 5.5+ servers as they are not natively
21-
supported by the overlying APIs. (Andrey)
22-
2310
- OPcache:
2411
. Added an optimization pass to convert FCALL_BY_NAME into DO_FCALL.
2512
(Laruence, Dmitry)

README.EXTENSIONS

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Between PHP 4.0.6 and 4.1.0, the Zend module struct changed in a way
2+
that broke both source and binary compatibility. If you are
3+
maintaining a third party extension, here's how to update it:
4+
5+
If this was your old module entry:
6+
7+
zend_module_entry foo_module_entry = {
8+
"foo", /* extension name */
9+
foo_functions, /* extension function list */
10+
NULL, /* extension-wide startup function */
11+
NULL, /* extension-wide shutdown function */
12+
PHP_RINIT(foo), /* per-request startup function */
13+
PHP_RSHUTDOWN(foo), /* per-request shutdown function */
14+
PHP_MINFO(foo), /* information function */
15+
STANDARD_MODULE_PROPERTIES
16+
};
17+
18+
Here's how it should look if you want your code to build with PHP
19+
4.1.0 and up:
20+
21+
zend_module_entry foo_module_entry = {
22+
#if ZEND_MODULE_API_NO >= 20010901
23+
STANDARD_MODULE_HEADER,
24+
#endif
25+
"foo", /* extension name */
26+
foo_functions, /* extension function list */
27+
NULL, /* extension-wide startup function */
28+
NULL, /* extension-wide shutdown function */
29+
PHP_RINIT(foo), /* per-request startup function */
30+
PHP_RSHUTDOWN(foo), /* per-request shutdown function */
31+
PHP_MINFO(foo), /* information function */
32+
#if ZEND_MODULE_API_NO >= 20010901
33+
FOO_VERSION, /* extension version number (string) */
34+
#endif
35+
STANDARD_MODULE_PROPERTIES
36+
};
37+
38+
If you don't care about source compatibility with earlier PHP releases
39+
than 4.1.0, you can drop the #if/#endif lines.

README.PHP4-TO-PHP5-THIN-CHANGES

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
1. strrpos() and strripos() now use the entire string as a needle. Be aware
2+
that the existing scripts may no longer work as you expect.
3+
4+
EX :
5+
<?php
6+
var_dump(strrpos("ABCDEF","DEF"));
7+
var_dump(strrpos("ABCDEF","DAF"));
8+
?>
9+
10+
Will give you different results. The former returns 3 while the latter
11+
returns false rather than the position of the last occurrence of 'D'.
12+
The same applies to strripos().
13+
14+
2. Illegal use of string offsets causes E_ERROR instead of E_WARNING.
15+
16+
EX :
17+
<?php
18+
$a = "foo";
19+
unset($a[0][1][2]);
20+
?>
21+
22+
Fatal error: Cannot use string offset as an array in ... on line 1
23+
24+
3. array_merge() was changed to accept only arrays. If a non-array variable is
25+
passed, a E_WARNING will be thrown for every such parameter. Be careful
26+
because your code may start emitting E_WARNING out of the blue.
27+
28+
4. Be careful when porting from ext/mysql to ext/mysqli. The following
29+
functions return NULL when no more data is available in the result set
30+
(ext/mysql's functions return FALSE).
31+
32+
- mysqli_fetch_row()
33+
- mysqli_fetch_array()
34+
- mysqli_fetch_assoc()
35+
36+
5. PATH_TRANSLATED server variable is no longer set implicitly under
37+
Apache2 SAPI in contrast to the situation in PHP 4, where it is set to the
38+
same value as the SCRIPT_FILENAME server variable when it is not populated
39+
by Apache. This change was made to comply with the CGI specification.
40+
Please refer to bug #23610 for further information.
41+
42+
6. Starting PHP 5.0.0 the T_ML_CONSTANT constant is no longer defined by the
43+
ext/tokenizer extension. If error_reporting is set to E_ALL notices will
44+
be produced. Instead of T_ML_CONSTANT for /* */ the T_COMMENT constant
45+
is used, thus both // and /* */ are resolved as the T_COMMENT constant.
46+
However the PHPDoc style comments /** */ ,which starting PHP 5 are parsed
47+
by PHP, are recongnized as T_DOC_COMMENT.
48+
49+
7. $_SERVER should be populated with argc and argv if variables_order
50+
includes "S". If you have specifically configured your system to not
51+
create $_SERVER, then of course it shouldn't be there. The change was to
52+
always make argc and argv available in the CLI version regardless of the
53+
variables_order setting. As in, the CLI version will now always populate
54+
the global $argc and $argv variables.
55+
56+
8. In some cases classes must be declared before used. It only happens only
57+
if some of the new features of PHP 5 are used. Otherwise the behaviour is
58+
the old.
59+
Example 1 (works with no errors):
60+
<?php
61+
$a = new a();
62+
class a {
63+
}
64+
?>
65+
66+
Example 2 (throws an error):
67+
<?php
68+
$a = new a();
69+
interface b{
70+
}
71+
class a implements b {
72+
}
73+
?>
74+
75+
Output (example 2) :
76+
Fatal error: Class 'a' not found in /tmp/cl.php on line 2
77+
78+
9. get_class() starting PHP 5 returns the name of the class as it was
79+
declared which may lead to problems in older scripts that rely on
80+
the previous behaviour - the class name is lowercased. Expect the
81+
same behaviour from get_parent_class() when applicable.
82+
Example :
83+
<?php
84+
class FooBar {
85+
}
86+
class ExtFooBar extends FooBar{}
87+
$a = new FooBar();
88+
var_dump(get_class($a), get_parent_class($a));
89+
?>
90+
91+
Output (PHP 4):
92+
string(6) "foobar"
93+
string(9) "extfoobar"
94+
95+
Output (PHP 5):
96+
string(6) "FooBar"
97+
string(9) "ExtFooBar"
98+
----------------------------------------------------------------------
99+
Example code that will break :
100+
//....
101+
function someMethod($p) {
102+
if (get_class($p) != 'helpingclass') {
103+
return FALSE;
104+
}
105+
//...
106+
}
107+
//...
108+
Possible solution is to search for get_class() and get_parent_class() in
109+
all your scripts and use strtolower().
110+
111+
10. get_class_methods() returns the names of the methods of a class as they
112+
declared. In PHP4 the names are all lowercased.
113+
Example code :
114+
<?php
115+
class Foo{
116+
function doFoo(){}
117+
function hasFoo(){}
118+
}
119+
var_dump(get_class_methods("Foo"));
120+
?>
121+
Output (PHP4):
122+
array(2) {
123+
[0]=>
124+
string(5) "dofoo"
125+
[1]=>
126+
string(6) "hasfoo"
127+
}
128+
Output (PHP5):
129+
array(2) {
130+
[0]=>
131+
string(5) "doFoo"
132+
[1]=>
133+
string(6) "hasFoo"
134+
}
135+
136+
11. Assignment $this is impossible. Starting PHP 5.0.0 $this has special
137+
meaning in class methods and is recognized by the PHP parser. The latter
138+
will generate a parse error when assignment to $this is found
139+
Example code :
140+
<?php
141+
class Foo {
142+
function assignNew($obj) {
143+
$this = $obj;
144+
}
145+
}
146+
$a = new Foo();
147+
$b = new Foo();
148+
$a->assignNew($b);
149+
echo "I was executed\n";
150+
?>
151+
Output (PHP 4):
152+
I was executed
153+
Output (PHP 5):
154+
PHP Fatal error: Cannot re-assign $this in /tmp/this_ex.php on line 4
155+

README.STREAMS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Opening Streams
4646
===============
4747
In most cases, you should use this API:
4848

49-
PHPAPI php_stream *php_stream_open_wrapper(const char *path, const char *mode,
49+
PHPAPI php_stream *php_stream_open_wrapper(char *path, char *mode,
5050
int options, char **opened_path TSRMLS_DC);
5151

5252
Where:

README.SUBMITTING_PATCH

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This document describes how to submit an enhancement or patch for PHP.
55
It's easy!
66

77
You don't need any login accounts or special access to download,
8-
build, debug and begin submitting PHP or PECL code, tests or
8+
build, debug and begin submitting PHP, PECL or PEAR code, tests or
99
documentation. Once you've followed this README and had several
1010
patches accepted, commit privileges are often quickly granted.
1111

@@ -16,8 +16,8 @@ http://phpadvent.org/2008/less-whining-more-coding-by-elizabeth-smith
1616
Online Forums
1717
-------------
1818
There are several IRC channels where PHP developers are often
19-
available to discuss questions. They include #php.pecl and #php.doc
20-
on the EFNet network and #php-dev-win on FreeNode.
19+
available to discuss questions. They include #php.pecl, #php.doc and
20+
#pear on the EFNet network and #php-dev-win on FreeNode.
2121

2222

2323
PHP Patches
@@ -78,7 +78,7 @@ of type 'text/*' are accepted.
7878
PECL Extension Patches: http://pecl.php.net/
7979
--------------------------------------------
8080
If you are fixing broken functionality in a PECL extension then create
81-
a bug or identify an existing bug at http://bugs.php.net/. A bug
81+
a bug or identify an existing bug at http://pecl.php.net/bugs/. A bug
8282
can be used to track the patch progress and prevent your changes
8383
getting lost in the PHP mail archives.
8484

@@ -114,15 +114,15 @@ http://pear.php.net/manual/en/guide-developers.php
114114

115115
How to create your PHP, PHP Documentation or PECL patch
116116
-------------------------------------------------------
117-
PHP and most PECL packages use Git for revision control. Some PECL
118-
packages use Subversion (SVN) Read http://www.php.net/git.php for help
119-
on using Git to get and build PHP source code. We recommend to look
120-
at our workflow on https://wiki.php.net/vcs/gitworkflow and our FAQ
121-
https://wiki.php.net/vcs/gitfaq.
117+
PHP and PECL use Subversion (SVN) for revision control. Read
118+
http://www.php.net/svn.php for help on using SVN to get and build PHP
119+
source code. We recommend using a Sparse Directory checkout described
120+
in http://wiki.php.net/vcs/svnfaq. If you are new to SVN, read
121+
http://svnbook.red-bean.com.
122122

123123
Generally we ask that bug fix patches work on the current stable PHP
124-
development branches and on "master". New PHP features only need to
125-
work on "master".
124+
development branches and on "trunk". New PHP features only need to
125+
work on "trunk".
126126

127127
Read CODING_STANDARDS before you start working.
128128

@@ -134,15 +134,15 @@ comprehensive.
134134

135135
After testing is finished, create a patch file using the command:
136136

137-
git diff > your_patch.txt
137+
svn diff > your_patch.txt
138138

139139
For ease of review and later troubleshooting, submit individual
140140
patches for each bug or feature.
141141

142142

143143
Checklist for submitting your PHP or PECL code patch
144144
----------------------------------------------------
145-
- Update git source just before running your final 'diff' and
145+
- Update SVN source just before running your final 'diff' and
146146
before testing.
147147
- Add in-line comments and/or have external documentation ready.
148148
Use only "/* */" style comments, not "//".
@@ -175,7 +175,7 @@ about these questions:
175175

176176
What happens when your PHP or PECL patch is applied
177177
---------------------------------------------------
178-
Your name will likely be included in the Git commit log. If your
178+
Your name will likely be included in the SVN commit log. If your
179179
patch affects end users, a brief description and your name might be
180180
added to the NEWS file.
181181

TSRM/tsrm_virtual_cwd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,7 @@ CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) /* {{{ */
16731673
}
16741674
/* }}} */
16751675

1676-
CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC) /* {{{ */
1676+
CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC) /* {{{ */
16771677
{
16781678
cwd_state old_state;
16791679
cwd_state new_state;

TSRM/tsrm_virtual_cwd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC);
161161
CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC);
162162
CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...);
163163
CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC);
164-
CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC);
164+
CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC);
165165
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
166166
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC);
167167
CWD_API int virtual_unlink(const char *path TSRMLS_DC);

0 commit comments

Comments
 (0)