You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
//phpinfo ();
//error_reporting(E_ALL | E_STRICT);
require_once '../htdocs/rsscache/default.php';
require_once '../htdocs/config.php';
require_once '../htdocs/misc/misc.php';
require_once '../htdocs/misc/sql.php';
require_once '../htdocs/misc/rss.php';
require_once '../htdocs/misc/youtube.php';
require_once '../htdocs/rsscache/rsscache_sql.php';
require_once '../htdocs/rsscache/rsscache_misc.php';
// main ()
// unlimited execution time
//ini_set('max_execution_time', '3600');
set_time_limit(0);
rsscache_sql_open();
$config = config_xml();
echo misc_exec('/etc/init.d/tor restart');
// DEBUG
echo 'database: ' . $rsscache_dbname . ' (' . $rsscache_dbuser . ')' . "\n";
for ($i = 0; isset($config['item'][$i]); $i++) {
    if (isset($config['item'][$i]['category'])) {
        print_r($config['item'][$i]);
        rsscache_download_feeds_by_category($config['item'][$i]['category']);
    }
}
rsscache_sql_close();
exit;
         $output = NULL;
     }
     if (in_array($f, array('cache', 'config'))) {
         $f = NULL;
     }
 }
 if ($f == 'robots') {
     header('Content-type: text/plain');
     echo rsscache_write_robots();
     exit;
 }
 rsscache_sql_open();
 if ($f == 'cache') {
     if ($c) {
         ob_start();
         rsscache_download_feeds_by_category($c);
         $p = str_replace("\n", "<br>\n", ob_get_contents());
         ob_end_clean();
         $p .= '<br><br>success';
     } else {
         $p = '&c=CATEGORY required';
     }
     $a = array('channel' => rsscache_default_channel(), 'item' => NULL);
     $a['channel']['description'] = $p;
 } else {
     if ($f == 'config' || $f == 'stats' || $output == 'sitemap') {
         $config = rsscache_add_stats($config);
         $a = $config;
     } else {
         // use SQL
         if ($item) {