PHP Класс PhpThumb, thinksns

This is the GD Implementation of the PHP Thumb library.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_implementations array This stores what implementations are available based on the loaded extensions in PHP, NOT whether or not the class files are present.
$_instance Instance of self
$_registry array This is where all plugins to be loaded are stored. Data about the plugin is provided, and currently consists of: - loaded: true/false - implementation: gd/imagick/both

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

Метод Описание
getInstance ( ) : PhpThumb Returns an instance of self
getPluginRegistry ( string $implementation ) : array Returns the plugin registry for the supplied implementation
isValidImplementation ( string $implementation ) : boolean Returns whether or not $implementation is valid (available)
loadPlugins ( string $pluginPath ) Loads all the plugins in $pluginPath
registerPlugin ( string $pluginName, string $implementation ) : boolean Registers a plugin in the registry

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

Метод Описание
__construct ( ) Class constructor
getImplementations ( ) Finds out what implementations are available

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

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

This is the usual singleton function that returns / instantiates the object
public static getInstance ( ) : PhpThumb
Результат PhpThumb

getPluginRegistry() публичный Метод

Returns the plugin registry for the supplied implementation
public getPluginRegistry ( string $implementation ) : array
$implementation string
Результат array

isValidImplementation() публичный Метод

If 'all' is passed, true is only returned if ALL implementations are available. You can also pass 'n/a', which always returns true
public isValidImplementation ( string $implementation ) : boolean
$implementation string
Результат boolean

loadPlugins() публичный Метод

All this function does is include all files inside the $pluginPath directory. The plugins themselves will not be added to the registry unless you've properly added the code to do so inside your plugin file.
public loadPlugins ( string $pluginPath )
$pluginPath string

registerPlugin() публичный Метод

Adds a plugin to the registry if it isn't already loaded, and if the provided implementation is valid. Note that you can pass the following special keywords for implementation: - all - Requires that all implementations be available - n/a - Doesn't require any implementation When a plugin is added to the registry, it's added as a key on $this->_registry with the value being an array containing the following keys: - loaded - whether or not the plugin has been "loaded" into the core class - implementation - what implementation this plugin is valid for
public registerPlugin ( string $pluginName, string $implementation ) : boolean
$pluginName string
$implementation string
Результат boolean

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

$_implementations защищенное свойство

This stores what implementations are available based on the loaded extensions in PHP, NOT whether or not the class files are present.
protected array $_implementations
Результат array

$_instance защищенное статическое свойство

Instance of self
protected static $_instance

$_registry защищенное свойство

This is where all plugins to be loaded are stored. Data about the plugin is provided, and currently consists of: - loaded: true/false - implementation: gd/imagick/both
protected array $_registry
Результат array