<?php
    include_once "cf-config.php";

    // Composer Autoloader
    if (is_file(DIR_LIBRARY . 'vendor/autoload.php')) {
        require_once(DIR_LIBRARY . 'vendor/autoload.php');
    }

    spl_autoload_register(function($class) {
        if (file_exists(DIR_LIBRARY . $class . '.php')) {
            require_once DIR_LIBRARY . $class . '.php';
        }
    });


    $db              = new Database();
    $utils			 = new Utils($db);
    $session		 = new Session($db, $utils);
    $menu		     = new Menu($db);
    $slider		     = new Slider($db);
    $banner		     = new Banner($db);
    $pagination		 = new Pagination($db);

    $config			 = new Config($db);

    $csrf_generator	 = new StatelessCSRF();
    $blog			 = new Blog($db, $utils);
    $pages			 = new Pages($db, $utils);
    $user   		 = new User($db, $utils, $session);
    $email   		 = new Email($db, $utils);
    $product   		 = new Product($db, $utils, $config);
    $order  		 = new Order($db, $utils, $session, $product);
    $support   		 = new Support($db, $utils);
    $couponCodes   	 = new CouponCodes($db);
    $systemLog   	 = new SystemLog($db);
    $faq       	     = new Faq($db, $utils);
    $seller       	 = new Seller($db, $utils);