Пример #1
0
 *
 * Requests may be redirected here either by using rewrite capabilities of web
 * server or using requests including this script such as
 *
 *    <your-site>/run.php/appname/script.php
 *
 * which is then processing request for script "script.php" of application
 * "appname".
 *
 * @author Thomas Urban
 *
 */
try {
    include 'rewritten.php';
    // get application actually requested
    $application = txf::getContext()->application;
    // get script of application actually requested
    $script = path::glue($application->pathname, $application->script);
    // change to that folder for supporting homogenic use of relative pathnames
    chdir(dirname($script));
    // include selected script
    include_once $script;
    // due to disabled shutdown handler we are required to call related handler manually
    view::current()->onShutdown();
} catch (http_exception $e) {
    header($e->getResponse());
    view::variable('exception', $e);
    view::addBodyClass('exception');
    view::addBodyClass('http-exception');
    $data = variable_space::create('reason', $e);
    try {
Пример #2
0
 public static final function getScopeParameter(&$domain, &$path)
 {
     // process focus selection
     $focus = config::get('session.focus', 'application');
     switch ($focus) {
         case 'domain':
             // valid for whole current domain
             $domain = $_SERVER['HTTP_HOST'];
             $path = '/';
             break;
         case 'txf':
             // valid for all applications in current installation, only
             $domain = $_SERVER['HTTP_HOST'];
             $path = '/' . txf::getContext()->prefixPathname;
             break;
         case 'application':
             // valid for current application, only
             $domain = $_SERVER['HTTP_HOST'];
             $path = '/' . application::current()->prefixPathname;
             break;
         default:
             // option is explicitly providing domain and path to focus
             if (strpos($focus, '%') !== false) {
                 $focus = strtr($focus, array('%H' => $_SERVER['HTTP_HOST'], '%T' => '/' . txf::getContext()->prefixPathname, '%A' => '/' . application::current()->prefixPathname));
             }
             $temp = explode('/', $focus);
             $domain = array_shift($temp);
             $path = '/' . implode('/', $temp);
     }
 }