Skip to content

Commit

Permalink
Merge 37cddfe into 1f1485c
Browse files Browse the repository at this point in the history
  • Loading branch information
krakjoe committed Aug 3, 2021
2 parents 1f1485c + 37cddfe commit bc072c4
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 243 deletions.
13 changes: 0 additions & 13 deletions .appveyor/build.ps1

This file was deleted.

55 changes: 0 additions & 55 deletions .appveyor/install.ps1

This file was deleted.

31 changes: 0 additions & 31 deletions .appveyor/test.ps1

This file was deleted.

66 changes: 47 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,53 @@ jobs:
ubuntu:
strategy:
matrix:
version: ["8.0", "8.1"]
version: ["PHP-8.0", "master"]
opcache: ["opcache.enable_cli=0", "opcache.enable_cli=1"]
runs-on: ubuntu-latest
steps:
- name: Checkout uopz
- name: Setup Ubuntu
run: sudo apt-get install lcov re2c bison
- name: Install PHP
run: |
sudo mkdir /opt/src
sudo chmod 777 /opt/src
cd /opt/src
git clone --depth=1 --branch ${{matrix.version}} https://github.com/php/php-src
cd php-src
./buildconf --force
./configure --disable-all \
--enable-gcov \
--enable-opcache \
--disable-opcache-jit \
--prefix=/opt \
--with-config-file-path=/opt/etc
make -j$(nproc)
sudo make install
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Generate Build Files
run: /opt/bin/phpize
- name: Configure Build
run: ./configure --enable-uopz --with-php-config=/opt/bin/php-config
- name: Build
run: EXTRA_CFLAGS="-fprofile-arcs -ftest-coverage" make
- name: Install
run: sudo make install
- name: Configure Installation
run: |
sudo mkdir /opt/etc
sudo chmod 777 /opt/etc
echo "zend_extension=opcache.so" > /opt/etc/php.ini
echo ${{matrix.opcache}} >> /opt/etc/php.ini
- name: Run Tests
run: /opt/bin/php run-tests.php -q -g FAIL,XFAIL,XLEAK,SKIP,BORK,WARN -P --show-diff
- name: Generate Test Coverage
run: lcov -c --directory . --output-file coverage.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
php-version: ${{matrix.version}}
extensions: :xdebug
ini-values: opcache.enable_cli=1
- name: phize
run: phpize
- name: configure
run: ./configure --enable-uopz
- name: make
run: make
- name: test
run: make test TESTS=tests
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.info
windows:
defaults:
run:
Expand All @@ -48,11 +76,11 @@ jobs:
with:
arch: ${{matrix.arch}}
toolset: ${{steps.setup-php.outputs.toolset}}
- name: phpize
- name: Generate Build Files
run: phpize
- name: configure
- name: Configure Build
run: configure --enable-uopz --with-prefix=${{steps.setup-php.outputs.prefix}}
- name: make
- name: Build
run: nmake
- name: test
- name: Run Tests
run: nmake test TESTS=tests
65 changes: 0 additions & 65 deletions .travis.yml

This file was deleted.

51 changes: 0 additions & 51 deletions appveyor.yml

This file was deleted.

16 changes: 7 additions & 9 deletions src/function.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ zend_bool uopz_set_static(zend_class_entry *clazz, zend_string *function, zval *
zend_function *entry;
zend_string *k = NULL;
zval *v = NULL;

if (clazz) {
entry = uopz_find_function(&clazz->function_table, function);
if (!entry) {
Expand Down Expand Up @@ -290,7 +290,7 @@ zend_bool uopz_set_static(zend_class_entry *clazz, zend_string *function, zval *

return 0;
}

if (!entry->op_array.static_variables) {
if (clazz) {
uopz_exception(
Expand All @@ -304,15 +304,13 @@ zend_bool uopz_set_static(zend_class_entry *clazz, zend_string *function, zval *

return 0;
}

HashTable *variables = ZEND_MAP_PTR_GET(entry->op_array.static_variables_ptr);

if (!variables) {
ZEND_MAP_PTR_INIT(
entry->op_array.static_variables_ptr,
&entry->op_array.static_variables);

variables = ZEND_MAP_PTR_GET(entry->op_array.static_variables_ptr);
variables = zend_array_dup(entry->op_array.static_variables);

ZEND_MAP_PTR_SET(entry->op_array.static_variables_ptr, variables);
}

ZEND_HASH_FOREACH_STR_KEY_VAL(variables, k, v) {
Expand All @@ -327,7 +325,7 @@ zend_bool uopz_set_static(zend_class_entry *clazz, zend_string *function, zval *

continue;
}

ZVAL_COPY(v, y);
} ZEND_HASH_FOREACH_END();

Expand Down

0 comments on commit bc072c4

Please sign in to comment.