<?php
$alpcal_options['cache_folder'] = str_replace("ALPCAL/Storage/", "", plugin_dir_path( __FILE__ )) . 'acCache/';

echo time();
echo "<pre>";

try {
	// initialize the Event
	$event = new ALPCAL\Draw\Event($alpcal_options);
	// set the variables for this retrieval
	$event->setId($_GET['ACResultsRender']);
	$event->getData();




	}
catch (Exception $exc)
	{
	echo "Exception caught: " . $exc->getMessage();
	die("<hr />Please report or correct this error and reload the page once fixed.");
	}
print_r($event);

die("</pre>dead");




	// if the file is older than allowed in cache, go fetch it
	if ($this->cacheFiles->fileAge > $this->alpcal_options['cache_length_months'])
		{
		echo "<!-- FETCHING NEW DATA FROM REMOTE SOURCE(S) -->";
		echo "<h1>Fetching new data from remote</h1>";
		try {
			$this->fetchEventTypes();
			$this->fetchRemoteCalendarData(); // go get the data for the draw range
			$this->setDrawEvents(); // sets the assoc array DrawEvents which puts calendar items into usable format for drawing
			$this->cacheFiles->writeFile($this);
			}
		catch(Exception $e)
			{
			$this->setEventsFromCache();
			}
		}
	else{
		$this->setEventsFromCache();
		}