From: Thibault M. <thi...@gm...> - 2018-06-30 18:22:02
|
Hi list, I have upgraded my system to php-7 and I was getting a few php warnings and errors. The attached patch (applied to the bleeding-edge branch) is my first attempt at fixing these. 1 preg_replace_callback ======================= The `/e' flag for `preg_replace' has been deprecated (<http://php.net/manual/en/function.preg-replace.php>) and should be replaced by `preg_replace_callback'. The attached patch replaces occurrences in the code. An earlier commit fixed one instance (<https://sourceforge.net/p/refbase/code/1417/tree//trunk/includes/include.inc.php?diff=58eee4b2a02bb1117c891ee8:1416> in `includes/include.inc.php' @@ -2043,7 +2041,13 @@). A significant change in this patch is in the `searchReplaceText' function (`includes/include.inc.php') which now accepts `callable' replacements. 2 Field information =================== The `getMySQLFieldInfo' function has seen some changes in the way it manages some of the fields returned by `mysqli_fetch_field_direct': r1420 re-add inadvertently deleted fieldInfoArrays r1418 remove attributes that don't seem to be present in mysqli-result::fetch_field_direct and don't seem to be used I believe that, while the old `mysql_fetch_field_direct' method was returning the fields `not_null', `primary_key', `unique_key', `multiple_key', `numeric', `blob', `unsigned', `zerofill', the `mysqli_fetch_field_direct' version returns this information via the `flags' field (<http://php.net/manual/en/mysqli-result.fetch-field-direct.php>, <https://stackoverflow.com/questions/34989329/convert-mysql-field-flags-to-mysqli>). The proposed patch attempts to fix this. 3 mysql wrapper =============== This is not included in the attached patch, but I had started to wrap all mysql calls in a function that uses mysqli for recent php versions and mysql for older version; is this something of interest? I could propose a separate patch for this if it is a desirable feature. Please let me know. Please let me know if there are questions or comments about this patch. Thanks, thibault |