/home/jobupeledu/public_html/job2/vendor/nette/database/src/Database/Connection.php
$this->params = [$dsn, $user, $password];
$this->options = (array) $options;
if (empty($options['lazy'])) {
$this->connect();
}
}
public function connect(): void
{
if ($this->pdo) {
return;
}
try {
$this->pdo = new PDO($this->params[0], $this->params[1], $this->params[2], $this->options);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
throw ConnectionException::from($e);
}
$class = empty($this->options['driverClass'])
? 'Nette\Database\Drivers\\' . ucfirst(str_replace('sql', 'Sql', $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME))) . 'Driver'
: $this->options['driverClass'];
$this->driver = new $class;
$this->preprocessor = new SqlPreprocessor($this);
$this->driver->initialize($this, $this->options);
Arrays::invoke($this->onConnect, $this);
}
public function reconnect(): void
{
$this->disconnect();
$this->connect();
}
public function disconnect(): void
/home/jobupeledu/public_html/job2/vendor/nette/database/src/Database/Connection.php
public function __construct(string $dsn, string $user = null, string $password = null, array $options = null)
{
$this->params = [$dsn, $user, $password];
$this->options = (array) $options;
if (empty($options['lazy'])) {
$this->connect();
}
}
public function connect(): void
{
if ($this->pdo) {
return;
}
try {
$this->pdo = new PDO($this->params[0], $this->params[1], $this->params[2], $this->options);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
throw ConnectionException::from($e);
}
$class = empty($this->options['driverClass'])
? 'Nette\Database\Drivers\\' . ucfirst(str_replace('sql', 'Sql', $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME))) . 'Driver'
: $this->options['driverClass'];
$this->driver = new $class;
$this->preprocessor = new SqlPreprocessor($this);
$this->driver->initialize($this, $this->options);
Arrays::invoke($this->onConnect, $this);
}
public function reconnect(): void
{
$this->disconnect();
$this->connect();
}
/home/jobupeledu/public_html/job2/vendor/nette/database/src/Database/Connection.php
public function __construct(string $dsn, string $user = null, string $password = null, array $options = null)
{
$this->params = [$dsn, $user, $password];
$this->options = (array) $options;
if (empty($options['lazy'])) {
$this->connect();
}
}
public function connect(): void
{
if ($this->pdo) {
return;
}
try {
$this->pdo = new PDO($this->params[0], $this->params[1], $this->params[2], $this->options);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
throw ConnectionException::from($e);
}
$class = empty($this->options['driverClass'])
? 'Nette\Database\Drivers\\' . ucfirst(str_replace('sql', 'Sql', $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME))) . 'Driver'
: $this->options['driverClass'];
$this->driver = new $class;
$this->preprocessor = new SqlPreprocessor($this);
$this->driver->initialize($this, $this->options);
Arrays::invoke($this->onConnect, $this);
}
public function reconnect(): void
{
$this->disconnect();
$this->connect();
}
/home/jobupeledu/public_html/job2/vendor/nette/database/src/Database/Connection.php
/** @var PDO|null */
private $pdo;
/** @var callable(array, ResultSet): array */
private $rowNormalizer = [Helpers::class, 'normalizeRow'];
/** @var string|null */
private $sql;
/** @var int */
private $transactionDepth = 0;
public function __construct(string $dsn, string $user = null, string $password = null, array $options = null)
{
$this->params = [$dsn, $user, $password];
$this->options = (array) $options;
if (empty($options['lazy'])) {
$this->connect();
}
}
public function connect(): void
{
if ($this->pdo) {
return;
}
try {
$this->pdo = new PDO($this->params[0], $this->params[1], $this->params[2], $this->options);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
throw ConnectionException::from($e);
}
$class = empty($this->options['driverClass'])
? 'Nette\Database\Drivers\\' . ucfirst(str_replace('sql', 'Sql', $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME))) . 'Driver'
: $this->options['driverClass'];
/home/jobupeledu/public_html/job2/config/database.php
'connections' => [
'mysql' => [
'driver' => 'mysql',
'url' => null,
'dsn' => 'mysql:host=localhost;dbname=kyc',
'port' => '3306',
'username' => 'radouan',
'password' => 'root',
'prefix' => ''
]
]
];
$DefaultDriver = $DATABASE['default'];
$database = new Nette\Database\Connection($DATABASE['connections'][$DefaultDriver]['dsn'], $DATABASE['connections'][$DefaultDriver]['username'], $DATABASE['connections'][$DefaultDriver]['password']);
/home/jobupeledu/public_html/job2/server.php
/* =============================================================================================================================*/
// include autoload file and load all dependencies
require_once __DIR__ . '/' . 'vendor/autoload.php';
// Errors Handler
require_once __DIR__ . '/' . 'config/errors.php';
// File Systems
require_once __DIR__ . '/' . 'config/filesystems.php';
// Configurations
require_once __DIR__ . '/' . 'config/config.php';
// Utilities & Uses
require_once __DIR__ . '/' . 'config/utilities.php';
// Databse connection
require_once __DIR__ . '/' . 'config/database.php';
// Security
require_once __DIR__ . '/' . 'config/security.php';
// Main APP CONF
require_once __DIR__ . '/' . 'config/app.php';
// Email Config
require_once __DIR__ . '/' . 'config/email.php';
// // Codes functions
require_once __DIR__ . '/' . 'app/main/functions.php';
// View Structures
require_once __DIR__ . '/' . 'config/view.php';
?>
/home/jobupeledu/public_html/job2/index.php
<?php
// check the vendor/autoload.php file
if ( file_exists( __DIR__ . '/' . 'vendor/autoload.php' ) ) {
require_once __DIR__ . '/' . 'server.php';
require_once __DIR__ . '/' . $FILES_SYSTEMS['public']['path'] . '/index.php';
}else{
echo "Please run <code>composer install </code> - <a target='_blank' href='https://getcomposer.org/doc/03-cli.md#install-i'>Read more from composer</a>";
exit();
}
?>