mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #43053
[Bug 1693559] A patch has been submitted for review
Patch for "master" branch: https://reviews.mahara.org/7838
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1693559
Title:
Fix remaining PHP7 compatibility problems
Status in Mahara:
Triaged
Bug description:
Mahara 16.10.4.
Used https://github.com/JakubOnderka/PHP-Parallel-Lint to lint the
Mahara codebase, found these issues:
------------------------------------------------------------
Parse error: mahara/auth/saml/extlib/simplesamlphp/vendor/openid/php-openid/Tests/Auth/OpenID/StoreTest.php:699
697| $db->query("USE $temp_db_name");
698|
> 699| $store =& new Auth_OpenID_MDB2Store($db);
700| if (!$store->createTables()) {
701| $this->fail("Failed to create tables");
Unexpected 'new' (T_NEW)
------------------------------------------------------------
Parse error: mahara/lib/elastica/lib/Elastica/Filter/Bool.php:13
11| * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-filter.html
12| */
> 13| class Bool extends BoolFilter
14| {
15| }
Fatal error: Cannot use 'Bool' as class name as it is reserved
------------------------------------------------------------
Parse error: mahara/lib/elastica/lib/Elastica/Query/Bool.php:13
11| * @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html
12| */
> 13| class Bool extends BoolQuery
14| {
15| }
Fatal error: Cannot use 'Bool' as class name as it is reserved
------------------------------------------------------------
Parse error: mahara/lib/elastica/lib/Elastica/Transport/Null.php:11
9| * @author James Boehmer <james.boehmer@xxxxxxxxxxxxxxxx>
10| */
> 11| class Null extends NullTransport
12| {
13| }
Fatal error: Cannot use 'Null' as class name as it is reserved
------------------------------------------------------------
There is also another tool that finds several other errors in the
codebase, https://github.com/sstalle/php7cc - in particular this one
will error:
File: search/internal/lib.php
> Line 1281: Removed regular expression modifier "e" used
preg_replace('/&(#x?)?([A-Za-z0-9]+);/e', '_decode_entities("$1", "$2", "$0", $newtable, $exclude)', $text);
There is another modifier "e" usage, but looks like it is only used in
a 2009 upgrade step. There are MANY more warnings, deprecations and
errors reported.
Yet another tool to check compatibility is
https://github.com/wimg/PHPCompatibility which mostly reports the same
information as php7cc, but it is harder to use. It does however have
support for PHP7.1.
Cheers!
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1693559/+subscriptions
References