Bitrix API

FileTransformer implements InterfaceCallback

AbstractYes

Table of Contents

Interfaces

InterfaceCallback

Constants

CACHE_PATH  = '/bx/transformer/command/'
CRC32  = 'crc32'
IMAGE  = 'jpg'
MAX_EXECUTION_TIME  = 14400
MAX_FILESIZE  = 104857600
MD5  = 'md5'
SHA1  = 'sha1'

Methods

call()  : mixed
Example callback that will be invoked after transformation to process results.
clearInfoCache()  : mixed
Clears cache of command info on $file.
getTransformationInfoByFile()  : bool|array<string|int, mixed>
Get information of the last transformation command of the file.
getTransformerCommandName()  : string
transform()  : Result
Make transformation of a file

Constants

MAX_EXECUTION_TIME

Transformer module handles timeouts on its own. You don't need to check max execution time.

public mixed MAX_EXECUTION_TIME = 14400

Methods

call()

Example callback that will be invoked after transformation to process results.

public static call(int $status, string $command, array<string|int, mixed> $params[, array<string|int, mixed> $result = [] ]) : mixed
Parameters
$status : int

Status of the command in b_transformer_command.

$command : string

Name of the command.

$params : array<string|int, mixed>

Parameters of the command.

$result : array<string|int, mixed> = []

Result of the command from controller array ( 'files' => array ( 'extension' => 'url', ... ) 'md5' => 'md5 sum', 'crc32' => 'crc32 sum', 'sha1' => 'sha1 sum', ... ).

clearInfoCache()

Clears cache of command info on $file.

public static clearInfoCache(int|string $file) : mixed
Parameters
$file : int|string
  • ID in b_file or path.

getTransformationInfoByFile()

Get information of the last transformation command of the file.

public static getTransformationInfoByFile(int|string $file) : bool|array<string|int, mixed>

array status - int time - DateTime id - int

Parameters
$file : int|string
  • ID in b_file or path.
Return values
bool|array<string|int, mixed>

getTransformerCommandName()

public final static getTransformerCommandName() : string
Return values
string

transform()

Make transformation of a file

public transform(int|string $file, array<string|int, mixed> $formats, string|array<string|int, mixed> $module, string|array<string|int, mixed> $callback[, array<string|int, mixed> $params = [] ]) : Result
Parameters
$file : int|string

ID from b_file or path to the file.

$formats : array<string|int, mixed>

What to do with the file.

$module : string|array<string|int, mixed>

Module name (one or several). These modules will be included before callback.

$callback : string|array<string|int, mixed>

Callback(s) to call with results.

$params : array<string|int, mixed> = []

Extra params.

Return values
Result

        
On this page

Search results