PHP Classes

File: demos/init-db.php

Recommend this page to a friend!
  Classes of Francesco Danti   ATK4 Session   demos/init-db.php   Download  
File: demos/init-db.php
Role: Example script
Content type: text/plain
Description: Example script
Class: ATK4 Session
Store and retrieve PHP session data in a database
Author: By
Last change:
Date: 18 days ago
Size: 436 bytes
 

Contents

Class file image Download
<?php

declare(strict_types=1);

namespace
Atk4\ATK4DBSession\Demos;

try {
    require_once
file_exists(__DIR__ . '/db.php')
        ?
__DIR__ . '/db.php'
       
: __DIR__ . '/db.default.php';
} catch (\
PDOException $e) {
   
// do not show $e unless you can secure DSN!
   
throw (new \Atk4\Core\Exception('This demo requires access to the database. See "demos/init-db.php"'))
        ->
addMoreInfo('PDO error', $e->getMessage());
}