Cleanup the folder

main
Jeroen De Meerleer 1 year ago
parent 76c27c703c
commit 736399cf15
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
  1. 18
      .env
  2. 4
      .gitignore
  3. 8
      lib/Framework/Controller.php
  4. 8
      lib/Framework/Kernel.php
  5. 0
      public/.htaccess
  6. 0
      public/css/site.css
  7. 0
      public/images/ajax-loader.gif
  8. 1
      public/index.php
  9. 0
      public/js/site.js
  10. 2
      templates/addjob.html.twig
  11. 4
      templates/base.html.twig
  12. 2
      templates/editjob.html.twig
  13. 2
      templates/overview.html.twig
  14. 6
      templates/security/login.html.twig
  15. 0
      webcron.old/addjob.php
  16. 0
      webcron.old/bootstrap.php
  17. 0
      webcron.old/composer.json
  18. 0
      webcron.old/composer.lock
  19. 0
      webcron.old/config.inc.sample.php
  20. 0
      webcron.old/config.php
  21. 0
      webcron.old/database.sql
  22. 0
      webcron.old/editjob.php
  23. 0
      webcron.old/include/finalize.inc.php
  24. 0
      webcron.old/include/functions.php
  25. 0
      webcron.old/index.php
  26. 0
      webcron.old/overview.php
  27. 0
      webcron.old/runnow.php
  28. 0
      webcron.old/runs.php
  29. 0
      webcron.old/webcron.php

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

@ -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">&times;</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">&times;</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">&times;</a>

Loading…
Cancel
Save