src/Utility/LinkScanner.php
public function export($filename = null)
    {
        is_true_or_fail(!$this->ResultScan->isEmpty(), __d('link-scanner', 'There is no result to export. Perhaps the scan was not performed?'), RuntimeException::class);

        $filename = $filename ?: sprintf('results_%s_%s', $this->hostname, $this->startTime);
        $filename = Folder::isAbsolute($filename) ? $filename : Folder::slashTerm($this->getConfig('target')) . $filename;
        (new File($filename, true))->write(serialize($this));
        $this->dispatchEvent('LinkScanner.resultsExported', [$filename]);

        return $filename;
    }
public function export($filename = null)
    {
        is_true_or_fail(!$this->ResultScan->isEmpty(), __d('link-scanner', 'There is no result to export. Perhaps the scan was not performed?'), RuntimeException::class);

        $filename = $filename ?: sprintf('results_%s_%s', $this->hostname, $this->startTime);
        $filename = Folder::isAbsolute($filename) ? $filename : Folder::slashTerm($this->getConfig('target')) . $filename;
        (new File($filename, true))->write(serialize($this));
        $this->dispatchEvent('LinkScanner.resultsExported', [$filename]);

        return $filename;
    }
public function export ( $ filename = null ) { is_true_or_fail ( ! $ this -> ResultScan -> isEmpty ( ) , __d ( 'link-scanner' , 'There is no result to export. Perhaps the scan was not performed?' ) , RuntimeException :: class ) ; $ filename = $ filename ? : sprintf ( 'results_%s_%s' , $ this -> hostname , $ this -> startTime ) ; $ filename = Folder :: isAbsolute ( $ filename ) ? $ filename : Folder :: slashTerm ( $ this -> getConfig ( 'target' ) ) . $ filename ; ( new File ( $ filename , true ) ) -> write ( serialize ( $ this ) ) ; $ this -> dispatchEvent ( 'LinkScanner.resultsExported' , [ $ filename ] ) ; return $ filename ; }
Exports scan results.

The filename will be generated automatically, or you can indicate a
relative or absolute path.
### Events
This method will trigger some events:
- `LinkScanner.resultsExported`: will be triggered when the results have
been exported.
@param string|null $filename Filename where to export
@return string
@see serialize()
@throws RuntimeException
@uses $ResultScan
@uses $hostname
@uses $startTime
Exports scan results .