PHP Класс Screen\Capture

Автор: André Filipe
Показать файл Открыть проект

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

Свойство Тип Описание
$binPath string Bin directory, should contain the phantomjs file, otherwise it won't work
$jobs Screen\Location\Jobs Jobs directory, directory for temporary files to be written and executed with phantomjs
$output Screen\Location\Output Base directory to save the output files
$templatePath string Template directory, directory in which will be the js templates files to execute

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

Свойство Тип Описание
$backgroundColor string Default body background color is white
$clipHeight integer Height of the page to clip
$clipWidth integer Width of the page to clip
$height integer Height of the page to render
$imageLocation string Location where the file was written to
$imageType Screen\Image\Types\Type Image Type, default is jpeg
$includedJsScripts array List of included JS scripts
$includedJsSnippets array List of included JS snippets
$options array List of options which will be passed to phantomjs
$timeout integer Sets the timeout period
$url string URL to capture the screen of
$userAgentString string User Agent String used on the page request
$width integer Width of the page to render

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

Метод Описание
__construct ( $url = null ) Capture constructor.
getImageLocation ( ) : string Returns the location where the screenshot file was written
getImageType ( ) : Type Returns the image type instance
includeJs ( string | URL $script ) : Capture Adds a JS script or snippet to the screen shot script
save ( string $imageLocation, boolean $deleteFileIfExists = true ) : boolean Saves the screenshot to the requested location
setBackgroundColor ( string $backgroundColor ) : Capture Sets the page body background color
setBinPath ( $binPath ) Sets the path to PhantomJS binary, example: "/usr/bin"
setClipHeight ( integer $clipHeight ) : Capture Sets the height to clip
setClipWidth ( integer $clipWidth ) : Capture Sets the width to clip
setHeight ( integer $height ) : Capture Sets the page height
setImageType ( string $type ) : Capture Sets the image type
setOptions ( array $options ) Sets the options which will be passed to phantomjs
setTimeout ( integer $timeout ) : Capture Sets the timeout period
setUrl ( string $url ) Sets the url to screenshot
setUserAgentString ( string $userAgentString ) : Capture Sets the User Agent String to be used on the page request
setWidth ( integer $width ) : Capture Sets the page width

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

Метод Описание
getOptionsString ( ) : string
getTemplateResult ( string $templateName, array $args ) : string

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

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

Capture constructor.
public __construct ( $url = null )

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

Returns the location where the screenshot file was written
public getImageLocation ( ) : string
Результат string

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

Returns the image type instance
public getImageType ( ) : Type
Результат Screen\Image\Types\Type

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

Adds a JS script or snippet to the screen shot script
public includeJs ( string | URL $script ) : Capture
$script string | URL Script to include
Результат Capture

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

Saves the screenshot to the requested location
public save ( string $imageLocation, boolean $deleteFileIfExists = true ) : boolean
$imageLocation string Image Location
$deleteFileIfExists boolean True to delete the file if it exists
Результат boolean

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

Sets the page body background color
public setBackgroundColor ( string $backgroundColor ) : Capture
$backgroundColor string Background Color
Результат Capture

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

Sets the path to PhantomJS binary, example: "/usr/bin"
public setBinPath ( $binPath )

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

Sets the height to clip
public setClipHeight ( integer $clipHeight ) : Capture
$clipHeight integer Page clip height
Результат Capture

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

Sets the width to clip
public setClipWidth ( integer $clipWidth ) : Capture
$clipWidth integer Page clip width
Результат Capture

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

Sets the page height
public setHeight ( integer $height ) : Capture
$height integer Page Height
Результат Capture

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

Sets the image type
public setImageType ( string $type ) : Capture
$type string 'jpg', 'png', etc...
Результат Capture

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

Sets the options which will be passed to phantomjs
public setOptions ( array $options )
$options array

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

Sets the timeout period
public setTimeout ( integer $timeout ) : Capture
$timeout integer Timeout period
Результат Capture

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

Sets the url to screenshot
public setUrl ( string $url )
$url string URL

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

Sets the User Agent String to be used on the page request
public setUserAgentString ( string $userAgentString ) : Capture
$userAgentString string User Agent String
Результат Capture

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

Sets the page width
public setWidth ( integer $width ) : Capture
$width integer Page Width
Результат Capture

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

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

Default body background color is white
protected string $backgroundColor
Результат string

$binPath публичное свойство

Bin directory, should contain the phantomjs file, otherwise it won't work
public string $binPath
Результат string

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

Height of the page to clip
protected int $clipHeight
Результат integer

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

Width of the page to clip
protected int $clipWidth
Результат integer

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

Height of the page to render
protected int $height
Результат integer

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

Location where the file was written to
protected string $imageLocation
Результат string

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

Image Type, default is jpeg
protected Type,Screen\Image\Types $imageType
Результат Screen\Image\Types\Type

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

List of included JS scripts
protected array $includedJsScripts
Результат array

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

List of included JS snippets
protected array $includedJsSnippets
Результат array

$jobs публичное свойство

Jobs directory, directory for temporary files to be written and executed with phantomjs
public Jobs,Screen\Location $jobs
Результат Screen\Location\Jobs

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

List of options which will be passed to phantomjs
protected array $options
Результат array

$output публичное свойство

Base directory to save the output files
public Output,Screen\Location $output
Результат Screen\Location\Output

$templatePath публичное свойство

Template directory, directory in which will be the js templates files to execute
public string $templatePath
Результат string

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

Sets the timeout period
protected int $timeout
Результат integer

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

URL to capture the screen of
protected string $url
Результат string

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

User Agent String used on the page request
protected string $userAgentString
Результат string

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

Width of the page to render
protected int $width
Результат integer