Last active
March 15, 2018 06:49
-
-
Save piiskop/ce53d8c82b3baabf63af8ef9679a0f57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace pupils; | |
class StudyGroupPupilsApi { | |
function __construct() { | |
ini_set('display_errors', 1); | |
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); | |
// @formatter:off | |
require_once sprintf( | |
'%1$s/settings/%2$s/Configuration.php', | |
dirname(__FILE__), // 1 | |
$_SERVER['SERVER_NAME'] // 2 | |
); | |
// @formatter:on | |
if(!isset($_SESSION)){ | |
session_start(); | |
} | |
require_once Configuration::CORE_FOLDER . 'DbEngine.php'; | |
new \o\DbEngine(array ( | |
'host' => Configuration::DB_HOST, | |
'name' => Configuration::DB_NAME, | |
'user' => Configuration::DB_USER, | |
'password' => Configuration::DB_PASS | |
)); | |
require_once Configuration::CORE_FOLDER . 'Response.php'; | |
if (isset($_GET['target']) && '' != $_GET['target']) { | |
require_once dirname(__FILE__) . '/StudyGroupController.php'; | |
new StudyGroupController(array ()); | |
} else { | |
new \o\Response(array ( | |
'message' => 'package is missing', | |
'status' => 400 | |
)); | |
} | |
} | |
} | |
new StudyGroupPupilsApi(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment