new scaffolding set up

beta
Ro 4 years ago
parent 67a47355d2
commit 3617565210

@ -0,0 +1,12 @@
<?php
class IndexControl
{
private $secret = 'not very secretish';
public function getSecret()
{
return $this->secret;
}
}

@ -0,0 +1,12 @@
<?php
class Auth
{
private $configs;
public function getSettings()
{
//return $this->secret;
}
}

@ -0,0 +1,15 @@
<?php
class Settings
{
private $folks;
private $tags;
private $settings;
public function getFolks()
{
return $this->folks = json_decode(file_get_contents('config/folks.json'), true);
//return $this->secret;
}
}

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
</head>
<body>
<p>
{{ name }} is a {{ occupation }}
</p>
<br>
<div>
{{folks}} has {{ secret }}
</div>
</body>
</html>

@ -1 +1,14 @@
[{"id":1,"handle":"ItsRo","avi":"/assets/images/user/2020/09/download20200802144459.png","email":"are0h@protonmail.com","password":"$2b$10$77PMC2W6aZ3gJP7TOA7OpeqQaz..SrRSO74WEa7cn61ehHI55.zKq","key":"fe79df250470815bf32dcea70221384c89163cad3a827a9c3da25d87159ed55a","role":"hnic","created":"2020-09-01T22:46:47+02:00","updated":"2020-09-01T22:46:47+02:00","deleted":null}]
[
{
"id": 1,
"handle": "ItsRo",
"avi": "/assets/images/user/2020/09/download20200802144459.png",
"email": "are0h@protonmail.com",
"password": "$2b$10$77PMC2W6aZ3gJP7TOA7OpeqQaz..SrRSO74WEa7cn61ehHI55.zKq",
"key": "fe79df250470815bf32dcea70221384c89163cad3a827a9c3da25d87159ed55a",
"role": "hnic",
"created": "2020-09-01T22:46:47+02:00",
"updated": "2020-09-01T22:46:47+02:00",
"deleted": null
}
]

@ -1 +1,32 @@
{"global":{"base_url":"https://fipamo.blog","title":"It's Fipamo","descriptions":"Because it should be easy, boss.","background":"/assets/images/user/2020/09/default-bg.jpg","private":false,"renderOnSave":"false","theme":"fipamo-default","display_limit":5,"port":3314,"last_backup":"2020-09-15T22:14:42+02:00"},"library_stats":{"current_index":5},"email":{"active":"","smtp":{"domain":"","email":"","password":""},"mailgun":{"domain":"","key":""}},"menu":[]}
{
"global": {
"base_url": "https://fipamo.blog",
"title": "It's Fipamo",
"descriptions": "Because it should be easy, boss.",
"background": "/assets/images/user/2020/09/default-bg.jpg",
"private": false,
"renderOnSave": "false",
"theme": "fipamo-default",
"display_limit": 5,
"port": 3314,
"last_backup": "2020-09-15T22:14:42+02:00"
},
"library_stats": {
"current_index": 5
},
"email": {
"active": "",
"smtp": {
"domain": "",
"email": "",
"password": ""
},
"mailgun": {
"domain": "",
"key": ""
}
},
"menu": [
]
}

@ -0,0 +1,33 @@
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use Slim\Views\Twig;
use Slim\Views\TwigMiddleware;
include 'brain/controller/IndexControl.inc.php';
include 'brain/data/Settings.inc.php';
require __DIR__ . '/vendor/autoload.php';
$app = AppFactory::create();
$twig = Twig::create('brain/views/default/');
$app->add(TwigMiddleware::create($app, $twig));
//Dashboard Index
$app->get('/dashboard', function (Request $request, Response $response) {
$index = new IndexControl();
$settings = new Settings();
$folks = $settings->getFolks();
$secret = $index->getSecret();
$view = Twig::fromRequest($request);
return $view->render($response, 'index.twig', [
'title' => 'This is Fipamo',
'name' => 'Ro',
'occupation'=>'pretty cool... I guess',
'folks' => $folks[0]['handle'],
'secret' => $secret
]);
});
$app->run();

@ -0,0 +1 @@
This is the index

@ -1,22 +0,0 @@
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use Slim\Views\Twig;
use Slim\Views\TwigMiddleware;
require __DIR__ . '/vendor/autoload.php';
$app = AppFactory::create();
$twig = Twig::create('content/themes/fipamo-default-redux', ['cache' => 'cache']);
$app->add(TwigMiddleware::create($app, $twig));
$app->get('/', function (Request $request, Response $response, $args) {
$view = Twig::fromRequest($request);
return $view->render($response, 'index.twig', [
'name' => 'Ro',
'occupation'=>'That Dude'
]);
});
$app->run();
Loading…
Cancel
Save