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;