ZenphotoCMS 1.6.1

cacheManager

Standard options interface

Tags
author

Stephen

Table of Contents

$albums_cached  : mixed
$enabledsizes  : mixed
$images_cached  : mixed
$imagesizes_cached  : mixed
$imagesizes_failed  : mixed
$imagesizes_total  : mixed
$missingimages  : mixed
$sizes  : mixed
$starttime  : mixed
__construct()  : mixed
addCacheSize()  : mixed
Adds a custom image cache size for themes and – despite the method name – also for plugins
addDefaultSizedImageSize()  : mixed
Adds default sized image size for the cachemanger
addDefaultThumbSize()  : mixed
Adds the default theme thumb cache size
albumbutton()  : mixed
cleanupCacheSizes()  : mixed
Removes up all sizes by non existing themes and non active plugins on this install
deleteCacheSizes()  : mixed
Deletes theme cache sizes of the owner
generateImage()  : mixed
Sends a single cURL request to i.php to generate the image size requested if curl is available, otherwise requests the image size directly by printing it.
getOptionsSupported()  : mixed
supported options
getSizes()  : array<string|int, mixed>
Returns an array with the stored sizes to cache
getTitle()  : string
isValid()  : bool
Used to check and skip cachemanager sizes if - their owner (theme or extension) isn't existing or not enabled.
loadAlbum()  : mixed
Processes a single album to cache its images
loadAlbums()  : type
Processes an album and recursively its subalbums
loadImage()  : mixed
Caches sizes for a single image
loadImages()  : int
Processes the images of an album
overviewbutton()  : mixed
printButtons()  : mixed
Prints the buttons after you cached image sizes
printCurlNote()  : mixed
Just prints a note if the PHP extension cURL is not available
printJS()  : mixed
printSizesListEntry()  : mixed
Prints the form elements to select a cache size to process
published()  : mixed
filter for the setShow() methods
recordMissing()  : mixed
Updates an global array variable with missing images
updateCacheName()  : mixed
Updates the path to the cache folder

Properties

$enabledsizes

public static mixed $enabledsizes = array()

$imagesizes_cached

public static mixed $imagesizes_cached = 0

$imagesizes_failed

public static mixed $imagesizes_failed = 0

$imagesizes_total

public static mixed $imagesizes_total = 0

$missingimages

public static mixed $missingimages = \null

Methods

__construct()

public __construct() : mixed
Return values
mixed

addCacheSize()

Adds a custom image cache size for themes and – despite the method name – also for plugins

public static addCacheSize(string $owner, int $size, int $width, int $height, int $cw, int $ch, int $cx, int $cy, bool $thumb[, bool $watermark = NULL ][, string $effects = NULL ][, bool $maxspace = false ]) : mixed
Parameters
$owner : string

Name of the theme (or plugin) this belongs to

$size : int
$width : int
$height : int
$cw : int

crop width

$ch : int

crop height

$cx : int

crop x

$cy : int

crop y

$thumb : bool
$watermark : bool = NULL
$effects : string = NULL
$maxspace : bool = false
Return values
mixed

addDefaultSizedImageSize()

Adds default sized image size for the cachemanger

public static addDefaultSizedImageSize() : mixed
Return values
mixed

addDefaultThumbSize()

Adds the default theme thumb cache size

public static addDefaultThumbSize() : mixed
Return values
mixed

albumbutton()

public static albumbutton(mixed $html, mixed $object, mixed $prefix) : mixed
Parameters
$html : mixed
$object : mixed
$prefix : mixed
Return values
mixed

cleanupCacheSizes()

Removes up all sizes by non existing themes and non active plugins on this install

public static cleanupCacheSizes() : mixed
Return values
mixed

deleteCacheSizes()

Deletes theme cache sizes of the owner

public static deleteCacheSizes(mixed $owner) : mixed
Parameters
$owner : mixed
Return values
mixed

generateImage()

Sends a single cURL request to i.php to generate the image size requested if curl is available, otherwise requests the image size directly by printing it.

public static generateImage(string $imageuri[, bool $output = true ]) : mixed
Parameters
$imageuri : string

The image processor uri to this image

$output : bool = true

If a list entry with the size generation status should be output. Default true. Set to false to return true|false for success. Note disabling output only works with the cURL mode!

Return values
mixed

getOptionsSupported()

supported options

public getOptionsSupported() : mixed
Return values
mixed

getSizes()

Returns an array with the stored sizes to cache

public static getSizes([string $mode = 'all' ]) : array<string|int, mixed>

Note: The default thumb and sized image sizes are not included even if set

Parameters
$mode : string = 'all'

"all" for all sizes stored, "inactive' or "active"

Return values
array<string|int, mixed>

getTitle()

public static getTitle(string $table, string $row) : string
Parameters
$table : string
$row : string
Return values
string

isValid()

Used to check and skip cachemanager sizes if - their owner (theme or extension) isn't existing or not enabled.

public static isValid(string $owner) : bool

Also used to sort our default thumb/default sized image

  • Checks if this is from an existing theme ("admin" sizes are always valid)
  • Checks if this is from an enabeled extension
  • Checks if this is from an installed extension at least
Parameters
$owner : string
Return values
bool

loadAlbum()

Processes a single album to cache its images

public static loadAlbum(mixed $albumobj) : mixed
Parameters
$albumobj : mixed
Tags
global

obj $_zp_gallery

Return values
mixed

loadAlbums()

Processes an album and recursively its subalbums

public static loadAlbums(type $albumobj) : type
Parameters
$albumobj : type
Return values
type

loadImage()

Caches sizes for a single image

public static loadImage(obj $imageobj[, bool $output = true ]) : mixed
Parameters
$imageobj : obj

Image object

$output : bool = true

If a list entry with the size generation status should be output. Default true. Set to false to return true|false for success. Note disabling output only works with the cURL mode!

Tags
since
1.6.1
Return values
mixed

loadImages()

Processes the images of an album

public static loadImages(type $albumobj) : int
Parameters
$albumobj : type
Tags
global

obj $_zp_gallery

Return values
int

overviewbutton()

public static overviewbutton(mixed $buttons) : mixed
Parameters
$buttons : mixed
Return values
mixed

printButtons()

Prints the buttons after you cached image sizes

public static printButtons(string $returnpage[, string $alb = '' ][, bool $hidden = false ]) : mixed
Parameters
$returnpage : string

Pageurl to return to

$alb : string = ''

Name of the album if caching from an album page

$hidden : bool = false

True if the buttons should be hidden via the css class "hidden" initially.

Return values
mixed

printCurlNote()

Just prints a note if the PHP extension cURL is not available

public static printCurlNote() : mixed
Return values
mixed

printJS()

public static printJS() : mixed
Return values
mixed

printSizesListEntry()

Prints the form elements to select a cache size to process

public static printSizesListEntry(string $value, string $checked, string $text[, string $class = null ]) : mixed
Parameters
$value : string
$checked : string
$text : string
$class : string = null
Return values
mixed

published()

filter for the setShow() methods

public static published(object $obj) : mixed
Parameters
$obj : object
Tags
deprecated
2.0
Return values
mixed

recordMissing()

Updates an global array variable with missing images

public static recordMissing(string $table, string $row, string $image) : mixed
Parameters
$table : string
$row : string
$image : string
Return values
mixed

updateCacheName()

Updates the path to the cache folder

public static updateCacheName(mixed $text, string $target, string $update) : mixed
Parameters
$text : mixed
$target : string
$update : string
Return values
mixed

Search results