#!/usr/bin/env php . /* * Script to print out current version of the software * * @package Realtime * @author Mikael Nordfeldth * @copyright 2011, StatusNet, Inc. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ define('INSTALLDIR', realpath(__DIR__ . '/../../..')); $shortoptions = 'u'; $longoptions = array('universe'); $helptext = <<selectAdd(); $rc->selectAdd('channel_key'); $rc->whereAdd(sprintf("modified < TIMESTAMP '%s'", common_sql_date(time() - Realtime_channel::TIMEOUT))); if ($rc->find()) { $keys = $rc->fetchAll(); foreach ($keys as $key) { $rc = Realtime_channel::getKV('channel_key', $key); if (!empty($rc)) { printfv("Deleting realtime channel '$key'\n"); $rc->delete(); } } } } if (have_option('u', 'universe')) { $sn = new Status_network(); if ($sn->find()) { while ($sn->fetch()) { $server = $sn->getServerName(); GNUsocial::init($server); cleanupChannels(); } } } else { cleanupChannels(); }