- //Get filesystem
- $filesystem = new Filesystem();
-
- //Set tmpdir
- //XXX: worst case scenario we have 3 files per zipcode
- if (!is_dir($tmpdir = sys_get_temp_dir().'/accuweather')) {
- try {
- //Create dir
- $filesystem->mkdir($tmpdir, 0775);
- } catch (IOExceptionInterface $exception) {
- //Display error
- echo 'Create dir '.$exception->getPath().' failed'."\n";
-
- //Exit with failure
- exit(self::FAILURE);
- }
- }
-