Mercurial > hg > mgallery
comparison mgtool.php @ 251:19dab8b0c340
Remove clean command suboptions 'thumbnails' and 'mediums' and replace them with 'images'.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 12 Dec 2018 12:40:57 +0200 |
parents | 3af3b3f50cb0 |
children | 5b41efcec87d |
comparison
equal
deleted
inserted
replaced
250:3af3b3f50cb0 | 251:19dab8b0c340 |
---|---|
32 define("GCMD_UPDATE" , 1); | 32 define("GCMD_UPDATE" , 1); |
33 define("GCMD_RESCAN" , 2); | 33 define("GCMD_RESCAN" , 2); |
34 define("GCMD_CLEAN" , 3); | 34 define("GCMD_CLEAN" , 3); |
35 | 35 |
36 define("GCLEAN_CACHES" , 0x01); | 36 define("GCLEAN_CACHES" , 0x01); |
37 define("GCLEAN_THUMBNAILS", 0x02); | 37 define("GCLEAN_IMAGES" , 0x02); |
38 define("GCLEAN_MEDIUMS" , 0x04); | |
39 define("GCLEAN_ALL" , 0x0f); | 38 define("GCLEAN_ALL" , 0x0f); |
40 | 39 |
41 define("GUPD_MED_IMAGE" , 0x01); | 40 define("GUPD_MED_IMAGE" , 0x01); |
42 define("GUPD_TN_IMAGE" , 0x02); | 41 define("GUPD_TN_IMAGE" , 0x02); |
43 define("GUPD_IMAGES" , 0x0f); | 42 define("GUPD_IMAGES" , 0x0f); |
511 if ($writeMode) | 510 if ($writeMode) |
512 { | 511 { |
513 if ($galCleanFlags & GCLEAN_CACHES) | 512 if ($galCleanFlags & GCLEAN_CACHES) |
514 mgDelete($cacheFilename, TRUE); | 513 mgDelete($cacheFilename, TRUE); |
515 | 514 |
516 if ($galCleanFlags & GCLEAN_THUMBNAILS) | 515 if ($galCleanFlags & GCLEAN_IMAGES) |
516 { | |
517 mgDelete($path."/".$galTNPath, FALSE); | 517 mgDelete($path."/".$galTNPath, FALSE); |
518 | |
519 if ($galCleanFlags & GCLEAN_MEDIUMS) | |
520 mgDelete($path."/".$galMedPath, FALSE); | 518 mgDelete($path."/".$galMedPath, FALSE); |
519 } | |
521 } | 520 } |
522 } | 521 } |
523 else | 522 else |
524 // Update modes | 523 // Update modes |
525 if ($mode == GCMD_UPDATE || $mode == GCMD_RESCAN) | 524 if ($mode == GCMD_UPDATE || $mode == GCMD_RESCAN) |
804 " rescan [path]\n". | 803 " rescan [path]\n". |
805 " Like 'update', but forces all cache files to be regenerated\n". | 804 " Like 'update', but forces all cache files to be regenerated\n". |
806 " and EXIF/caption/etc information to be re-scanned even\n". | 805 " and EXIF/caption/etc information to be re-scanned even\n". |
807 " if the file timestamps do not justify re-scanning.\n". | 806 " if the file timestamps do not justify re-scanning.\n". |
808 "\n". | 807 "\n". |
809 " clean <all|caches|thumbnails|mediums|generated> [path]\n". | 808 " clean <all|caches|images> [path]\n". |
810 " Delete all generated files or selectively cache files or\n". | 809 " Delete all generated files, or data cache files or\n". |
811 " everything inside thumbnail directories.\n". | 810 " everything inside medium/thumbnail image directories.\n". |
812 "\n". | 811 "\n". |
813 " config|dump\n". | 812 " config|dump\n". |
814 " Display configuration values (with extra information) or\n". | 813 " Display configuration values (with extra information) or\n". |
815 " \"dump\" current configuration as is.\n". | 814 " \"dump\" current configuration as is.\n". |
816 "\n"; | 815 "\n"; |
869 $cmode = mgCArgLC(2, 2); | 868 $cmode = mgCArgLC(2, 2); |
870 switch ($cmode) | 869 switch ($cmode) |
871 { | 870 { |
872 case "al": $galCleanFlags = GCLEAN_ALL; break; | 871 case "al": $galCleanFlags = GCLEAN_ALL; break; |
873 case "ca": $galCleanFlags = GCLEAN_CACHES; break; | 872 case "ca": $galCleanFlags = GCLEAN_CACHES; break; |
874 case "th": $galCleanFlags = GCLEAN_THUMBNAILS; break; | 873 case "im": $galCleanFlags = GCLEAN_IMAGES; break; |
875 case "me": $galCleanFlags = GCLEAN_MEDIUMS; break; | |
876 case "ge": $galCleanFlags = GCLEAN_THUMBNAILS | GCLEAN_MEDIUMS; break; | |
877 case FALSE: | 874 case FALSE: |
878 mgFatal("Cleaning requires a mode argument.\n"); | 875 mgFatal("Cleaning requires a mode argument.\n"); |
879 | 876 |
880 default: | 877 default: |
881 mgFatal("Invalid clean mode '".mgCArg(2)."'.\n"); | 878 mgFatal("Invalid clean mode '".mgCArg(2)."'.\n"); |