1
0
mirror of https://github.com/Mowie/Mowie synced 2024-06-11 05:09:39 +00:00
Mowie/inc/autoload.php
kolaente b6a4ecbe1e Added own class to loop through apps
Added App-Support for aliases, domains and own CSS (Documentation coming soon)
2016-09-28 17:49:00 +02:00

37 lines
887 B
PHP
Executable File

<?php
session_name('adminsession');
session_start();
//Richtigen Pfad rausfinden
$path = '';
$pos = strpos($_SERVER['REQUEST_URI'], 'apps/');
//echo str_replace(substr($_SERVER['REQUEST_URI'], 0, $pos).'apps/', '', $_SERVER['REQUEST_URI']);
$rel = explode('/', str_replace(substr(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), 0, $pos).'apps/', '', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));
$count = count($rel);
$count = $count -1;
$i = 1;
while($i<$count)
{
$path .= '../';
$i++;
}
require_once $path.'../../inc/config.php';
//Language
$lang->setLangFolder( $path.'../../admin/lang/');
if(file_exists($path.'lang/') && is_dir($path.'lang/'))
{
$lang->setLangFolder( $path.'lang/');
}
//init Apps
require_once $path.'../../inc/apps.php';
$apps = new apps();
//Require appsConfig
require_once $path.'config.php';
require_once $path.'../../inc/libs/functions.php';