diff options
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | PHPINFO | 2 | ||||
| -rw-r--r-- | REFLECTION | 39 | ||||
| -rw-r--r-- | composer.json | 35 | ||||
| -rw-r--r-- | php-pinba.spec | 164 |
5 files changed, 114 insertions, 128 deletions
@@ -1,5 +1,7 @@ +clog package-*.xml *.tgz +*.tar.bz2 *.tar.gz *.tar.xz *.tar.xz.asc @@ -2,7 +2,7 @@ pinba Pinba support => enabled -Extension version => 1.1.2 +Extension version => 1.4.0 Directive => Local Value => Master Value pinba.server => no value => no value @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #116 pinba version 1.1.2 ] { +Extension [ <persistent> extension #114 pinba version 1.4.0 ] { - INI { Entry [ pinba.server <ALL> ] @@ -16,11 +16,11 @@ Extension [ <persistent> extension #116 pinba version 1.1.2 ] { } - Constants [5] { - Constant [ int PINBA_FLUSH_ONLY_STOPPED_TIMERS ] { 1 } - Constant [ int PINBA_FLUSH_RESET_DATA ] { 2 } - Constant [ int PINBA_ONLY_STOPPED_TIMERS ] { 1 } - Constant [ int PINBA_ONLY_RUNNING_TIMERS ] { 4 } - Constant [ int PINBA_AUTO_FLUSH ] { 8 } + Constant [ <persistent> int PINBA_FLUSH_ONLY_STOPPED_TIMERS ] { 1 } + Constant [ <persistent> int PINBA_FLUSH_RESET_DATA ] { 2 } + Constant [ <persistent> int PINBA_ONLY_STOPPED_TIMERS ] { 1 } + Constant [ <persistent> int PINBA_ONLY_RUNNING_TIMERS ] { 4 } + Constant [ <persistent> int PINBA_AUTO_FLUSH ] { 8 } } - Functions { @@ -28,8 +28,8 @@ Extension [ <persistent> extension #116 pinba version 1.1.2 ] { - Parameters [3] { Parameter #0 [ <required> $tags ] - Parameter #1 [ <optional> $data ] - Parameter #2 [ <optional> $hit_count ] + Parameter #1 [ <optional> $data = <default> ] + Parameter #2 [ <optional> $hit_count = <default> ] } } Function [ <internal:pinba> function pinba_timer_add ] { @@ -37,7 +37,7 @@ Extension [ <persistent> extension #116 pinba version 1.1.2 ] { - Parameters [3] { Parameter #0 [ <required> $tags ] Parameter #1 [ <required> $value ] - Parameter #2 [ <optional> $data ] + Parameter #2 [ <optional> $data = <default> ] } } Function [ <internal:pinba> function pinba_timer_stop ] { @@ -83,8 +83,8 @@ Extension [ <persistent> extension #116 pinba version 1.1.2 ] { Function [ <internal:pinba> function pinba_flush ] { - Parameters [2] { - Parameter #0 [ <optional> $custom_script_name ] - Parameter #1 [ <optional> $flags ] + Parameter #0 [ <optional> $custom_script_name = <default> ] + Parameter #1 [ <optional> $flags = <default> ] } } Function [ <internal:pinba> function pinba_reset ] { @@ -100,7 +100,7 @@ Extension [ <persistent> extension #116 pinba version 1.1.2 ] { Function [ <internal:pinba> function pinba_get_data ] { - Parameters [1] { - Parameter #0 [ <optional> $flags ] + Parameter #0 [ <optional> $flags = <default> ] } } Function [ <internal:pinba> function pinba_timer_get_info ] { @@ -116,7 +116,8 @@ Extension [ <persistent> extension #116 pinba version 1.1.2 ] { } Function [ <internal:pinba> function pinba_timers_get ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ <optional> $flags = <default> ] } } Function [ <internal:pinba> function pinba_script_name_set ] { @@ -288,8 +289,8 @@ Extension [ <persistent> extension #116 pinba version 1.1.2 ] { - Parameters [4] { Parameter #0 [ <required> $tags ] Parameter #1 [ <required> $value ] - Parameter #2 [ <optional> $rusage ] - Parameter #3 [ <optional> $hit_count ] + Parameter #2 [ <optional> $rusage = <default> ] + Parameter #3 [ <optional> $hit_count = <default> ] } } @@ -298,22 +299,22 @@ Extension [ <persistent> extension #116 pinba version 1.1.2 ] { - Parameters [4] { Parameter #0 [ <required> $tags ] Parameter #1 [ <required> $value ] - Parameter #2 [ <optional> $rusage ] - Parameter #3 [ <optional> $hit_count ] + Parameter #2 [ <optional> $rusage = <default> ] + Parameter #3 [ <optional> $hit_count = <default> ] } } Method [ <internal:pinba> public method send ] { - Parameters [1] { - Parameter #0 [ <optional> $flags ] + Parameter #0 [ <optional> $flags = <default> ] } } Method [ <internal:pinba> public method getData ] { - Parameters [1] { - Parameter #0 [ <optional> $flags ] + Parameter #0 [ <optional> $flags = <default> ] } } } diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..166f3b5 --- /dev/null +++ b/composer.json @@ -0,0 +1,35 @@ +{ + "name": "xolegator/pinba_extension", + "description": "Pinba PHP extension: collects request and timer metrics and ships them over UDP (protobuf) to Pinba Engine.", + "type": "php-ext", + "keywords": ["pinba", "extension", "profiling", "metrics", "monitoring", "protobuf"], + "homepage": "https://github.com/XOlegator/pinba_extension", + "license": "LGPL-2.1-or-later", + "authors": [ + { + "name": "Antony Dovgal", + "homepage": "https://github.com/tony2001/pinba_extension", + "role": "Original author" + }, + { + "name": "Oleg Ekhlakov", + "email": "o.ekhlakov@protonmail.com", + "homepage": "https://github.com/XOlegator/pinba_extension", + "role": "Fork maintainer" + } + ], + "support": { + "issues": "https://github.com/XOlegator/pinba_extension/issues", + "source": "https://github.com/XOlegator/pinba_extension" + }, + "require": { + "php": ">=8.2" + }, + "php-ext": { + "extension-name": "pinba", + "priority": 20, + "support-zts": true, + "support-nts": true, + "configure-options": [] + } +} diff --git a/php-pinba.spec b/php-pinba.spec index fdeec54..e5c98fd 100644 --- a/php-pinba.spec +++ b/php-pinba.spec @@ -1,95 +1,67 @@ # remirepo spec file for php-pinba # -# Copyright (c) 2017-2020 Remi Collet -# License: CC-BY-SA -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2017-2026 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # -# we don't want -z defs linker flag -%undefine _strict_symbol_defs_build - %{?scl: %scl_package php-pinba} -%global gh_commit 98c01fb5cde068426aae61d239205db75c507cbf -%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_owner tony2001 +%global gh_owner XOlegator %global gh_project pinba_extension -%global pecl_name pinba -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global ini_name 40-%{pecl_name}.ini +%global pie_vend xolegator +%global pie_proj %{gh_project} +%global ext_name pinba +%global ini_name 40-%{ext_name}.ini +%global forgeurl https://github.com/%{gh_owner}/%{gh_project} -Summary: Client extension for Pinba statistics server Name: %{?scl_prefix}php-pinba -Version: 1.1.2 -%if 0%{?gh_date:1} -Release: 1%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -%else -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -%endif -License: LGPLv2+ -URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz - +Summary: Client extension for Pinba statistics server +Version: 1.4.0 +Release: 1%{?dist} +License: LGPL-2.1-or-later +%forgemeta +URL: %{forgeurl} +Source0: %{forgesource} + +BuildRequires: make BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel > 7 -BuildRequires: %{?scl_prefix}php-tokenizer +BuildRequires: %{?scl_prefix}php-devel > 8.2 +BuildRequires: protobuf-c-devel Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} - -%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -%if "%{php_version}" > "7.2" -Obsoletes: php72u-%{pecl_name} <= %{version} -Obsoletes: php72w-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.3" -Obsoletes: php73-%{pecl_name} <= %{version} -Obsoletes: php73w-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.4" -Obsoletes: php74-%{pecl_name} <= %{version} -Obsoletes: php74w-%{pecl_name} <= %{version} -%endif -%endif - -%if 0%{?fedora} < 20 && 0%{?rhel} < 7 -# Filter shared private -%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} -%{?filter_setup} -%endif + +# PIE +Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version} +Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version} %description -Client extension for Pinba statistics server. +Pinba Extension is the PHP client extension for the Pinba monitoring stack. + +It collects timing and request metrics inside PHP, serializes them with +protobuf, and sends them over UDP to Pinba Engine. Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. %prep -%setup -qc -mv %{gh_project}-%{gh_commit} NTS +%forgesetup -cd NTS # Sanity check, really often broken extver=$(sed -n '/#define PHP_PINBA_VERSION/{s/.* "//;s/".*$//;p}' php_pinba.h) if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then : Error: Upstream extension version is ${extver}, expecting %{version}%{?gh_date:-dev}. exit 1 fi -cd .. - -%if %{with_zts} -# duplicate for ZTS build -cp -pr NTS ZTS -%endif # Drop in the bit of configuration cat << 'EOF' | tee %{ini_name} ; Enable '%{summary}' extension module -extension = %{pecl_name}.so +extension = %{ext_name}.so ; Configuration ;pinba.server = '' @@ -102,83 +74,59 @@ EOF %build %{?dtsenable} -cd NTS -%{_bindir}/phpize -%configure \ - --with-php-config=%{_bindir}/php-config \ - --enable-pinba -make %{?_smp_mflags} +%{__phpize} +sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global -%if %{with_zts} -cd ../ZTS -%{_bindir}/zts-phpize %configure \ - --with-php-config=%{_bindir}/zts-php-config \ + --with-php-config=%{__phpconfig} \ --enable-pinba -make %{?_smp_mflags} -%endif + +%make_build %install %{?dtsenable} -# Install the NTS stuff -make -C NTS install INSTALL_ROOT=%{buildroot} -install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} - -%if %{with_zts} -# Install the ZTS stuff -make -C ZTS install INSTALL_ROOT=%{buildroot} -install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} -%endif +# Install the extension +%make_install +# Install the configuration file +install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} %check -cd NTS : Minimal load test for NTS extension %{__php} --no-php-ini \ - --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --define extension=%{buildroot}%{php_extdir}/%{ext_name}.so \ + --modules | grep '^%{ext_name}$' : Upstream test suite for NTS extension TEST_PHP_EXECUTABLE=%{__php} \ -TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ +TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{ext_name}.so" \ NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{__php} -n run-tests.php --show-diff || : ignore - -%if %{with_zts} -cd ../ZTS -: Minimal load test for ZTS extension -%{__ztsphp} --no-php-ini \ - --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} - -: Upstream test suite for ZTS extension -TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ -NO_INTERACTION=1 \ -REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php --show-diff -%endif +%{__php} -n run-tests.php --show-diff %files -%{!?_licensedir:%global license %%doc} -#license NTS/LICENSE -%doc NTS/{CREDITS,NEWS,README} +%license LICENSE +%doc composer.json +%doc AUTHORS +%doc NOTICE +%doc *.md %config(noreplace) %{php_inidir}/%{ini_name} -%{php_extdir}/%{pecl_name}.so - -%if %{with_zts} -%config(noreplace) %{php_ztsinidir}/%{ini_name} -%{php_ztsextdir}/%{pecl_name}.so -%endif +%{php_extdir}/%{ext_name}.so %changelog +* Fri Jun 19 2026 Remi Collet <remi@remirepo.net> - 1.4.0-1 +- update to 1.4.0 +- switch to XOlegator fork +- drop ZTS build +- re-license spec file to CECILL-2.1 +- add pie virtual provides + * Sun Aug 2 2020 Remi Collet <remi@remirepo.net> - 1.1.2-1 - update to 1.1.2 |
