initial commit

This commit is contained in:
flash 2020-12-31 01:38:59 +00:00
commit 0967a515d6
8 changed files with 39 additions and 0 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
* text=auto

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.debug

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# Koakuma
Error submission system

BIN
public/assets/koa.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 MiB

BIN
public/assets/novids.mp3 Normal file

Binary file not shown.

BIN
public/assets/novids.ogg Normal file

Binary file not shown.

11
public/index.php Normal file
View file

@ -0,0 +1,11 @@
<?php
namespace Koakuma;
require_once __DIR__ . '/../startup.php';
if($_SERVER['REQUEST_METHOD'] === 'GET' && trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/') === '') {
echo '<!doctype html><title>Koakuma</title>'
. '<style>body { background: url(\'/assets/koa.gif\'); background-repeat: no-repeat; background-attachment: fixed; background-position: center; background-color: #d3fddc;</style>'
. '<audio autoplay loop><source src="/assets/novids.mp3" type="audio/mpeg" /><source src="/assets/novids.ogg" type="audio/ogg" /></audio>';
return;
}

23
startup.php Normal file
View file

@ -0,0 +1,23 @@
<?php
namespace Koakuma;
define('KOA_STARTUP', microtime(true));
define('KOA_ROOT', __DIR__);
define('KOA_DEBUG', is_file(KOA_ROOT . '/.debug'));
define('KOA_PUB', KOA_ROOT . '/public'); // WWW visible
define('KOA_SRC', KOA_ROOT . '/src'); // Patchouli namespace
define('KOA_LIB', KOA_ROOT . '/lib'); // Other unresolved namespaces
ini_set('display_errors', KOA_DEBUG ? 'on' : 'off');
error_reporting(KOA_DEBUG ? -1 : 0);
mb_internal_encoding('utf-8');
set_include_path(KOA_SRC . PATH_SEPARATOR . KOA_LIB . PATH_SEPARATOR . get_include_path());
spl_autoload_register(function(string $className) {
$parts = explode('\\', trim($className, '\\'), 2);
if($parts[0] === __NAMESPACE__)
require_once KOA_SRC . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $parts[1]) . '.php';
else
require_once KOA_LIB . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';
});