PHP Class Spatie\HttpStatusCheck\CrawlLogger

Inheritance: implements Spatie\Crawler\CrawlObserver
Show file Open project: spatie/http-status-check Class Usage Examples

Protected Properties

Property Type Description
$consoleOutput Symfony\Component\Console\Output\OutputInterface
$crawledUrls array
$outputFile string | null

Public Methods

Method Description
__construct ( Symfony\Component\Console\Output\OutputInterface $consoleOutput )
finishedCrawling ( ) Called when the crawl has ended.
hasBeenCrawled ( Url $url, Psr\Http\Message\ResponseInterface | null $response, Url $foundOn = null ) Called when the crawler has crawled the given url.
setOutputFile ( string $filename ) Set the filename to write the output log.
startsWith ( string | null $haystack, string | array $needles ) : boolean
willCrawl ( Url $url ) Called when the crawl will crawl the url.

Protected Methods

Method Description
getColorTagForStatusCode ( string $code ) : string

Method Details

__construct() public method

public __construct ( Symfony\Component\Console\Output\OutputInterface $consoleOutput )
$consoleOutput Symfony\Component\Console\Output\OutputInterface

finishedCrawling() public method

Called when the crawl has ended.
public finishedCrawling ( )

getColorTagForStatusCode() protected method

protected getColorTagForStatusCode ( string $code ) : string
$code string
return string

hasBeenCrawled() public method

Called when the crawler has crawled the given url.
public hasBeenCrawled ( Url $url, Psr\Http\Message\ResponseInterface | null $response, Url $foundOn = null )
$url Spatie\Crawler\Url
$response Psr\Http\Message\ResponseInterface | null
$foundOn Spatie\Crawler\Url

setOutputFile() public method

Set the filename to write the output log.
public setOutputFile ( string $filename )
$filename string

startsWith() public method

public startsWith ( string | null $haystack, string | array $needles ) : boolean
$haystack string | null
$needles string | array
return boolean

willCrawl() public method

Called when the crawl will crawl the url.
public willCrawl ( Url $url )
$url Spatie\Crawler\Url

Property Details

$consoleOutput protected property

protected OutputInterface,Symfony\Component\Console\Output $consoleOutput
return Symfony\Component\Console\Output\OutputInterface

$crawledUrls protected property

protected array $crawledUrls
return array

$outputFile protected property

protected string|null $outputFile
return string | null