com php-src: some extension to the porting doc: compat/PECL_P ORTING
| From: | Anatol Belski | Date: | Fri, 24 Jan 2014 03:15:50 +0000 |
| Subject: | com php-src: some extension to the porting doc: compat/PECL_P ORTING | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75775@lists.php.net to get a copy of this message | ||
Commit: 9debf41bfd65dc0088992aa30e3e68d70225191e
Author: Anatol Belski <ab@php.net> Fri, 24 Jan 2014 03:24:43 +0100
Parents: daa34699afc1dd1664fdca408a407d508a0168d7
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9debf41bfd65dc0088992aa30e3e68d70225191e
Log:
some extension to the porting doc
Changed paths:
M compat/PECL_PORTING
Diff:
diff --git a/compat/PECL_PORTING b/compat/PECL_PORTING
index 9acd7c1..1b3a916 100644
--- a/compat/PECL_PORTING
+++ b/compat/PECL_PORTING
@@ -115,7 +115,7 @@ II. Porting steps
variable of type php_int_t to be passed. The string/path lengths are expected
to be of type php_size_t.
- The recommended way to declare the argument specs is using the ternary operator,
+ A possible way to declare the argument specs were using the ternary operator,
eq.
#define COMP (PHP_MAJOR_VERSION < 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION
< 6)
@@ -128,6 +128,7 @@ II. Porting steps
return;
}
+
iv. Manual code fixes
While for many extensions the mechanic replacements will do the big job to
@@ -136,6 +137,12 @@ II. Porting steps
this is likely the case for extensions with library dependencies, see also the
pitfalls section.
+ After adjusting the variable types in zpp, the first places you automatically should
+ look for are the functions where you pass the parameters. Especially those accepting
+ integers by reference might be broken. If those functions are your own implementations,
+ it might make sense you to adapt the function signatures. In case of some library
+ functions an intermediate variable of an appropriate type can be used.
+
v. Library dependencies
Libraries using incompatible data types for string sizes and integers require
@@ -167,6 +174,14 @@ II. Porting steps
return;
}
+
+ Please note, that the replacement tool will not do automatic replacements for the %ld
+ and other specs. It's up to the porter where such replacement were appropriate.
+ To ease the process, some automatic still could be used, like here how it could
+ be done in vim
+
+ :%s,%ld," ZEND_INT_FMT ",g
+
vii. Array API
Datatype for array indexes was changed to php_uint_t, for key lengths to php_size_t