Skip to content

Commit

Permalink
Downgrade bundled PCRE to version 7.9 due to 8.0+ version use of C99
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Alshanetsky committed Feb 3, 2010
1 parent 43d5429 commit 91eb2de
Show file tree
Hide file tree
Showing 45 changed files with 3,679 additions and 7,828 deletions.
1 change: 1 addition & 0 deletions NEWS
@@ -1,6 +1,7 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Feb 2010, PHP 5.2.13
- Downgrade bundled PCRE to version 7.9. (Ilia)
- Fixed a possible open_basedir/safe_mode bypass in session extension
identified by Grzegorz Stachowiak. (Ilia)

Expand Down
4 changes: 2 additions & 2 deletions ext/pcre/pcrelib/AUTHORS
Expand Up @@ -8,7 +8,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.

Copyright (c) 1997-2010 University of Cambridge
Copyright (c) 1997-2009 University of Cambridge
All rights reserved


Expand All @@ -17,7 +17,7 @@ THE C++ WRAPPER LIBRARY

Written by: Google Inc.

Copyright (c) 2007-2010 Google Inc
Copyright (c) 2007-2008 Google Inc
All rights reserved

####
292 changes: 0 additions & 292 deletions ext/pcre/pcrelib/ChangeLog

Large diffs are not rendered by default.

44 changes: 20 additions & 24 deletions ext/pcre/pcrelib/HACKING
Expand Up @@ -67,22 +67,22 @@ many tests of the mode that might slow it down. So I re-factored the compiling
functions to work this way. This got rid of about 600 lines of source. It
should make future maintenance and development easier. As this was such a major
change, I never released 6.8, instead upping the number to 7.0 (other quite
major changes were also present in the 7.0 release).
major changes are also present in the 7.0 release).

A side effect of this work was that the previous limit of 200 on the nesting
A side effect of this work is that the previous limit of 200 on the nesting
depth of parentheses was removed. However, there is a downside: pcre_compile()
runs more slowly than before (30% or more, depending on the pattern) because it
is doing a full analysis of the pattern. My hope was that this would not be a
big issue, and in the event, nobody has commented on it.
is doing a full analysis of the pattern. My hope is that this is not a big
issue.

Traditional matching function
-----------------------------

The "traditional", and original, matching function is called pcre_exec(), and
it implements an NFA algorithm, similar to the original Henry Spencer algorithm
and the way that Perl works. This is not surprising, since it is intended to be
as compatible with Perl as possible. This is the function most users of PCRE
will use most of the time.
and the way that Perl works. Not surprising, since it is intended to be as
compatible with Perl as possible. This is the function most users of PCRE will
use most of the time.

Supplementary matching function
-------------------------------
Expand Down Expand Up @@ -119,7 +119,6 @@ quantifiers) are always just two bytes long.

A list of the opcodes follows:


Opcodes with no following data
------------------------------

Expand Down Expand Up @@ -151,12 +150,12 @@ These items are all just one byte long
OP_EXTUNI match an extended Unicode character
OP_ANYNL match any Unicode newline sequence

OP_ACCEPT ) These are Perl 5.10's "backtracking
OP_COMMIT ) control verbs". If OP_ACCEPT is inside
OP_FAIL ) capturing parentheses, it may be preceded
OP_PRUNE ) by one or more OP_CLOSE, followed by a 2-byte
OP_SKIP ) number, indicating which parentheses must be
OP_THEN ) closed.
OP_ACCEPT )
OP_COMMIT )
OP_FAIL ) These are Perl 5.10's "backtracking
OP_PRUNE ) control verbs".
OP_SKIP )
OP_THEN )


Repeating single characters
Expand Down Expand Up @@ -373,15 +372,12 @@ These are like other subpatterns, but they start with the opcode OP_COND, or
OP_SCOND for one that might match an empty string in an unbounded repeat. If
the condition is a back reference, this is stored at the start of the
subpattern using the opcode OP_CREF followed by two bytes containing the
reference number. OP_NCREF is used instead if the reference was generated by
name (so that the runtime code knows to check for duplicate names).

If the condition is "in recursion" (coded as "(?(R)"), or "in recursion of
group x" (coded as "(?(Rx)"), the group number is stored at the start of the
subpattern using the opcode OP_RREF or OP_NRREF (cf OP_NCREF), and a value of
zero for "the whole pattern". For a DEFINE condition, just the single byte
OP_DEF is used (it has no associated data). Otherwise, a conditional subpattern
always starts with one of the assertions.
reference number. If the condition is "in recursion" (coded as "(?(R)"), or "in
recursion of group x" (coded as "(?(Rx)"), the group number is stored at the
start of the subpattern using the opcode OP_RREF, and a value of zero for "the
whole pattern". For a DEFINE condition, just the single byte OP_DEF is used (it
has no associated data). Otherwise, a conditional subpattern always starts with
one of the assertions.


Recursion
Expand Down Expand Up @@ -419,4 +415,4 @@ at compile time, and so does not cause anything to be put into the compiled
data.

Philip Hazel
October 2009
April 2008
6 changes: 3 additions & 3 deletions ext/pcre/pcrelib/LICENCE
Expand Up @@ -4,7 +4,7 @@ PCRE LICENCE
PCRE is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.

Release 8 of PCRE is distributed under the terms of the "BSD" licence, as
Release 7 of PCRE is distributed under the terms of the "BSD" licence, as
specified below. The documentation for PCRE, supplied in the "doc"
directory, is distributed under the same terms as the software itself.

Expand All @@ -22,7 +22,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.

Copyright (c) 1997-2010 University of Cambridge
Copyright (c) 1997-2009 University of Cambridge
All rights reserved.


Expand All @@ -31,7 +31,7 @@ THE C++ WRAPPER FUNCTIONS

Contributed by: Google Inc.

Copyright (c) 2007-2010, Google Inc.
Copyright (c) 2007-2008, Google Inc.
All rights reserved.


Expand Down
22 changes: 0 additions & 22 deletions ext/pcre/pcrelib/NEWS
@@ -1,28 +1,6 @@
News about PCRE releases
------------------------

Release 8.01 19-Jan-2010
------------------------

This is a bug-fix release. Several bugs in the code itself and some bugs and
infelicities in the build system have been fixed.


Release 8.00 19-Oct-09
----------------------

Bugs have been fixed in the library and in pcregrep. There are also some
enhancements. Restrictions on patterns used for partial matching have been
removed, extra information is given for partial matches, the partial matching
process has been improved, and an option to make a partial match override a
full match is available. The "study" process has been enhanced by finding a
lower bound matching length. Groups with duplicate numbers may now have
duplicated names without the use of PCRE_DUPNAMES. However, they may not have
different names. The documentation has been revised to reflect these changes.
The version number has been expanded to 3 digits as it is clear that the rate
of change is not slowing down.


Release 7.9 11-Apr-09
---------------------

Expand Down
111 changes: 29 additions & 82 deletions ext/pcre/pcrelib/NON-UNIX-USE
Expand Up @@ -12,10 +12,9 @@ This document contains the following sections:
Comments about Win32 builds
Building PCRE on Windows with CMake
Use of relative paths with CMake on Windows
Testing with RunTest.bat
Testing with runtest.bat
Building under Windows with BCC5.5
Building PCRE on OpenVMS
Building PCRE on Stratus OpenVOS


GENERAL
Expand All @@ -37,10 +36,10 @@ wrapper functions are a separate issue (see below).

The PCRE distribution includes a "configure" file for use by the Configure/Make
build system, as found in many Unix-like environments. There is also support
support for CMake, which some users prefer, especially in Windows environments.
There are some instructions for CMake under Windows in the section entitled
"Building PCRE with CMake" below. CMake can also be used to build PCRE in
Unix-like systems.
support for CMake, which some users prefer, in particular in Windows
environments. There are some instructions for CMake under Windows in the
section entitled "Building PCRE with CMake" below. CMake can also be used to
build PCRE in Unix-like systems.


GENERIC INSTRUCTIONS FOR THE PCRE C LIBRARY
Expand Down Expand Up @@ -127,16 +126,12 @@ The following are generic comments about building the PCRE C library "by hand".
your system has static and shared libraries, you may have to do this once
for each type.

(8) Similarly, if you want to build the POSIX wrapper functions, ensure that
you have the pcreposix.h file and then compile pcreposix.c (remembering
-DHAVE_CONFIG_H if necessary). Link the result (on its own) as the
pcreposix library.
(8) Similarly, compile pcreposix.c (remembering -DHAVE_CONFIG_H if necessary)
and link the result (on its own) as the pcreposix library.

(9) Compile the test program pcretest.c (again, don't forget -DHAVE_CONFIG_H).
This needs the functions in the PCRE library when linking. It also needs
the pcreposix wrapper functions unless you compile it with -DNOPOSIX. The
pcretest.c program also needs the pcre_printint.src source file, which it
#includes.
This needs the functions in the pcre and pcreposix libraries when linking.
It also needs the pcre_printint.src source file, which it #includes.

(10) Run pcretest on the testinput files in the testdata directory, and check
that the output matches the corresponding testoutput files. Note that the
Expand Down Expand Up @@ -277,47 +272,46 @@ gcc and MinGW's gcc). So, a user can:

The test files that are supplied with PCRE are in Unix format, with LF
characters as line terminators. It may be necessary to change the line
terminators in order to get some of the tests to work.
terminators in order to get some of the tests to work. We hope to improve
things in this area in future.


BUILDING PCRE ON WINDOWS WITH CMAKE

CMake is an alternative configuration facility that can be used instead of the
traditional Unix "configure". CMake creates project files (make files, solution
files, etc.) tailored to numerous development environments, including Visual
Studio, Borland, Msys, MinGW, NMake, and Unix. The following instructions
CMake is an alternative build facility that can be used instead of the
traditional Unix "configure". CMake version 2.4.7 supports Borland makefiles,
MinGW makefiles, MSYS makefiles, NMake makefiles, UNIX makefiles, Visual Studio
6, Visual Studio 7, Visual Studio 8, and Watcom W8. The following instructions
were contributed by a PCRE user.

1. Install the latest CMake version available from http://www.cmake.org/, and
ensure that cmake\bin is on your path.
1. Download CMake 2.4.7 or above from http://www.cmake.org/, install and ensure
that cmake\bin is on your path.

2. Unzip (retaining folder structure) the PCRE source tree into a source
directory such as C:\pcre.

3. Create a new, empty build directory, for example C:\pcre\build\
3. Create a new, empty build directory: C:\pcre\build\

4. Run cmake-gui from the Shell envirornment of your build tool, for example,
Msys for Msys/MinGW or Visual Studio Command Prompt for VC/VC++.
4. Run CMakeSetup from the Shell envirornment of your build tool, e.g., Msys
for Msys/MinGW or Visual Studio Command Prompt for VC/VC++

5. Enter C:\pcre\pcre-xx and C:\pcre\build for the source and build
directories, respectively.
directories, respectively

6. Hit the "Configure" button.

7. Select the particular IDE / build tool that you are using (Visual
Studio, MSYS makefiles, MinGW makefiles, etc.)
7. Select the particular IDE / build tool that you are using (Visual Studio,
MSYS makefiles, MinGW makefiles, etc.)

8. The GUI will then list several configuration options. This is where
you can enable UTF-8 support or other PCRE optional features.
8. The GUI will then list several configuration options. This is where you can
enable UTF-8 support, etc.

9. Hit "Configure" again. The adjacent "Generate" button should now be
active.
9. Hit "Configure" again. The adjacent "OK" button should now be active.

10. Hit "Generate".
10. Hit "OK".

11. The build directory should now contain a usable build system, be it a
solution file for Visual Studio, makefiles for MinGW, etc. Exit from
cmake-gui and use the generated build system with your compiler or IDE.
solution file for Visual Studio, makefiles for MinGW, etc.


USE OF RELATIVE PATHS WITH CMAKE ON WINDOWS
Expand Down Expand Up @@ -450,52 +444,5 @@ $! Locale could not be set to fr
$!
=========================


BUILDING PCRE ON STRATUS OPENVOS

These notes on the port of PCRE to VOS (lightly edited) were supplied by
Ashutosh Warikoo, whose email address has the local part awarikoo and the
domain nse.co.in. The port was for version 7.9 in August 2009.

1. Building PCRE

I built pcre on OpenVOS Release 17.0.1at using GNU Tools 3.4a without any
problems. I used the following packages to build PCRE:

ftp://ftp.stratus.com/pub/vos/posix/ga/posix.save.evf.gz

Please read and follow the instructions that come with these packages. To start
the build of pcre, from the root of the package type:

./build.sh

2. Installing PCRE

Once you have successfully built PCRE, login to the SysAdmin group, switch to
the root user, and type

[ !create_dir (master_disk)>usr --if needed ]
[ !create_dir (master_disk)>usr>local --if needed ]
!gmake install

This installs PCRE and its man pages into /usr/local. You can add
(master_disk)>usr>local>bin to your command search paths, or if you are in
BASH, add /usr/local/bin to the PATH environment variable.

4. Restrictions

This port requires readline library optionally. However during the build I
faced some yet unexplored errors while linking with readline. As it was an
optional component I chose to disable it.

5. Known Problems

I ran a the test suite, but you will have to be your own judge of whether this
command, and this port, suits your purposes. If you find any problems that
appear to be related to the port itself, please let me know. Please see the
build.log file in the root of the package also.


=========================
Last Updated: 19 January 2010
Last Updated: 17 March 2009
****

0 comments on commit 91eb2de

Please sign in to comment.