Skip to content

Commit 8a82b47

Browse files
committed
Show file contents when path is not a directory
1 parent bdf14b2 commit 8a82b47

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/directory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828

2929
$client = new Client($url, $browser);
3030

31-
$client->fetchDirectory($path, $revision)->then('var_dump', 'var_dump');
31+
if (substr($path, -1) === '/') {
32+
$client->fetchDirectory($path, $revision)->then('var_dump', 'printf');
33+
} else {
34+
$client->fetchFile($path, $revision)->then('printf', 'printf');
35+
}
3236

3337
$loop->run();

0 commit comments

Comments
 (0)