rework structure
added Router added .htaccess removed API-Module => is not used renamed batch to CRON
This commit is contained in:
parent
ccf2f506f0
commit
c33bb4cb3a
37 changed files with 680 additions and 190 deletions
58
base/config.base.php
Normal file
58
base/config.base.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
use Venom\Core\Config;
|
||||
use Venom\Core\DatabaseHandler;
|
||||
|
||||
$config = Config::getInstance();
|
||||
$config->setVersion(1.0);
|
||||
$config->setDatabase([
|
||||
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',
|
||||
DatabaseHandler::DB_PASSWORD => 'venomPassword',
|
||||
DatabaseHandler::DB_DB => 'venomCMS',
|
||||
DatabaseHandler::DB_EXTRA => '' // need to start with ';'
|
||||
]);
|
||||
|
||||
/**
|
||||
* Cron Mailing is something that will send only mails after a specific time like 1 min.
|
||||
* it is used to prevent spamming.
|
||||
* 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([
|
||||
'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...
|
||||
'user' => 'youruser@yourdomain.de',
|
||||
'password' => 'this-is-secret',
|
||||
'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([
|
||||
'theme' => 'default', //very important! it will search for a folder with this name.
|
||||
'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/',
|
||||
'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
|
||||
$config->setSeoMode(true); //seo mode is to lookup the complete entered url in the database! without query-parameters and load the get parameters from it
|
||||
|
||||
$config->close();
|
||||
3
base/lang.base.php
Normal file
3
base/lang.base.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
require_once __DIR__ . '/../lang/de.php';
|
||||
9
base/module.base.php
Normal file
9
base/module.base.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
//register modules -> need to have the Module Class at parent with the init function ;)
|
||||
$modules = [];
|
||||
|
||||
// register controllers that can handle templates ;) need to have a render function for this
|
||||
$controllers = [
|
||||
'test' => \Modules\TestController::class,
|
||||
];
|
||||
29
base/router.base.php
Normal file
29
base/router.base.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
// file is included by Setup! so it can Render direct into VenomCore!
|
||||
// this routes are only for API use!
|
||||
// if you not need the Router disable it in the Config then the Default Seo-Loader will only used
|
||||
|
||||
use Venom\Routing\Route;
|
||||
use Venom\Routing\Router;
|
||||
|
||||
if (!isset($venom)) {
|
||||
echo 'make sure Venom is loaded!';
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$router = new Router('defaultRouter', 1.0, 'api/');
|
||||
$router->addRoutes([
|
||||
'/test' => [
|
||||
'cl' => Route::class,
|
||||
'roles' => ['ROLE_GUEST'],
|
||||
'routes' => [
|
||||
'*' => [
|
||||
"GET" => 'getAll'
|
||||
],
|
||||
'1' => [
|
||||
"GET" => 'getAll'
|
||||
]
|
||||
]
|
||||
],
|
||||
]);
|
||||
$venom->addRouter('defaultRouter', $router);
|
||||
Loading…
Add table
Add a link
Reference in a new issue