Closed darkalchemy closed 4 years ago
I have to point out again, files in hidden folders should be hidden.
test_dir\.hidden\.hidden.txt
test_dir\.hidden\aaa.txt
test_dir\ccc\.hidden.txt
test_dir\ccc\ccc.txt
test_dir\ddd.txt
test_dir\eee.txt
test_dir\.hidden\aaa.txt
test_dir\ccc\ccc.txt
test_dir\ddd.txt
test_dir\eee.txt
test_dir\ccc\ccc.txt
test_dir\ddd.txt
test_dir\eee.txt
How did you call it? If you want to ignore hidden files, the last param should be false, call it like so:
$torrent = new Torrent(/path/to/torrent/file, [], 256, false)
edit: I didn't see that that you wanted to ignore hidden folders, I will look into it.
In my branch I called the variable $skip_hidden_objects. I took it for granted that both types should be hidden.
It's fixed now. I don't know how to write unit tests, so I have included it bin/demo.php. When run within the git repo, it will create a torrent of that folder, ignoring all hidden files and folders.
I am pleased that someone is bothering and continues to work, but I am not really enthusiastic about your changes and I would not like it if the changes were adopted in the main branch. An example, the following line $br = PHP_SAPI === 'cli' ? PHP_EOL : "\n";
of code makes no sense, it should look like this $br = PHP_SAPI === 'cli' ? PHP_EOL : "<br>";
. I have already completely revised my branch, only details should be taken from it, such as the inclusion of an iterator. Your changes are a bit too extensive.
You're quoting from a demo file that has no bearing on the class itself and it's so its readable from cli and a webpage, since the original demo was written to view from a webpage.
It is not necessary to explain the code by specifying "<br>"
an HTML tag, as I have already made it clear that it is intended to be displayed on a web page. Unfortunately, you don't understand what I'm saying.
Since it appears that only you and I are going to comment on this. I propose you step up and take over maintenance of this project and I will step away and continue to use my own fork.
Incorporates changes requested by @xxalfa in PR #50 and by @Machou in PR #54 along with adding install by composer.