Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/actions/verify-generated-files/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ runs:
ext/tokenizer/tokenizer_data_gen.php
build/gen_stub.php -f --generate-optimizer-info --verify
ext/phar/makestub.php
# Use the -a flag for a bug in git 2.46.0, which doesn't consider changed -diff files.
git add . -N && git diff -a --exit-code
.github/scripts/test-directory-unchanged.sh .
32 changes: 32 additions & 0 deletions .github/scripts/download-bundled/pcre2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh
set -ex
cd "$(dirname "$0")/../../.."

revision=refs/tags/pcre2-10.44

git clone --depth 1 --recurse-submodules --revision="$revision" https://github.com/PCRE2Project/pcre2.git /tmp/php-src-bundled/pcre2

rm -rf ext/pcre/pcre2lib
cp -R /tmp/php-src-bundled/pcre2/src ext/pcre/pcre2lib

cd ext/pcre/pcre2lib

# remove unneeded files
rm config.h.generic
rm pcre2.h.in
rm pcre2_dftables.c
rm pcre2_fuzzsupport.c
rm pcre2_jit_test.c
rm pcre2demo.c
rm pcre2grep.c
rm pcre2posix.c
rm pcre2posix.h
rm pcre2posix_test.c
rm pcre2test.c

# move renamed files
mv pcre2.h.generic pcre2.h
mv pcre2_chartables.c.dist pcre2_chartables.c

# add extra files
git restore config.h # based on config.h.generic but with many changes
13 changes: 13 additions & 0 deletions .github/scripts/test-directory-unchanged.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -ex

cd "$(dirname "$0")/../../$1"

# notify git about untracked (except ignored) files
git add -N .

# display overview of changed files
git status .

# display diff of working directory vs HEAD commit and set exit code
git diff -a --exit-code HEAD .
39 changes: 39 additions & 0 deletions .github/workflows/verify-bundled-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Verify Bundled Files

on:
push: ~
pull_request: ~
schedule:
- cron: "0 1 * * *"
workflow_dispatch: ~

permissions:
contents: read

jobs:
VERIFY_BUNDLED_FILES:
name: Verify Bundled Files
runs-on: ubuntu-24.04
steps:
- name: git checkout
uses: actions/checkout@v5

- name: Detect changed files
uses: dorny/paths-filter@v3
id: changes
with:
base: master
filters: |
pcre2:
- '.github/scripts/download-bundled/pcre2.sh'
- 'ext/pcre/pcre2lib/**'

- name: PCRE2
if: ${{ !cancelled() && (steps.changes.outputs.pcre2 == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }}
run: |
echo "::group::Download"
.github/scripts/download-bundled/pcre2.sh
echo "::endgroup::"
echo "::group::Verify files"
.github/scripts/test-directory-unchanged.sh ext/pcre/pcre2lib
echo "::endgroup::"
12 changes: 3 additions & 9 deletions ext/pcre/pcre2lib/pcre2_chartables.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
/* This file was automatically written by the pcre2_dftables auxiliary
program. It contains character tables that are used when no external
tables are passed to PCRE2 by the application that calls it. The tables
are used only for characters whose code values are less than 256. */
are used only for characters whose code values are less than 256, and
only relevant if not in UCP mode. */

/* This set of tables was written in the C locale. */

Expand All @@ -18,13 +19,6 @@ PCRE2 is configured with --enable-rebuild-chartables. However, you can run
pcre2_dftables manually with the -L option to build tables using the LC_ALL
locale. */

/* The following #include is present because without it gcc 4.x may remove
the array definition from the final binary if PCRE2 is built into a static
library and dead code stripping is activated. This leads to link errors.
Pulling in the header ensures that the array gets flagged as "someone
outside this compilation unit might reference this" and so it will always
be supplied to the linker. */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand Down Expand Up @@ -163,7 +157,7 @@ graph, print, punct, and cntrl. Other classes are built from combinations. */
0x02 letter
0x04 lower case letter
0x08 decimal digit
0x10 alphanumeric or '_'
0x10 word (alphanumeric or '_')
*/

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */
Expand Down
Loading