Esempio n. 1
0
    $injector->share($session);
}
$callable = 'servePage';
$headers = [];
$count = 0;
$response = null;
do {
    $result = $injector->execute($callable);
    if ($result instanceof Response) {
        $response = $result;
        break;
    } else {
        if ($result instanceof Tier) {
            $injectionParams = $result->getInjectionParams();
            if ($injectionParams) {
                addInjectionParams($injector, $injectionParams);
            }
            $callable = $result->getCallable();
        } else {
            echo "Unknown result: ";
            var_dump($result);
            exit(0);
        }
    }
    $count++;
} while ($count < 10);
//  if (false) {
//        $session->save();
//        $headers = $session->getHeaders(\ASM\SessionManager::CACHE_NO_CACHE);
//    }
if ($response != null) {
Esempio n. 2
0
File: index.php Progetto: PeeHaa/Jig
        //If the requests are for static files, tell the PHP server to
        //serve them directly
        return false;
    }
}
$injector = bootstrapInjector();
$callable = 'getRouteCallable';
try {
    $count = 0;
    do {
        $result = $injector->execute($callable);
        if ($result instanceof Response) {
            $result->send();
            break;
        } else {
            if ($result instanceof Tier) {
                addInjectionParams($injector, $result);
                $callable = $result->getCallable();
            } else {
                throw new \Exception("Return value of tier must be either a response or a tier");
            }
        }
        $count++;
    } while ($count < 10);
} catch (Jig\JigException $je) {
    echo "Error rendering template: " . $je->getMessage() . "<br/>";
    echo nl2br($je->getTraceAsString());
} catch (\Exception $e) {
    echo "Unexpected exception: " . $e->getMessage() . "<br/>";
    echo nl2br($e->getTraceAsString());
}