]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
test if /install exists
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Thu, 8 Aug 2013 07:11:12 +0000 (09:11 +0200)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Thu, 8 Aug 2013 07:11:12 +0000 (09:11 +0200)
CREDITS
inc/poche/Poche.class.php
index.php
install/update_sqlite_from_0_to_1.php

diff --git a/CREDITS b/CREDITS
index d6874a7bb8ebbb16188be865f1dd4721fbbb777e..a6dedce4b2e49ea8286047433003e42d564022f3 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -1,5 +1,5 @@
 poche is based on :
-* PHP Readability http://www.keyvan.net/2010/08/php-readability/
+* PHP Readability https://bitbucket.org/fivefilters/php-readability
 * Encoding https://github.com/neitanod/forceutf8
 * logo by Brightmix http://www.iconfinder.com/icondetails/43256/128/jeans_monotone_pocket_icon
 * icons http://icomoon.io
index 38b4a98ea803e7e464c15d4dee166bc0c71ab918..0439f301fc2952ae56f5c7ade576434d9c541a57 100644 (file)
@@ -31,6 +31,11 @@ class Poche
 
     private function init() 
     {
+        if (file_exists('./install') && !DEBUG_POCHE) {
+            Tools::logm('folder /install exists');
+            die('the folder /install exists, you have to delete it before using poche.');
+        }
+
         Tools::initPhp();
         Session::init();
 
index 40cadf885ae03459f4af2d95c397e701a5c9bd95..353df873fb14c7f8ce1b53e8d2f64ee9a0b8cb00 100644 (file)
--- a/index.php
+++ b/index.php
@@ -10,6 +10,7 @@
 
 include dirname(__FILE__).'/inc/poche/config.inc.php';
 
+# Parse GET & REFERER vars
 $referer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
 $view = Tools::checkVar('view', 'home');
 $action = Tools::checkVar('action');
@@ -17,6 +18,7 @@ $id = Tools::checkVar('id');
 $_SESSION['sort'] = Tools::checkVar('sort', 'id');
 $url = new Url((isset ($_GET['url'])) ? $_GET['url'] : '');
 
+# poche actions
 if (isset($_GET['login'])) {
     # hello you
     $poche->login($referer);
@@ -36,6 +38,7 @@ elseif (isset($_GET['export'])) {
     $poche->export();
 }
 
+# vars to send to templates
 $tpl_vars = array(
     'referer' => $referer,
     'view' => $view,
@@ -50,6 +53,7 @@ if (Session::isLogged()) {
     $tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id));
 }
 else {
+    # login
     $tpl_file = 'login.twig';
 }
 
@@ -57,5 +61,5 @@ else {
 $messages = $poche->messages->display('all', FALSE);
 $tpl_vars = array_merge($tpl_vars, array('messages' => $messages));
 
-# Aaaaaaand action !
+# display poche
 echo $poche->tpl->render($tpl_file, $tpl_vars);
\ No newline at end of file
index c88af540c5d1ef5519d8bdf1e558ba29f3633c10..299abf48d33ce7a0c8e5859d5dc5d1d9f6acf05c 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-
+# import script to upgrade from poche 0.3
 $db_path = 'sqlite:../db/poche.sqlite';
 $handle = new PDO($db_path);
 $handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);