Browse Source

Repo reset.

Julian van de Groep 11 months 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 @@
1
-# Auto detect text files and perform LF normalization
2 1
 * text=auto
3
-
4
-# Custom for Visual Studio
5
-*.cs     diff=csharp
6
-*.sln    merge=union
7
-*.csproj merge=union
8
-*.vbproj merge=union
9
-*.fsproj merge=union
10
-*.dbproj merge=union
11
-
12
-# Standard to msysgit
13
-*.doc	 diff=astextplain
14
-*.DOC	 diff=astextplain
15
-*.docx diff=astextplain
16
-*.DOCX diff=astextplain
17
-*.dot  diff=astextplain
18
-*.DOT  diff=astextplain
19
-*.pdf  diff=astextplain
20
-*.PDF	 diff=astextplain
21
-*.rtf	 diff=astextplain
22
-*.RTF	 diff=astextplain

+ 3
- 0
CODE_OF_CONDUCT.md View File

@@ -0,0 +1,3 @@
1
+# Code of Conduct
2
+
3
+thou shan't be a binch

+ 1
- 1
LICENSE View File

@@ -186,7 +186,7 @@ Apache License
186 186
       same "printed page" as the copyright notice for easier
187 187
       identification within third-party archives.
188 188
 
189
-   Copyright 2016 Julian van de Groep <http://flash.moe>
189
+   Copyright 2013-2018 Julian van de Groep <http://flash.moe>
190 190
 
191 191
    Licensed under the Apache License, Version 2.0 (the "License");
192 192
    you may not use this file except in compliance with the License.

+ 1
- 1
README.md View File

@@ -1,3 +1,3 @@
1 1
 # Satoko
2 2
 
3
-Yes, yet another imageboard script. I'll write up a better README.md later, can't be bothered right now.
3
+it's not dead!

+ 0
- 4
application/routes.php View File

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

+ 0
- 26
application/satoko.php View File

@@ -1,26 +0,0 @@
1
-<?php
2
-/*
3
- * Satoko startup
4
- * (c) 2013-2016 Julian van de Groep <https://flash.moe>
5
- */
6
-
7
-namespace Satoko;
8
-
9
-use Phroute\Phroute\RouteCollector;
10
-
11
-// Require composer libraries
12
-require_once __DIR__ . '/../vendor/autoload.php';
13
-
14
-// Initialise the configuration
15
-Config::init("path/to/right/now/nonexistent/configuration.ini");
16
-
17
-// Setup the database connection
18
-DB::setup(
19
-    Config::get('database')
20
-);
21
-
22
-// Create the router
23
-$router = new RouteCollector;
24
-
25
-// Require the routes file
26
-require_once 'routes.php';

+ 0
- 24
composer.json View File

@@ -1,24 +0,0 @@
1
-{
2
-    "name": "flashwave/satoko",
3
-    "description": "An imageboard script",
4
-    "license": "Apache-2.0",
5
-    "homepage": "https://flash.moe/satoko",
6
-    "support": {
7
-        "email": "me@flash.moe",
8
-        "issues": "https://github.com/flashwave/satoko/issues"
9
-    },
10
-    "require": {
11
-        "php": ">=5.5.9",
12
-        "jbbcode/jbbcode": "1.*",
13
-        "twig/twig": "1.*",
14
-        "illuminate/database": "5.2.*",
15
-        "illuminate/filesystem": "5.2.*",
16
-        "doctrine/dbal": "~2.4",
17
-        "phroute/phroute": "2.1.*"
18
-    },
19
-    "autoload": {
20
-        "psr-4": {
21
-            "Satoko\\": "satoko/"
22
-        }
23
-    }
24
-}

+ 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 @@
1
-<?php
2
-namespace Satoko;
3
-
4
-use Phroute\Phroute\Dispatcher;
5
-
6
-require_once __DIR__ . '/../application/satoko.php';
7
-
8
-// Create a dispatcher
9
-$dispatcher = new Dispatcher($router->getData());
10
-
11
-// Handle requests
12
-echo $dispatcher->dispatch(
13
-    $_SERVER['REQUEST_METHOD'],
14
-    parse_url(
15
-        $_SERVER['REQUEST_URI'],
16
-        PHP_URL_PATH
17
-    )
18
-);

+ 0
- 70
satoko/Config.php View File

@@ -1,70 +0,0 @@
1
-<?php
2
-namespace Satoko;
3
-
4
-/**
5
- * Configuration manager.
6
- *
7
- * @package Satoko
8
- * @author Julian van de Groep <me@flash.moe>
9
- */
10
-class Config
11
-{
12
-    /**
13
-     * Path to the configuration file.
14
-     *
15
-     * @var string
16
-     */
17
-    private static $path = "";
18
-
19
-    /**
20
-     * Parsed configuration file.
21
-     *
22
-     * @var array
23
-     */
24
-    private static $conf = [];
25
-
26
-    /**
27
-     * Initialise the configuration manager.
28
-     *
29
-     * @param string $file Path to the configuration file.
30
-     */
31
-    public static function init($file)
32
-    {
33
-        // Assign file
34
-        self::$path = $file;
35
-
36
-        // Parse the file
37
-        self::$conf = parse_ini_file(self::$path, true);
38
-    }
39
-
40
-    /**
41
-     * Write configuration to the set INI file.
42
-     */
43
-    public static function save()
44
-    {
45
-        // tbi
46
-    }
47
-
48
-    /**
49
-     * Set a configuration value.
50
-     *
51
-     * @param string $name Key name separated by dots (e.g. database.host).
52
-     * @param string $value Value to store under this entry.
53
-     */
54
-    public static function set($name, $value)
55
-    {
56
-        // tbi
57
-    }
58
-
59
-    /**
60
-     * Get a configuration value.
61
-     *
62
-     * @param string $name Key name separated by dots (e.g. database.host).
63
-     *
64
-     * @return string|array
65
-     */
66
-    public static function get($name, $fallback = null)
67
-    {
68
-        // tbi
69
-    }
70
-}

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

@@ -1,12 +0,0 @@
1
-<?php
2
-namespace Satoko\Controllers;
3
-
4
-/**
5
- * Base controller (which other controllers should extend on).
6
- *
7
- * @package Satoko
8
- * @author Julian van de Groep <me@flash.moe>
9
- */
10
-class Controller
11
-{
12
-}

+ 0
- 30
satoko/DB.php View File

@@ -1,30 +0,0 @@
1
-<?php
2
-namespace Satoko;
3
-
4
-use Illuminate\Database\Capsule\Manager;
5
-
6
-/**
7
- * Extensions to the Illuminate (Laravel) database.
8
- *
9
- * @package Satoko
10
- * @author Julian van de Groep <me@flash.moe>
11
- */
12
-class DB extends Manager
13
-{
14
-    /**
15
-     * Set the database connection up.
16
-     *
17
-     * @param array $config Configuration array according to the Laravel documentation.
18
-     */
19
-    public static function setup($config)
20
-    {
21
-        // Create a new database capsule
22
-        $capsule = new Manager;
23
-
24
-        // Add the connection
25
-        $capsule->addConnection($config);
26
-
27
-        // Make the capsule globally accessible
28
-        $capsule->setAsGlobal();
29
-    }
30
-}

+ 0
- 12
satoko/Exception.php View File

@@ -1,12 +0,0 @@
1
-<?php
2
-namespace Satoko;
3
-
4
-/**
5
- * Base exception for Satoko things.
6
- *
7
- * @package Satoko
8
- * @author Julian van de Groep <me@flash.moe>
9
- */
10
-class Exception extends \Exception
11
-{
12
-}

+ 0
- 21
server.php View File

@@ -1,21 +0,0 @@
1
-<?php
2
-if (php_sapi_name() === 'cli') {
3
-    exec("php -S localhost:8000 -t public/ {$_SERVER['PHP_SELF']}");
4
-    return;
5
-}
6
-
7
-// Decode and parse the request uri
8
-$uri = urldecode(
9
-    parse_url(
10
-        $_SERVER['REQUEST_URI'],
11
-        PHP_URL_PATH
12
-    )
13
-);
14
-
15
-// Check if the file exist in the public directory and if it does serve it.
16
-if ($uri !== '/' && file_exists(__DIR__ . '/public' . $uri)) {
17
-    return false;
18
-}
19
-
20
-// Otherwise include the router
21
-require_once __DIR__ . '/public/index.php';