Skip to content

Commit 3abc80f

Browse files
committed
Document changes
1 parent 50cb6e1 commit 3abc80f

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# dev
55
/samples
66
/debug
7+
/venv
78

89
# composer
910
/vendor

docs/info.rst

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Info Fields
22
###########
33

4+
.. highlight:: php
5+
46
.. versionchanged:: 5.0 A lot of stuff was moved to version specific namespaces, see :ref:`torrent_versions`
57

68
Fields of the info dictionary of the torrent file.
@@ -21,7 +23,7 @@ All hashes
2123

2224
Get all available hashes as array.
2325

24-
.. code-block:: php
26+
::
2527

2628
<?php
2729
$infoHashes = $torrent->getInfoHashes();
@@ -33,7 +35,7 @@ Metadata
3335

3436
Checks the version of the torrent.
3537

36-
.. code-block:: php
38+
::
3739

3840
<?php
3941
$torrent->hasMetadata(MetaVersion::V1); // simple check, does not create v1 Files object
@@ -44,6 +46,25 @@ Checks the version of the torrent.
4446
// or
4547
$torrent->v2() !== null; // if you plan to iterate over files too
4648

49+
Metadata Removal
50+
================
51+
52+
.. versionadded:: 5.1
53+
54+
Methods to "unhybridize" hybrid V1+V2 torrents.
55+
56+
Remove a specific version::
57+
58+
<?php
59+
60+
$torrent->removeMetadata(MetaVersion::V1);
61+
62+
or keep a specific version::
63+
64+
<?php
65+
66+
$torrent->keepOnlyMetadata(MetaVersion::V1);
67+
4768
Name
4869
====
4970

@@ -56,7 +77,7 @@ A base name of the encoded file or directory.
5677

5778
However the content of the name field in the parsed file is not guaranteed to exist or be valid.
5879

59-
.. code-block:: php
80+
::
6081

6182
<?php
6283
// should be a valid file/dir name
@@ -72,7 +93,7 @@ Private
7293

7394
Get / set / unset the private flag.
7495

75-
.. code-block:: php
96+
::
7697

7798
<?php
7899
$isPrivate = $torrent->isPrivate();

docs/saveload.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Create a torrent for existing directory or file
5454
.. versionadded:: 2.5/3.3/4.1 forceMultifile
5555
.. versionchanged:: 4.1 MetaVersion::HybridV1V2 is now an array [MetaVersion::V1, MetaVersion::V2]
5656
.. versionadded:: 5.0.1 $clock
57+
.. versionadded:: 5.1.0 forceMultifile is true by default
5758

5859
The library can create a torrent file from scratch for a file or a directory.
5960

@@ -107,7 +108,7 @@ Available options:
107108
V1 torrents are created in 'directory' mode even when created for a single file.
108109
This mode fixes some possible incompatibilities between V1 and V2 data in hybrid torrents.
109110
Always enabled in hybrid torrents, meaningless for pure V2.
110-
Default: ``false``
111+
Default: ``true``
111112
``clock``
112113
A parameter to inject a clock component, mostly for debug purposes.
113114
To set the creation timestamp normally, use `setCreationDate($timestamp)` on the created torrent object.

0 commit comments

Comments
 (0)