Bläddra i källkod

Remove AntKeywords, minor formatting changes

Belle Aerni 2 år sedan
förälder
incheckning
d03ec564f6
4 ändrade filer med 7 tillägg och 44 borttagningar
  1. 1 1
      src/AntCMS/AntConfig.php
  2. 0 37
      src/AntCMS/AntKeywords.php
  3. 5 5
      src/Plugins/Robotstxt/RobotstxtPlugin.php
  4. 1 1
      src/index.php

+ 1 - 1
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);
     }
 }

+ 0 - 37
src/AntCMS/AntKeywords.php

@@ -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;
-    }
-}

+ 5 - 5
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';

+ 1 - 1
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();