diff --git a/.gitignore b/.gitignore index e6d45be..7b54800 100644 --- a/.gitignore +++ b/.gitignore @@ -461,5 +461,8 @@ MigrationBackup/ # real ignore for venom -config.inc.php -module.inc.php \ No newline at end of file +conf/config.inc.php +conf/module.inc.php +conf/routers.inc.php +conf/lang.inc.php +logs/Exception.log \ No newline at end of file diff --git a/config.base.php b/base/config.base.php similarity index 63% rename from config.base.php rename to base/config.base.php index 7e9d883..a3f7224 100644 --- a/config.base.php +++ b/base/config.base.php @@ -1,12 +1,12 @@ setVersion(1.0); $config->setDatabase([ - DatabaseHandler::DB_TYPE => 'mysql', //please change only if you now what you're doing! this can break a lot. + DatabaseHandler::DB_TYPE => 'mysql', //please change only if you know what you're doing! this can break a lot. DatabaseHandler::DB_HOST => '127.0.0.1', DatabaseHandler::DB_PORT => '3306', //default port is 3306 DatabaseHandler::DB_USER => 'venom', @@ -15,26 +15,14 @@ $config->setDatabase([ DatabaseHandler::DB_EXTRA => '' // need to start with ';' ]); -// used for external batch-mailing and error reporting. -// please generate login data at: api.vstz.dev -// api will check this data before processing -$config->setAPIAuth([ - 'useAPI' => true, - 'url' => 'https://api.vstz.dev/v1/', - 'user' => 'vstz', - 'pw' => '6(f&B~ZxH3DfC#qJ', - 'logsError' => true -]); - /** - * BATCH Mailing is something that will send only mails after a specific time like 1 min. + * Cron Mailing is something that will send only mails after a specific time like 1 min. * it is used to prevent spamming. - * batch mailing only works via API!... if API not used BatchMailing will disabled... or you have a cron that works like a batch... + * CronMailing looks if the Same Mail is in the Database in the last 24 Hours! if it's already in then it will skip the sending! */ $config->setMail([ - 'useBatch' => true, //if true it will not send mails. - 'writeToDB' => true, //is needed for batch and is always true if batch is use - //this stuff is only important if not using batch mailing! + 'useCron' => true, //if true it will not send mails directly. + 'writeToDB' => true, //is needed for cron and is always true if batch is use 'host' => 'localhost', 'port' => '587', 'useTLS' => true, //use startTLS. is the default case ;) here it's important the security Cert is secure... @@ -43,6 +31,13 @@ $config->setMail([ 'from' => 'info@venom.io' ]); +$config->setSecurity([ + 'useSecurity' => true, // should init the Security Module + 'securityClass' => Venom\Security\BaseLogin::class, // Security class that is used + 'secret' => 'venomDefaultSecret', // add to the hash.. ;) use HashingAlgo + 'algo' => 'SHA256' // SHA256, SHA512..., +]); + // all templates are in __DIR__/tpl/ // all themes are in __DIR__/public/theme/ $config->setRender([ @@ -50,9 +45,11 @@ $config->setRender([ 'baseFile' => 'base', //this will called after all templates are rendered... 'useCache' => false, //is only on big systems good 'cacheName' => 'defaultCache', //this is for bigger systems, ignore it - 'uploadDir' => 'content/' + 'uploadDir' => 'content/', + 'useStaticUrl' => false, ]); +$config->setEnableRouter(false); $config->setMaintainMode(false); $config->setDevMode(true); $config->setBaseUrl(''); // can changed to something like that: https://example.com !not enter a / after the url! this will break all diff --git a/base/lang.base.php b/base/lang.base.php new file mode 100644 index 0000000..d770e23 --- /dev/null +++ b/base/lang.base.php @@ -0,0 +1,3 @@ + \Modules\TestController::class, - //api-controller - 'apiMailer' => \Modules\API\APIMailer::class, ]; \ No newline at end of file diff --git a/base/router.base.php b/base/router.base.php new file mode 100644 index 0000000..008287d --- /dev/null +++ b/base/router.base.php @@ -0,0 +1,29 @@ +addRoutes([ + '/test' => [ + 'cl' => Route::class, + 'roles' => ['ROLE_GUEST'], + 'routes' => [ + '*' => [ + "GET" => 'getAll' + ], + '1' => [ + "GET" => 'getAll' + ] + ] + ], +]); +$venom->addRouter('defaultRouter', $router); \ No newline at end of file diff --git a/lang.php b/lang.php deleted file mode 100644 index e3972ad..0000000 --- a/lang.php +++ /dev/null @@ -1,3 +0,0 @@ -getLang()->registerLang('de', [ 'HEADLINE' => 'VenomCMS', 'TEST_TRANSLATION' => 'Das ist ein Test :)', diff --git a/logs/.gitkeep b/logs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..4d339de --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,7 @@ +RewriteEngine On + +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d + +RewriteCond %{REQUEST_URI} (/[^.]*|\.)$ [NC] +RewriteRule .* index.php [L] \ No newline at end of file diff --git a/public/admin/.htaccess b/public/admin/.htaccess new file mode 100644 index 0000000..4d339de --- /dev/null +++ b/public/admin/.htaccess @@ -0,0 +1,7 @@ +RewriteEngine On + +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d + +RewriteCond %{REQUEST_URI} (/[^.]*|\.)$ [NC] +RewriteRule .* index.php [L] \ No newline at end of file diff --git a/public/admin/index.php b/public/admin/index.php index a6e5691..7ece959 100644 --- a/public/admin/index.php +++ b/public/admin/index.php @@ -1,30 +1,24 @@ setIsAdmin(true); - -require_once '../../config.inc.php'; -require_once '../../module.inc.php'; - +if ($config->isMaintenance()) { + echo 'Currently not available'; + exit; +} +//if devMode is on show all errors! if ($config->isDevMode()) { error_reporting(E_ALL); ini_set('error_reporting', E_ALL); } $venom = new Venom(); -$venom->initModules($modules); -$venom->initControllers($controllers); +Setup::loadRouters($venom); +Setup::loadModules($venom); $venom->run(); \ No newline at end of file diff --git a/public/index.php b/public/index.php index 85b7f07..e1d99e3 100755 --- a/public/index.php +++ b/public/index.php @@ -1,22 +1,12 @@ isMaintenance()) { @@ -29,6 +19,6 @@ if ($config->isDevMode()) { ini_set('error_reporting', E_ALL); } $venom = new Venom(); -$venom->initModules($modules); -$venom->initControllers($controllers); +Setup::loadRouters($venom); +Setup::loadModules($venom); $venom->run(); \ No newline at end of file diff --git a/src/Venom/ArgumentHandler.php b/src/Venom/Core/ArgumentHandler.php similarity index 93% rename from src/Venom/ArgumentHandler.php rename to src/Venom/Core/ArgumentHandler.php index 48e5534..69e5ac9 100644 --- a/src/Venom/ArgumentHandler.php +++ b/src/Venom/Core/ArgumentHandler.php @@ -1,7 +1,7 @@ mail = new ConfigObject(); + $this->renderer = new ConfigObject(); + $this->security = new ConfigObject(); } public static function getInstance(): Config @@ -39,16 +43,24 @@ class Config } } - public function setAPIAuth(array $array): void - { - $this->set('api', $array); - } - public function setRender(array $array): void { $this->set('renderer', $array); } + public function set(string $variable, $value): void + { + if (!$this->isWriteable) { + trigger_error('try to write closed config!'); + return; + } + if ($this->$variable instanceof ConfigObject) { + $this->$variable->setData($value); + } else { + $this->$variable = $value; + } + } + public function setMaintainMode(bool $mode): void { $this->set('maintenance', $mode); @@ -64,12 +76,7 @@ class Config $this->set('version', $param); } - public function getApi(): array - { - return $this->api; - } - - public function getMail(): array + public function getMail(): ConfigObject { return $this->mail; } @@ -79,7 +86,7 @@ class Config $this->set('mail', $array); } - public function getRenderer(): array + public function getRenderer(): ConfigObject { return $this->renderer; } @@ -115,15 +122,13 @@ class Config $this->set('isAdmin', $isAdmin); } - public function setBaseUrl(string $url) { - $this->set('baseUrl', $url); - } - - public function setSeoMode(bool $mode) { + public function setSeoMode(bool $mode): void + { $this->set('seoMode', $mode); } - public function getSeoEnabled() { + public function getSeoEnabled(): bool + { return $this->seoMode; } @@ -143,16 +148,34 @@ class Config $this->isWriteable = false; } - public function set(string $variable, $value) { - if (!$this->isWriteable) { - trigger_error('try to write closed config!'); - return; - } - $this->$variable = $value; - } - - public function getBaseUrl() + public function getBaseUrl(): string { return $this->baseUrl; } + + public function setBaseUrl(string $url): void + { + $this->set('baseUrl', $url); + } + + public function getSecurity(): ConfigObject + { + return $this->security; + } + + public function setSecurity(array $security): void + { + $this->set('security', $security); + } + + public function setEnableRouter(bool $value): void + { + $this->set('useRouter', $value); + } + + public function isRouterEnabled(): bool + { + return $this->useRouter; + } + } \ No newline at end of file diff --git a/src/Venom/Database/DatabaseHandler.php b/src/Venom/Core/DatabaseHandler.php similarity index 97% rename from src/Venom/Database/DatabaseHandler.php rename to src/Venom/Core/DatabaseHandler.php index 2bc3f4b..38b8c09 100644 --- a/src/Venom/Database/DatabaseHandler.php +++ b/src/Venom/Core/DatabaseHandler.php @@ -1,11 +1,12 @@ id)) { $this->language = $lang; } else { - throw new \RuntimeException("Language \"$lang\" not found"); + throw new RuntimeException("Language \"$lang\" not found"); } } diff --git a/src/Venom/Module.php b/src/Venom/Core/Module.php similarity index 81% rename from src/Venom/Module.php rename to src/Venom/Core/Module.php index 8120ddc..746d386 100644 --- a/src/Venom/Module.php +++ b/src/Venom/Core/Module.php @@ -1,7 +1,7 @@ can diff --git a/src/Venom/Core/Setup.php b/src/Venom/Core/Setup.php new file mode 100644 index 0000000..c35d1a1 --- /dev/null +++ b/src/Venom/Core/Setup.php @@ -0,0 +1,58 @@ +setIsAdmin($isAdmin); + $file = self::tryLoading('config.inc.php', 'config.base.php', "Config"); + require $file; + } + + public static function tryLoading(string $file, string $baseFile, string $type): string + { + $newFile = __DIR__ . '/../../../conf/' . $file; + if (!file_exists($newFile)) { + $newBaseFile = __DIR__ . '/../../../base/' . $baseFile; + if (copy($newBaseFile, $newFile)) { + echo 'Created File for: ' . $type . '! Please Adjust the file'; + } else { + echo 'Cannot create File for: ' . $type . '!'; + } + + exit(1); + } + return $newFile; + } + + public static function loadModules(Venom $venom): void + { + $file = self::tryLoading('modules.inc.php', 'module.base.php', "Modules"); + require $file; + if (isset($modules)) { + $venom->initModules($modules); + } + if (isset($controllers)) { + $venom->initControllers($controllers); + } + } + + public static function loadRouters(Venom $venom): void + { + $file = self::tryLoading('routers.inc.php', 'router.base.php', "Routers"); + require $file; + } + + public static function loadLanguage(): void + { + $file = self::tryLoading('lang.inc.php', 'lang.base.php', "Languages"); + require $file; + } +} \ No newline at end of file diff --git a/src/Venom/Exceptions/ExceptionHandler.php b/src/Venom/Exceptions/ExceptionHandler.php new file mode 100644 index 0000000..ca60475 --- /dev/null +++ b/src/Venom/Exceptions/ExceptionHandler.php @@ -0,0 +1,48 @@ +file = fopen($this->logFile, 'ab+'); + } catch (Throwable $ex) { + $this->file = null; + } + } + + public static function setExceptionHandler(): void + { + set_exception_handler(array(__CLASS__, 'handleException')); + } + + public static function handleException(Throwable $ex): void + { + $handler = new ExceptionHandler(); + $handler->writeException($ex); + exit(255); + } + + public function writeException(Throwable $ex): void + { + if ($this->file !== null) { + try { + $trace = "=====[FATAL ERROR]=====\n" . $ex->getMessage() . "\n" . $ex->getTraceAsString() . "\n=====[FATAL ERROR END]=====\n"; + fwrite($this->file, $trace); + fclose($this->file); + } catch (Exception $e) { + trigger_error("cannot write Exception file!"); + } + } + } +} \ No newline at end of file diff --git a/src/Venom/Helper/ErrorHandler.php b/src/Venom/Helper/ErrorHandler.php new file mode 100644 index 0000000..764afca --- /dev/null +++ b/src/Venom/Helper/ErrorHandler.php @@ -0,0 +1,35 @@ +setItem('cl', 'error'); + ArgumentHandler::get()->setItem('fnc', 'handleError'); + ArgumentHandler::get()->setItem('errorCode', $errorCode); + } +} \ No newline at end of file diff --git a/src/Venom/Helper/MetaGenerator.php b/src/Venom/Helper/MetaGenerator.php new file mode 100644 index 0000000..e6dd9dd --- /dev/null +++ b/src/Venom/Helper/MetaGenerator.php @@ -0,0 +1,14 @@ +parsedUrl = htmlspecialchars(parse_url($_SERVER['REQUEST_URI'])['path']); + } + + public static function getInstance(): URLHelper + { + if (self::$instance === null) { + self::$instance = new self(); + } + return self::$instance; + } + + public function getUrl(): string + { + return $this->parsedUrl; + } + + + public function getUrlForId($id): string + { + return ''; + } + + public function getUrlForController($cl): string + { + return ''; + } + + public function generateFullUrl($url): string + { + return $url; + } +} \ No newline at end of file diff --git a/src/Venom/Models/ConfigObject.php b/src/Venom/Models/ConfigObject.php new file mode 100644 index 0000000..931ce4e --- /dev/null +++ b/src/Venom/Models/ConfigObject.php @@ -0,0 +1,38 @@ +data[$name])) { + return $this->data[$name]; + } + return null; + } + + public function __set($name, $value) + { + $this->data[$name] = $value; + } + + public function __isset($name) + { + return isset($this->data[$name]); + } + + public function setData(array $data): void + { + $this->data = $data; + } + + public function toString(): string + { + return implode(';', $this->data); + } +} \ No newline at end of file diff --git a/src/Venom/Database/DatabaseObject.php b/src/Venom/Models/DatabaseObject.php similarity index 87% rename from src/Venom/Database/DatabaseObject.php rename to src/Venom/Models/DatabaseObject.php index b1168ac..26a8cd4 100644 --- a/src/Venom/Database/DatabaseObject.php +++ b/src/Venom/Models/DatabaseObject.php @@ -1,7 +1,7 @@ id = $id; + $this->version = $version; + $this->prefix = $prefix; + } + + public function addRoutes(array $routes): void + { + $this->routes = $routes; + } + + public function addRoute(string $path, array $route): void + { + $this->routes[$path] = $route; + } + + /* + * return matched route or null + */ + public function findRoute($url, $method): ?array + { + $url = $this->removeIfFirst($url, $this->prefix); + // check if full match... this can easily done if the url isset select the empty! + $method = strtoupper($method); + $route = $this->getRouteByName($url, $method); + if ($route !== null) { + return $route; + } + $url = $this->removeIfFirst($url, '/'); + $baseRoute = $this->getNearestBaseRoute(explode("/", $url)); + if ($baseRoute !== null) { + $count = count($baseRoute['params']); + return $this->getRouteByName($baseRoute['url'], $method, $count, $baseRoute['params']) ?? $this->getRouteByName($baseRoute['url'], $method); + } + return null; + } + + private function removeIfFirst($rawString, $string) + { + if ($string !== '' && 0 === strpos($rawString, $string)) { + return substr($rawString, strlen($string)); + } + return $rawString; + } + + /* @todo implement Security Check if SecurityModule is used */ + private function getRouteByName($url, $method, $subRoute = '*', $params = []): ?array + { + $routeAvailable = isset($this->routes[$url]); + $subRouteFound = isset($this->routes[$url]['routes'][$subRoute]); + $methodFound = isset($this->routes[$url]['routes'][$subRoute][$method]); + if ($routeAvailable && $subRouteFound && $methodFound) { + return [ + 'cl' => $this->routes[$url]['cl'], + 'fnc' => $this->routes[$url]['routes'][$subRoute][$method], + 'params' => $params + ]; + } + return null; + } + + private function getNearestBaseRoute(array $params): ?array + { + $count = count($params); + $baseUrlArray = []; + $newParams = []; + foreach ($params as $value) { + $baseUrlArray[] = $value; + } + for ($i = 0; $i < $count; $i++) { + $newParams[] = array_pop($baseUrlArray); + $url = '/' . implode('/', $baseUrlArray); + if (isset($this->routes[$url])) { + return ['url' => $url, 'params' => $newParams]; + } + } + return null; + } + + public function tryFunctionCall(?array $aRoute): bool + { + if ($aRoute === null || !is_callable(array($aRoute['cl'], $aRoute['fnc']))) { + return false; + } + $route = new $aRoute['cl'](); + try { + $fnc = $aRoute['fnc']; + $params = $aRoute['params'] ?? []; + $route->$fnc(...$params); + return true; + } catch (Exception $ex) { + return false; + } + } +} \ No newline at end of file diff --git a/src/Venom/SEO/SeoController.php b/src/Venom/Routing/SeoController.php similarity index 59% rename from src/Venom/SEO/SeoController.php rename to src/Venom/Routing/SeoController.php index a8387db..969f94d 100644 --- a/src/Venom/SEO/SeoController.php +++ b/src/Venom/Routing/SeoController.php @@ -1,12 +1,14 @@ shouldUse = Config::getInstance()->getSeoEnabled(); } - public function loadSite() + public function loadSite(): void { if (!$this->shouldUse) { return; } - $url = htmlspecialchars(parse_url($_SERVER['REQUEST_URI'])['path']); + $url = URLHelper::getInstance()->getUrl(); $data = DatabaseHandler::get()->getOne("SELECT * FROM seoData WHERE seo = :url", [ ':url' => $url, ]); $this->data = $data; - if($this->data != null) { + if ($this->data !== null) { parse_str(parse_url($this->data->raw)['query'], $queryItems); - foreach($queryItems as $key => $item) { + foreach ($queryItems as $key => $item) { ArgumentHandler::get()->setItem($key, $item); } + } else { + ErrorHandler::setNotFound(); } } - public function addSite() + public function addSite(): void { } - public function deleteSite() + public function deleteSite(): void { } diff --git a/src/Venom/Security/BaseLogin.php b/src/Venom/Security/BaseLogin.php new file mode 100644 index 0000000..1a94a5c --- /dev/null +++ b/src/Venom/Security/BaseLogin.php @@ -0,0 +1,13 @@ +renderer = new VenomRenderer($this); Asset::get()->setRenderer($this->renderer); } @@ -24,17 +34,40 @@ class Venom { // we need to load the current controller and the current start template. // after this we can start the renderer + if (Config::getInstance()->isRouterEnabled()) { + $status = $this->useRouter(); + if ($status['found']) { + if ($status['status']) { + exit(0); + } + ErrorHandler::setFatalError(); + } + } $registry = Registry::getInstance(); - $registry->getSeo()->loadSite(); $registry->getLang()->initLang(); + $registry->getSeo()->loadSite(); $this->renderer->init($this->findController()); $this->renderer->render(); } + private function useRouter(): array + { + $url = URLHelper::getInstance()->getUrl(); + /** @var Router $router */ + foreach ($this->routers as $router) { + $route = $router->findRoute($url, $_SERVER['REQUEST_METHOD']); + $status = $router->tryFunctionCall($route); + if ($route !== null) { + return ['found' => true, 'status' => $status]; + } + } + return ['found' => false, 'status' => true]; + } + private function findController(): ?RenderController { $cl = ArgumentHandler::get()->getItem('cl'); - if ($cl != null && isset($this->controllers[$cl])) { + if ($cl !== null && isset($this->controllers[$cl])) { return $this->controllers[$cl]; } return null; @@ -60,8 +93,8 @@ class Venom } } - private function prepare() + public function addRouter(string $name, Router $router): void { - + $this->routers[$name] = $router; } } \ No newline at end of file diff --git a/src/Venom/Views/Asset.php b/src/Venom/Views/Asset.php index ee5c0fa..843f44a 100644 --- a/src/Venom/Views/Asset.php +++ b/src/Venom/Views/Asset.php @@ -4,14 +4,14 @@ namespace Venom\Views; -use Venom\Config; +use Venom\Core\Config; class Asset { - static ?Asset $instance = null; - private ?VenomRenderer $renderer = null; + public static ?Asset $instance = null; private array $jsFiles = []; private array $cssFiles = []; + private VenomRenderer $renderer; private function __construct() { @@ -19,43 +19,44 @@ class Asset public static function get(): Asset { - if (self::$instance == null) { + if (self::$instance === null) { self::$instance = new Asset(); } return self::$instance; } - public function addJS(string $name, string $filepath, $pos = 99999) + public function addJS(string $name, string $filepath, $pos = 99999): void { $this->jsFiles[$name] = [ 'file' => $filepath, - 'pos' => $pos + 'pos' => $pos ]; } - public function addCSS(string $name, string $filepath, $pos = 99999) + public function addCSS(string $name, string $filepath, $pos = 99999): void { $this->cssFiles[$name] = [ 'file' => $filepath, - 'pos' => $pos + 'pos' => $pos ]; } public function getImagePath(string $filepath, bool $useAbsolute = false) { - $preDir = '/content'; + $preDir = '/content/'; if ($useAbsolute) { $preDir = Config::getInstance()->getBaseUrl() . $preDir; } + return $preDir . $filepath; } - public function setRenderer(VenomRenderer $renderer) + public function setRenderer(VenomRenderer $renderer): void { $this->renderer = $renderer; } //this will output all js files! sorted by position - public function renderJS() + public function renderJS(): void { usort($this->jsFiles, function ($a, $b) { return $a['pos'] <=> $b['pos']; @@ -66,24 +67,25 @@ class Asset } } - public function renderCSS() - { - usort($this->cssFiles, function ($a, $b) { - return $a['pos'] <=> $b['pos']; - }); - $theme = $this->getPath('/theme/' . Config::getInstance()->getRenderer()['theme'] . '/css/'); - foreach ($this->cssFiles as $key => $file) { - echo ''; - } - } - - private function getPath($base) + private function getPath($base): string { $preDir = $base; + $config = Config::getInstance(); $baseUrl = Config::getInstance()->getBaseUrl(); - if ($baseUrl != '') { + if ($baseUrl != '' && $config->getRenderer()->useStaticUrl) { $preDir = Config::getInstance()->getBaseUrl() . $preDir; } return $preDir; } + + public function renderCSS(): void + { + usort($this->cssFiles, function ($a, $b) { + return $a['pos'] <=> $b['pos']; + }); + $theme = $this->getPath('/theme/' . Config::getInstance()->getRenderer()->theme . '/css/'); + foreach ($this->cssFiles as $key => $file) { + echo ''; + } + } } \ No newline at end of file diff --git a/src/Venom/Views/VenomRenderer.php b/src/Venom/Views/VenomRenderer.php index 771c963..5111120 100644 --- a/src/Venom/Views/VenomRenderer.php +++ b/src/Venom/Views/VenomRenderer.php @@ -4,8 +4,8 @@ namespace Venom\Views; -use Venom\ArgumentHandler; -use Venom\Config; +use Venom\Core\ArgumentHandler; +use Venom\Core\Config; use Venom\Venom; class VenomRenderer @@ -68,7 +68,7 @@ class VenomRenderer return ''; } - public function addVar($name, $value) + public function addVar($name, $value): void { $this->vars[$name] = $value; } @@ -82,8 +82,8 @@ class VenomRenderer { $this->controller = $controller; $data = Config::getInstance()->getRenderer(); - $this->baseTemplate = $data['baseFile'] . '.php' ?? 'base.php'; - $this->templateDir = __DIR__ . '/../../../tpl/' . $data['theme'] . '/'; - $this->assetsDir = __DIR__ . '/../../../public/theme/' . $data['theme'] . '/'; + $this->baseTemplate = $data->baseFile . '.php' ?? 'base.php'; + $this->templateDir = __DIR__ . '/../../../tpl/' . $data->theme . '/'; + $this->assetsDir = __DIR__ . '/../../../public/theme/' . $data->theme . '/'; } } \ No newline at end of file diff --git a/src/modules/API/APIMailer.php b/src/modules/API/APIMailer.php deleted file mode 100644 index c98ee77..0000000 --- a/src/modules/API/APIMailer.php +++ /dev/null @@ -1,33 +0,0 @@ -useAPI = Config::getInstance()->getApi()['useAPI'] === true; - return true; - } - - public function render(VenomRenderer $renderer): bool - { - //check for batch rendering... this is very important! - echo 'batch...'; - return $this->useAPI; - } - - //return async to say the backend that this should exit after rendering - public function getTemplate(): string - { - return 'async'; - } -} \ No newline at end of file diff --git a/tpl/default/base.php b/tpl/default/base.php index 712d120..d8c6d1c 100644 --- a/tpl/default/base.php +++ b/tpl/default/base.php @@ -1,6 +1,6 @@ getLang();
- getTranslation("HEADLINE");?> + getTranslation("HEADLINE")?>
getTranslation("TEST_TRANSLATION");