1a3dc3edaSGreg Roach<?php 2a3dc3edaSGreg Roach/** 3a3dc3edaSGreg Roach * webtrees: online genealogy 4*8fcd0d32SGreg Roach * Copyright (C) 2019 webtrees development team 5a3dc3edaSGreg Roach * This program is free software: you can redistribute it and/or modify 6a3dc3edaSGreg Roach * it under the terms of the GNU General Public License as published by 7a3dc3edaSGreg Roach * the Free Software Foundation, either version 3 of the License, or 8a3dc3edaSGreg Roach * (at your option) any later version. 9a3dc3edaSGreg Roach * This program is distributed in the hope that it will be useful, 10a3dc3edaSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 11a3dc3edaSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12a3dc3edaSGreg Roach * GNU General Public License for more details. 13a3dc3edaSGreg Roach * You should have received a copy of the GNU General Public License 14a3dc3edaSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 15a3dc3edaSGreg Roach */ 16e7f56f2aSGreg Roachdeclare(strict_types=1); 17e7f56f2aSGreg Roach 18a3dc3edaSGreg Roachnamespace Fisharebest\Webtrees\Services; 19a3dc3edaSGreg Roach 20a3dc3edaSGreg Roachuse Exception; 21a3dc3edaSGreg Roachuse Fisharebest\Webtrees\Database; 22a3dc3edaSGreg Roachuse League\Flysystem\Filesystem; 23a3dc3edaSGreg Roach 24a3dc3edaSGreg Roach/** 25a3dc3edaSGreg Roach * Clean up old data, files and folders. 26a3dc3edaSGreg Roach */ 27a3dc3edaSGreg Roachclass HousekeepingService 28a3dc3edaSGreg Roach{ 29a3dc3edaSGreg Roach // This is a list of old files and directories, from earlier versions of webtrees. 30a3dc3edaSGreg Roach // git diff 1.7.9..master --name-status | grep ^D 31a3dc3edaSGreg Roach const OLD_PATHS = [ 32a3dc3edaSGreg Roach // Removed in 1.0.2 33a3dc3edaSGreg Roach 'language/en.mo', 34a3dc3edaSGreg Roach // Removed in 1.0.3 35a3dc3edaSGreg Roach 'themechange.php', 36a3dc3edaSGreg Roach // Removed in 1.1.0 37a3dc3edaSGreg Roach 'addremotelink.php', 38a3dc3edaSGreg Roach 'addsearchlink.php', 39a3dc3edaSGreg Roach 'client.php', 40a3dc3edaSGreg Roach 'dir_editor.php', 41a3dc3edaSGreg Roach 'editconfig_gedcom.php', 42a3dc3edaSGreg Roach 'editgedcoms.php', 43a3dc3edaSGreg Roach 'edit_merge.php', 44a3dc3edaSGreg Roach 'edit_news.php', 45a3dc3edaSGreg Roach 'genservice.php', 46a3dc3edaSGreg Roach 'logs.php', 47a3dc3edaSGreg Roach 'manageservers.php', 48a3dc3edaSGreg Roach 'media.php', 49a3dc3edaSGreg Roach 'module_admin.php', 50a3dc3edaSGreg Roach //WT_ROOT.'modules', // Do not delete - users may have stored custom modules/data here 51a3dc3edaSGreg Roach 'opensearch.php', 52a3dc3edaSGreg Roach 'PEAR.php', 53a3dc3edaSGreg Roach 'pgv_to_wt.php', 54a3dc3edaSGreg Roach 'places', 55a3dc3edaSGreg Roach //WT_ROOT.'robots.txt', // Do not delete this - it may contain user data 56a3dc3edaSGreg Roach 'serviceClientTest.php', 57a3dc3edaSGreg Roach 'siteconfig.php', 58a3dc3edaSGreg Roach 'SOAP', 59a3dc3edaSGreg Roach 'themes/clouds/mozilla.css', 60a3dc3edaSGreg Roach 'themes/clouds/netscape.css', 61a3dc3edaSGreg Roach 'themes/colors/mozilla.css', 62a3dc3edaSGreg Roach 'themes/colors/netscape.css', 63a3dc3edaSGreg Roach 'themes/fab/mozilla.css', 64a3dc3edaSGreg Roach 'themes/fab/netscape.css', 65a3dc3edaSGreg Roach 'themes/minimal/mozilla.css', 66a3dc3edaSGreg Roach 'themes/minimal/netscape.css', 67a3dc3edaSGreg Roach 'themes/webtrees/mozilla.css', 68a3dc3edaSGreg Roach 'themes/webtrees/netscape.css', 69a3dc3edaSGreg Roach 'themes/webtrees/style_rtl.css', 70a3dc3edaSGreg Roach 'themes/xenea/mozilla.css', 71a3dc3edaSGreg Roach 'themes/xenea/netscape.css', 72a3dc3edaSGreg Roach 'uploadmedia.php', 73a3dc3edaSGreg Roach 'useradmin.php', 74a3dc3edaSGreg Roach 'webservice', 75a3dc3edaSGreg Roach 'wtinfo.php', 76a3dc3edaSGreg Roach // Removed in 1.1.2 77a3dc3edaSGreg Roach 'treenav.php', 78a3dc3edaSGreg Roach // Removed in 1.2.0 79a3dc3edaSGreg Roach 'themes/clouds/jquery', 80a3dc3edaSGreg Roach 'themes/colors/jquery', 81a3dc3edaSGreg Roach 'themes/fab/jquery', 82a3dc3edaSGreg Roach 'themes/minimal/jquery', 83a3dc3edaSGreg Roach 'themes/webtrees/jquery', 84a3dc3edaSGreg Roach 'themes/xenea/jquery', 85a3dc3edaSGreg Roach // Removed in 1.2.2 86a3dc3edaSGreg Roach 'themes/clouds/chrome.css', 87a3dc3edaSGreg Roach 'themes/clouds/opera.css', 88a3dc3edaSGreg Roach 'themes/clouds/print.css', 89a3dc3edaSGreg Roach 'themes/clouds/style_rtl.css', 90a3dc3edaSGreg Roach 'themes/colors/chrome.css', 91a3dc3edaSGreg Roach 'themes/colors/opera.css', 92a3dc3edaSGreg Roach 'themes/colors/print.css', 93a3dc3edaSGreg Roach 'themes/colors/style_rtl.css', 94a3dc3edaSGreg Roach 'themes/fab/chrome.css', 95a3dc3edaSGreg Roach 'themes/fab/opera.css', 96a3dc3edaSGreg Roach 'themes/minimal/chrome.css', 97a3dc3edaSGreg Roach 'themes/minimal/opera.css', 98a3dc3edaSGreg Roach 'themes/minimal/print.css', 99a3dc3edaSGreg Roach 'themes/minimal/style_rtl.css', 100a3dc3edaSGreg Roach 'themes/xenea/chrome.css', 101a3dc3edaSGreg Roach 'themes/xenea/opera.css', 102a3dc3edaSGreg Roach 'themes/xenea/print.css', 103a3dc3edaSGreg Roach 'themes/xenea/style_rtl.css', 104a3dc3edaSGreg Roach // Removed in 1.2.3 105a3dc3edaSGreg Roach //WT_ROOT.'modules_v2', // Do not delete - users may have stored custom modules/data here 106a3dc3edaSGreg Roach // Removed in 1.2.4 107a3dc3edaSGreg Roach 'modules_v3/gedcom_favorites/help_text.php', 108a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/_MEDIA/media_3_find.php', 109a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/_MEDIA/media_3_search_add.php', 110a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/_MEDIA/media_5_input.js', 111a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/_MEDIA/media_5_input.php', 112a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php', 113a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/_MEDIA/media_query_1a.php', 114a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/_MEDIA/media_query_2a.php', 115a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/_MEDIA/media_query_3a.php', 116a3dc3edaSGreg Roach 'modules_v3/lightbox/css/album_page_RTL2.css', 117a3dc3edaSGreg Roach 'modules_v3/lightbox/css/album_page_RTL.css', 118a3dc3edaSGreg Roach 'modules_v3/lightbox/css/album_page_RTL_ff.css', 119a3dc3edaSGreg Roach 'modules_v3/lightbox/css/clearbox_music.css', 120a3dc3edaSGreg Roach 'modules_v3/lightbox/css/clearbox_music_RTL.css', 121a3dc3edaSGreg Roach 'modules_v3/user_favorites/db_schema', 122a3dc3edaSGreg Roach 'modules_v3/user_favorites/help_text.php', 123a3dc3edaSGreg Roach 'search_engine.php', 124a3dc3edaSGreg Roach 'themes/clouds/modules.css', 125a3dc3edaSGreg Roach 'themes/colors/modules.css', 126a3dc3edaSGreg Roach 'themes/fab/modules.css', 127a3dc3edaSGreg Roach 'themes/minimal/modules.css', 128a3dc3edaSGreg Roach 'themes/webtrees/modules.css', 129a3dc3edaSGreg Roach 'themes/xenea/modules.css', 130a3dc3edaSGreg Roach // Removed in 1.2.5 131a3dc3edaSGreg Roach 'modules_v3/clippings/index.php', 132a3dc3edaSGreg Roach 'modules_v3/googlemap/css/googlemap_style.css', 133a3dc3edaSGreg Roach 'modules_v3/googlemap/css/wt_v3_places_edit.css', 134a3dc3edaSGreg Roach 'modules_v3/googlemap/index.php', 135a3dc3edaSGreg Roach 'modules_v3/lightbox/index.php', 136a3dc3edaSGreg Roach 'modules_v3/recent_changes/help_text.php', 137a3dc3edaSGreg Roach 'modules_v3/todays_events/help_text.php', 138a3dc3edaSGreg Roach 'sidebar.php', 139a3dc3edaSGreg Roach // Removed in 1.2.6 140a3dc3edaSGreg Roach 'modules_v3/sitemap/admin_index.php', 141a3dc3edaSGreg Roach 'modules_v3/sitemap/help_text.php', 142a3dc3edaSGreg Roach 'modules_v3/tree/css/styles', 143a3dc3edaSGreg Roach 'modules_v3/tree/css/treebottom.gif', 144a3dc3edaSGreg Roach 'modules_v3/tree/css/treebottomleft.gif', 145a3dc3edaSGreg Roach 'modules_v3/tree/css/treebottomright.gif', 146a3dc3edaSGreg Roach 'modules_v3/tree/css/tree.jpg', 147a3dc3edaSGreg Roach 'modules_v3/tree/css/treeleft.gif', 148a3dc3edaSGreg Roach 'modules_v3/tree/css/treeright.gif', 149a3dc3edaSGreg Roach 'modules_v3/tree/css/treetop.gif', 150a3dc3edaSGreg Roach 'modules_v3/tree/css/treetopleft.gif', 151a3dc3edaSGreg Roach 'modules_v3/tree/css/treetopright.gif', 152a3dc3edaSGreg Roach 'modules_v3/tree/css/treeview_print.css', 153a3dc3edaSGreg Roach 'modules_v3/tree/help_text.php', 154a3dc3edaSGreg Roach 'modules_v3/tree/images/print.png', 155a3dc3edaSGreg Roach // Removed in 1.2.7 156a3dc3edaSGreg Roach 'login_register.php', 157a3dc3edaSGreg Roach 'modules_v3/top10_givnnames/help_text.php', 158a3dc3edaSGreg Roach 'modules_v3/top10_surnames/help_text.php', 159a3dc3edaSGreg Roach // Removed in 1.3.0 160a3dc3edaSGreg Roach 'admin_site_ipaddress.php', 161a3dc3edaSGreg Roach 'downloadgedcom.php', 162a3dc3edaSGreg Roach 'export_gedcom.php', 163a3dc3edaSGreg Roach 'gedcheck.php', 164a3dc3edaSGreg Roach 'images', 165a3dc3edaSGreg Roach 'modules_v3/googlemap/admin_editconfig.php', 166a3dc3edaSGreg Roach 'modules_v3/googlemap/admin_placecheck.php', 167a3dc3edaSGreg Roach 'modules_v3/googlemap/flags.php', 168a3dc3edaSGreg Roach 'modules_v3/googlemap/images/pedigree_map.gif', 169a3dc3edaSGreg Roach 'modules_v3/googlemap/pedigree_map.php', 170a3dc3edaSGreg Roach 'modules_v3/lightbox/admin_config.php', 171a3dc3edaSGreg Roach 'modules_v3/lightbox/album.php', 172a3dc3edaSGreg Roach 'modules_v3/tree/css/vline.jpg', 173a3dc3edaSGreg Roach // Removed in 1.3.1 174a3dc3edaSGreg Roach 'imageflush.php', 175a3dc3edaSGreg Roach 'modules_v3/googlemap/wt_v3_pedigree_map.js.php', 176a3dc3edaSGreg Roach 'modules_v3/lightbox/js/tip_balloon_RTL.js', 177a3dc3edaSGreg Roach // Removed in 1.3.2 178a3dc3edaSGreg Roach 'modules_v3/address_report', 179a3dc3edaSGreg Roach 'modules_v3/lightbox/functions/lb_horiz_sort.php', 180a3dc3edaSGreg Roach 'modules_v3/random_media/help_text.php', 181a3dc3edaSGreg Roach // Removed in 1.4.0 182a3dc3edaSGreg Roach 'imageview.php', 183a3dc3edaSGreg Roach 'media/MediaInfo.txt', 184a3dc3edaSGreg Roach 'media/thumbs/ThumbsInfo.txt', 185a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/css/media_0_inverselink.css', 186a3dc3edaSGreg Roach 'modules_v3/lightbox/help_text.php', 187a3dc3edaSGreg Roach 'modules_v3/lightbox/images/blank.gif', 188a3dc3edaSGreg Roach 'modules_v3/lightbox/images/close_1.gif', 189a3dc3edaSGreg Roach 'modules_v3/lightbox/images/image_add.gif', 190a3dc3edaSGreg Roach 'modules_v3/lightbox/images/image_copy.gif', 191a3dc3edaSGreg Roach 'modules_v3/lightbox/images/image_delete.gif', 192a3dc3edaSGreg Roach 'modules_v3/lightbox/images/image_edit.gif', 193a3dc3edaSGreg Roach 'modules_v3/lightbox/images/image_link.gif', 194a3dc3edaSGreg Roach 'modules_v3/lightbox/images/images.gif', 195a3dc3edaSGreg Roach 'modules_v3/lightbox/images/image_view.gif', 196a3dc3edaSGreg Roach 'modules_v3/lightbox/images/loading.gif', 197a3dc3edaSGreg Roach 'modules_v3/lightbox/images/next.gif', 198a3dc3edaSGreg Roach 'modules_v3/lightbox/images/nextlabel.gif', 199a3dc3edaSGreg Roach 'modules_v3/lightbox/images/norm_2.gif', 200a3dc3edaSGreg Roach 'modules_v3/lightbox/images/overlay.png', 201a3dc3edaSGreg Roach 'modules_v3/lightbox/images/prev.gif', 202a3dc3edaSGreg Roach 'modules_v3/lightbox/images/prevlabel.gif', 203a3dc3edaSGreg Roach 'modules_v3/lightbox/images/private.gif', 204a3dc3edaSGreg Roach 'modules_v3/lightbox/images/slideshow.jpg', 205a3dc3edaSGreg Roach 'modules_v3/lightbox/images/transp80px.gif', 206a3dc3edaSGreg Roach 'modules_v3/lightbox/images/zoom_1.gif', 207a3dc3edaSGreg Roach 'modules_v3/lightbox/js', 208a3dc3edaSGreg Roach 'modules_v3/lightbox/music', 209a3dc3edaSGreg Roach 'modules_v3/lightbox/pic', 210a3dc3edaSGreg Roach 'themes/webtrees/chrome.css', 211a3dc3edaSGreg Roach // Removed in 1.4.1 212a3dc3edaSGreg Roach 'modules_v3/lightbox/images/image_edit.png', 213a3dc3edaSGreg Roach 'modules_v3/lightbox/images/image_view.png', 214a3dc3edaSGreg Roach // Removed in 1.4.2 215a3dc3edaSGreg Roach 'modules_v3/lightbox/images/image_view.png', 216a3dc3edaSGreg Roach 'modules_v3/top10_pageviews/help_text.php', 217a3dc3edaSGreg Roach 'themes/clouds/jquery-ui-1.10.0', 218a3dc3edaSGreg Roach 'themes/colors/jquery-ui-1.10.0', 219a3dc3edaSGreg Roach 'themes/fab/jquery-ui-1.10.0', 220a3dc3edaSGreg Roach 'themes/minimal/jquery-ui-1.10.0', 221a3dc3edaSGreg Roach 'themes/webtrees/jquery-ui-1.10.0', 222a3dc3edaSGreg Roach 'themes/xenea/jquery-ui-1.10.0', 223a3dc3edaSGreg Roach // Removed in 1.5.0 224a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/_CENS/census_note_decode.php', 225a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/_CENS/census_asst_date.php', 226a3dc3edaSGreg Roach 'modules_v3/googlemap/wt_v3_googlemap.js.php', 227a3dc3edaSGreg Roach 'modules_v3/lightbox/functions/lightbox_print_media.php', 228a3dc3edaSGreg Roach 'modules_v3/upcoming_events/help_text.php', 229a3dc3edaSGreg Roach 'modules_v3/stories/help_text.php', 230a3dc3edaSGreg Roach 'modules_v3/user_messages/help_text.php', 231a3dc3edaSGreg Roach 'themes/clouds/favicon.png', 232a3dc3edaSGreg Roach 'themes/clouds/images', 233a3dc3edaSGreg Roach 'themes/clouds/msie.css', 234a3dc3edaSGreg Roach 'themes/clouds/style.css', 235a3dc3edaSGreg Roach 'themes/colors/css', 236a3dc3edaSGreg Roach 'themes/colors/favicon.png', 237a3dc3edaSGreg Roach 'themes/colors/images', 238a3dc3edaSGreg Roach 'themes/colors/ipad.css', 239a3dc3edaSGreg Roach 'themes/colors/msie.css', 240a3dc3edaSGreg Roach 'themes/fab/favicon.png', 241a3dc3edaSGreg Roach 'themes/fab/images', 242a3dc3edaSGreg Roach 'themes/fab/msie.css', 243a3dc3edaSGreg Roach 'themes/fab/style.css', 244a3dc3edaSGreg Roach 'themes/minimal/favicon.png', 245a3dc3edaSGreg Roach 'themes/minimal/images', 246a3dc3edaSGreg Roach 'themes/minimal/msie.css', 247a3dc3edaSGreg Roach 'themes/minimal/style.css', 248a3dc3edaSGreg Roach 'themes/webtrees/favicon.png', 249a3dc3edaSGreg Roach 'themes/webtrees/images', 250a3dc3edaSGreg Roach 'themes/webtrees/msie.css', 251a3dc3edaSGreg Roach 'themes/webtrees/style.css', 252a3dc3edaSGreg Roach 'themes/xenea/favicon.png', 253a3dc3edaSGreg Roach 'themes/xenea/images', 254a3dc3edaSGreg Roach 'themes/xenea/msie.css', 255a3dc3edaSGreg Roach 'themes/xenea/style.css', 256a3dc3edaSGreg Roach // Removed in 1.5.1 257a3dc3edaSGreg Roach 'themes/clouds/css-1.5.0', 258a3dc3edaSGreg Roach 'themes/colors/css-1.5.0', 259a3dc3edaSGreg Roach 'themes/fab/css-1.5.0', 260a3dc3edaSGreg Roach 'themes/minimal/css-1.5.0', 261a3dc3edaSGreg Roach 'themes/webtrees/css-1.5.0', 262a3dc3edaSGreg Roach 'themes/xenea/css-1.5.0', 263a3dc3edaSGreg Roach // Removed in 1.5.2 264a3dc3edaSGreg Roach 'themes/clouds/css-1.5.1', 265a3dc3edaSGreg Roach 'themes/colors/css-1.5.1', 266a3dc3edaSGreg Roach 'themes/fab/css-1.5.1', 267a3dc3edaSGreg Roach 'themes/minimal/css-1.5.1', 268a3dc3edaSGreg Roach 'themes/webtrees/css-1.5.1', 269a3dc3edaSGreg Roach 'themes/xenea/css-1.5.1', 270a3dc3edaSGreg Roach // Removed in 1.5.3 271a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/_CENS/census_asst_help.php', 272a3dc3edaSGreg Roach 'modules_v3/googlemap/admin_places.php', 273a3dc3edaSGreg Roach 'modules_v3/googlemap/defaultconfig.php', 274a3dc3edaSGreg Roach 'modules_v3/googlemap/googlemap.php', 275a3dc3edaSGreg Roach 'modules_v3/googlemap/placehierarchy.php', 276a3dc3edaSGreg Roach 'modules_v3/googlemap/places_edit.php', 277a3dc3edaSGreg Roach 'modules_v3/googlemap/util.js', 278a3dc3edaSGreg Roach 'modules_v3/googlemap/wt_v3_places_edit.js.php', 279a3dc3edaSGreg Roach 'modules_v3/googlemap/wt_v3_places_edit_overlays.js.php', 280a3dc3edaSGreg Roach 'modules_v3/googlemap/wt_v3_street_view.php', 281a3dc3edaSGreg Roach 'readme.html', 282a3dc3edaSGreg Roach 'themes/clouds/css-1.5.2', 283a3dc3edaSGreg Roach 'themes/colors/css-1.5.2', 284a3dc3edaSGreg Roach 'themes/fab/css-1.5.2', 285a3dc3edaSGreg Roach 'themes/minimal/css-1.5.2', 286a3dc3edaSGreg Roach 'themes/webtrees/css-1.5.2', 287a3dc3edaSGreg Roach 'themes/xenea/css-1.5.2', 288a3dc3edaSGreg Roach // Removed in 1.6.0 289a3dc3edaSGreg Roach 'downloadbackup.php', 290a3dc3edaSGreg Roach 'modules_v3/ckeditor/ckeditor-4.3.2-custom', 291a3dc3edaSGreg Roach 'site-php-version.php', 292a3dc3edaSGreg Roach 'themes/clouds/css-1.5.3', 293a3dc3edaSGreg Roach 'themes/colors/css-1.5.3', 294a3dc3edaSGreg Roach 'themes/fab/css-1.5.3', 295a3dc3edaSGreg Roach 'themes/minimal/css-1.5.3', 296a3dc3edaSGreg Roach 'themes/webtrees/css-1.5.3', 297a3dc3edaSGreg Roach 'themes/xenea/css-1.5.3', 298a3dc3edaSGreg Roach // Removed in 1.6.2 299a3dc3edaSGreg Roach 'themes/clouds/jquery-ui-1.10.3', 300a3dc3edaSGreg Roach 'themes/colors/css-1.6.0', 301a3dc3edaSGreg Roach 'themes/colors/jquery-ui-1.10.3', 302a3dc3edaSGreg Roach 'themes/fab/css-1.6.0', 303a3dc3edaSGreg Roach 'themes/fab/jquery-ui-1.10.3', 304a3dc3edaSGreg Roach 'themes/minimal/css-1.6.0', 305a3dc3edaSGreg Roach 'themes/minimal/jquery-ui-1.10.3', 306a3dc3edaSGreg Roach 'themes/webtrees/css-1.6.0', 307a3dc3edaSGreg Roach 'themes/webtrees/jquery-ui-1.10.3', 308a3dc3edaSGreg Roach 'themes/xenea/css-1.6.0', 309a3dc3edaSGreg Roach 'themes/xenea/jquery-ui-1.10.3', 310a3dc3edaSGreg Roach // Removed in 1.7.0 311a3dc3edaSGreg Roach 'admin_site_other.php', 312a3dc3edaSGreg Roach 'js', 313a3dc3edaSGreg Roach 'language/en_GB.mo', 314a3dc3edaSGreg Roach // Replaced with en-GB.mo 315a3dc3edaSGreg Roach 'language/en_US.mo', 316a3dc3edaSGreg Roach // Replaced with en-US.mo 317a3dc3edaSGreg Roach 'language/pt_BR.mo', 318a3dc3edaSGreg Roach // Replaced with pt-BR.mo 319a3dc3edaSGreg Roach 'language/zh_CN.mo', 320a3dc3edaSGreg Roach // Replaced with zh-Hans.mo 321a3dc3edaSGreg Roach 'language/extra', 322a3dc3edaSGreg Roach 'library', 323a3dc3edaSGreg Roach 'modules_v3/batch_update/admin_batch_update.php', 324a3dc3edaSGreg Roach 'modules_v3/batch_update/plugins', 325a3dc3edaSGreg Roach 'modules_v3/charts/help_text.php', 326a3dc3edaSGreg Roach 'modules_v3/ckeditor/ckeditor-4.4.1-custom', 327a3dc3edaSGreg Roach 'modules_v3/clippings/clippings_ctrl.php', 328a3dc3edaSGreg Roach 'modules_v3/clippings/help_text.php', 329a3dc3edaSGreg Roach 'modules_v3/faq/help_text.php', 330a3dc3edaSGreg Roach 'modules_v3/gedcom_favorites/db_schema', 331a3dc3edaSGreg Roach 'modules_v3/gedcom_news/db_schema', 332a3dc3edaSGreg Roach 'modules_v3/googlemap/db_schema', 333a3dc3edaSGreg Roach 'modules_v3/googlemap/help_text.php', 334a3dc3edaSGreg Roach 'modules_v3/html/help_text.php', 335a3dc3edaSGreg Roach 'modules_v3/logged_in/help_text.php', 336a3dc3edaSGreg Roach 'modules_v3/review_changes/help_text.php', 337a3dc3edaSGreg Roach 'modules_v3/todo/help_text.php', 338a3dc3edaSGreg Roach 'modules_v3/tree/class_treeview.php', 339a3dc3edaSGreg Roach 'modules_v3/user_blog/db_schema', 340a3dc3edaSGreg Roach 'modules_v3/yahrzeit/help_text.php', 341a3dc3edaSGreg Roach 'save.php', 342a3dc3edaSGreg Roach 'themes/clouds/css-1.6.2', 343a3dc3edaSGreg Roach 'themes/clouds/templates', 344a3dc3edaSGreg Roach 'themes/clouds/header.php', 345a3dc3edaSGreg Roach 'themes/clouds/footer.php', 346a3dc3edaSGreg Roach 'themes/colors/css-1.6.2', 347a3dc3edaSGreg Roach 'themes/colors/templates', 348a3dc3edaSGreg Roach 'themes/colors/header.php', 349a3dc3edaSGreg Roach 'themes/colors/footer.php', 350a3dc3edaSGreg Roach 'themes/fab/css-1.6.2', 351a3dc3edaSGreg Roach 'themes/fab/templates', 352a3dc3edaSGreg Roach 'themes/fab/header.php', 353a3dc3edaSGreg Roach 'themes/fab/footer.php', 354a3dc3edaSGreg Roach 'themes/minimal/css-1.6.2', 355a3dc3edaSGreg Roach 'themes/minimal/templates', 356a3dc3edaSGreg Roach 'themes/minimal/header.php', 357a3dc3edaSGreg Roach 'themes/minimal/footer.php', 358a3dc3edaSGreg Roach 'themes/webtrees/css-1.6.2', 359a3dc3edaSGreg Roach 'themes/webtrees/templates', 360a3dc3edaSGreg Roach 'themes/webtrees/header.php', 361a3dc3edaSGreg Roach 'themes/webtrees/footer.php', 362a3dc3edaSGreg Roach 'themes/xenea/css-1.6.2', 363a3dc3edaSGreg Roach 'themes/xenea/templates', 364a3dc3edaSGreg Roach 'themes/xenea/header.php', 365a3dc3edaSGreg Roach 'themes/xenea/footer.php', 366a3dc3edaSGreg Roach // Removed in 1.7.2 367a3dc3edaSGreg Roach 'assets/js-1.7.0', 368a3dc3edaSGreg Roach // Removed in 1.7.3 369a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/census/date.js', 370a3dc3edaSGreg Roach 'modules_v3/GEDFact_assistant/census/dynamicoptionlist.js', 371a3dc3edaSGreg Roach // Removed in 1.7.4 372a3dc3edaSGreg Roach 'assets/js-1.7.2', 373a3dc3edaSGreg Roach 'themes/clouds/css-1.7.0', 374a3dc3edaSGreg Roach 'themes/colors/css-1.7.0', 375a3dc3edaSGreg Roach 'themes/fab/css-1.7.0', 376a3dc3edaSGreg Roach 'themes/minimal/css-1.7.0', 377a3dc3edaSGreg Roach 'themes/webtrees/css-1.7.0', 378a3dc3edaSGreg Roach 'themes/xenea/css-1.7.0', 379a3dc3edaSGreg Roach // Removed in 1.7.5 380a3dc3edaSGreg Roach 'themes/clouds/css-1.7.4', 381a3dc3edaSGreg Roach 'themes/colors/css-1.7.4', 382a3dc3edaSGreg Roach 'themes/fab/css-1.7.4', 383a3dc3edaSGreg Roach 'themes/minimal/css-1.7.4', 384a3dc3edaSGreg Roach 'themes/webtrees/css-1.7.4', 385a3dc3edaSGreg Roach 'themes/xenea/css-1.7.4', 386a3dc3edaSGreg Roach // Removed in 1.7.7 387a3dc3edaSGreg Roach 'assets/js-1.7.4', 388a3dc3edaSGreg Roach 'modules_v3/googlemap/images/css_sprite_facts.png', 389a3dc3edaSGreg Roach 'modules_v3/googlemap/images/flag_shadow.png', 390a3dc3edaSGreg Roach 'modules_v3/googlemap/images/shadow-left-large.png', 391a3dc3edaSGreg Roach 'modules_v3/googlemap/images/shadow-left-small.png', 392a3dc3edaSGreg Roach 'modules_v3/googlemap/images/shadow-right-large.png', 393a3dc3edaSGreg Roach 'modules_v3/googlemap/images/shadow-right-small.png', 394a3dc3edaSGreg Roach 'modules_v3/googlemap/images/shadow50.png', 395a3dc3edaSGreg Roach 'modules_v3/googlemap/images/transparent-left-large.png', 396a3dc3edaSGreg Roach 'modules_v3/googlemap/images/transparent-left-small.png', 397a3dc3edaSGreg Roach 'modules_v3/googlemap/images/transparent-right-large.png', 398a3dc3edaSGreg Roach 'modules_v3/googlemap/images/transparent-right-small.png', 399a3dc3edaSGreg Roach // Removed in 1.7.8 400a3dc3edaSGreg Roach 'themes/clouds/css-1.7.5', 401a3dc3edaSGreg Roach 'themes/colors/css-1.7.5', 402a3dc3edaSGreg Roach 'themes/fab/css-1.7.5', 403a3dc3edaSGreg Roach 'themes/minimal/css-1.7.5', 404a3dc3edaSGreg Roach 'themes/webtrees/css-1.7.5', 405a3dc3edaSGreg Roach 'themes/xenea/css-1.7.5', 406a3dc3edaSGreg Roach // Removed in 2.0.0 407a3dc3edaSGreg Roach 'action.php', 408a3dc3edaSGreg Roach 'addmedia.php', 409a3dc3edaSGreg Roach 'addmin.php', 410a3dc3edaSGreg Roach 'admin_media.php', 411a3dc3edaSGreg Roach 'admin_media_upload.php', 412a3dc3edaSGreg Roach 'admin_module_blocks.php', 413a3dc3edaSGreg Roach 'admin_module_charts.php', 414a3dc3edaSGreg Roach 'admin_module_menus.php', 415a3dc3edaSGreg Roach 'admin_module_reports.php', 416a3dc3edaSGreg Roach 'admin_module_sidebar.php', 417a3dc3edaSGreg Roach 'admin_module_tabs.php', 418a3dc3edaSGreg Roach 'admin_modules.php', 419a3dc3edaSGreg Roach 'admin_pgv_to_wt.php', 420a3dc3edaSGreg Roach 'admin_site_access.php', 421a3dc3edaSGreg Roach 'admin_site_change.php', 422a3dc3edaSGreg Roach 'admin_site_clean.php', 423a3dc3edaSGreg Roach 'admin_site_config.php', 424a3dc3edaSGreg Roach 'admin_site_info.php', 425a3dc3edaSGreg Roach 'admin_site_logs.php', 426a3dc3edaSGreg Roach 'admin_site_merge.php', 427a3dc3edaSGreg Roach 'admin_site_readme.php', 428a3dc3edaSGreg Roach 'admin_site_upgrade.php', 429a3dc3edaSGreg Roach 'admin_trees_check.php', 430a3dc3edaSGreg Roach 'admin_trees_config.php', 431a3dc3edaSGreg Roach 'admin_trees_download.php', 432a3dc3edaSGreg Roach 'admin_trees_duplicates.php', 433a3dc3edaSGreg Roach 'admin_trees_export.php', 434a3dc3edaSGreg Roach 'admin_trees_manage.php', 435a3dc3edaSGreg Roach 'admin_trees_merge.php', 436a3dc3edaSGreg Roach 'admin_trees_places.php', 437a3dc3edaSGreg Roach 'admin_trees_renumber.php', 438a3dc3edaSGreg Roach 'admin_trees_unconnected.php', 439a3dc3edaSGreg Roach 'admin_users.php', 440a3dc3edaSGreg Roach 'admin_users_bulk.php', 441a3dc3edaSGreg Roach 'ancestry.php', 442a3dc3edaSGreg Roach 'app/Controller', 443a3dc3edaSGreg Roach 'app/HitCounter.php', 444a3dc3edaSGreg Roach 'app/Module/ClippingsCart/ClippingsCartController.php', 445a3dc3edaSGreg Roach 'app/Module/FamiliesSidebarModule.php', 446a3dc3edaSGreg Roach 'app/Module/FamilyTreeFavorites', 447a3dc3edaSGreg Roach 'app/Module/GoogleMaps', 448a3dc3edaSGreg Roach 'app/Module/IndividualSidebarModule.php', 449a3dc3edaSGreg Roach 'app/Module/PageMenuModule.php', 45080536c2dSGreg Roach 'app/Query', 451a3dc3edaSGreg Roach 'app/SpecialChars', 452a3dc3edaSGreg Roach 'assets/js-1.7.7', 453a3dc3edaSGreg Roach 'assets/js-1.7.9', 454a3dc3edaSGreg Roach 'autocomplete.php', 455a3dc3edaSGreg Roach 'block_edit.php', 456a3dc3edaSGreg Roach 'branches.php', 457a3dc3edaSGreg Roach 'calendar.php', 458a3dc3edaSGreg Roach 'compact.php', 459a3dc3edaSGreg Roach 'data/html_purifier_cache', 460a3dc3edaSGreg Roach 'descendancy.php', 461a3dc3edaSGreg Roach 'editnews.php', 462a3dc3edaSGreg Roach 'edituser.php', 463a3dc3edaSGreg Roach 'edit_changes.php', 464a3dc3edaSGreg Roach 'edit_interface.php', 465a3dc3edaSGreg Roach 'expand_view.php', 466a3dc3edaSGreg Roach 'familybook.php', 467a3dc3edaSGreg Roach 'famlist.php', 468a3dc3edaSGreg Roach 'fanchart.php', 469a3dc3edaSGreg Roach 'find.php', 470a3dc3edaSGreg Roach 'help_text.php', 471a3dc3edaSGreg Roach 'hourglass.php', 472a3dc3edaSGreg Roach 'hourglass_ajax.php', 473a3dc3edaSGreg Roach 'import.php', 474a3dc3edaSGreg Roach 'includes', 475a3dc3edaSGreg Roach 'index_edit.php', 476a3dc3edaSGreg Roach 'indilist.php', 477a3dc3edaSGreg Roach 'inverselink.php', 478a3dc3edaSGreg Roach 'lifespan.php', 479a3dc3edaSGreg Roach 'login.php', 480a3dc3edaSGreg Roach 'logout.php', 481a3dc3edaSGreg Roach 'mediafirewall.php', 482a3dc3edaSGreg Roach 'medialist.php', 483a3dc3edaSGreg Roach 'message.php', 484a3dc3edaSGreg Roach 'module.php', 485a3dc3edaSGreg Roach 'notelist.php', 486a3dc3edaSGreg Roach 'packages', 487a3dc3edaSGreg Roach 'pedigree.php', 488a3dc3edaSGreg Roach 'relationship.php', 489a3dc3edaSGreg Roach 'repolist.php', 490a3dc3edaSGreg Roach 'reportengine.php', 491a3dc3edaSGreg Roach 'search.php', 492a3dc3edaSGreg Roach 'search_advanced.php', 493a3dc3edaSGreg Roach 'site-offline.php', 494a3dc3edaSGreg Roach 'site-unavailable.php', 495a3dc3edaSGreg Roach 'sourcelist.php', 496a3dc3edaSGreg Roach 'statistics.php', 497a3dc3edaSGreg Roach 'statisticsplot.php', 498a3dc3edaSGreg Roach 'themes/_administration', 499a3dc3edaSGreg Roach 'themes/_custom', 500a3dc3edaSGreg Roach 'themes/clouds/css-1.7.8', 501a3dc3edaSGreg Roach 'themes/clouds/jquery-ui-1.11.2', 502a3dc3edaSGreg Roach 'themes/colors/css-1.7.8', 503a3dc3edaSGreg Roach 'themes/colors/jquery-ui-1.11.2', 504a3dc3edaSGreg Roach 'themes/fab/css-1.7.8', 505a3dc3edaSGreg Roach 'themes/fab/jquery-ui-1.11.2', 506a3dc3edaSGreg Roach 'themes/minimal/css-1.7.8', 507a3dc3edaSGreg Roach 'themes/minimal/jquery-ui-1.11.2', 508a3dc3edaSGreg Roach 'themes/webtrees/css-1.7.8', 509a3dc3edaSGreg Roach 'themes/webtrees/jquery-ui-1.11.2', 510a3dc3edaSGreg Roach 'themes/xenea/css-1.7.8', 511a3dc3edaSGreg Roach 'themes/xenea/jquery-ui-1.11.2', 512a3dc3edaSGreg Roach 'timeline.php', 513a3dc3edaSGreg Roach ]; 514a3dc3edaSGreg Roach 515a3dc3edaSGreg Roach /** 516a3dc3edaSGreg Roach * Delete files and folders that belonged to an earlier version of webtrees. 517a3dc3edaSGreg Roach * Return a list of those that we could not delete. 518a3dc3edaSGreg Roach * 519a3dc3edaSGreg Roach * @param Filesystem $filesystem 520a3dc3edaSGreg Roach * 521a3dc3edaSGreg Roach * @return array 522a3dc3edaSGreg Roach */ 523a3dc3edaSGreg Roach public function deleteOldWebtreesFiles(Filesystem $filesystem): array 524a3dc3edaSGreg Roach { 525a3dc3edaSGreg Roach $paths_to_delete = []; 526a3dc3edaSGreg Roach 527a3dc3edaSGreg Roach foreach (self::OLD_PATHS as $path) { 528a3dc3edaSGreg Roach if (!$this->deleteFileOrFolder($filesystem, $path)) { 529a3dc3edaSGreg Roach $paths_to_delete[] = $path; 530a3dc3edaSGreg Roach } 531a3dc3edaSGreg Roach } 532a3dc3edaSGreg Roach 533a3dc3edaSGreg Roach return $paths_to_delete; 534a3dc3edaSGreg Roach } 535a3dc3edaSGreg Roach 536a3dc3edaSGreg Roach /** 537a3dc3edaSGreg Roach * Delete old cache files. 538a3dc3edaSGreg Roach * 539a3dc3edaSGreg Roach * @param Filesystem $filesystem 540a3dc3edaSGreg Roach * @param string $path_to_cache 541a3dc3edaSGreg Roach * @param int $max_age_in_seconds 542c7ff4153SGreg Roach * 543c7ff4153SGreg Roach * @return void 544a3dc3edaSGreg Roach */ 545a3dc3edaSGreg Roach public function deleteOldCacheFiles(Filesystem $filesystem, string $path_to_cache, int $max_age_in_seconds) 546a3dc3edaSGreg Roach { 547a3dc3edaSGreg Roach $list = $filesystem->listContents($path_to_cache, true); 548a3dc3edaSGreg Roach 549a3dc3edaSGreg Roach foreach ($list as $metadata) { 550a3dc3edaSGreg Roach if ($metadata['timestamp'] ?? WT_TIMESTAMP < WT_TIMESTAMP - $max_age_in_seconds) { 551a3dc3edaSGreg Roach $this->deleteFileOrFolder($filesystem, $metadata['path']); 552a3dc3edaSGreg Roach } 553a3dc3edaSGreg Roach } 554a3dc3edaSGreg Roach } 555a3dc3edaSGreg Roach 556a3dc3edaSGreg Roach /** 557a3dc3edaSGreg Roach * @param int $max_age_in_seconds 558c7ff4153SGreg Roach * 559c7ff4153SGreg Roach * @return void 560a3dc3edaSGreg Roach */ 561a3dc3edaSGreg Roach public function deleteOldLogs(int $max_age_in_seconds) 562a3dc3edaSGreg Roach { 563a3dc3edaSGreg Roach if (Database::isConnected()) { 564a3dc3edaSGreg Roach Database::prepare( 565a3dc3edaSGreg Roach "DELETE FROM `##log` WHERE log_type IN ('error', 'media') AND log_time < FROM_UNIXTIME(:timestamp)" 566a3dc3edaSGreg Roach )->execute([ 567a3dc3edaSGreg Roach 'timestamp' => WT_TIMESTAMP - $max_age_in_seconds 568a3dc3edaSGreg Roach ]); 569a3dc3edaSGreg Roach } 570a3dc3edaSGreg Roach } 571a3dc3edaSGreg Roach 572a3dc3edaSGreg Roach /** 573a3dc3edaSGreg Roach * @param int $max_age_in_seconds 574c7ff4153SGreg Roach * 575c7ff4153SGreg Roach * @return void 576a3dc3edaSGreg Roach */ 577a3dc3edaSGreg Roach public function deleteOldSessions(int $max_age_in_seconds) 578a3dc3edaSGreg Roach { 579a3dc3edaSGreg Roach if (Database::isConnected()) { 580a3dc3edaSGreg Roach Database::prepare( 581a3dc3edaSGreg Roach "DELETE FROM `##session` WHERE session_time < FROM_UNIXTIME(:timestamp)" 582a3dc3edaSGreg Roach )->execute([ 583a3dc3edaSGreg Roach 'timestamp' => WT_TIMESTAMP - $max_age_in_seconds 584a3dc3edaSGreg Roach ]); 585a3dc3edaSGreg Roach } 586a3dc3edaSGreg Roach } 587a3dc3edaSGreg Roach 588a3dc3edaSGreg Roach /** 589a3dc3edaSGreg Roach * Delete a file or folder, if we can. 590a3dc3edaSGreg Roach * 591a3dc3edaSGreg Roach * @param Filesystem $filesystem 592a3dc3edaSGreg Roach * @param string $path 593a3dc3edaSGreg Roach * 594a3dc3edaSGreg Roach * @return bool 595a3dc3edaSGreg Roach */ 596a3dc3edaSGreg Roach private function deleteFileOrFolder(Filesystem $filesystem, string $path): bool 597a3dc3edaSGreg Roach { 598a3dc3edaSGreg Roach if ($filesystem->has($path)) { 599a3dc3edaSGreg Roach try { 600a3dc3edaSGreg Roach $metadata = $filesystem->getMetadata($path); 601a3dc3edaSGreg Roach 602a3dc3edaSGreg Roach if ($metadata['type'] === 'dir') { 603a3dc3edaSGreg Roach $filesystem->deleteDir($path); 604a3dc3edaSGreg Roach } 605a3dc3edaSGreg Roach 606a3dc3edaSGreg Roach if ($metadata['type'] === 'file') { 607a3dc3edaSGreg Roach $filesystem->delete($path); 608a3dc3edaSGreg Roach } 609a3dc3edaSGreg Roach } catch (Exception $ex) { 610a3dc3edaSGreg Roach return false; 611a3dc3edaSGreg Roach } 612a3dc3edaSGreg Roach } 613a3dc3edaSGreg Roach 614a3dc3edaSGreg Roach return true; 615a3dc3edaSGreg Roach } 616a3dc3edaSGreg Roach} 617