Chora::fatal PHP Méthode

fatal() public static méthode

Output an error page.
public static fatal ( string $message, string $code = null )
$message string The verbose error message to be displayed.
$code string The HTTP error number (and optional text), for sending 404s or other codes if appropriate.
    public static function fatal($message, $code = null)
    {
        global $notification, $page_output, $registry;
        if (is_a($message, 'Horde_Vcs_Exception')) {
            $message = $message->getMessage();
        }
        if ($code) {
            header('HTTP/1.0 ' . $code);
        }
        // Make sure we are in Chora scope.
        $registry->pushApp('chora');
        $notification->push($message, 'horde.error');
        $page_output->header();
        $notification->notify(array('listeners' => 'status'));
        echo ' ';
        $page_output->footer();
        exit;
    }

Usage Example

Exemple #1
0
            // Not supported in any other VC systems yet.
            $allDiffsLink = '';
        }
        $files = array();
        $dir = dirname($where);
        foreach ($patchset['members'] as $member) {
            $file = array();
            $mywhere = is_a($VC, 'VC_svn') ? $member['file'] : $dir . DIRECTORY_SEPARATOR . $member['file'];
            $file['file'] = Horde::link(Chora::url('patchsets', $mywhere), $member['file']) . $member['file'] . '</a>';
            if ($member['from'] == 'INITIAL') {
                $file['from'] = '<i>' . _("New File") . '</i>';
                $file['diff'] = '';
            } else {
                $file['from'] = Horde::link(Chora::url('co', $mywhere, array('r' => $member['from'])), $member['from']) . $member['from'] . '</a>';
                $file['diff'] = Horde::link(Chora::url('diff', $mywhere, array('r1' => $member['from'], 'r2' => $member['to'], 'ty' => 'u')), _("Diff")) . '(' . _("Diff") . ')';
            }
            if (substr($member['to'], -6) == '(DEAD)') {
                $file['to'] = '<i>' . _("Deleted") . '</i>';
                $file['diff'] = '';
            } else {
                $file['to'] = Horde::link(Chora::url('co', $mywhere, array('r' => $member['to'])), $member['to']) . $member['to'] . '</a>';
            }
            $files[] = $file;
        }
        $logMessage = Chora::formatLogMessage($patchset['log']);
        require CHORA_TEMPLATES . '/patchsets/ps.inc';
    }
    require $registry->getParam('templates', 'horde') . '/common-footer.inc';
} else {
    Chora::fatal('404 Not Found', "{$where}: no such file or directory");
}
All Usage Examples Of Chora::fatal