Browse Source

new scaffolding set up

develop
Ro 2 weeks ago
parent
commit
3617565210
9 changed files with 141 additions and 24 deletions
  1. +12
    -0
      brain/controller/IndexControl.inc.php
  2. +12
    -0
      brain/data/Auth.inc.php
  3. +15
    -0
      brain/data/Settings.inc.php
  4. +22
    -0
      brain/views/default/index.twig
  5. +14
    -1
      config/folks.json
  6. +32
    -1
      config/settings.json
  7. +33
    -0
      dashboard.php
  8. +1
    -0
      index.html
  9. +0
    -22
      index.php

+ 12
- 0
brain/controller/IndexControl.inc.php View File

@@ -0,0 +1,12 @@
<?php

class IndexControl
{
private $secret = 'not very secretish';
public function getSecret()
{
return $this->secret;
}
}

+ 12
- 0
brain/data/Auth.inc.php View File

@@ -0,0 +1,12 @@
<?php

class Auth
{
private $configs;
public function getSettings()
{
//return $this->secret;
}
}

+ 15
- 0
brain/data/Settings.inc.php View File

@@ -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;
}
}

+ 22
- 0
brain/views/default/index.twig View File

@@ -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>

+ 14
- 1
config/folks.json View File

@@ -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
}
]

+ 32
- 1
config/settings.json View File

@@ -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": [
]
}

+ 33
- 0
dashboard.php View File

@@ -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();

+ 1
- 0
index.html View File

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

+ 0
- 22
index.php View File

@@ -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