1From 3.2 to 3.3 2=============== 3 4.. contents:: Contents 5 :local: 6 :depth: 1 7 8 9PHP Version 10----------- 11 12PHP 7.1 has reached `end of life`_ in December 2019. To ensure that Elgg sites are secure, we now require PHP 7.2 for new installations. 13 14If upgrading from a previous Elgg installation make sure you have the correct PHP version installed. 15 16In order to be able to test Elgg on PHP 7.4 we had to update the PHPUnit testsuite to version 8.5. This may require some rewrites of your 17own unit/integration tests. 18 19.. _end of life: https://www.php.net/eol.php 20 21Simpler use of 'default' layout 22------------------------------- 23 24Currently a common pattern is to do the following: 25 26.. code-block:: php 27 28 $title = 'All blogs'; 29 30 $content = elgg_list_entities([ 31 'type' => 'object', 32 'subtype' => 'blog', 33 ]); 34 35 $layout = elgg_view_layout('default', [ 36 'title' => $title, 37 'content' => $content, 38 ]); 39 40 echo elgg_view_page($title, $layout); 41 42We made this kind of pattern simpler. You can now pass an array of layout options to the second parameter of `elgg_view_page`. 43The `elgg_view_page` function will use this array to wrap it in the 'default' layout. It also adds the page title to the layout. 44 45The new way to do it is: 46 47.. code-block:: php 48 49 echo elgg_view_page('All blogs', [ 50 'content' => elgg_list_entities([ 51 'type' => 'object', 52 'subtype' => 'blog', 53 ]), 54 ]); 55 56Deprecated layout names 57----------------------- 58 59For an easy transition from Elgg 2.x to 3.x we kept some old layout names ('one_sidebar', 'one_column', 'two_sidebar' and 'content') intact 60when used in the `elgg_view_layout` function. As of Elgg 3.3 these layout names are deprecated and you should update your code to use the new 'default' layout. 61 62When changing the use of the 'content' layout name you should take into consideration that the the 'content' generates a filter menu. 63This menu is slightly different from the regular 'filter' menu generated in the 'default' layout. It uses different hook names. 64If you already disabled the filter in your layout you can change the layout without any issues. 65 66Plugin Manifest changes 67----------------------- 68 69We are working towards the removal of the plugin manifest file. Some features of the manifest will be replaced and some will be dropped. 70To make this transition a bit easier we have already deprecated the following ``ElggPluginManifest`` api functions: 71 72* ``getCopyright()`` 73* ``getDonationsPageURL()`` 74* ``getSuggests()`` use suggestions in composer 75 76Deprecated APIs 77--------------- 78 79 * ``elgg_disable_query_cache()`` 80 * ``elgg_enable_query_cache()`` 81 * ``elgg_format_attributes()`` use ``elgg_format_element()`` 82 * ``elgg_flush_caches()`` use ``elgg_clear_caches()`` 83 * ``elgg_get_menu_item()`` 84 * ``elgg_get_ordered_event_handlers()`` use ``elgg()->events->getOrderedHandlers()`` 85 * ``elgg_get_ordered_hook_handlers()`` use ``elgg()->hooks->getOrderedHandlers()`` 86 * ``elgg_invalidate_simplecache()`` use ``elgg_clear_caches()`` 87 * ``elgg_is_menu_item_registered()`` 88 * ``elgg_view_entity_annotations()`` 89 * ``execute_delayed_write_query()`` use ``elgg()->db->registerDelayedQuery()`` 90 * ``execute_delayed_read_query()`` use ``elgg()->db->registerDelayedQuery()`` 91 * ``run_sql_script()`` 92 * ``elgg_unset_all_plugin_settings()`` use ``\ElggPlugin::unsetAllSettings()`` 93 * ``elgg_get_file_simple_type()`` use ``elgg()->mimetype->getSimpleType()`` 94 * ``ElggFile::detectMimeType()`` use ``elgg()->mimetype->getMimeType()`` 95 * ``generate_action_token()`` use ``elgg()->csrf->generateActionToken()`` 96 * ``elgg_split()`` 97 98Deprecated Config values 99------------------------ 100 101 * ``simplecache_lastupdate`` use ``lastcache`` 102 103Deprecated CLI commands 104----------------------- 105 106 * ``elgg-cli flush`` use ``elgg-cli cache:clear`` 107 108Deprecated Hooks 109---------------- 110 111 * **entity:annotate, <entity_type>** 112