PHP Class KamranAhmed\Smasher\Scanner

Responsible for crawling the paths and gathering information
Mostrar archivo Open project: kamranahmedse/smasher Class Usage Examples

Protected Properties

Property Type Description
$path The path to operate on
$response Format for the response
$result Encoded response which will be returned

Public Methods

Method Description
__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

Protected Methods

Method Description
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

Private Methods

Method Description
populatePath ( $outputDir, $sourceFile, array $content = [], boolean $isRecursive = false ) Uses the smashed/response file to recursively populate the path

Method Details

__construct() public method

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

getScannedContent() protected method

Gets the scanned content from passed file
protected getScannedContent ( $path ) : array
$path
return array

populate() public method

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() protected method

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

scan() public method

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
return string

Property Details

$path protected_oe property

The path to operate on
protected $path

$response protected_oe property

Format for the response
protected $response

$result protected_oe property

Encoded response which will be returned
protected $result