Files
luos/workflow/public_html/app.php

75 lines
2.2 KiB
PHP
Raw Normal View History

2014-03-07 13:20:06 -04:00
<?php
use Illuminate\Foundation\Http\Kernel;
// Because laravel has a __ helper function, it's important we include the class.g file to ensure our __ is used.
require_once __DIR__.'/../../gulliver/system/class.g.php';
require_once __DIR__.'/../../bootstrap/autoload.php';
require_once __DIR__.'/../../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
register_shutdown_function(
create_function(
"",
"
if (class_exists(\"Propel\")) {
Propel::close();
}
"
)
);
ini_set("session.cookie_httponly", 1);
2014-06-24 12:12:59 -04:00
if (isset($_SERVER['UNENCODED_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL'];
}
2014-03-10 16:02:09 -04:00
try {
$rootDir = realpath(__DIR__ . "/../../") . DIRECTORY_SEPARATOR;
$app = new Maveriks\WebApplication();
2014-03-11 18:05:50 -04:00
2014-03-10 16:02:09 -04:00
$app->setRootDir($rootDir);
$app->setRequestUri($_SERVER['REQUEST_URI']);
2014-03-11 18:05:50 -04:00
$stat = $app->route();
2014-03-10 16:02:09 -04:00
2014-03-11 18:05:50 -04:00
switch ($stat)
2014-03-10 16:02:09 -04:00
{
case Maveriks\WebApplication::RUNNING_WORKFLOW:
2014-03-10 16:02:09 -04:00
include "sysGeneric.php";
break;
case Maveriks\WebApplication::RUNNING_API:
$app->run(Maveriks\WebApplication::SERVICE_API);
2014-03-10 16:02:09 -04:00
break;
case Maveriks\WebApplication::RUNNING_OAUTH2:
$app->run(Maveriks\WebApplication::SERVICE_OAUTH2);
break;
case Maveriks\WebApplication::RUNNING_INDEX:
$response = new Maveriks\Http\Response(file_get_contents("index.html"), 302);
$response->send();
break;
case Maveriks\WebApplication::RUNNING_DEFAULT:
$response = new Maveriks\Http\Response("", 302);
//TODO compose this def url with configuration data from env.ini
$response->setHeader("location", "/sys/en/neoclassic/login/login");
$response->send();
break;
2014-03-10 16:02:09 -04:00
}
2017-08-07 02:20:05 -04:00
} catch (ProcessMaker\Exception\RBACException $e) {
G::header('location: ' . $e->getPath());
2014-03-10 16:02:09 -04:00
} catch (Exception $e) {
$view = new Maveriks\Pattern\Mvc\PhtmlView($rootDir . "framework/src/templates/Exception.phtml");
$view->set("message", $e->getMessage());
$view->set("exception", $e);
$response = new Maveriks\Http\Response($view->getOutput(), 503);
$response->send();
2014-03-10 16:02:09 -04:00
}