Cleanup the folder
This commit is contained in:
parent
76c27c703c
commit
736399cf15
18
.env
18
.env
@ -1,18 +0,0 @@
|
||||
################
|
||||
### DATABASE ###
|
||||
################
|
||||
## Look at the url below to create a database URL
|
||||
## https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||
|
||||
## Mysql sample
|
||||
DATABASE="mysql://root:letmein@localhost:3306/webcron?charset=UTF8"
|
||||
## Sqlite sample
|
||||
DATABASE="sqlite://storage/database.sqlite"
|
||||
|
||||
###############
|
||||
### SECRETS ###
|
||||
###############
|
||||
|
||||
## This secret value is used to encrypt secret values (eg. ssh-keys, http-auth passwords, etc)
|
||||
## You should consider your already stored secret values lost when changing this value.
|
||||
SECRET=ImNotThatSecretSoPleaseChangeMe0123456789
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,6 +1,6 @@
|
||||
cache/*
|
||||
!cache/.gitkeep
|
||||
nbproject/private/
|
||||
vendor/
|
||||
config.inc.php
|
||||
webcron.old/config.inc.php
|
||||
\.idea/
|
||||
.env
|
@ -3,6 +3,7 @@
|
||||
namespace JeroenED\Framework;
|
||||
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use http\Env\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Twig\Environment;
|
||||
@ -12,14 +13,21 @@ abstract class Controller
|
||||
{
|
||||
private $twig;
|
||||
private $request;
|
||||
private $database;
|
||||
private $kernel;
|
||||
|
||||
public function __construct(Request $request, Kernel $kernel)
|
||||
{
|
||||
$loader = new FilesystemLoader([$kernel->getTemplateDir()]);
|
||||
$this->twig = new Environment($loader);
|
||||
$this->request = $request;
|
||||
$this->kernel = $kernel;
|
||||
}
|
||||
|
||||
public function getDbCon(): Connection
|
||||
{
|
||||
return $this->kernel->getDbCon();
|
||||
}
|
||||
/**
|
||||
* @return Request
|
||||
*/
|
||||
|
@ -4,11 +4,12 @@
|
||||
namespace JeroenED\Framework;
|
||||
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\DriverManager;
|
||||
use http\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class Kernel
|
||||
{
|
||||
@ -87,6 +88,11 @@ class Kernel
|
||||
return Request::createFromGlobals();
|
||||
}
|
||||
|
||||
public function getDbCon(): Connection
|
||||
{
|
||||
$db = DriverManager::getConnection(['url' => $_ENV['DATABASE']]);
|
||||
}
|
||||
|
||||
private function createResponse($request, $routes): Response
|
||||
{
|
||||
$requestContext = RequestContext::fromUri($request->getUri());
|
||||
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
@ -9,5 +9,4 @@ $kernel->setProjectDir(__DIR__);
|
||||
$kernel->setConfigDir(__DIR__ . '/config/');
|
||||
$kernel->setTemplateDir(__DIR__ . '/templates/');
|
||||
|
||||
$db = DriverManager::getConnection(['url' => $_ENV['DATABASE']]);
|
||||
$kernel->handle()->send();
|
@ -1,7 +1,7 @@
|
||||
{% extends "base.html.twig" %}
|
||||
{% block title %}Add job{% endblock %}
|
||||
{% block content %}
|
||||
<form method="post" action="/addjob.php">
|
||||
<form method="post" action="/webcron.old/addjob.php">
|
||||
{% if not error == "" %}
|
||||
<div class="alert alert-danger fade in">
|
||||
<a href="#" class="close" data-dismiss="alert">×</a>
|
||||
|
@ -8,13 +8,13 @@
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.css">
|
||||
<link rel="stylesheet" href="/css/site.css">
|
||||
<link rel="stylesheet" href="/public/css/site.css">
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.js" type="text/javascript"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
|
||||
<script src="/js/site.js" type="text/javascript"></script>
|
||||
<script src="/public/js/site.js" type="text/javascript"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% extends "base.html.twig" %}
|
||||
{% block title %}Edit job {{ name }}{% endblock %}
|
||||
{% block content %}
|
||||
<form method="post" action="/editjob.php?jobID={{ jobID }}">
|
||||
<form method="post" action="/webcron.old/editjob.php?jobID={{ jobID }}">
|
||||
{% if not error == "" %}
|
||||
<div class="alert alert-danger fade in">
|
||||
<a href="#" class="close" data-dismiss="alert">×</a>
|
||||
|
@ -47,6 +47,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id='ajax_loader' style="position: fixed; left: 50%; top: 50%; display: none;">
|
||||
<img src="/images/ajax-loader.gif" alt="loading">
|
||||
<img src="/public/images/ajax-loader.gif" alt="loading">
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -7,17 +7,17 @@
|
||||
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="/css/site.css">
|
||||
<link rel="stylesheet" href="/public/css/site.css">
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
<script src="/js/site.js" type="text/javascript"></script>
|
||||
<script src="/public/js/site.js" type="text/javascript"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="col-md-4 col-md-offset-4 col-xs-12">
|
||||
<h1>Webcron management</h1>
|
||||
<form class="form-horizontal" method="post" action="/index.php">
|
||||
<form class="form-horizontal" method="post" action="/public/index.php">
|
||||
{% if not error == "" %}
|
||||
<div class="alert alert-danger fade in">
|
||||
<a href="#" class="close" data-dismiss="alert">×</a>
|
||||
|
0
composer.lock → webcron.old/composer.lock
generated
0
composer.lock → webcron.old/composer.lock
generated
Loading…
Reference in New Issue
Block a user