Project

General

Profile

« Previous | Next » 

Revision 99204edb

ID99204edba3717fae10809180fbaae00a9478a889
Parent d4e538ff
Child 1662eb69

Added by Jocelyn Delande about 9 years ago

tolerate that the dir exists before tiles creation

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences

Changesets

class/TilesGenerator.php
27 27
			if (! mkdir(PANORAMA_PATH)) {
28 28
				$err = "le répertoire \"PANORAMA_PATH\" n'est pas accessible et ne peut être créé";
29 29
			}
30
		} else if (file_exists($pano_path)) {
31
			$err = sprintf("le nom de répertoire \"%s\" est déjà pris",
32
			               $pano_path);
33 30
		} else {
34
			mkdir($pano_path);
35
		}
31
      if (file_exists($pano_path)) {
32
         $pano_files = scandir($pano_path);
33
        foreach($pano_files as $filename) {
34
          if (preg_match('/.*\.jpg/', $filename)) {
35
			      $err = sprintf("\"%s\" contient déjà un découpage de panorama.",
36
                           $pano_path);
37
            break;
38
          }
39
        }
40
		  } else {
41
			  mkdir($pano_path);
42
		  }
43
    }
36 44
		if ($err) {
37 45
			throw (new TilesGeneratorRightsException($err));
38 46
		}