Overview
Comment:Fix sync of files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: 610de89bf351f9ad0d2f816be4758735438ef32d603a8e18d01bb8565a2d1909
User & Date: bohwaz on 2021-04-09 00:50:40
Other Links: manifest | tags
Context
2021-04-09
01:35
Fix web page file creation/move/rename check-in: fa6b527ca3 user: bohwaz tags: trunk, stable
00:50
Fix sync of files check-in: 610de89bf3 user: bohwaz tags: trunk, stable
00:27
Attempt to fix bugs in renaming web pages at creation check-in: 8b46a75845 user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Web/Web.php from [17cc419c70] to [71964e9c02].

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
			$deleted = array_map(function ($page) {
				return $page->path;
			}, $deleted);

			$db->exec(sprintf('DELETE FROM web_pages WHERE %s;', $db->where('path', $deleted)));
		}

		foreach ($new as $file) {
			$f = Files::get($file . '/index.txt');

			if (!$f) {
				continue;
			}

			Page::fromFile($f)->save();







|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
			$deleted = array_map(function ($page) {
				return $page->path;
			}, $deleted);

			$db->exec(sprintf('DELETE FROM web_pages WHERE %s;', $db->where('path', $deleted)));
		}

		foreach (array_keys($new) as $file) {
			$f = Files::get($file . '/index.txt');

			if (!$f) {
				continue;
			}

			Page::fromFile($f)->save();