~thirdplace/discovery

04aab497860f5ad880ae1f63b48e428027e90327 — Dag 1 year, 1 month ago 3f59b41
fix
3 files changed, 9 insertions(+), 7 deletions(-)

M composer.json
M src/bootstrap.php
M src/container.php
M composer.json => composer.json +3 -2
@@ 4,10 4,11 @@
    "type": "project",
    "license": "GPL-3",
    "require": {
        "ext-dom": "*",
        "thirdplace/components": "dev-main",
        "thirdplace/feed-finder": "dev-main",
        "ext-mbstring": "*"
        "ext-mbstring": "*",
        "ext-pdo": "*",
        "ext-dom": "*"
    },
    "autoload": {
        "psr-4": {

M src/bootstrap.php => src/bootstrap.php +5 -4
@@ 4,12 4,16 @@ declare(strict_types=1);
namespace Thirdplace;

ini_set('error_log', __DIR__ . '/../var/php-error.log');
ini_set('display_errors', '1');
//ini_set('display_errors', '1');
ini_set('max_execution_time', '10');
ini_set('memory_limit', '32M');

require __DIR__ . '/../vendor/autoload.php';

if (!is_writable(__DIR__ . '/../var')) {
    die('var folder is not writeable');
}

$container = require __DIR__ . '/../src/container.php';

(function() {


@@ 27,9 31,6 @@ $container = require __DIR__ . '/../src/container.php';
        $app->run();
    } catch (\Throwable $e) {
        if (env() === 'dev') {
            // This is a hack
            http_response_code(500);
            print '<pre>';
        } else {
            render('error.php', [], 500)->send();
        }

M src/container.php => src/container.php +1 -1
@@ 71,7 71,7 @@ $container['config'] = function ($c) {

$container['pdo'] = function ($c) {
    $file = __DIR__ . '/../var/db.sqlite';
    if (!is_writable($file)) die('db.sqlite is not writable');

    $pdo = new \PDO('sqlite:' . $file);
    $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
    return $pdo;