PHP Класс ThumbBase, thinksns

This is the base class that all implementations must extend. It contains the core variables and functionality common to all implementations, as well as the functions that allow plugins to augment those classes.
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$errorMessage string The last error message raised
$fileName string This must include the path to the file (absolute paths recommended)
$format string What the file format is (mime-type)
$hasError boolean Whether or not the current instance has any errors
$imported array An array of imported plugin objects
$importedFunctions array An array of all methods added to this class by imported plugin objects
$isDataStream boolean By "raw file data" it's meant that we're actually passing the result of something like file_get_contents() or perhaps from a database blob
$remoteImage boolean Whether or not the image is hosted remotely

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

Метод Описание
__call ( string $method, array $args ) Calls plugin / imported functions
__construct ( $fileName, $isDataStream = false ) : ThumbBase Class constructor
getErrorMessage ( ) Returns $errorMessage.
getFileName ( ) Returns $fileName.
getFormat ( ) Returns $format.
getHasError ( ) Returns $hasError.
getImported ( ) : array Returns $imported.
getImportedFunctions ( ) : array Returns $importedFunctions.
importPlugins ( array $registry ) Imports plugins in $registry to the class
setErrorMessage ( object $errorMessage ) Sets $errorMessage.
setFileName ( object $fileName ) Sets $fileName.
setFormat ( object $format ) Sets $format.
setHasError ( object $hasError ) Sets $hasError.

Защищенные методы

Метод Описание
fileExistsAndReadable ( ) Checks to see if $this->fileName exists and is readable
imports ( string $object ) Imports a plugin
triggerError ( string $errorMessage ) Sets $this->errorMessage to $errorMessage and throws an exception

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

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

This is also where a fair amount of plugins magaic happens. This magic method is called whenever an "undefined" class method is called in code, and we use that to call an imported function. You should NEVER EVER EVER invoke this function manually. The universe will implode if you do... seriously ;)
public __call ( string $method, array $args )
$method string
$args array

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

Class constructor
public __construct ( $fileName, $isDataStream = false ) : ThumbBase
Результат ThumbBase

fileExistsAndReadable() защищенный Метод

Checks to see if $this->fileName exists and is readable
protected fileExistsAndReadable ( )

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

Returns $errorMessage.
См. также: ThumbBase::$errorMessage
public getErrorMessage ( )

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

Returns $fileName.
См. также: ThumbBase::$fileName
public getFileName ( )

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

Returns $format.
См. также: ThumbBase::$format
public getFormat ( )

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

Returns $hasError.
См. также: ThumbBase::$hasError
public getHasError ( )

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

Returns $imported.
См. также: ThumbBase::$imported
public getImported ( ) : array
Результат array

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

Returns $importedFunctions.
См. также: ThumbBase::$importedFunctions
public getImportedFunctions ( ) : array
Результат array

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

Imports plugins in $registry to the class
public importPlugins ( array $registry )
$registry array

imports() защищенный Метод

This is where all the plugins magic happens! This function "loads" the plugin functions, making them available as methods on the class.
protected imports ( string $object )
$object string The name of the object to import / "load"

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

Sets $errorMessage.
См. также: ThumbBase::$errorMessage
public setErrorMessage ( object $errorMessage )
$errorMessage object

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

Sets $fileName.
См. также: ThumbBase::$fileName
public setFileName ( object $fileName )
$fileName object

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

Sets $format.
См. также: ThumbBase::$format
public setFormat ( object $format )
$format object

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

Sets $hasError.
См. также: ThumbBase::$hasError
public setHasError ( object $hasError )
$hasError object

triggerError() защищенный Метод

Also sets $this->hasError to true, so even if the exceptions are caught, we don't attempt to proceed with any other functions
protected triggerError ( string $errorMessage )
$errorMessage string

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

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

The last error message raised
protected string $errorMessage
Результат string

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

This must include the path to the file (absolute paths recommended)
protected string $fileName
Результат string

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

What the file format is (mime-type)
protected string $format
Результат string

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

Whether or not the current instance has any errors
protected bool $hasError
Результат boolean

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

An array of imported plugin objects
protected array $imported
Результат array

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

An array of all methods added to this class by imported plugin objects
protected array $importedFunctions
Результат array

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

By "raw file data" it's meant that we're actually passing the result of something like file_get_contents() or perhaps from a database blob
protected bool $isDataStream
Результат boolean

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

Whether or not the image is hosted remotely
protected bool $remoteImage
Результат boolean