From 26b77483ee7545c0e4f8eeb205a5743bf3589adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 12 Jul 2014 16:39:31 +0200 Subject: remove PicoFarad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’ll implement it an other day. --- index.php | 57 +++++---------------------------------------------------- 1 file changed, 5 insertions(+), 52 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 6f190518..e199956c 100755 --- a/index.php +++ b/index.php @@ -12,56 +12,9 @@ define ('POCHE', '1.8.0'); require 'check_setup.php'; require_once 'inc/poche/global.inc.php'; +// Start session +Session::$sessionName = 'wallabag'; +Session::init(); -use PicoFarad\Router; -use PicoFarad\Response; -use PicoFarad\Request; -use PicoFarad\Session; - -// Called before each action -Router\before(function($action) { - - // Open a session only for the specified directory - Session\open(dirname($_SERVER['PHP_SELF'])); - - // HTTP secure headers - Response\csp(); - Response\xframe(); - Response\xss(); - Response\nosniff(); -}); - -// Show help -Router\get_action('unread', function() use ($wallabag) { - $view = 'home'; - $id = 0; - - $tpl_vars = array( - 'referer' => $wallabag->routing->referer, - 'view' => $wallabag->routing->view, - 'poche_url' => Tools::getPocheUrl(), - 'title' => _('wallabag, a read it later open source system'), - 'token' => \Session::getToken(), - 'theme' => $wallabag->tpl->getTheme(), - 'entries' => '', - 'page_links' => '', - 'nb_results' => '', - 'listmode' => (isset($_COOKIE['listmode']) ? true : false), - ); - - $count = $wallabag->store->getEntriesByViewCount($view, $wallabag->user->getId(), $id); - - if ($count > 0) { - $wallabag->pagination->set_total($count); - $page_links = str_replace(array('previous', 'next'), array(_('previous'), _('next')), - $wallabag->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . (($id)?'&id='.$id:'') . '&' )); - $tpl_vars['entries'] = $wallabag->store->getEntriesByView($view, $wallabag->user->getId(), $wallabag->pagination->get_limit(), $id); - $tpl_vars['page_links'] = $page_links; - $tpl_vars['nb_results'] = $count; - } - - $wallabag->routing->render('home.twig', $tpl_vars); - - Tools::logm('display ' . $view . ' view'); - -}); +// Let's rock ! +$wallabag = new Poche(); -- cgit v1.2.3