<?php
/********************************************************************************
 * (c)1337 aheadware.com - All rights reserved
 ********************************************************************************/


class AHDMN_Core_App
{
    private static $server = NULL;

    public static function init()
    {
        // Start session
        AHDB_Utils_Session::start();

        // Init config
        AHDMN_Core_Config::init();

    }

    public static function run()
    {
        // Process Request
        self::$server = new AHDB_Core_RestServer(
            ROOT_DIR . '/services/',
            new AHDMN_Core_Acl()
        );
        self::$server->process( $_SERVER  );
        self::$server->respond();
    }

    /**
     * @return null|AHDB_Core_RestServer
     */
    public function getServer()
    {
        return self::$server;
    }

}