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.
파일 보기 프로젝트 열기: medz/thinksns-4 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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