<?php
/**
 * Created by PhpStorm.
 * User: Игорь
 * Date: 23.01.2017
 * Time: 00:07
 */

require_once __DIR__ . '/../vendor/autoload.php';


setlocale(LC_ALL,'ru_RU.UTF-8');

$app = new PFRM\App();

$app->config = (object) [
  "views_dir"  => __DIR__ . '/V/',
  "public_dir" => dirname(__DIR__) . '/public/',
  "db"         => (object) [
    'host'     => '127.0.0.1',
    'port'     => '3306',
    'dbname'   => 'test',
    'user'     => 'testuser',
    'password' => 'testpassword',
  ],
  "controller_namespace" => "\\PTEST\\C\\",
  "site_name" => "Доска объявлений"
];

$app->setRoute( '/^\/CAPTCHA.png\?*\d*$/', 'CAPTCHA' );
$app->setRoute( '|^/page/(?<id>\d+)/$|', 'Index', 'page');
$app->setRoute( '/^.*$/', 'error404' );

$app->run();