Commit 03d82443 authored by tadityar's avatar tadityar Committed by paulmckibben
Browse files

Issue #2410039 by tadityar: Documentation should not exceed 80 chars

parent ce9cb5a7
......@@ -16,7 +16,8 @@ use Drupal\Core\Template\TwigEnvironment;
use Drupal\Core\Entity\EntityManagerInterface;
/**
* Returns responses for xmlsitemap.sitemap_xml and xmlsitemap.sitemap_xsl routes.
* Returns responses for xmlsitemap.sitemap_xml and xmlsitemap.sitemap_xsl
* routes.
*/
class XmlSitemapController extends ControllerBase {
......@@ -68,7 +69,8 @@ class XmlSitemapController extends ControllerBase {
* @throws NotFoundHttpException
*
* @return \Symfony\Component\HttpFoundation\Response
* The sitemap in XML format or plain text if xmlsitemap_developer_mode flag is set.
* The sitemap in XML format or plain text if xmlsitemap_developer_mode flag
* is set.
*/
public function renderSitemapXml() {
$sitemap = $this->entityManager->getStorage('xmlsitemap')->loadByContext();
......
......@@ -383,7 +383,7 @@ abstract class XmlSitemapTestBase extends WebTestBase {
'@timestamp' => $message->timestamp,
'@severity' => $levels[$message->severity],
'@type' => $message->type,
//'!message' => theme_dblog_message(array('event' => $message, 'link' => FALSE)),
// '!message' => theme_dblog_message(array('event' => $message, 'link' => FALSE)),
));
}
......
......@@ -261,17 +261,17 @@ class XmlSitemapGenerator implements XmlSitemapGeneratorInterface {
$element['lastmod'] = gmdate($lastmod_format, $link['lastmod']);
// If the link has a lastmod value, update the changefreq so that links
// with a short changefreq but updated two years ago show decay.
// We use abs() here just incase items were created on this same cron run
// because lastmod would be greater than REQUEST_TIME.
// We use abs() here just incase items were created on this same cron
// run because lastmod would be greater than REQUEST_TIME.
$link['changefreq'] = (abs(REQUEST_TIME - $link['lastmod']) + $link['changefreq']) / 2;
}
if ($link['changefreq']) {
$element['changefreq'] = xmlsitemap_get_changefreq($link['changefreq']);
}
if (isset($link['priority']) && $link['priority'] != 0.5) {
// Don't output the priority value for links that have 0.5 priority. This
// is the default 'assumed' value if priority is not included as per the
// sitemaps.org specification.
// Don't output the priority value for links that have 0.5 priority.
// This is the default 'assumed' value if priority is not included as
// per the sitemaps.org specification.
$element['priority'] = number_format($link['priority'], 1);
}
$writer->writeSitemapElement('url', $element);
......
......@@ -15,9 +15,9 @@ interface XmlSitemapGeneratorInterface {
/**
* Given an internal Drupal path, return the alias for the path.
*
* This is similar to drupal_get_path_alias(), but designed to fetch all alises
* at once so that only one database query is executed instead of several or
* possibly thousands during sitemap generation.
* This is similar to drupal_get_path_alias(), but designed to fetch all
* aliases at once so that only one database query is executed instead of
* severa or possibly thousands during sitemap generation.
*
* @param string $path
* An internal Drupal path.
......
......@@ -39,8 +39,8 @@ interface XmlSitemapLinkStorageInterface {
* An array of the sitemap link.
* @param array $original_link
* An optional array of the existing data. This should only contain the
* fields necessary for comparison. If not provided the existing data will be
* loaded from the database.
* fields necessary for comparison. If not provided the existing data will
* be loaded from the database.
* @param bool $flag
* An optional boolean that if TRUE, will set the regenerate needed flag if
* there is a match. Defaults to FALSE.
......
......@@ -1024,7 +1024,8 @@ function xmlsitemap_get_chunk_size($reset = FALSE) {
if (!isset($size) || $reset) {
$size = xmlsitemap_var('chunk_size');
if ($size === 'auto') {
$count = max(xmlsitemap_get_link_count($reset), 1); // Prevent divide by zero.
// Prevent divide by zero.
$count = max(xmlsitemap_get_link_count($reset), 1);
$size = min(ceil($count / 10000) * 5000, XMLSITEMAP_MAX_SITEMAP_LINKS);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment