PHP Classes
elePHPant
Icontem

File: testing/bootstrap.php

Recommend this page to a friend!
  Classes of Subin Siby  >  Secure PHP Login System  >  testing/bootstrap.php  >  Download  
File: testing/bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Secure PHP Login System
Register and login users using a database via PDO
Author: By
Last change: Changed session library

* Now uses non-blocking sessions
* Removed usage of native PHP sessions
* Allow to rename session cookie
* Removed defunct TwoStepLogin tests
Merge branch 'MaterializeExample' into dev
Date: 1 year ago
Size: 725 bytes
 

 

Contents

Class file image Download
<?php
require_once __DIR__ . '/../vendor/autoload.php';

if (
$GLOBALS['DB_TYPE'] === 'sqlite') {
   
$GLOBALS['DB_SQLITE_PATH'] = tempnam(sys_get_temp_dir(), 'logSysSQLiteDB');
   
$GLOBALS['DB_DSN'] = 'sqlite:' . $GLOBALS['DB_SQLITE_PATH'];
} elseif (
$GLOBALS['DB_TYPE'] === 'postgresql') {
   
$GLOBALS['DB_DSN'] = 'pgsql:dbname=' . $GLOBALS['DB_NAME'] . ';host=' . $GLOBALS['DB_HOST'] . ';port=' . $GLOBALS['DB_PORT'];
} else {
   
$GLOBALS['DB_DSN'] = 'mysql:dbname=' . $GLOBALS['DB_NAME'] . ';host=' . $GLOBALS['DB_HOST'] . ';port=' . $GLOBALS['DB_PORT'];
}

function
setServerArray()
{
   
$_SERVER['SERVER_NAME'] = 'localhost';
   
$_SERVER['SERVER_PORT'] = '80';
   
$_SERVER['REQUEST_URI'] = '/index.php';
}