Split browser.php to commands with routes.

This commit is contained in:
Krzysztof Płaczek
2024-10-13 20:44:14 +02:00
parent e13a0acce1
commit f2e6cba2f5
12 changed files with 281 additions and 40 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace Krzysiej\RyobiCrawler\Controller;
use Twig\Environment;
use Twig\Loader\FilesystemLoader;
use Illuminate\Database\Capsule\Manager as Capsule;
class BaseController
{
protected Environment $twig;
public function __construct()
{
$capsule = new Capsule;
$capsule->addConnection(['driver' => 'sqlite', 'database' => __DIR__ . '/../../database.sqlite']);
$capsule->setAsGlobal();
$capsule->bootEloquent();
$loader = new FilesystemLoader( __DIR__ . '/../../src/templates');
$this->twig = new Environment($loader);
}
}