<?php

	require_once 'include.php';

	# Get files and write them into result
	$files = scanrdir(ROOT, $ignore);
	$success = @file_put_contents('result', serialize($files));

	# Print response
	header('Content-type: application/xml');
	echo '<?xml version="1.0" encoding="UTF-8"?>';
?>

<root>
	<success><?= (int) !!$success ?></success>
	<files><?= sizeof($files) ?></files>
	<meta>
		<ip><?= $_SERVER['REMOTE_ADDR'] ?></ip>
		<version>1</version>
		<cached><?= date('Y-m-d H:i:s') ?></cached>
		<error />
		<generated><?= round(1000 * (microtime(true) - START_TIME)) ?></generated>
	</meta>
</root>
