Skip to content

animetosho/uploader-php-ext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anime Tosho DDL Uploader PHP Extension

This is a simple PHP extension which provides support to Anime Tosho's DDL uploader PHP script.

Installation

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.

Functions

Very brief descriptions - see code for more details.

string atext_swap4(string data)

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.

bool/int atext_sendfile(resource source, resource dest, int max_len=PHP_INT_MAX, int pos=-1)

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.

bool atext_is_raw_stream(resource stream)

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.

bool posix_fadvise(resource stream, int advice, int offset=-1, int length=0)

Exposes the posix_fadvise system call. The supplied stream must be a ‘raw’ stream.

License

This code is Public Domain or CC0 (or equivalent) if PD isn’t recognised.

About

Anime Tosho DDL uploader PHP extension

Resources

Stars

Watchers

Forks

Contributors