Example #1
0
    }
    if ($request->hasParam('show') && ($config->restrict_show && \Pste\Registry::getInstance()->authenticated || !$config->restrict_show)) {
        $content = \Pste\Component::add(new \Pste\Component\SinglePaste(array('pid' => $request->getParam('show'), 'request' => $request)));
    } else {
        if ($request->hasParam('archive')) {
            require_once 'components/PasteArchive.php';
            $content = \Pste\Component::add(new \Pste\Component\PasteArchive(array('page' => $request->getParam('page'), 'request' => $request)));
        } else {
            if ($request->hasParam('submit', 'GET')) {
                $content = \Pste\Component::add(new \Pste\Component\PasteForm(array('request' => $request)));
            } else {
                if ($request->hasParam('info', 'GET') && \Pste\Registry::getInstance()->authenticated) {
                    phpinfo();
                    die;
                } else {
                    $content = \Pste\Component::add(new \Pste\Component\StaticPage(array('template' => 'components/frontpage.php', 'request' => $request)));
                }
            }
        }
    }
    $layout = new \Pste\Layout(array('request' => $request));
    $layout->setContent($content);
    $layout->setTemplate('theme.php');
    ob_start();
    echo $layout->render();
    ob_end_flush();
} catch (Exception $ex) {
    header('Content-type: text/plain');
    echo "An error occured\n";
    echo $ex->getMessage() . "\n";
    echo $ex->getTraceAsString();
Example #2
0
        </div>
        <div id="menu">
            <?php 
echo \Pste\Component::add(new \Pste\Component\RecentItems());
?>
        </div>
        
        <div id="content"><br />
            <h1>Welcome! Here you can paste sources and general debugging text, 
                You can even set yourself a password if you want to keep it just for yourself.</h1>
                <?php 
echo $this->content;
?>
                <br />
                
                <h1>&copy; <?php 
echo date("Y");
?>
 - Powered by <a href="https://github.com/nicolask/indechse-pste">Indechse Pste</a> 0.1 
                    - rendered in <?php 
echo round(microtime(true) - \Pste\Registry::getInstance()->starttime, 4);
?>
</h1>
                <?php 
echo \Pste\Component::add(new \Pste\Component\StaticPage(array('template' => 'components/credits.php')));
?>
 
            
        </div>
    </body>
</html>