diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-07-02 09:55:34 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-07-02 09:55:34 +0200 |
commit | ae0f44df91703671155add3e28a9fcfe62ef57e9 (patch) | |
tree | fd3e20b9efd0382b2d99b99b1198b3c9cfbc7296 | |
parent | b3500f62994353b8e652dcc71a6ac8d940b6bb92 (diff) |
php-pecl-yaf: 3.0.3
-rw-r--r-- | REFLECTION-PHP7 | 4 | ||||
-rw-r--r-- | php-pecl-yaf-php7.spec | 11 | ||||
-rw-r--r-- | yaf-pr289.patch | 145 |
3 files changed, 8 insertions, 152 deletions
diff --git a/REFLECTION-PHP7 b/REFLECTION-PHP7 index 86f047e..010eae3 100644 --- a/REFLECTION-PHP7 +++ b/REFLECTION-PHP7 @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #61 yaf version 3.0.2 ] { +Extension [ <persistent> extension #125 yaf version 3.0.3 ] { - Dependencies { Dependency [ spl (Required) ] @@ -40,7 +40,7 @@ Extension [ <persistent> extension #61 yaf version 3.0.2 ] { } - Constants [12] { - Constant [ string YAF_VERSION ] { 3.0.2 } + Constant [ string YAF_VERSION ] { 3.0.3 } Constant [ string YAF_ENVIRON ] { product } Constant [ integer YAF_ERR_STARTUP_FAILED ] { 512 } Constant [ integer YAF_ERR_ROUTE_FAILED ] { 513 } diff --git a/php-pecl-yaf-php7.spec b/php-pecl-yaf-php7.spec index e53ddde..ad775d1 100644 --- a/php-pecl-yaf-php7.spec +++ b/php-pecl-yaf-php7.spec @@ -22,12 +22,12 @@ Summary: Yet Another Framework Name: %{?sub_prefix}php-pecl-yaf -Version: 3.0.2 +Version: 3.0.3 %if 0%{?gh_date:1} Release: 0.8.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz %else -Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz %endif License: PHP @@ -35,8 +35,6 @@ Group: Development/Languages URL: http://pecl.php.net/package/yaf Source1: %{pecl_name}.ini -Patch0: %{pecl_name}-pr289.patch - BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: %{?scl_prefix}php-pear BuildRequires: pcre-devel @@ -101,7 +99,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -%patch0 -p1 -b .pr289 # Sanity check, really often broken extver=$(sed -n '/#define PHP_YAF_VERSION/{s/.*\t"//;s/".*$//;p}' php_yaf.h ) @@ -219,6 +216,10 @@ fi %changelog +* Sat Jul 2 2016 Remi Collet <remi@fedoraproject.org> - 3.0.3-1 +- update to 3.0.3 +- drop patch merged upstream + * Sat Jun 11 2016 Remi Collet <remi@fedoraproject.org> - 3.0.2-3 - add patch for PHP 7.1 open https://github.com/laruence/yaf/pull/289 diff --git a/yaf-pr289.patch b/yaf-pr289.patch deleted file mode 100644 index c0d8bc9..0000000 --- a/yaf-pr289.patch +++ /dev/null @@ -1,145 +0,0 @@ -From bd6ffea2ca669a1614d15fdd7322994a7c50e4d0 Mon Sep 17 00:00:00 2001 -From: Remi Collet <fedora@famillecollet.com> -Date: Sat, 11 Jun 2016 08:14:00 +0200 -Subject: [PATCH] fix for PHP 7.1 - ---- - requests/yaf_request_simple.c | 2 ++ - views/yaf_view_simple.c | 35 +++++++++++++++++++++++++++++++++-- - yaf_loader.c | 4 ++++ - 3 files changed, 39 insertions(+), 2 deletions(-) - -diff --git a/requests/yaf_request_simple.c b/requests/yaf_request_simple.c -index 475e424..efd5934 100644 ---- a/requests/yaf_request_simple.c -+++ b/requests/yaf_request_simple.c -@@ -254,8 +254,10 @@ YAF_STARTUP_FUNCTION(request_simple){ - yaf_request_simple_ce = zend_register_internal_class_ex(&ce, yaf_request_ce); - yaf_request_simple_ce->ce_flags |= ZEND_ACC_FINAL; - -+#if PHP_VERSION_ID < 70100 - zend_declare_class_constant_string(yaf_request_simple_ce, ZEND_STRL("SCHEME_HTTP"), "http"); - zend_declare_class_constant_string(yaf_request_simple_ce, ZEND_STRL("SCHEME_HTTPS"), "https"); -+#endif - - return SUCCESS; - } -diff --git a/views/yaf_view_simple.c b/views/yaf_view_simple.c -index 700661d..e436433 100644 ---- a/views/yaf_view_simple.c -+++ b/views/yaf_view_simple.c -@@ -102,12 +102,17 @@ static int yaf_view_simple_extract(zval *tpl_vars, zval *vars) /* {{{ */ { - - if (tpl_vars && Z_TYPE_P(tpl_vars) == IS_ARRAY) { - ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(tpl_vars), var_name, entry) { -+#if PHP_VERSION_ID < 70100 -+ zend_class_entry *scope = EG(scope); -+#else -+ zend_class_entry *scope = zend_get_executed_scope(); -+#endif - /* GLOBALS protection */ - if (zend_string_equals_literal(var_name, "GLOBALS")) { - continue; - } - -- if (zend_string_equals_literal(var_name, "this") && EG(scope) && ZSTR_LEN(EG(scope)->name) != 0) { -+ if (zend_string_equals_literal(var_name, "this") && scope && ZSTR_LEN(scope->name) != 0) { - continue; - } - -@@ -121,12 +126,17 @@ static int yaf_view_simple_extract(zval *tpl_vars, zval *vars) /* {{{ */ { - - if (vars && Z_TYPE_P(vars) == IS_ARRAY) { - ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(vars), var_name, entry) { -+#if PHP_VERSION_ID < 70100 -+ zend_class_entry *scope = EG(scope); -+#else -+ zend_class_entry *scope = zend_get_executed_scope(); -+#endif - /* GLOBALS protection */ - if (zend_string_equals_literal(var_name, "GLOBALS")) { - continue; - } - -- if (zend_string_equals_literal(var_name, "this") && EG(scope) && ZSTR_LEN(EG(scope)->name) != 0) { -+ if (zend_string_equals_literal(var_name, "this") && scope && ZSTR_LEN(scope->name) != 0) { - continue; - } - -@@ -257,15 +267,24 @@ int yaf_view_simple_display(yaf_view_t *view, zval *tpl, zval *vars, zval *ret) - - (void)yaf_view_simple_extract(tpl_vars, vars); - -+#if PHP_VERSION_ID < 70100 - old_scope = EG(scope); - EG(scope) = yaf_view_simple_ce; -+#else -+ old_scope = EG(fake_scope); -+ EG(fake_scope) = yaf_view_simple_ce; -+#endif - - if (IS_ABSOLUTE_PATH(Z_STRVAL_P(tpl), Z_STRLEN_P(tpl))) { - script = Z_STRVAL_P(tpl); - len = Z_STRLEN_P(tpl); - if (yaf_loader_import(script, len, 0) == 0) { - yaf_trigger_error(YAF_ERR_NOTFOUND_VIEW, "Failed opening template %s: %s" , script, strerror(errno)); -+#if PHP_VERSION_ID < 70100 - EG(scope) = old_scope; -+#else -+ EG(fake_scope) = old_scope; -+#endif - return 0; - } - } else { -@@ -278,7 +297,11 @@ int yaf_view_simple_display(yaf_view_t *view, zval *tpl, zval *vars, zval *ret) - yaf_trigger_error(YAF_ERR_NOTFOUND_VIEW, - "Could not determine the view script path, you should call %s::setScriptPath to specific it", - ZSTR_VAL(yaf_view_simple_ce->name)); -+#if PHP_VERSION_ID < 70100 - EG(scope) = old_scope; -+#else -+ EG(fake_scope) = old_scope; -+#endif - return 0; - } - } else { -@@ -288,13 +311,21 @@ int yaf_view_simple_display(yaf_view_t *view, zval *tpl, zval *vars, zval *ret) - if (yaf_loader_import(script, len, 0) == 0) { - yaf_trigger_error(YAF_ERR_NOTFOUND_VIEW, "Failed opening template %s: %s", script, strerror(errno)); - efree(script); -+#if PHP_VERSION_ID < 70100 - EG(scope) = old_scope; -+#else -+ EG(fake_scope) = old_scope; -+#endif - return 0; - } - efree(script); - } - -+#if PHP_VERSION_ID < 70100 - EG(scope) = old_scope; -+#else -+ EG(fake_scope) = old_scope; -+#endif - - return 1; - } -diff --git a/yaf_loader.c b/yaf_loader.c -index a345d58..d5cd20a 100644 ---- a/yaf_loader.c -+++ b/yaf_loader.c -@@ -83,9 +83,13 @@ int yaf_loader_register(yaf_loader_t *loader) /* {{{ */ { - do { - zend_fcall_info fci = { - sizeof(fci), -+#if PHP_VERSION_ID < 70100 - EG(function_table), -+#endif - function, -+#if PHP_VERSION_ID < 70100 - NULL, -+#endif - &ret, - params, - NULL, |