Skip to content

Instantly share code, notes, and snippets.

@licvido
Created July 11, 2015 11:33
Show Gist options
  • Save licvido/a3e6764e05086d30fe22 to your computer and use it in GitHub Desktop.
Save licvido/a3e6764e05086d30fe22 to your computer and use it in GitHub Desktop.
Nette\Database
<?php
require 'nette.phar';
//Tracy\Debugger::enable();
$dns = "mysql:host=localhost;dbname=database";
$user = "user";
$password = "*****";
$connection = new Nette\Database\Connection($dns, $user, $password);
$cacheMemoryStorage = new Nette\Caching\Storages\MemoryStorage;
$structure = new Nette\Database\Structure($connection, $cacheMemoryStorage);
$conventions = new Nette\Database\Conventions\DiscoveredConventions($structure);
$context = new Nette\Database\Context($connection, $structure, $conventions, $cacheMemoryStorage);
//dump($context);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment