src/Utility/LinkScanner.php
public function scan()
    {
        //Sets the full base url
        $fullBaseUrl = $this->getConfig('fullBaseUrl', Configure::read('App.fullBaseUrl') ?: 'http://localhost');
        is_true_or_fail(is_url($fullBaseUrl), __d('link-scanner', 'Invalid full base url `{0}`', $fullBaseUrl), InvalidArgumentException::class);
        $this->hostname = get_hostname_from_url($fullBaseUrl);

        $this->_createLockFile();
        $this->startTime = time();

        $maxNestingLevel = ini_set('xdebug.max_nesting_level', -1);

        try {
            $this->dispatchEvent('LinkScanner.scanStarted', [$this->startTime, $fullBaseUrl]);
            $this->_recursiveScan($fullBaseUrl);
            $this->endTime = time();
            $this->dispatchEvent('LinkScanner.scanCompleted', [$this->startTime, $this->endTime, $this->ResultScan]);
        } finally {
            ini_set('xdebug.max_nesting_level', $maxNestingLevel);
            @unlink($this->lockFile);
        }

        return $this;
    }
public function scan()
    {
        //Sets the full base url
        $fullBaseUrl = $this->getConfig('fullBaseUrl', Configure::read('App.fullBaseUrl') ?: 'http://localhost');
        is_true_or_fail(is_url($fullBaseUrl), __d('link-scanner', 'Invalid full base url `{0}`', $fullBaseUrl), InvalidArgumentException::class);
        $this->hostname = get_hostname_from_url($fullBaseUrl);

        $this->_createLockFile();
        $this->startTime = time();

        $maxNestingLevel = ini_set('xdebug.max_nesting_level', -1);

        try {
            $this->dispatchEvent('LinkScanner.scanStarted', [$this->startTime, $fullBaseUrl]);
            $this->_recursiveScan($fullBaseUrl);
            $this->endTime = time();
            $this->dispatchEvent('LinkScanner.scanCompleted', [$this->startTime, $this->endTime, $this->ResultScan]);
        } finally {
            ini_set('xdebug.max_nesting_level', $maxNestingLevel);
            @unlink($this->lockFile);
        }

        return $this;
    }
public function scan ( ) { //Sets the full base url $ fullBaseUrl = $ this -> getConfig ( 'fullBaseUrl' , Configure :: read ( 'App.fullBaseUrl' ) ? : 'http://localhost' ) ; is_true_or_fail ( is_url ( $ fullBaseUrl ) , __d ( 'link-scanner' , 'Invalid full base url `{0}`' , $ fullBaseUrl ) , InvalidArgumentException :: class ) ; $ this -> hostname = get_hostname_from_url ( $ fullBaseUrl ) ; $ this -> _createLockFile ( ) ; $ this -> startTime = time ( ) ; $ maxNestingLevel = ini_set ( 'xdebug.max_nesting_level' , - 1 ) ; try { $ this -> dispatchEvent ( 'LinkScanner.scanStarted' , [ $ this -> startTime , $ fullBaseUrl ] ) ; $ this -> _recursiveScan ( $ fullBaseUrl ) ; $ this -> endTime = time ( ) ; $ this -> dispatchEvent ( 'LinkScanner.scanCompleted' , [ $ this -> startTime , $ this -> endTime , $ this -> ResultScan ] ) ; } finally { ini_set ( 'xdebug.max_nesting_level' , $ maxNestingLevel ) ; @ unlink ( $ this -> lockFile ) ; } return $ this ; }
Performs a complete scan.

### Events
This method will trigger some events:
- `LinkScanner.scanStarted`: will be triggered before the scan starts;
- `LinkScanner.scanCompleted`: will be triggered after the scan is
finished.

Other events will be triggered by `_recursiveScan()` and `_singleScan()`
methods.
@return $this
@throws InvalidArgumentException
@uses _createLockFile()
@uses _recursiveScan()
@uses $ResultScan
@uses $endTime
@uses $hostname
@uses $lockFile
@uses $startTime
Performs a complete scan .