Arachnid\Crawler::checkIfCrawlable PHP Method

checkIfCrawlable() protected method

Is a given URL crawlable?
protected checkIfCrawlable ( string $uri ) : boolean
$uri string
return boolean
    protected function checkIfCrawlable($uri)
    {
        if (empty($uri) === true) {
            return false;
        }
        $stop_links = array('@^javascript\\:.*$@i', '@^#.*@', '@^mailto\\:.*@i', '@^tel\\:.*@i', '@^fax\\:.*@i');
        foreach ($stop_links as $ptrn) {
            if (preg_match($ptrn, $uri) === 1) {
                return false;
            }
        }
        return true;
    }