Jul 28, 2024
- Exception fixes:
- Using $options array now throws
BadFunctionCallException
ParseErrorException
reclassified toUnexpectedValueException
(runtime instead of logic)
- Using $options array now throws
Mar 9, 2024
- Callback Decoder (proposed in gitlab#2)
Jul 14, 2023
- Removed implicit conversion of floats to strings. Since it was unreliable, it's not considered a BC break.
Dec 14, 2022
4.0.0 was branched from 3.1.0
- The package is now
arokettu/bencode
- The namespace is now
Arokettu\Bencode\
- New class names can be used with old branches (1.8+, 2.8+, 3.1+)
- $options arrays now generate an exception if they are not empty
- The parameters are kept for param order compatibility
- Passing class names to
listType
,dictType
, andbigInt
generates a TypeError listType
,dictType
, andbigInt
callbacks receiveiterable
instead ofarray
- Dictionaries are converted to ArrayObject by default
Dec 14, 2022
sandfoxme/bencode
is now provided by the package
Dec 13, 2022
- $options arrays are deprecated
- Passing class names to
listType
,dictType
, andbigInt
is deprecated - Aliased all classes in
SandFox\Bencode\*
toArokettu\Bencode\*
in preparation for 4.0
Oct 24, 2021
- dump() now throws exception if the file is not writable
- load() now throws exception if the file is not readable
Oct 23, 2021
- Objects serialized to empty values are now allowed on non-root levels
Sep 25, 2021
- Future compatible stream check
Sep 17, 2021
3.0.0 was branched from 2.6.1
- PHP 8.1 is required
- Decoding:
- Removed deprecated options:
dictionaryType
(usedictType
),useGMP
(usebigInt: Bencode\BigInt::GMP
) Bencode\BigInt
andBencode\Collection
are now enums, thereforedictType
,listType
,bigInt
params no longer accept bare string values (like'array'
or'object'
or'gmp'
).
- Removed deprecated options:
- Encoding:
- Traversables no longer become dictionaries by default.
You need to wrap them with
DictType
. - Stringables no longer become strings by default.
Use
useStringable: true
to return old behavior. dump($filename, $data)
becamedump($data, $filename)
for consistency with streams.
- Traversables no longer become dictionaries by default.
You need to wrap them with
Decoder
andEncoder
objects that can be pre-configured and then used with consistent options.bencodeSerialize
now declaresmixed
return type
Dec 14, 2022
sandfoxme/bencode
is now provided by the package
Dec 13, 2022
- Alias all classes in
SandFox\Bencode\*
toArokettu\Bencode\*
in preparation for 4.0
Nov 30, 2021
- symfony/contracts v3 is now allowed
Oct 24, 2021
- dump() now throws exception if the file is not writable
- load() now throws exception if the file is not readable
Oct 23, 2021
- Objects serialized to empty values are now allowed on non-root levels
Sep 25, 2021
- Future compatible stream check
Sep 17, 2021
- Decoder and Encoder are backported from 3.x
DictType
backported from 3.xuseJsonSerializable
backported from 3.xuseGMP
is marked as deprecated- Fixed
'useGMP'
in options array causing crash
Sep 10, 2021
- Fixed possible invalid dictionary encoding when traversable returns non unique keys
Feb 14, 2021
- Expanded big integer support:
brick/math
Math_BigInteger
- Custom BigIntType numeric string wrapper
- Callback and custom class name
Feb 3, 2021
- Added stream API
- Added GMP support
Nov 10, 2020
- Make spec compliant BitTorrent code simpler:
null
andfalse
values are now skipped on encoding - Remove deprecation warning for options array
Oct 4, 2020
- Shorten
dictionaryType
todictType
.dictionaryType
will be removed in 3.0 - Trigger silent deprecations for deprecated stuff
Oct 3, 2020
- Update
dump()
andload()
signatures to matchencode()
anddecode()
Aug 5, 2020
- Replace Becnode::decode() options array with named parameters. Options array is now deprecated and will be removed in 3.0
- Engine optimizations
Jun 30, 2020
2.0.0 was branched from 1.3.0
- PHP 8 is required
- Legacy namespace
SandFoxMe\Bencode
is removed - Encode now throws an error if it encounters a value that cannot be serialized
Dec 14, 2022
sandfoxme/bencode
is now provided by the package
Dec 13, 2022
- Alias all classes in
SandFox\Bencode\*
toArokettu\Bencode\*
in preparation for 4.0
Oct 24, 2021
- dump() now throws exception if the file is not writable
- load() now throws exception if the file is not readable
Oct 23, 2021
- Objects serialized to empty values are now allowed on non-root levels
Sep 25, 2021
- Future compatible stream check
Sep 17, 2021
- Decoder and Encoder are backported from 3.x
DictType
backported from 3.xuseJsonSerializable
backported from 3.x
Sep 10, 2021
- Fixed possible invalid dictionary encoding when traversable returns non unique keys
Feb 14, 2021
- Fixed invalid
BigIntType::assertValidInteger
visibility - Added missing
@internal
and strict type markings
Feb 14, 2021
- Expanded big integer support:
brick/math
Math_BigInteger
- Custom BigIntType numeric string wrapper
- Callback and custom class name
Feb 3, 2021
- Added stream API
- Added GMP support
Nov 10, 2020
- Made spec compliant BitTorrent code simpler:
null
andfalse
values are now skipped on encoding - Added
'dictType'
alias for'dictionaryType'
for 2.3 compatibility
Feb 14, 2019
- Increased parser speed and reduced memory consumption
- Base namespace is now
SandFox\Bencode
. Compatibility is kept for now - Fixed tests for PHP 8
Feb 14, 2018
- Added
BencodeSerializable
interface
Dec 12, 2017
- Throw a Runtime Exception when trying to use the library with Mbstring Function Overloading on
Mar 30, 2017
- ListType can now wrap arrays
Mar 29, 2017
- boolean is now converted to integer
Bencode::dump
now returns success as boolean- Fixed: decoded junk at the end of the string replaced entire parsed data if it also was valid bencode
- PHP 7.0 is now required instead of PHP 7.1
- Tests!
Mar 22, 2017
- Added stdClass as list/dict decoding option
Mar 22, 2017
Initial release