This is a simple PHP extension which provides support to Anime Tosho's DDL uploader PHP script.
This is built like a typical PHP extension: phpize && ./configure && make && make install
You’ll likely need to enable the extension afterwards.
This extension should be compatible with both PHP 7 and 8.
Very brief descriptions - see code for more details.
Performs 7-Zip's swap4 encoding on supplied argument and returns the result. This can also be thought of as performing a 4 byte endian swap on given data. If the passed in data’s length is not a multiple of four, the order of the remaining bytes are kept as is.
Exposes the sendfile system call. Both streams must be 'raw' streams (i.e. direct to OS stream without filtering).
Returns false on error, or the number of bytes sent if successful.
Returns true if supplied resource is a non-filtered stream. This is useful to check if the stream can be used in atext_sendfile and posix_fadvise.
Exposes the posix_fadvise system call. The supplied stream must be a ‘raw’ stream.
This code is Public Domain or CC0 (or equivalent) if PD isn’t recognised.