PHP Classes

File: lib/pdoonecli

Recommend this page to a friend!
  Classes of Jorge Castro   PHP PDO One   lib/pdoonecli   Download  
File: lib/pdoonecli
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP PDO One
Access to database with PDO and run common queries
Author: By
Last change:
Date: 18 days ago
Size: 611 bytes
 

Contents

Class file image Download
<?php

namespace eftec;
include_once
__DIR__ . '/PdoOneCli.php';
// this code only runs on CLI but only if pdoonecli.php is called directly and via command line.
if (!defined('PHPUNIT_COMPOSER_INSTALL') && !defined('__PHPUNIT_PHAR__')
    && isset(
$_SERVER['PHP_SELF']) &&
   
PdoOneCli::isCli() &&
    (
basename($_SERVER['PHP_SELF']) === 'pdoonecli.php' || basename($_SERVER['PHP_SELF']) === 'pdoonecli')
) {
   
// we also excluded it if it is called by phpunit.
   
$path = PdoOneCli::findVendorPath();
    include_once
__DIR__ . '/' . $path . '/autoload.php';
   
$cli = new PdoOneCli();
}