protected function initLMS($tp)
 {
     include_once $tp . "/include/inc.ilias_version.php";
     $aVersion = explode('.', ILIAS_VERSION_NUMERIC);
     if (!empty($aVersion)) {
         $vstring = $aVersion[0] . '.' . $aVersion[1];
         $strVersionInit = 'tla/include/PowerTLA/Ilias/ilRESTInitialisation.' . $vstring . '.php';
         $this->iliasVersion = $aVersion[0] . '.' . $aVersion[1];
         if (file_exists($tp . '/' . $strVersionInit)) {
             // $this->log("ilias file exists");
             require_once $strVersionInit;
             switch ($vstring) {
                 case '4.2':
                     $ilInit = new ilRESTInitialisation();
                     $GLOBALS['ilInit'] = $ilInit;
                     $ilInit->initILIAS("rest");
                     break;
                 case '4.3':
                     ilRESTInitialisation::initIlias();
                     // why oh why?!?
                     break;
                 case '4.4':
                 case '5.0':
                     ilRESTInitialisation::initILIAS();
                     // fake OOP again,
                     // but now all CAPS?
                     break;
                 default:
                     $this->fatal("Unsupported Ilias Version " . $vstring);
                     break;
             }
         }
     }
 }
 /**
  * ilias initialisation
  *
  * This needs to be overwritten because Ilias would ignore several settings
  * initIlias has to be overwritten because there is no easy way to
  * refine the context definition
  */
 public static function initILIAS()
 {
     if (self::$already_initialized) {
         return;
     }
     self::$already_initialized = true;
     global $tree;
     self::initCore();
     if (ilContext::initClient()) {
         self::initClient();
         self::initUser();
         // NOTE authenticate() will setup the session user
         self::authenticate();
         // init after Auth otherwise breaks CAS
         self::includePhp5Compliance();
         // language may depend on user setting
         self::initLanguage();
         $tree->initLangCode();
     }
 }