PHP Класс AMP_Image_Dimension_Extractor, amp-wp

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$callbacks_registered

Открытые методы

Метод Описание
extract ( $urls )
extract_by_downloading_images ( array $dimensions, string $mode = 'concurrent' ) : array Extract dimensions from downloaded images (or transient/cached dimensions from downloaded images)
get_default_user_agent ( ) : string Get default user agent
normalize_url ( $url )

Приватные методы

Метод Описание
determine_which_images_to_fetch ( array &$dimensions, array &$urls_to_fetch ) Determine which images to fetch by checking for dimensions in transient/cache.
fetch_images ( array $urls_to_fetch, array &$images, string $mode ) Fetch dimensions of remote images
fetch_images_via_fast_image ( array $urls_to_fetch, array &$images ) Fetch images via FastImage library
fetch_images_via_faster_image ( array $urls_to_fetch, array &$images ) Fetch images via FasterImage library
process_fetched_images ( array $urls_to_fetch, array $images, array &$dimensions, integer $transient_expiration ) Determine success or failure of remote fetch, integrate fetched dimensions into url to dimension mapping, cache fetched dimensions via transient and release/delete semaphore transient
register_callbacks ( )

Описание методов

extract() публичный статический Метод

public static extract ( $urls )

extract_by_downloading_images() публичный статический Метод

Extract dimensions from downloaded images (or transient/cached dimensions from downloaded images)
public static extract_by_downloading_images ( array $dimensions, string $mode = 'concurrent' ) : array
$dimensions array Image urls mapped to dimensions.
$mode string Whether image dimensions should be extracted concurrently or synchronously.
Результат array Dimensions mapped to image urls, or false if they could not be retrieved

get_default_user_agent() публичный статический Метод

Get default user agent
public static get_default_user_agent ( ) : string
Результат string

normalize_url() публичный статический Метод

public static normalize_url ( $url )

Описание свойств

$callbacks_registered статическое публичное свойство

static public $callbacks_registered