for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Mage Scan
*
* PHP version 5
* @category MageScan
* @package MageScan
* @author Steve Robbins <[email protected]>
* @copyright 2015 Steve Robbins
* @license http://creativecommons.org/licenses/by/4.0/ CC BY 4.0
* @link https://github.com/steverobbins/magescan
*/
namespace MageScan\Check;
use GuzzleHttp\Psr7\Response;
use MageScan\Request;
* Parse a sitemap
class Sitemap extends AbstractCheck
{
* Parse the sitemap url out of a robots.txt contents
* @param Response $response
* @return string|boolean
public function getSitemapFromRobotsTxt(Response $response)
return $this->getRequest()->findMatchInResponse(
$response->getBody()->getContents(),
'/^(?!#+)\s*Sitemap:\s+(.*)$/mi'
);
}