add 'adding content' chapter

This commit is contained in:
lubiana 2022-04-05 19:09:40 +02:00
parent 46b98d16a6
commit 11172fb3d3
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
20 changed files with 884 additions and 251 deletions

View file

@ -13,6 +13,7 @@ use function count;
use function file_get_contents;
use function glob;
use function is_array;
use function random_int;
use function str_replace;
use function substr;
use function usleep;
@ -31,7 +32,7 @@ final class MarkdownPageFilesystem implements MarkdownPageRepo
$fileNames = glob($this->dataPath . '*.md');
assert(is_array($fileNames));
return array_map(function (string $name): MarkdownPage {
usleep(rand(200, 500) * 1000);
usleep(random_int(200, 500) * 1000);
$content = file_get_contents($name);
$name = str_replace($this->dataPath, '', $name);
$name = str_replace('.md', '', $name);