+ //Tmp directory
+ $tmpdir = $kernel->getContainer()->getParameter('kernel.project_dir').'/var/cache/weather';
+
+ //Set tmpdir
+ //XXX: worst case scenario we have 3 files per zipcode plus daily
+ if (!is_dir($tmpdir)) {
+ try {
+ //Create dir
+ $this->filesystem->mkdir($tmpdir, 0775);
+ } catch (IOException $exception) {
+ //Display error
+ echo 'Create dir '.$exception->getPath().' failed'."\n";
+
+ //Exit with failure
+ exit(self::FAILURE);
+ }
+ }
+
+ //Cleanup kernel
+ unset($kernel);