as some of you already noticed, there are some bigger issues for running some of the latest controllers on php 5.6/7.x. Mainly there are three tasks to perform in order to prepare the controllers to run on php 7.
1. Mysql deprecation
There is already a post  outside covering this for xaseco. It advertises a small plugin coded by reaby that basically does a wrap-up of the obsoleted mysql API and internally uses the mysqli api. I am not aware of the state of other controllers than xaseco and manialive here. Although this solution might work for you, there is a better way, which includes a little more effort. However, if you are just for an "it just works"-solution, you might be happy with it.
Anyway. it is only about replacing the old api. I always prefer using the object-orientated style. I did simply use some regex-enabled code editor and did a quick search and replace on those api parts. This worked for me very well, but keep in mind, that unless the plugin author will use the mysqli api in further releases, you would have to adapt this every time. So maybe, this is not the best solution for you. If you wanna go this way to hell, you can use these regexes for search-n-replace (each first line is search query, next is replacement):
Code: Select all
mysql_(query|ping|select_db)\((.*?)\) \$aseco->db->$1($2) mysql_(fetch_array|fetch_object|fetch_assoc|fetch_row)\((.*?)\) $2->$1() mysql_free_result\((.*?)\) $1->free() mysql_num_rows\((.*?)\) $1->num_rows mysql_(affected_rows|error|errno)\(\) \$aseco->db->$1
2. Memory leaks
Even if you got your controller running with the patch of reaby listed above, it won't run for long as there are several memory leaks present in the current versions of xaseco (1.16), fast (3.2.3t/4.0.0t) and probably other server controllers as well. All of them reside in the fact, that the resource handling was changed to a more strict one beginning with PHP7.0.
For those controllers, this means the usage of the xml_parser component inside three major components:
- Parsing incoming XMLRPC/GbxRemote messages from the gameserver
- Parsing the mapfile metadata
- Parsing various configuration files (not the variant that uses simplexml_load_xy)
Manialive isn't affected again, as they did use the simplexml_load_string function, which does not use a resource and therefore is not affected.
3. Even more deprecation
There are a few more deprecated functions, here is a list of obsoleted functions and their possible replacement:
- split() -> explode()
- If I remember more, I will update this post
: "modernizer" plugin by reaby for mysql/mysqli API convergence - viewtopic.php?f=127&t=35817
: patched files including the memory leak fix - https://ftp.bueddl.de/tm/php7_patches/