From d03ec564f6a4aeef07c8d09866836fbb262bc4b1 Mon Sep 17 00:00:00 2001 From: Belle Aerni Date: Sat, 13 May 2023 13:08:33 -0700 Subject: [PATCH] Remove AntKeywords, minor formatting changes --- src/AntCMS/AntConfig.php | 2 +- src/AntCMS/AntKeywords.php | 37 ----------------------- src/Plugins/Robotstxt/RobotstxtPlugin.php | 10 +++--- src/index.php | 2 +- 4 files changed, 7 insertions(+), 44 deletions(-) delete mode 100644 src/AntCMS/AntKeywords.php diff --git a/src/AntCMS/AntConfig.php b/src/AntCMS/AntConfig.php index d011957..78a760f 100644 --- a/src/AntCMS/AntConfig.php +++ b/src/AntCMS/AntConfig.php @@ -90,7 +90,7 @@ class AntConfig throw new Exception("New config is missing the required {$ConfigKey} key from it's array!"); } } - + return AntYaml::saveFile(antConfigFile, $config); } } diff --git a/src/AntCMS/AntKeywords.php b/src/AntCMS/AntKeywords.php deleted file mode 100644 index 44e6770..0000000 --- a/src/AntCMS/AntKeywords.php +++ /dev/null @@ -1,37 +0,0 @@ -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; - } -} diff --git a/src/Plugins/Robotstxt/RobotstxtPlugin.php b/src/Plugins/Robotstxt/RobotstxtPlugin.php index 6725dd8..a451396 100644 --- a/src/Plugins/Robotstxt/RobotstxtPlugin.php +++ b/src/Plugins/Robotstxt/RobotstxtPlugin.php @@ -12,15 +12,15 @@ 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; } - + public function getName(): string { return 'Robotstxt'; diff --git a/src/index.php b/src/index.php index 8d08a10..04eced2 100644 --- a/src/index.php +++ b/src/index.php @@ -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();