Procházet zdrojové kódy

create DB class in Blog

Namespaces
Ruben De Baets před 2 roky
rodič
revize
83157446f4
2 změnil soubory, kde provedl 16 přidání a 11 odebrání
  1. 3
    11
      public/index.php
  2. 13
    0
      src/DB.php

+ 3
- 11
public/index.php Zobrazit soubor

@@ -9,23 +9,15 @@ session_start();
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use SQLite3;
use Blog\DB;


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

$app = AppFactory::create();



class MyDB extends SQLite3
{
function __construct()
{
$this->open('../private/test.db');
}
}

$db = new MyDB();
$db = new DB();
ini_set('display_errors', 'Off');



+ 13
- 0
src/DB.php Zobrazit soubor

@@ -0,0 +1,13 @@
<?php

namespace Blog;

use SQLite3;

class DB extends SQLite3
{
function __construct()
{
$this->open('../private/test.db');
}
}

Načítá se…
Zrušit
Uložit