PHP Classes

File: app/app.php

Recommend this page to a friend!
  Classes of Jorge Castro   PHP PDO Login System One   app/app.php   Download  
File: app/app.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP PDO Login System One
Authenticate users with records on MySQL using PDO
Author: By
Last change:
Date: 3 years ago
Size: 872 bytes
 

Contents

Class file image Download
<?php
@session_start();

use
eftec\bladeone\BladeOne;
use
eftec\PdoOne;
use
eftec\ValidationOne;

include
__DIR__."/../vendor/autoload.php";


// singleton and container

/** @var BladeOne $bladeOne */
$bladeOne=null;
/** @var PdoOne $pdoOne */
$pdoOne=null;
/** @var ValidationOne $validationOne */
$validationOne=null;

function
bladeOne() {
    global
$bladeOne;
    if(
$bladeOne===null) {
       
$bladeOne=new BladeOne();
    }
    return
$bladeOne;
}
function
pdoOne() {
    global
$pdoOne;
    if(
$pdoOne===null) {
       
$pdoOne=new PdoOne('mysql','127.0.0.1','root','abc.123','testdb');
       
$pdoOne->logLevel=3; // it shows all errors.
       
$pdoOne->open();
    }
    return
$pdoOne;
}
function
validationOne() {
    global
$validationOne;
    if(
$validationOne===null) {
       
$validationOne=new ValidationOne();
    }
    return
$validationOne;
}