PHP Класс KamranAhmed\Smasher\Scanner

Responsible for crawling the paths and gathering information
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$path The path to operate on
$response Format for the response
$result Encoded response which will be returned

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

Метод Описание
__construct ( KamranAhmed\Smasher\Contracts\ResponseContract $response ) Scanner constructor.
populate ( $outputDir, $sourceFile ) Uses the source file to populate the path provided
scan ( $path, string $resultPath = '' ) : string Scans the provided path and returns the encoded response. Also if resultPath is provided then the response will be stored in the resultPath

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

Метод Описание
getScannedContent ( $path ) : array Gets the scanned content from passed file
probe ( $path, &$parentItem, string $fullPath = '' ) Probes the path and keeps populating the array with the results

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

Метод Описание
populatePath ( $outputDir, $sourceFile, array $content = [], boolean $isRecursive = false ) Uses the smashed/response file to recursively populate the path

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

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

Scanner constructor.
public __construct ( KamranAhmed\Smasher\Contracts\ResponseContract $response )
$response KamranAhmed\Smasher\Contracts\ResponseContract

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

Gets the scanned content from passed file
protected getScannedContent ( $path ) : array
$path
Результат array

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

Uses the source file to populate the path provided
public populate ( $outputDir, $sourceFile )
$outputDir The directory at which the content from file is to be populated
$sourceFile The file to use for populating

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

Probes the path and keeps populating the array with the results
protected probe ( $path, &$parentItem, string $fullPath = '' )
$path
$parentItem
$fullPath string

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

Scans the provided path and returns the encoded response. Also if resultPath is provided then the response will be stored in the resultPath
public scan ( $path, string $resultPath = '' ) : string
$path The path to scan
$resultPath string The path at which the resultant file will be created
Результат string

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

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

The path to operate on
protected $path

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

Format for the response
protected $response

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

Encoded response which will be returned
protected $result