From 506503bbcdc525851aa3ec041396583d2ff06fb0 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 24 Aug 2016 21:17:58 -0400 Subject: [PATCH] Add Miniflux namespace everywhere --- app/common.php | 4 +- app/constants.php | 2 +- app/controllers/bookmark.php | 6 +++ app/controllers/common.php | 10 ++++ app/controllers/config.php | 9 +++- app/controllers/console.php | 5 ++ app/controllers/feed.php | 8 +++ app/controllers/history.php | 7 +++ app/controllers/item.php | 8 +++ app/controllers/search.php | 7 +++ app/controllers/user.php | 6 +++ app/core/request.php | 2 +- app/core/response.php | 2 +- app/core/router.php | 2 +- app/core/session.php | 2 +- app/core/template.php | 2 +- app/core/translator.php | 2 +- app/functions.php | 10 ++-- app/handlers/opml.php | 6 +-- app/handlers/proxy.php | 6 +-- app/handlers/scraper.php | 4 +- app/handlers/service.php | 6 +-- app/helpers/app.php | 2 +- app/helpers/csrf.php | 2 +- app/helpers/favicon.php | 2 +- app/helpers/form.php | 2 +- app/helpers/template.php | 6 ++- app/models/auto_update.php | 6 +-- app/models/bookmark.php | 6 +-- app/models/config.php | 6 +-- app/models/database.php | 8 +-- app/models/favicon.php | 8 +-- app/models/feed.php | 14 +++--- app/models/group.php | 2 +- app/models/item.php | 10 ++-- app/models/item_feed.php | 2 +- app/models/item_group.php | 4 +- app/models/remember_me.php | 12 ++--- app/models/search.php | 2 +- app/models/user.php | 12 ++--- app/schemas/sqlite.php | 8 +-- app/templates/about.php | 6 +-- app/templates/add.php | 18 +++---- app/templates/api.php | 12 ++--- app/templates/bookmarks.php | 7 ++- app/templates/config.php | 72 +++++++++++++-------------- app/templates/confirm_remove_feed.php | 4 +- app/templates/console.php | 2 +- app/templates/database.php | 4 +- app/templates/edit_feed.php | 28 +++++------ app/templates/feed_items.php | 8 +-- app/templates/feeds.php | 8 +-- app/templates/help.php | 4 +- app/templates/help_layer.php | 4 +- app/templates/history.php | 6 +-- app/templates/item.php | 28 +++++------ app/templates/layout.php | 12 ++--- app/templates/login.php | 20 ++++---- app/templates/new_db.php | 18 +++---- app/templates/search.php | 6 +-- app/templates/search_form.php | 4 +- app/templates/services.php | 24 ++++----- app/templates/show_item.php | 20 ++++---- app/templates/unread_items.php | 6 +-- app/validators/user.php | 10 ++-- cronjob.php | 2 + index.php | 3 ++ jsonrpc.php | 4 +- producer.php | 1 + tests/unit/HelperTest.php | 2 + tests/unit/RequestTest.php | 2 + worker.php | 1 + 72 files changed, 326 insertions(+), 250 deletions(-) diff --git a/app/common.php b/app/common.php index 936da90..9dd5034 100644 --- a/app/common.php +++ b/app/common.php @@ -13,10 +13,10 @@ require __DIR__.'/functions.php'; PicoDb\Database::setInstance('db', function() { $db = new PicoDb\Database(array( 'driver' => 'sqlite', - 'filename' => Model\Database\get_path(), + 'filename' => Miniflux\Model\Database\get_path(), )); - if ($db->schema()->check(Schema\VERSION)) { + if ($db->schema('\Miniflux\Schema')->check(Miniflux\Schema\VERSION)) { return $db; } else { diff --git a/app/constants.php b/app/constants.php index f212733..18cdac5 100644 --- a/app/constants.php +++ b/app/constants.php @@ -1,6 +1,6 @@ Helper\generate_csrf(), 'config' => Model\Config\get_all(), - 'db_size' => filesize(\Model\Database\get_path()), + 'db_size' => filesize(Model\Database\get_path()), 'nb_unread_items' => Model\Item\count_by_status('unread'), 'menu' => 'config', 'title' => t('Preferences') diff --git a/app/controllers/console.php b/app/controllers/console.php index ea362b0..3b6c3eb 100644 --- a/app/controllers/console.php +++ b/app/controllers/console.php @@ -1,5 +1,10 @@ getRealPath(); if ($fileinfo->isFile()) { - \Model\Config\debug('[REMOVE] '.$filename); + Config\debug('[REMOVE] '.$filename); @unlink($filename); } else { cleanup_directory($filename); diff --git a/app/models/bookmark.php b/app/models/bookmark.php index 53ff4bd..aa4fbab 100644 --- a/app/models/bookmark.php +++ b/app/models/bookmark.php @@ -1,10 +1,10 @@ $filename, )); - if ($db->schema()->check(Schema\VERSION)) { + if ($db->schema('\Miniflux\Schema')->check(Schema\VERSION)) { $credentials = array( 'username' => $username, 'password' => password_hash($password, PASSWORD_BCRYPT) diff --git a/app/models/favicon.php b/app/models/favicon.php index 8a3426d..75cedcf 100644 --- a/app/models/favicon.php +++ b/app/models/favicon.php @@ -1,10 +1,10 @@

- () - + () +

diff --git a/app/templates/add.php b/app/templates/add.php index beb0c3c..2a80d77 100644 --- a/app/templates/add.php +++ b/app/templates/add.php @@ -12,24 +12,24 @@
- + - -

+ +

-
-
-
+
+
+

- +
- + - +
diff --git a/app/templates/api.php b/app/templates/api.php index 34a68c1..fe41094 100644 --- a/app/templates/api.php +++ b/app/templates/api.php @@ -15,17 +15,17 @@

    -
  • -
  • -
  • +
  • +
  • +

    -
  • -
  • -
  • +
  • +
  • +
diff --git a/app/templates/bookmarks.php b/app/templates/bookmarks.php index 1296a80..6dbfd96 100644 --- a/app/templates/bookmarks.php +++ b/app/templates/bookmarks.php @@ -1,7 +1,7 @@

- + diff --git a/app/templates/console.php b/app/templates/console.php index 93c3018..0271797 100644 --- a/app/templates/console.php +++ b/app/templates/console.php @@ -9,5 +9,5 @@

-
+
diff --git a/app/templates/database.php b/app/templates/database.php index 449ecad..74b7cb8 100644 --- a/app/templates/database.php +++ b/app/templates/database.php @@ -14,7 +14,7 @@
    -
  • +
  • @@ -24,4 +24,4 @@
-
\ No newline at end of file + diff --git a/app/templates/edit_feed.php b/app/templates/edit_feed.php index 8f67c1c..d1d7896 100644 --- a/app/templates/edit_feed.php +++ b/app/templates/edit_feed.php @@ -10,32 +10,32 @@ - + - - + + - - + + - - + + -
+
-
+
-
+
-
+
- +
- + - +
diff --git a/app/templates/feed_items.php b/app/templates/feed_items.php index a81b810..1cccc60 100644 --- a/app/templates/feed_items.php +++ b/app/templates/feed_items.php @@ -5,7 +5,7 @@ - $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'order' => $order, 'direction' => $direction, 'feed_id' => $feed['id'])) ?> + $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'order' => $order, 'direction' => $direction, 'feed_id' => $feed['id'])) ?> - \ No newline at end of file + diff --git a/app/templates/feeds.php b/app/templates/feeds.php index 0a60528..8dd2464 100644 --- a/app/templates/feeds.php +++ b/app/templates/feeds.php @@ -31,9 +31,9 @@ - + - + @@ -58,7 +58,7 @@
  • - +
  • @@ -73,4 +73,4 @@ - \ No newline at end of file + diff --git a/app/templates/help.php b/app/templates/help.php index 68890a5..c2d89af 100644 --- a/app/templates/help.php +++ b/app/templates/help.php @@ -12,7 +12,7 @@
- +

@@ -32,4 +32,4 @@
  • - \ No newline at end of file + diff --git a/app/templates/help_layer.php b/app/templates/help_layer.php index a6b0cb5..c045890 100644 --- a/app/templates/help_layer.php +++ b/app/templates/help_layer.php @@ -1,6 +1,6 @@
    ×
    - +
    -
    \ No newline at end of file +
    diff --git a/app/templates/history.php b/app/templates/history.php index 90d521c..5890071 100644 --- a/app/templates/history.php +++ b/app/templates/history.php @@ -1,7 +1,7 @@

    - + ') ?> - %s
    ') ?> + %s
    ') ?> + %s') ?> - + diff --git a/app/templates/login.php b/app/templates/login.php index 7b063fb..e173bc7 100644 --- a/app/templates/login.php +++ b/app/templates/login.php @@ -1,6 +1,6 @@ + dir="rtl" > @@ -19,31 +19,31 @@ Miniflux - +
    -

    +

    - + - -
    + +
    - - + + -
    +
    1): ?>

    $dbname): ?> - +
    diff --git a/app/templates/new_db.php b/app/templates/new_db.php index 0c899d0..244d35f 100644 --- a/app/templates/new_db.php +++ b/app/templates/new_db.php @@ -14,20 +14,20 @@ - + - - + +

    - -
    + +
    - - + + - -
    + +
    diff --git a/app/templates/search.php b/app/templates/search.php index 42f0583..6c7f3cc 100644 --- a/app/templates/search.php +++ b/app/templates/search.php @@ -1,4 +1,4 @@ - $text, 'opened' => true)) ?> + $text, 'opened' => true)) ?>

    @@ -8,7 +8,7 @@
    - $item, 'menu' => $menu, 'offset' => $offset, @@ -20,7 +20,7 @@ )) ?> - $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'text' => $text)) ?> + $menu, 'nb_items' => $nb_items, 'items_per_page' => $items_per_page, 'offset' => $offset, 'text' => $text)) ?>
    diff --git a/app/templates/search_form.php b/app/templates/search_form.php index a627a61..ba23768 100644 --- a/app/templates/search_form.php +++ b/app/templates/search_form.php @@ -1,7 +1,7 @@ diff --git a/app/templates/services.php b/app/templates/services.php index fac4c13..dacf213 100644 --- a/app/templates/services.php +++ b/app/templates/services.php @@ -15,33 +15,33 @@
    - +

    -
    +
    - -
    + +
    - - + +

    -
    +
    - -
    + +
    - -
    + +
    -
    \ No newline at end of file + diff --git a/app/templates/show_item.php b/app/templates/show_item.php index cc0162a..12739b4 100644 --- a/app/templates/show_item.php +++ b/app/templates/show_item.php @@ -13,7 +13,7 @@ -

    $feed['rtl'])) ? 'dir="rtl"' : 'dir="ltr"' ?>> - +

    $feed['rtl'])) ? 'dir="rtl"' : 'dir="ltr"' ?>> +

    -
    $feed['rtl'])) ? 'dir="rtl"' : 'dir="ltr"' ?>> +
    $feed['rtl'])) ? 'dir="rtl"' : 'dir="ltr"' ?>> @@ -103,7 +103,7 @@