src/Event/LinkScannerCommandEventListener.php
public function scanStarted(Event $event, $startTime, $fullBaseUrl)
    {
        if ($this->args->getOption('verbose')) {
            $this->io->hr();
        }

        $startTime = (new Time($startTime))->i18nFormat('yyyy-MM-dd HH:mm:ss');
        $this->io->info(__d('link-scanner', 'Scan started for {0} at {1}', $fullBaseUrl, $startTime));

        if (!$this->args->getOption('verbose')) {
            return true;
        }

        $this->io->hr();

        $cache = Cache::getConfig('LinkScanner');
        if (!$this->args->getOption('no-cache') && Cache::enabled() && !empty($cache['duration'])) {
            $this->io->success(__d('link-scanner', 'The cache is enabled and its duration is `{0}`', $cache['duration']));
        } else {
            $this->io->info(__d('link-scanner', 'The cache is disabled'));
        }

        if ($this->args->getOption('force')) {
            $this->io->info(__d('link-scanner', 'Force mode is enabled'));
        } else {
            $this->io->info(__d('link-scanner', 'Force mode is not enabled'));
        }

        if ($event->getSubject()->getConfig('externalLinks')) {
            $this->io->info(__d('link-scanner', 'Scanning of external links is enabled'));
        } else {
            $this->io->info(__d('link-scanner', 'Scanning of external links is not enabled'));
        }

        if ($event->getSubject()->getConfig('followRedirects')) {
            $this->io->info(__d('link-scanner', 'Redirects will be followed'));
        } else {
            $this->io->info(__d('link-scanner', 'Redirects will not be followed'));
        }

        $maxDepth = $event->getSubject()->getConfig('maxDepth');
        if (is_positive($maxDepth)) {
            $this->io->info(__d('link-scanner', 'Maximum depth of the scan: {0}', $maxDepth));
        }

        $timeout = $event->getSubject()->Client->getConfig('timeout');
        if (is_positive($timeout)) {
            $this->io->info(__d('link-scanner', 'Timeout in seconds for GET requests: {0}', $timeout));
        }

        $this->io->hr();

        return true;
    }
public function scanStarted(Event $event, $startTime, $fullBaseUrl)
    {
        if ($this->args->getOption('verbose')) {
            $this->io->hr();
        }

        $startTime = (new Time($startTime))->i18nFormat('yyyy-MM-dd HH:mm:ss');
        $this->io->info(__d('link-scanner', 'Scan started for {0} at {1}', $fullBaseUrl, $startTime));

        if (!$this->args->getOption('verbose')) {
            return true;
        }

        $this->io->hr();

        $cache = Cache::getConfig('LinkScanner');
        if (!$this->args->getOption('no-cache') && Cache::enabled() && !empty($cache['duration'])) {
            $this->io->success(__d('link-scanner', 'The cache is enabled and its duration is `{0}`', $cache['duration']));
        } else {
            $this->io->info(__d('link-scanner', 'The cache is disabled'));
        }

        if ($this->args->getOption('force')) {
            $this->io->info(__d('link-scanner', 'Force mode is enabled'));
        } else {
            $this->io->info(__d('link-scanner', 'Force mode is not enabled'));
        }

        if ($event->getSubject()->getConfig('externalLinks')) {
            $this->io->info(__d('link-scanner', 'Scanning of external links is enabled'));
        } else {
            $this->io->info(__d('link-scanner', 'Scanning of external links is not enabled'));
        }

        if ($event->getSubject()->getConfig('followRedirects')) {
            $this->io->info(__d('link-scanner', 'Redirects will be followed'));
        } else {
            $this->io->info(__d('link-scanner', 'Redirects will not be followed'));
        }

        $maxDepth = $event->getSubject()->getConfig('maxDepth');
        if (is_positive($maxDepth)) {
            $this->io->info(__d('link-scanner', 'Maximum depth of the scan: {0}', $maxDepth));
        }

        $timeout = $event->getSubject()->Client->getConfig('timeout');
        if (is_positive($timeout)) {
            $this->io->info(__d('link-scanner', 'Timeout in seconds for GET requests: {0}', $timeout));
        }

        $this->io->hr();

        return true;
    }
public function scanStarted ( Event $ event , $ startTime , $ fullBaseUrl ) { if ( $ this -> args -> getOption ( 'verbose' ) ) { $ this -> io -> hr ( ) ; } $ startTime = ( new Time ( $ startTime ) ) -> i18nFormat ( 'yyyy-MM-dd HH:mm:ss' ) ; $ this -> io -> info ( __d ( 'link-scanner' , 'Scan started for {0} at {1}' , $ fullBaseUrl , $ startTime ) ) ; if ( ! $ this -> args -> getOption ( 'verbose' ) ) { return true ; } $ this -> io -> hr ( ) ; $ cache = Cache :: getConfig ( 'LinkScanner' ) ; if ( ! $ this -> args -> getOption ( 'no-cache' ) && Cache :: enabled ( ) && ! empty ( $ cache [ 'duration' ] ) ) { $ this -> io -> success ( __d ( 'link-scanner' , 'The cache is enabled and its duration is `{0}`' , $ cache [ 'duration' ] ) ) ; } else { $ this -> io -> info ( __d ( 'link-scanner' , 'The cache is disabled' ) ) ; } if ( $ this -> args -> getOption ( 'force' ) ) { $ this -> io -> info ( __d ( 'link-scanner' , 'Force mode is enabled' ) ) ; } else { $ this -> io -> info ( __d ( 'link-scanner' , 'Force mode is not enabled' ) ) ; } if ( $ event -> getSubject ( ) -> getConfig ( 'externalLinks' ) ) { $ this -> io -> info ( __d ( 'link-scanner' , 'Scanning of external links is enabled' ) ) ; } else { $ this -> io -> info ( __d ( 'link-scanner' , 'Scanning of external links is not enabled' ) ) ; } if ( $ event -> getSubject ( ) -> getConfig ( 'followRedirects' ) ) { $ this -> io -> info ( __d ( 'link-scanner' , 'Redirects will be followed' ) ) ; } else { $ this -> io -> info ( __d ( 'link-scanner' , 'Redirects will not be followed' ) ) ; } $ maxDepth = $ event -> getSubject ( ) -> getConfig ( 'maxDepth' ) ; if ( is_positive ( $ maxDepth ) ) { $ this -> io -> info ( __d ( 'link-scanner' , 'Maximum depth of the scan: {0}' , $ maxDepth ) ) ; } $ timeout = $ event -> getSubject ( ) -> Client -> getConfig ( 'timeout' ) ; if ( is_positive ( $ timeout ) ) { $ this -> io -> info ( __d ( 'link-scanner' , 'Timeout in seconds for GET requests: {0}' , $ timeout ) ) ; } $ this -> io -> hr ( ) ; return true ; }
`LinkScanner.scanStarted` event
@param Event $event An `Event` instance
@param int $startTime Start time
@param string $fullBaseUrl Full base url
@return bool
@uses $args
@uses $io
LinkScanner . scanStarted event