Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
fca1950
ci: build the test fixtures before running the suite
somethingwithproof Aug 21, 2026
109a553
tests: refresh the rrd_tune and rrd_xport expectations
somethingwithproof Aug 21, 2026
def9748
fix: initialise the RRDCreator startTime parameter
somethingwithproof Aug 21, 2026
c3f5957
fix: validate object state before building rrd arguments
somethingwithproof Aug 21, 2026
f18be81
fix: size the timestamp buffer for 64-bit time values
somethingwithproof Aug 21, 2026
d3c14d3
fix: reset the remaining creator state on re-construction
somethingwithproof Aug 21, 2026
ea62c3e
fix: apply open_basedir to RRDCreator::save and RRDGraph::saveVerbose
somethingwithproof Aug 21, 2026
f01390f
fix: stop rewriting the caller's options array
somethingwithproof Aug 21, 2026
19a881c
fix: abort argument building when a value cannot be converted
somethingwithproof Aug 21, 2026
51c7997
fix: pin the checked path and the options array across userland calls
somethingwithproof Aug 21, 2026
4412812
fix: hold a reference to the graph options while building the argumen…
somethingwithproof Aug 21, 2026
39def9a
fix: clear file_path on release and stop walking past the fetch result
somethingwithproof Aug 21, 2026
d00ead3
tests: cover duplicate data source names, re-construction and unbuilt…
somethingwithproof Aug 21, 2026
e18e4d3
chore: replace three macros PHP master has removed
somethingwithproof Aug 21, 2026
019fd68
ci: add an allowed-to-fail job against php-src master
somethingwithproof Aug 21, 2026
49835d3
chore: probe for librrd's argv constness instead of assuming it
somethingwithproof Aug 21, 2026
d5a4842
refactor: build the librrd argument list without the dummy slot
somethingwithproof Aug 21, 2026
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
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ jobs:
build:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
include:
# nightly build of php-src master; allowed to fail so an unrelated
# upstream break does not gate pull requests
- php: '8.6'
experimental: true

steps:
- name: Checkout
Expand All @@ -25,7 +31,7 @@ jobs:
- name: Install librrd
run: |
sudo apt-get update
sudo apt-get install -y librrd-dev pkg-config
sudo apt-get install -y librrd-dev pkg-config rrdtool

- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
Expand All @@ -40,6 +46,9 @@ jobs:
./configure --with-rrd
make -j"$(nproc)"

- name: Generate test fixtures
run: make -C tests/data all

- name: Test
run: make test
env:
Expand Down
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,19 @@ modules
run-tests.php
tmp-php.ini
tests/rrdtool-bin.inc
*.dep
configure.ac
tests/*.diff
tests/*.exp
tests/*.log
tests/*.out
tests/*.php
tests/*.sh
tests/*.txt
tests/*.png
tests/*.rrd
tests/data/*.png
tests/data/*.rrd
tests/data/*.txt
tests/data/*.xml
tests/data/Makefile
14 changes: 14 additions & 0 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ if test "$PHP_RRD" != "no"; then
AC_MSG_ERROR(pkgconfig and librrd in version >= 1.3.0 must be installed)
fi

dnl librrd took char ** for argv before 1.9 and const char ** from 1.9 on
AC_MSG_CHECKING(whether librrd takes const char ** argv)
rrd_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $LIBRRD_CFLAGS -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <rrd.h>]],
[[const char *argv[2] = { "create", 0 }; rrd_create(1, argv);]])],
[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_RRD_CONST_ARGV, 1, [librrd takes const char ** argv])
],
[AC_MSG_RESULT(no)])
CFLAGS="$rrd_save_CFLAGS"

dnl rrd_lastupdate_r available in 1.4.0+
AC_CHECK_LIB([rrd], [rrd_lastupdate_r],
[
Expand Down
7 changes: 7 additions & 0 deletions php_rrd.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ extern zend_module_entry rrd_module_entry;
# define zend_parse_parameters_none() zend_parse_parameters(ZEND_NUM_ARGS(), "")
#endif

/* librrd took char ** for argv before 1.9 and const char ** from 1.9 on */
#ifdef HAVE_RRD_CONST_ARGV
# define RRD_ARGV(argv) ((const char **)(argv))
#else
# define RRD_ARGV(argv) (argv)
#endif

typedef struct _rrd_args {
int count;
char **args;
Expand Down
Loading
Loading