*/
public function index()
{
- $this->checkDeps();
+ try {
+ $this->checkDeps();
+ } catch (\Exception $e) {
+ $res = new TemplateResponse('grauphel', 'error');
+ $res->setParams(
+ array(
+ 'message' => $e->getMessage(),
+ 'code' => $e->getCode(),
+ )
+ );
+ return $res;
+ }
$res = new TemplateResponse('grauphel', 'index');
$res->setParams(
protected function checkDeps()
{
if (!class_exists('OAuthProvider')) {
- throw new \Exception('PHP extension "oauth" is required');
+ throw new \Exception('PHP extension "oauth" is required', 1001);
}
}
--- /dev/null
+<link rel="stylesheet" href="<?php p(OCP\Util::linkTo('grauphel','grauphel.css')); ?>" type="text/css"/>
+
+<div id="app-content" class="content">
+ <div>
+ <h1>grauphel - Tomboy notes server</h1>
+ <h2>Error</h2>
+ <p><?php p($_['message']); ?></p>
+ <?php if ($_['code'] == 1001) { ?>
+ <p>
+ You need to install the PHP PECL OAuth extension to make grauphel work.
+ See the
+ <a class="lined" href="http://cweiske.de/grauphel.htm#manual">
+ installation instructions</a>
+ for more information.
+ </p>
+ <?php } ?>
+ </div>
+</div>