aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Cron_weekly.php
blob: 1d842094774c69fafa9805a3657fdd0c567b1e75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php

namespace Zotlabs\Daemon;

class Cron_weekly {

	static public function run($argc,$argv) {		

		/**
		 * Cron Weekly
		 * 
		 * Actions in the following block are executed once per day only on Sunday (once per week).
		 *
		 */

		call_hooks('cron_weekly',datetime_convert());


		z_check_cert();

		require_once('include/hubloc.php');
		prune_hub_reinstalls();
	
		mark_orphan_hubsxchans();


		// get rid of really old poco records

		q("delete from xlink where xlink_updated < %s - INTERVAL %s and xlink_static = 0 ",
			db_utcnow(), db_quoteinterval('14 DAY')
		);

		$dirmode = intval(get_config('system','directory_mode'));
		if($dirmode === DIRECTORY_MODE_SECONDARY || $dirmode === DIRECTORY_MODE_PRIMARY) {
			logger('regdir: ' . print_r(z_fetch_url(get_directory_primary() . '/regdir?f=&url=' . urlencode(z_root()) . '&realm=' . urlencode(get_directory_realm())),true));
		}

		// Check for dead sites
		Master::Summon(array('Checksites'));
			
		// update searchable doc indexes
		Master::Summon(array('Importdoc'));

		/**
		 * End Cron Weekly
		 */

	}
}