]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/CronJobs.php
Merge pull request #5862 from nupplaphil/rename_App_Methods
[friendica.git] / src / Worker / CronJobs.php
index 950dd71af6035f99a7daf62b84332e1533be2bfa..bd34449729392f575ad53169dc1750cb590ce5ad 100644 (file)
@@ -120,6 +120,12 @@ class CronJobs
                // delete user records for recently removed accounts
                $users = DBA::select('user', ['uid'], ["`account_removed` AND `account_expires_on` < UTC_TIMESTAMP() - INTERVAL 3 DAY"]);
                while ($user = DBA::fetch($users)) {
+                       // Delete the contacts of this user
+                       $self = DBA::selectFirst('contact', ['nurl'], ['self' => true, 'uid' => $user['uid']]);
+                       if (DBA::isResult($self)) {
+                               DBA::delete('contact', ['nurl' => $self['nurl'], 'self' => false]);
+                       }
+
                        DBA::delete('user', ['uid' => $user['uid']]);
                }
        }
@@ -151,14 +157,14 @@ class CronJobs
                clear_cache();
 
                // clear cache for photos
-               clear_cache($a->get_basepath(), $a->get_basepath() . "/photo");
+               clear_cache($a->getBasePath(), $a->getBasePath() . "/photo");
 
                // clear smarty cache
-               clear_cache($a->get_basepath() . "/view/smarty3/compiled", $a->get_basepath() . "/view/smarty3/compiled");
+               clear_cache($a->getBasePath() . "/view/smarty3/compiled", $a->getBasePath() . "/view/smarty3/compiled");
 
                // clear cache for image proxy
                if (!Config::get("system", "proxy_disabled")) {
-                       clear_cache($a->get_basepath(), $a->get_basepath() . "/proxy");
+                       clear_cache($a->getBasePath(), $a->getBasePath() . "/proxy");
 
                        $cachetime = Config::get('system', 'proxy_cache_time');