Remove AntKeywords, minor formatting changes

This commit is contained in:
Belle Aerni 2023-05-13 13:08:33 -07:00
parent 95c2774222
commit d03ec564f6
4 changed files with 7 additions and 44 deletions

View file

@ -1,37 +0,0 @@
<?php
namespace AntCMS;
use AntCMS\AntCache;
use AntCMS\AntConfig;
use DonatelloZa\RakePlus\RakePlus;
class AntKeywords
{
/**
* @return string
*/
public function generateKeywords(string $content = '', int $count = 15)
{
$antCache = new AntCache();
$cacheKey = $antCache->createCacheKey($content, 'keywords');
if (!AntConfig::currentConfig('generateKeywords')) {
return '';
}
if ($antCache->isCached($cacheKey)) {
$cachedKeywords = $antCache->getCache($cacheKey);
if ($cachedKeywords !== false && !empty($cachedKeywords)) {
return $cachedKeywords;
}
}
$keywords = RakePlus::create($content, 'en_US', $count)->keywords();
$keywords = implode(",", $keywords);
$antCache->setCache($cacheKey, $keywords);
return $keywords;
}
}

View file

@ -12,10 +12,10 @@ class RobotstxtPlugin extends AntPlugin
$baseURL = AntConfig::currentConfig('baseURL');
$robotstxt = 'User-agent: *' . "\n";
$robotstxt.= 'Disallow: /plugin/' . "\n";
$robotstxt.= 'Disallow: /admin/' . "\n";
$robotstxt.= 'Disallow: /profile/' . "\n";
$robotstxt.= 'Sitemap: ' . $protocol . '://' . AntTools::repairURL($baseURL . '/sitemap.xml' . "\n");
$robotstxt .= 'Disallow: /plugin/' . "\n";
$robotstxt .= 'Disallow: /admin/' . "\n";
$robotstxt .= 'Disallow: /profile/' . "\n";
$robotstxt .= 'Sitemap: ' . $protocol . '://' . AntTools::repairURL($baseURL . '/sitemap.xml' . "\n");
header("Content-Type: text/plain");
echo $robotstxt;
exit;

View file

@ -7,7 +7,7 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . 'Vendor' . DIRECTORY_SEPARATOR . 'a
require_once __DIR__ . DIRECTORY_SEPARATOR . 'Constants.php';
$classMapPath = __DIR__ . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR . 'classMap.php';
$loader = new AntCMS\AntLoader($classMapPath );
$loader = new AntCMS\AntLoader($classMapPath);
$loader->addPrefix('AntCMS\\', __DIR__ . DIRECTORY_SEPARATOR . 'AntCMS');
$loader->checkClassMap();
$loader->register();