Browse Source

Repo reset.

master
Julian van de Groep 1 year ago
parent
commit
13e99b117b
14 changed files with 5 additions and 1399 deletions
  1. 0
    21
      .gitattributes
  2. 3
    0
      CODE_OF_CONDUCT.md
  3. 1
    1
      LICENSE
  4. 1
    1
      README.md
  5. 0
    4
      application/routes.php
  6. 0
    26
      application/satoko.php
  7. 0
    24
      composer.json
  8. 0
    1159
      composer.lock
  9. 0
    18
      public/index.php
  10. 0
    70
      satoko/Config.php
  11. 0
    12
      satoko/Controllers/Controller.php
  12. 0
    30
      satoko/DB.php
  13. 0
    12
      satoko/Exception.php
  14. 0
    21
      server.php

+ 0
- 21
.gitattributes View File

@@ -1,22 +1 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

+ 3
- 0
CODE_OF_CONDUCT.md View File

@@ -0,0 +1,3 @@
# Code of Conduct

thou shan't be a binch

+ 1
- 1
LICENSE View File

@@ -186,7 +186,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2016 Julian van de Groep <http://flash.moe>
Copyright 2013-2018 Julian van de Groep <http://flash.moe>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

+ 1
- 1
README.md View File

@@ -1,3 +1,3 @@
# Satoko

Yes, yet another imageboard script. I'll write up a better README.md later, can't be bothered right now.
it's not dead!

+ 0
- 4
application/routes.php View File

@@ -1,4 +0,0 @@
<?php
$router->get('/', function () {
return "satoko!";
});

+ 0
- 26
application/satoko.php View File

@@ -1,26 +0,0 @@
<?php
/*
* Satoko startup
* (c) 2013-2016 Julian van de Groep <https://flash.moe>
*/

namespace Satoko;

use Phroute\Phroute\RouteCollector;

// Require composer libraries
require_once __DIR__ . '/../vendor/autoload.php';

// Initialise the configuration
Config::init("path/to/right/now/nonexistent/configuration.ini");

// Setup the database connection
DB::setup(
Config::get('database')
);

// Create the router
$router = new RouteCollector;

// Require the routes file
require_once 'routes.php';

+ 0
- 24
composer.json View File

@@ -1,24 +0,0 @@
{
"name": "flashwave/satoko",
"description": "An imageboard script",
"license": "Apache-2.0",
"homepage": "https://flash.moe/satoko",
"support": {
"email": "me@flash.moe",
"issues": "https://github.com/flashwave/satoko/issues"
},
"require": {
"php": ">=5.5.9",
"jbbcode/jbbcode": "1.*",
"twig/twig": "1.*",
"illuminate/database": "5.2.*",
"illuminate/filesystem": "5.2.*",
"doctrine/dbal": "~2.4",
"phroute/phroute": "2.1.*"
},
"autoload": {
"psr-4": {
"Satoko\\": "satoko/"
}
}
}

+ 0
- 1159
composer.lock
File diff suppressed because it is too large
View File


+ 0
- 18
public/index.php View File

@@ -1,18 +0,0 @@
<?php
namespace Satoko;

use Phroute\Phroute\Dispatcher;

require_once __DIR__ . '/../application/satoko.php';

// Create a dispatcher
$dispatcher = new Dispatcher($router->getData());

// Handle requests
echo $dispatcher->dispatch(
$_SERVER['REQUEST_METHOD'],
parse_url(
$_SERVER['REQUEST_URI'],
PHP_URL_PATH
)
);

+ 0
- 70
satoko/Config.php View File

@@ -1,70 +0,0 @@
<?php
namespace Satoko;

/**
* Configuration manager.
*
* @package Satoko
* @author Julian van de Groep <me@flash.moe>
*/
class Config
{
/**
* Path to the configuration file.
*
* @var string
*/
private static $path = "";

/**
* Parsed configuration file.
*
* @var array
*/
private static $conf = [];

/**
* Initialise the configuration manager.
*
* @param string $file Path to the configuration file.
*/
public static function init($file)
{
// Assign file
self::$path = $file;

// Parse the file
self::$conf = parse_ini_file(self::$path, true);
}

/**
* Write configuration to the set INI file.
*/
public static function save()
{
// tbi
}

/**
* Set a configuration value.
*
* @param string $name Key name separated by dots (e.g. database.host).
* @param string $value Value to store under this entry.
*/
public static function set($name, $value)
{
// tbi
}

/**
* Get a configuration value.
*
* @param string $name Key name separated by dots (e.g. database.host).
*
* @return string|array
*/
public static function get($name, $fallback = null)
{
// tbi
}
}

+ 0
- 12
satoko/Controllers/Controller.php View File

@@ -1,12 +0,0 @@
<?php
namespace Satoko\Controllers;

/**
* Base controller (which other controllers should extend on).
*
* @package Satoko
* @author Julian van de Groep <me@flash.moe>
*/
class Controller
{
}

+ 0
- 30
satoko/DB.php View File

@@ -1,30 +0,0 @@
<?php
namespace Satoko;

use Illuminate\Database\Capsule\Manager;

/**
* Extensions to the Illuminate (Laravel) database.
*
* @package Satoko
* @author Julian van de Groep <me@flash.moe>
*/
class DB extends Manager
{
/**
* Set the database connection up.
*
* @param array $config Configuration array according to the Laravel documentation.
*/
public static function setup($config)
{
// Create a new database capsule
$capsule = new Manager;

// Add the connection
$capsule->addConnection($config);

// Make the capsule globally accessible
$capsule->setAsGlobal();
}
}

+ 0
- 12
satoko/Exception.php View File

@@ -1,12 +0,0 @@
<?php
namespace Satoko;

/**
* Base exception for Satoko things.
*
* @package Satoko
* @author Julian van de Groep <me@flash.moe>
*/
class Exception extends \Exception
{
}

+ 0
- 21
server.php View File

@@ -1,21 +0,0 @@
<?php
if (php_sapi_name() === 'cli') {
exec("php -S localhost:8000 -t public/ {$_SERVER['PHP_SELF']}");
return;
}

// Decode and parse the request uri
$uri = urldecode(
parse_url(
$_SERVER['REQUEST_URI'],
PHP_URL_PATH
)
);

// Check if the file exist in the public directory and if it does serve it.
if ($uri !== '/' && file_exists(__DIR__ . '/public' . $uri)) {
return false;
}

// Otherwise include the router
require_once __DIR__ . '/public/index.php';

Loading…
Cancel
Save