<?
error_reporting( 0 );
// error_reporting( E_ALL ^ E_NOTICE ^ E_STRICT );
function __autoload_my_classes( $classname )
{
  $q = explode( '\\' , $classname );
  $c = array_pop( $q );
  $f = '../autoload/' . implode( '/' , $q ) . '/class.' . $c . '.php';
  if ( $c == 'Savant3' )
  {
    require_once( '../autoload/Savant3.php' );
    return true;
  }
  if ( file_exists( $f ) )
    require_once( $f );
}
spl_autoload_register( '__autoload_my_classes' );

require_once '../config.php';
require_once '../libraries/medoo/medoo.php';
require_once '../libraries/grid/config.php';
date_default_timezone_set('Europe/Warsaw');

session_start();

$mdb = new medoo( [
                    'database_type' => 'mysql',
                    'database_name' => $database['name'],
                    'server'        => $database['host'],
                    'username'      => $database['user'],
                    'password'      => $database['password'],
                    'charset'       => 'utf8'
                ] );

require_once 'ajax/pages.php';
require_once 'ajax/articles.php';
require_once 'ajax/users.php';
require_once 'ajax/newsletter.php';
?>