Example #1
0
 private function setupAutoload()
 {
     if (class_exists("StudipAutoloader")) {
         StudipAutoloader::addAutoloadPath(__DIR__ . '/models');
     } else {
         spl_autoload_register(function ($class) {
             include_once __DIR__ . $class . '.php';
         });
     }
 }
Example #2
0
 /**
  * Adds a bundle of classes and their locations to the lookup table.
  *
  * @param Array $map Associative array of class name and their locations
  * @since Stud.IP 3.4
  */
 public static function addClassLookups(array $map)
 {
     self::$class_lookup = array_merge(self::$class_lookup, $map);
 }
Example #3
0
<?php

StudipAutoloader::addAutoloadPath(__DIR__ . '/classes/');
require_once __DIR__ . '/vendor/autoload.php';
Example #4
0
 if (Config::get()->RESOURCES_ENABLE) {
     StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'] . '/' . $GLOBALS['RELATIVE_PATH_RESOURCES'] . '/lib');
     require_once $GLOBALS['RELATIVE_PATH_RESOURCES'] . '/resourcesFunc.inc.php';
     require_once $GLOBALS['RELATIVE_PATH_RESOURCES'] . '/lib/list_assign.inc.php';
 }
 if (Config::get()->EXTERN_ENABLE) {
     StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'] . '/' . $GLOBALS['RELATIVE_PATH_EXTERN'] . '/lib');
     require_once $GLOBALS['STUDIP_BASE_PATH'] . '/' . $GLOBALS['RELATIVE_PATH_EXTERN'] . '/extern_config.inc.php';
     require_once $GLOBALS['STUDIP_BASE_PATH'] . '/' . $GLOBALS['RELATIVE_PATH_EXTERN'] . '/lib/extern_functions.inc.php';
 }
 if (Config::get()->CALENDAR_ENABLE) {
     StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'] . '/' . $GLOBALS['RELATIVE_PATH_CALENDAR'] . '/lib');
     require_once $GLOBALS['STUDIP_BASE_PATH'] . '/' . $GLOBALS['RELATIVE_PATH_CALENDAR'] . '/calendar_func.inc.php';
 }
 if (Config::get()->ELEARNING_INTERFACE_ENABLE) {
     StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'] . '/' . $GLOBALS['RELATIVE_PATH_ELEARNING_INTERFACE']);
 }
 // set dummy navigation until db is ready
 Navigation::setRootNavigation(new Navigation(''));
 // set up default page layout
 PageLayout::initialize();
 //Besser hier globale Variablen definieren...
 $GLOBALS['_fullname_sql'] = array();
 $GLOBALS['_fullname_sql']['full'] = "TRIM(CONCAT(title_front,' ',Vorname,' ',Nachname,IF(title_rear!='',CONCAT(', ',title_rear),'')))";
 $GLOBALS['_fullname_sql']['full_rev'] = "TRIM(CONCAT(Nachname,', ',Vorname,IF(title_front!='',CONCAT(', ',title_front),''),IF(title_rear!='',CONCAT(', ',title_rear),'')))";
 $GLOBALS['_fullname_sql']['no_title'] = "CONCAT(Vorname ,' ', Nachname)";
 $GLOBALS['_fullname_sql']['no_title_rev'] = "CONCAT(Nachname ,', ', Vorname)";
 $GLOBALS['_fullname_sql']['no_title_short'] = "CONCAT(Nachname,', ',UCASE(LEFT(TRIM(Vorname),1)),'.')";
 $GLOBALS['_fullname_sql']['no_title_motto'] = "CONCAT(Vorname ,' ', Nachname,IF(motto!='',CONCAT(', ',motto),''))";
 $GLOBALS['_fullname_sql']['full_rev_username'] = "******";
 //Initialize $SEM_TYPE and $SEM_CLASS arrays
Example #5
0
<?php

namespace {
    StudipAutoloader::addAutoloadPath($GLOBALS['STUDIP_BASE_PATH'] . '/vendor/oauth-php/library');
    StudipAutoloader::addClassLookup('DocBlock', 'vendor/docblock-parser/docblock-parser.php');
    // Set base url for URLHelper class
    URLHelper::setBaseUrl($GLOBALS['CANONICAL_RELATIVE_PATH_STUDIP']);
}
namespace RESTAPI {
    use Studip, OAuthStore;
    // Define api version
    const VERSION = '2';
    $router = Router::getInstance();
    // Register JSON content renderer
    $router->registerRenderer(new Renderer\JSONRenderer(), true);
    // If in development mode, register debug content renderer
    if (defined('Studip\\ENV') && Studip\ENV === 'development') {
        $router->registerRenderer(new Renderer\DebugRenderer());
    }
    OAuthStore::instance('PDO', array('dsn' => 'mysql:host=' . $GLOBALS['DB_STUDIP_HOST'] . ';dbname=' . $GLOBALS['DB_STUDIP_DATABASE'], 'username' => $GLOBALS['DB_STUDIP_USER'], 'password' => $GLOBALS['DB_STUDIP_PASSWORD']));
    // Register default consumers
    Consumer\Base::addType('http', 'RESTAPI\\Consumer\\HTTP');
    Consumer\Base::addType('studip', 'RESTAPI\\Consumer\\Studip');
    Consumer\Base::addType('oauth', 'RESTAPI\\Consumer\\OAuth');
    // $router->registerConsumer('oauth', new Consumer\OAuth);
    // $router->registerConsumer('basic', new Consumer\HTTP);
    // $router->registerConsumer('studip', new Consumer\Studip);
}