]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #5435 from annando/htaccess
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Sat, 21 Jul 2018 05:48:15 +0000 (07:48 +0200)
committerGitHub <noreply@github.com>
Sat, 21 Jul 2018 05:48:15 +0000 (07:48 +0200)
Automatically create a .htaccess when not existing

src/Worker/Cron.php

index 644ef6b9d4e9f1c922fbc018c54a8a0cb2502964..bf1b44f55d4e0c0530c0729a5f72c5c67cfa6a66 100644 (file)
@@ -112,6 +112,13 @@ class Cron
                        Config::set('system', 'last_cron_hourly', time());
                }
 
+               // Ensure to have a .htaccess file.
+               // this is a precaution for systems that update automatically
+               $basepath = $a->get_basepath();
+               if (!file_exists($basepath . '/.htaccess')) {
+                       copy($basepath . '/.htaccess-dist', $basepath . '/.htaccess');
+               }
+
                // Poll contacts
                self::pollContacts($parameter, $generation);