]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #1182 from ArthurHoaro/feature/session-protection-stay-login
authorArthurHoaro <arthur@hoa.ro>
Sat, 9 Feb 2019 11:36:31 +0000 (12:36 +0100)
committerGitHub <noreply@github.com>
Sat, 9 Feb 2019 11:36:31 +0000 (12:36 +0100)
Do not check the IP address with session protection disabled

198 files changed:
.dockerignore
.gitattributes
.gitignore
.htaccess
.travis.yml
AUTHORS
CHANGELOG.md
Dockerfile.armhf
Doxyfile [deleted file]
Makefile
README.md
application/ApplicationUtils.php
application/FileUtils.php
application/History.php
application/Languages.php
application/Router.php
application/Thumbnailer.php [new file with mode: 0644]
application/Utils.php
application/api/ApiMiddleware.php
application/api/ApiUtils.php
application/api/controllers/ApiController.php
application/api/controllers/HistoryController.php [moved from application/api/controllers/History.php with 95% similarity]
application/api/controllers/Info.php
application/api/controllers/Tags.php
application/api/exceptions/ApiException.php
application/api/exceptions/ApiLinkNotFoundException.php
application/api/exceptions/ApiTagNotFoundException.php
application/bookmark/LinkDB.php [moved from application/LinkDB.php with 88% similarity]
application/bookmark/LinkFilter.php [moved from application/LinkFilter.php with 90% similarity]
application/bookmark/LinkUtils.php [moved from application/LinkUtils.php with 95% similarity]
application/bookmark/exception/LinkNotFoundException.php [new file with mode: 0644]
application/config/ConfigJson.php
application/config/ConfigManager.php
application/config/ConfigPhp.php
application/config/ConfigPlugin.php
application/exceptions/IOException.php
application/feed/Cache.php [moved from application/Cache.php with 100% similarity]
application/feed/CachedPage.php [moved from application/CachedPage.php with 93% similarity]
application/feed/FeedBuilder.php [moved from application/FeedBuilder.php with 84% similarity]
application/http/Base64Url.php [moved from application/Base64Url.php with 83% similarity]
application/http/HttpUtils.php [moved from application/HttpUtils.php with 94% similarity]
application/http/Url.php [moved from application/Url.php with 62% similarity]
application/http/UrlUtils.php [new file with mode: 0644]
application/netscape/NetscapeBookmarkUtils.php [moved from application/NetscapeBookmarkUtils.php with 87% similarity]
application/plugin/PluginManager.php [moved from application/PluginManager.php with 86% similarity]
application/plugin/exception/PluginFileNotFoundException.php [new file with mode: 0644]
application/render/PageBuilder.php [moved from application/PageBuilder.php with 75% similarity]
application/render/ThemeUtils.php [moved from application/ThemeUtils.php with 96% similarity]
application/security/LoginManager.php
application/updater/Updater.php [moved from application/Updater.php with 81% similarity]
application/updater/UpdaterUtils.php [new file with mode: 0644]
application/updater/exception/UpdaterException.php [new file with mode: 0644]
assets/common/js/picwall.js [deleted file]
assets/common/js/thumbnails-update.js [new file with mode: 0644]
assets/common/js/thumbnails.js [new file with mode: 0644]
assets/default/js/base.js
assets/default/scss/shaarli.scss
assets/vintage/css/shaarli.css
composer.json
composer.lock
doc/custom_theme/main.html [new file with mode: 0644]
doc/md/Community-&-Related-software.md
doc/md/Link-structure.md [new file with mode: 0644]
doc/md/REST-API.md
doc/md/Server-configuration.md
doc/md/Sharing-content.md
doc/md/guides/backup-restore-import-export.md [moved from doc/md/Backup,-restore,-import-and-export.md with 100% similarity]
doc/md/guides/images/01-create-droplet-distro.jpg [new file with mode: 0644]
doc/md/guides/images/02-create-droplet-region.jpg [new file with mode: 0644]
doc/md/guides/images/03-create-droplet-size.jpg [new file with mode: 0644]
doc/md/guides/images/04-finalize.jpg [new file with mode: 0644]
doc/md/guides/images/05-droplet.jpg [new file with mode: 0644]
doc/md/guides/images/06-domain.jpg [new file with mode: 0644]
doc/md/guides/images/07-installation.jpg [new file with mode: 0644]
doc/md/guides/install-shaarli-with-debian9-and-docker.md [new file with mode: 0644]
doc/md/guides/various-hacks.md [moved from doc/md/Various-hacks.md with 100% similarity]
doc/md/images/icon.png [new file with mode: 0644]
doc/md/index.md
docker-compose.yml [new file with mode: 0644]
inc/languages/fr/LC_MESSAGES/shaarli.po
inc/web-thumbnailer.json [new file with mode: 0644]
index.php
mkdocs.yml
phpcs.xml [new file with mode: 0644]
phpdoc.dist.xml [new file with mode: 0644]
plugins/addlink_toolbar/addlink_toolbar.php
plugins/archiveorg/archiveorg.php
plugins/demo_plugin/demo_plugin.php
plugins/isso/comment.png [new file with mode: 0644]
plugins/isso/isso.php
plugins/isso/isso_button.html [new file with mode: 0644]
plugins/markdown/markdown.php
plugins/piwik/piwik.php
plugins/playvideos/playvideos.php
plugins/pubsubhubbub/pubsubhubbub.php
plugins/qrcode/qrcode.php
plugins/wallabag/WallabagInstance.php
plugins/wallabag/wallabag.php
tests/ApplicationUtilsTest.php
tests/FileUtilsTest.php
tests/HistoryTest.php
tests/LanguagesTest.php
tests/PluginManagerTest.php
tests/RouterTest.php
tests/ThumbnailerTest.php [new file with mode: 0644]
tests/TimeZoneTest.php
tests/UtilsTest.php
tests/api/ApiMiddlewareTest.php
tests/api/ApiUtilsTest.php
tests/api/controllers/history/HistoryTest.php
tests/api/controllers/info/InfoTest.php
tests/api/controllers/links/DeleteLinkTest.php
tests/api/controllers/links/GetLinkIdTest.php
tests/api/controllers/links/GetLinksTest.php
tests/api/controllers/links/PostLinkTest.php
tests/api/controllers/links/PutLinkTest.php
tests/api/controllers/tags/DeleteTagTest.php
tests/api/controllers/tags/GetTagNameTest.php
tests/api/controllers/tags/GetTagsTest.php
tests/api/controllers/tags/PutTagTest.php
tests/bookmark/LinkDBTest.php [moved from tests/LinkDBTest.php with 92% similarity]
tests/bookmark/LinkFilterTest.php [moved from tests/LinkFilterTest.php with 95% similarity]
tests/bookmark/LinkUtilsTest.php [moved from tests/LinkUtilsTest.php with 75% similarity]
tests/config/ConfigJsonTest.php
tests/config/ConfigManagerTest.php
tests/config/ConfigPhpTest.php
tests/config/ConfigPluginTest.php
tests/feed/CacheTest.php [moved from tests/CacheTest.php with 67% similarity]
tests/feed/CachedPageTest.php [moved from tests/CachedPageTest.php with 92% similarity]
tests/feed/FeedBuilderTest.php [moved from tests/FeedBuilderTest.php with 92% similarity]
tests/http/HttpUtils/ClientIpIdTest.php [moved from tests/HttpUtils/ClientIpIdTest.php with 89% similarity]
tests/http/HttpUtils/GetHttpUrlTest.php [moved from tests/HttpUtils/GetHttpUrlTest.php with 85% similarity]
tests/http/HttpUtils/GetIpAdressFromProxyTest.php [moved from tests/HttpUtils/GetIpAdressFromProxyTest.php with 91% similarity]
tests/http/HttpUtils/IndexUrlTest.php [moved from tests/HttpUtils/IndexUrlTest.php with 92% similarity]
tests/http/HttpUtils/IsHttpsTest.php [moved from tests/HttpUtils/IsHttpsTest.php with 89% similarity]
tests/http/HttpUtils/PageUrlTest.php [moved from tests/HttpUtils/PageUrlTest.php with 93% similarity]
tests/http/HttpUtils/ServerUrlTest.php [moved from tests/HttpUtils/ServerUrlTest.php with 97% similarity]
tests/http/UrlTest.php [moved from tests/Url/UrlTest.php with 85% similarity]
tests/http/UrlUtils/CleanupUrlTest.php [moved from tests/Url/CleanupUrlTest.php with 96% similarity]
tests/http/UrlUtils/GetUrlSchemeTest.php [moved from tests/Url/GetUrlSchemeTest.php with 76% similarity]
tests/http/UrlUtils/UnparseUrlTest.php [moved from tests/Url/UnparseUrlTest.php with 76% similarity]
tests/http/UrlUtils/WhitelistProtocolsTest.php [moved from tests/Url/WhitelistProtocolsTest.php with 91% similarity]
tests/languages/de/UtilsDeTest.php
tests/languages/fr/LanguagesFrTest.php
tests/netscape/BookmarkExportTest.php [moved from tests/NetscapeBookmarkUtils/BookmarkExportTest.php with 91% similarity]
tests/netscape/BookmarkImportTest.php [moved from tests/NetscapeBookmarkUtils/BookmarkImportTest.php with 99% similarity]
tests/netscape/input/empty.htm [moved from tests/NetscapeBookmarkUtils/input/empty.htm with 100% similarity]
tests/netscape/input/internet_explorer_encoding.htm [moved from tests/NetscapeBookmarkUtils/input/internet_explorer_encoding.htm with 100% similarity]
tests/netscape/input/lowercase_doctype.htm [moved from tests/NetscapeBookmarkUtils/input/lowercase_doctype.htm with 100% similarity]
tests/netscape/input/netscape_basic.htm [moved from tests/NetscapeBookmarkUtils/input/netscape_basic.htm with 100% similarity]
tests/netscape/input/netscape_nested.htm [moved from tests/NetscapeBookmarkUtils/input/netscape_nested.htm with 100% similarity]
tests/netscape/input/no_doctype.htm [moved from tests/NetscapeBookmarkUtils/input/no_doctype.htm with 100% similarity]
tests/netscape/input/same_date.htm [moved from tests/NetscapeBookmarkUtils/input/same_date.htm with 100% similarity]
tests/plugins/PluginAddlinkTest.php
tests/plugins/PluginArchiveorgTest.php
tests/plugins/PluginIssoTest.php
tests/plugins/PluginMarkdownTest.php
tests/plugins/PluginPlayvideosTest.php
tests/plugins/PluginPubsubhubbubTest.php
tests/plugins/PluginQrcodeTest.php
tests/plugins/PluginWallabagTest.php
tests/plugins/WallabagInstanceTest.php
tests/plugins/resources/hashtags.md [new file with mode: 0644]
tests/plugins/resources/hashtags.raw [new file with mode: 0644]
tests/plugins/resources/markdown.html
tests/plugins/resources/markdown.md
tests/render/ThemeUtilsTest.php [moved from tests/ThemeUtilsTest.php with 93% similarity]
tests/security/LoginManagerTest.php
tests/security/SessionManagerTest.php
tests/updater/DummyUpdater.php [moved from tests/Updater/DummyUpdater.php with 75% similarity]
tests/updater/UpdaterTest.php [moved from tests/Updater/UpdaterTest.php with 82% similarity]
tests/utils/CurlUtils.php [new file with mode: 0644]
tests/utils/FakeApplicationUtils.php [new file with mode: 0644]
tests/utils/ReferenceHistory.php
tests/utils/ReferenceLinkDB.php
tests/utils/config/configJson.json.php
tests/utils/config/configPhp.php
tests/utils/config/wt.json [new file with mode: 0644]
tpl/default/addlink.html
tpl/default/configure.html
tpl/default/daily.html
tpl/default/dailyrss.html
tpl/default/includes.html
tpl/default/linklist.html
tpl/default/linklist.paging.html
tpl/default/page.header.html
tpl/default/picwall.html
tpl/default/thumbnails.html [new file with mode: 0644]
tpl/default/tools.html
tpl/vintage/configure.html
tpl/vintage/daily.html
tpl/vintage/dailyrss.html
tpl/vintage/includes.html
tpl/vintage/linklist.html
tpl/vintage/picwall.html
tpl/vintage/thumbnails.html [new file with mode: 0644]
tpl/vintage/tools.html
webpack.config.js

index a0d28dc6212f28f3dea3f4dbb57a440071e474fa..96fd31c5bf630425977583f46de76fae72d6def9 100644 (file)
@@ -4,6 +4,9 @@
 .github
 tests
 
+# Docker Compose resources
+docker-compose.yml
+
 # Shaarli runtime resources
 cache/*
 data/*
index 9d22f11b282811b6007920e44813694a0946efd4..9a92bc37d8f1228f1ac5153b4f06cec8b8504618 100644 (file)
@@ -35,6 +35,7 @@ doc/**/*.json     export-ignore
 doc/**/*.md       export-ignore
 .docker/          export-ignore
 .dockerignore     export-ignore
+docker-compose.*  export-ignore
 Dockerfile*       export-ignore
 Doxyfile          export-ignore
 Makefile          export-ignore
index 414ff6d51c9ab85374ba527ee8f3d561915d8ab7..6208e7951e80c7bddabcd8cf10f59dd2811e904f 100644 (file)
@@ -22,15 +22,16 @@ inc/languages/*/LC_MESSAGES/shaarli.mo
 
 # Development and test resources
 coverage
-doxygen
 sandbox
 phpmd.html
+phpdoc.xml
 
 # User plugin configuration
 plugins/*/config.php
 
 # HTML documentation
 doc/html/
+doc/phpdoc/
 
 # 3rd party themes
 tpl/*
index b238854c7929d911bb7dc1b5093e29dfbee7cd46..4c00427195ecb0998589fc09dd02fa8580d97a3e 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -16,8 +16,33 @@ RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^ index.php [QSA,L]
 
 <Limit GET POST PUT DELETE OPTIONS>
+  <IfModule version_module>
+    <IfVersion >= 2.4>
+       Require all granted
+    </IfVersion>
+    <IfVersion < 2.4>
+       Allow from all
+       Deny from none
+    </IfVersion>
+  </IfModule>
+
+  <IfModule !version_module>
     Require all granted
+  </IfModule>
 </Limit>
+
 <LimitExcept GET POST PUT DELETE OPTIONS>
+  <IfModule version_module>
+    <IfVersion >= 2.4>
+       Require all denied
+    </IfVersion>
+    <IfVersion < 2.4>
+       Allow from none
+       Deny from all
+    </IfVersion>
+  </IfModule>
+
+  <IfModule !version_module>
     Require all denied
+  </IfModule>
 </LimitExcept>
index cb81846f306a9001721de5e75ede34518e230779..c6400eef0faadacced206212fde6a37b24fcdb44 100644 (file)
@@ -3,6 +3,8 @@ dist: trusty
 
 matrix:
   include:
+    - language: php
+      php: 7.3
     - language: php
       php: 7.2
     - language: php
diff --git a/AUTHORS b/AUTHORS
index 409a03086796ca3e93f12fad39f3d3a4a270009c..db23ad322f18ea1bbf5728cf5b24a365571410f7 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,6 +1,6 @@
-   647 ArthurHoaro <arthur@hoa.ro>
-   327 VirtualTam <virtualtam@flibidi.net>
-   187 nodiscc <nodiscc@gmail.com>
+   687 ArthurHoaro <arthur@hoa.ro>
+   355 VirtualTam <virtualtam@flibidi.net>
+   195 nodiscc <nodiscc@gmail.com>
     56 Sébastien Sauvage <sebsauvage@sebsauvage.net>
     15 Florian Eula <eula.florian@gmail.com>
     13 Emilien Klein <emilien@klein.st>
@@ -15,7 +15,9 @@
      4 David Sferruzza <david.sferruzza@gmail.com>
      4 Immánuel Fodor <immanuelfactor+github@gmail.com>
      3 Teromene <teromene@teromene.fr>
+     3 llune <llune@users.noreply.github.com>
      2 Chris Kuethe <chris.kuethe@gmail.com>
+     2 Felix Bartels <felix@host-consultants.de>
      2 Knah Tsaeb <Knah-Tsaeb@knah-tsaeb.org>
      2 Mathieu Chabanon <git@matchab.fr>
      2 Miloš Jovanović <mjovanovic@gmail.com>
@@ -24,7 +26,9 @@
      2 Timo Van Neerden <fire@lehollandaisvolant.net>
      2 julienCXX <software@chmodplusx.eu>
      2 philipp-r <philipp-r@users.noreply.github.com>
+     2 pips <pips@e5150.fr>
      1 Adrien Oliva <adrien.oliva@yapbreak.fr>
+     1 Adrien le Maire <adrien@alemaire.be>
      1 Alexandre G.-Raymond <alex@ndre.gr>
      1 Alexis J <alexis@effingo.be>
      1 Angristan <angristan@users.noreply.github.com>
@@ -36,7 +40,6 @@
      1 Dennis Verspuij <dennisverspuij@users.noreply.github.com>
      1 Dimtion <zizou.xena@gmail.com>
      1 Fanch <fanch-github@qth.fr>
-     1 Felix Bartels <felix@host-consultants.de>
      1 Felix Kästner <github.com-fpunktk@fpunktk.de>
      1 Florian Voigt <flvoigt@me.com>
      1 Franck Kerbiriou <FranckKe@users.noreply.github.com>
@@ -55,3 +58,4 @@
      1 TsT <tst2005@gmail.com>
      1 dimtion <zizou.xena@gmail.com>
      1 durcheinandr <jochen@durcheinandr.de>
+     1 lapineige <lapineige@users.noreply.github.com>
index bafbd06c0c7a9e9fd8c81a89f14a56699ff7d553..aa1f0d8aa30cf74d9f2bbbf87b4603ac8068e87c 100644 (file)
@@ -4,7 +4,33 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](http://keepachangelog.com/)
 and this project adheres to [Semantic Versioning](http://semver.org/).
 
-## [v0.10.0](https://github.com/shaarli/Shaarli/releases/tag/v0.10.0) - UNPUBLISHED
+## [v0.10.2](https://github.com/shaarli/Shaarli/releases/tag/v0.10.2) - 2018-08-11
+
+### Fixed
+
+- Docker build
+
+## [v0.10.1](https://github.com/shaarli/Shaarli/releases/tag/v0.10.1) - 2018-08-11
+
+### Changed 
+
+- Accessibility:
+    - Remove alt text on the logo
+    - Remove redundant title in tools page
+
+### Fixed
+
+- Fixed an error on the daily page and daily RSS
+- Fixed an issue causing 'You are not authorized to add a link' error while logged out
+- Fixed thumbnail path when Shaarli's path uses symbolic links
+- Add a `mod_version` check in Shaarli's root `.htaccess` file for Apache 2.2 syntax
+- Include assets in the release Makefile target
+
+### Removed
+
+- Firefox Social API shaare has been removed
+
+## [v0.10.0](https://github.com/shaarli/Shaarli/releases/tag/v0.10.0) - 2018-07-28
 **PHP 5.5 compatibility has been dropped.** Shaarli now requires at least PHP 5.6.
 
 ### Added
@@ -18,8 +44,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 - Support redirection in cURL download callback
 - Introduce multi-stage builds for Docker images
 - Use Travis matrix and stages to run Javascript tests in a dedicated environment
+- Add tag endpoint in the REST API
+- Build the documentation in Travis builds
+- Provide a Docker Compose example 
 
 ### Changed
+- Use web-thumbnailer to retrieve thumbnails (see #687)
 - Use a specific page title in all pages
 - Daily: run hooks before creating the columns
 - Load theme translations files automatically
@@ -32,6 +62,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 - Refactor server-side session management
 - Update Doxygen configuration
 - Update Parsedown
+- Improve documentation
+- Docker: build the images from the local sources
+- Docker: bump alpine version to 3.7
+- Docker: expose a volume for the thumbnail cache
 
 ### Removed
 - Drop support for PHP 5.5
@@ -45,6 +79,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 - Ensure user-specific CSS file is loaded
 - Fix feed permalink rendering when Markdown escaping is enabled
 - Fix order of tags with the same number of occurrences
+- Fixed the referrer meta tag in default template
+- Disable MkDocs' strict mode for ReadTheDocs builds to pass
+- fix and simplify Dockerfile for armhf
 
 ### Security
 - Update `.htaccess` to prevent accessing Git metadata when using a Git-based installation
index 5dcc34aab006abed741c723197fa81004dd34b90..1185e2df6d800656cf96c4d32fde2698f438fdf7 100644 (file)
@@ -1,9 +1,38 @@
-FROM lsiobase/alpine.armhf:3.6
+# Stage 1:
+# - Copy Shaarli sources
+# - Build documentation
+FROM arm32v6/alpine:3.8 as docs
+ADD . /usr/src/app/shaarli
+RUN apk --update --no-cache add py2-pip \
+    && cd /usr/src/app/shaarli \
+    && pip install --no-cache-dir mkdocs \
+    && mkdocs build --clean
+
+# Stage 2:
+# - Resolve PHP dependencies with Composer
+FROM arm32v6/alpine:3.8 as composer
+COPY --from=docs /usr/src/app/shaarli /app/shaarli
+RUN apk --update --no-cache add php7-mbstring composer \
+    && cd /app/shaarli \
+    && composer --prefer-dist --no-dev install
+
+# Stage 3:
+# - Frontend dependencies
+FROM arm32v6/alpine:3.8 as node
+COPY --from=composer /app/shaarli /shaarli
+RUN apk --update --no-cache add yarn nodejs-current python2 build-base \
+    && cd /shaarli \
+    && yarn install \
+    && yarn run build \
+    && rm -rf node_modules
+
+# Stage 4:
+# - Shaarli image
+FROM arm32v6/alpine:3.8
 LABEL maintainer="Shaarli Community"
 
 RUN apk --update --no-cache add \
         ca-certificates \
-        curl \
         nginx \
         php7 \
         php7-ctype \
@@ -15,7 +44,6 @@ RUN apk --update --no-cache add \
         php7-json \
         php7-mbstring \
         php7-openssl \
-        php7-phar \
         php7-session \
         php7-xml \
         php7-zlib \
@@ -25,22 +53,19 @@ COPY .docker/nginx.conf /etc/nginx/nginx.conf
 COPY .docker/php-fpm.conf /etc/php7/php-fpm.conf
 COPY .docker/services.d /etc/services.d
 
-RUN curl -sS https://getcomposer.org/installer | php7 -- --install-dir=/usr/local/bin --filename=composer \
-    && rm -rf /etc/php7/php-fpm.d/www.conf \
+RUN rm -rf /etc/php7/php-fpm.d/www.conf \
     && sed -i 's/post_max_size.*/post_max_size = 10M/' /etc/php7/php.ini \
     && sed -i 's/upload_max_filesize.*/upload_max_filesize = 10M/' /etc/php7/php.ini
 
 
 WORKDIR /var/www
-RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - \
-    && mv Shaarli-master shaarli \
-    && cd shaarli \
-    && composer --prefer-dist --no-dev install \
-    && rm -rf ~/.composer \
-    && chown -R nginx:nginx . \
+COPY --from=node /shaarli /var/www/shaarli
+
+RUN chown -R nginx:nginx . \
     && ln -sf /dev/stdout /var/log/nginx/shaarli.access.log \
     && ln -sf /dev/stderr /var/log/nginx/shaarli.error.log
 
+VOLUME /var/www/shaarli/cache
 VOLUME /var/www/shaarli/data
 
 EXPOSE 80
diff --git a/Doxyfile b/Doxyfile
deleted file mode 100644 (file)
index a7f6e04..0000000
--- a/Doxyfile
+++ /dev/null
@@ -1,2377 +0,0 @@
-# Doxyfile 1.8.9.1
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
-#
-# All text after a double hash (##) is considered a comment and is placed in
-# front of the TAG it is preceding.
-#
-# All text after a single hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists, items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (\" \").
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all text
-# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
-# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
-# for the list of possible encodings.
-# The default value is: UTF-8.
-
-DOXYFILE_ENCODING      = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
-# double-quotes, unless you are using Doxywizard) that should identify the
-# project for which the documentation is generated. This name is used in the
-# title of most generated pages and in a few other places.
-# The default value is: My Project.
-
-PROJECT_NAME           = Shaarli
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
-# could be handy for archiving the generated documentation or if some version
-# control system is used.
-
-PROJECT_NUMBER         =
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer a
-# quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF          = "The personal, minimalist, super-fast, no-database delicious clone"
-
-# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
-# in the documentation. The maximum height of the logo should not exceed 55
-# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
-# the logo to the output directory.
-
-PROJECT_LOGO           = doc/md/images/logo.png
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
-# into which the generated documentation will be written. If a relative path is
-# entered, it will be relative to the location where doxygen was started. If
-# left blank the current directory will be used.
-
-OUTPUT_DIRECTORY       = .
-
-# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
-# directories (in 2 levels) under the output directory of each output format and
-# will distribute the generated files over these directories. Enabling this
-# option can be useful when feeding doxygen a huge amount of source files, where
-# putting all generated files in the same directory would otherwise causes
-# performance problems for the file system.
-# The default value is: NO.
-
-CREATE_SUBDIRS         = NO
-
-# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
-# characters to appear in the names of generated files. If set to NO, non-ASCII
-# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
-# U+3044.
-# The default value is: NO.
-
-ALLOW_UNICODE_NAMES    = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
-# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
-# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
-# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
-# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
-# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
-# Ukrainian and Vietnamese.
-# The default value is: English.
-
-OUTPUT_LANGUAGE        = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
-# descriptions after the members that are listed in the file and class
-# documentation (similar to Javadoc). Set to NO to disable this.
-# The default value is: YES.
-
-BRIEF_MEMBER_DESC      = YES
-
-# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
-# description of a member or function before the detailed description
-#
-# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-# The default value is: YES.
-
-REPEAT_BRIEF           = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator that is
-# used to form the text in various listings. Each string in this list, if found
-# as the leading text of the brief description, will be stripped from the text
-# and the result, after processing the whole list, is used as the annotated
-# text. Otherwise, the brief description is used as-is. If left blank, the
-# following values are used ($name is automatically replaced with the name of
-# the entity):The $name class, The $name widget, The $name file, is, provides,
-# specifies, contains, represents, a, an and the.
-
-ABBREVIATE_BRIEF       = "The $name class" \
-                         "The $name widget" \
-                         "The $name file" \
-                         is \
-                         provides \
-                         specifies \
-                         contains \
-                         represents \
-                         a \
-                         an \
-                         the
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# doxygen will generate a detailed section even if there is only a brief
-# description.
-# The default value is: NO.
-
-ALWAYS_DETAILED_SEC    = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-# The default value is: NO.
-
-INLINE_INHERITED_MEMB  = NO
-
-# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
-# before files name in the file list and in the header files. If set to NO the
-# shortest path that makes the file name unique will be used
-# The default value is: YES.
-
-FULL_PATH_NAMES        = YES
-
-# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
-# Stripping is only done if one of the specified strings matches the left-hand
-# part of the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the path to
-# strip.
-#
-# Note that you can specify absolute paths here, but also relative paths, which
-# will be relative from the directory where doxygen is started.
-# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-
-STRIP_FROM_PATH        =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
-# path mentioned in the documentation of a class, which tells the reader which
-# header file to include in order to use a class. If left blank only the name of
-# the header file containing the class definition is used. Otherwise one should
-# specify the list of include paths that are normally passed to the compiler
-# using the -I flag.
-
-STRIP_FROM_INC_PATH    =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
-# less readable) file names. This can be useful is your file systems doesn't
-# support long names like on DOS, Mac, or CD-ROM.
-# The default value is: NO.
-
-SHORT_NAMES            = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
-# first line (until the first dot) of a Javadoc-style comment as the brief
-# description. If set to NO, the Javadoc-style will behave just like regular Qt-
-# style comments (thus requiring an explicit @brief command for a brief
-# description.)
-# The default value is: NO.
-
-JAVADOC_AUTOBRIEF      = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
-# line (until the first dot) of a Qt-style comment as the brief description. If
-# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
-# requiring an explicit \brief command for a brief description.)
-# The default value is: NO.
-
-QT_AUTOBRIEF           = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
-# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
-# a brief description. This used to be the default behavior. The new default is
-# to treat a multi-line C++ comment block as a detailed description. Set this
-# tag to YES if you prefer the old behavior instead.
-#
-# Note that setting this tag to YES also means that rational rose comments are
-# not recognized any more.
-# The default value is: NO.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
-# documentation from any documented member that it re-implements.
-# The default value is: YES.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
-# page for each member. If set to NO, the documentation of a member will be part
-# of the file/class/namespace that contains it.
-# The default value is: NO.
-
-SEPARATE_MEMBER_PAGES  = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
-# uses this value to replace tabs by spaces in code fragments.
-# Minimum value: 1, maximum value: 16, default value: 4.
-
-TAB_SIZE               = 4
-
-# This tag can be used to specify a number of aliases that act as commands in
-# the documentation. An alias has the form:
-# name=value
-# For example adding
-# "sideeffect=@par Side Effects:\n"
-# will allow you to put the command \sideeffect (or @sideeffect) in the
-# documentation, which will result in a user-defined paragraph with heading
-# "Side Effects:". You can put \n's in the value part of an alias to insert
-# newlines.
-
-ALIASES                =
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding "class=itcl::class"
-# will allow you to use the command class in the itcl::class meaning.
-
-TCL_SUBST              =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C. For
-# instance, some of the names that are used will be different. The list of all
-# members will be omitted, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_FOR_C  = YES
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
-# Python sources only. Doxygen will then generate output that is more tailored
-# for that language. For instance, namespaces will be presented as packages,
-# qualified scopes will look different, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_JAVA   = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources. Doxygen will then generate output that is tailored for Fortran.
-# The default value is: NO.
-
-OPTIMIZE_FOR_FORTRAN   = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for VHDL.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_VHDL   = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
-# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
-# Fortran. In the later case the parser tries to guess whether the code is fixed
-# or free formatted code, this is the default for Fortran type files), VHDL. For
-# instance to make doxygen treat .inc files as Fortran files (default is PHP),
-# and .f files as C (default is Fortran), use: inc=Fortran f=C.
-#
-# Note: For files without extension you can use no_extension as a placeholder.
-#
-# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen.
-
-EXTENSION_MAPPING      =
-
-# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
-# according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you can
-# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
-# case of backward compatibilities issues.
-# The default value is: YES.
-
-MARKDOWN_SUPPORT       = YES
-
-# When enabled doxygen tries to link words that correspond to documented
-# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by putting a % sign in front of the word or
-# globally by setting AUTOLINK_SUPPORT to NO.
-# The default value is: YES.
-
-AUTOLINK_SUPPORT       = YES
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should set this
-# tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string);
-# versus func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-# The default value is: NO.
-
-BUILTIN_STL_SUPPORT    = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-# The default value is: NO.
-
-CPP_CLI_SUPPORT        = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
-# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
-# will parse them like normal C++ but will assume all classes use public instead
-# of private inheritance when no explicit protection keyword is present.
-# The default value is: NO.
-
-SIP_SUPPORT            = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES will make
-# doxygen to replace the get and set methods by a property in the documentation.
-# This will only work if the methods are indeed getting or setting a simple
-# type. If this is not the case, or you want to show the methods anyway, you
-# should set this option to NO.
-# The default value is: YES.
-
-IDL_PROPERTY_SUPPORT   = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-# The default value is: NO.
-
-DISTRIBUTE_GROUP_DOC   = NO
-
-# Set the SUBGROUPING tag to YES to allow class member groups of the same type
-# (for instance a group of public functions) to be put as a subgroup of that
-# type (e.g. under the Public Functions section). Set it to NO to prevent
-# subgrouping. Alternatively, this can be done per class using the
-# \nosubgrouping command.
-# The default value is: YES.
-
-SUBGROUPING            = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
-# are shown inside the group in which they are included (e.g. using \ingroup)
-# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
-# and RTF).
-#
-# Note that this feature does not work in combination with
-# SEPARATE_MEMBER_PAGES.
-# The default value is: NO.
-
-INLINE_GROUPED_CLASSES = NO
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
-# with only public data fields or simple typedef fields will be shown inline in
-# the documentation of the scope in which they are defined (i.e. file,
-# namespace, or group documentation), provided this scope is documented. If set
-# to NO, structs, classes, and unions are shown on a separate page (for HTML and
-# Man pages) or section (for LaTeX and RTF).
-# The default value is: NO.
-
-INLINE_SIMPLE_STRUCTS  = NO
-
-# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
-# enum is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically be
-# useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-# The default value is: NO.
-
-TYPEDEF_HIDES_STRUCT   = NO
-
-# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
-# cache is used to resolve symbols given their name and scope. Since this can be
-# an expensive process and often the same symbol appears multiple times in the
-# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
-# doxygen will become slower. If the cache is too large, memory is wasted. The
-# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
-# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
-# symbols. At the end of a run doxygen will report the cache usage and suggest
-# the optimal cache size from a speed point of view.
-# Minimum value: 0, maximum value: 9, default value: 0.
-
-LOOKUP_CACHE_SIZE      = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
-# documentation are documented, even if no documentation was available. Private
-# class members and static file members will be hidden unless the
-# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
-# Note: This will also disable the warnings about undocumented members that are
-# normally produced when WARNINGS is set to YES.
-# The default value is: NO.
-
-EXTRACT_ALL            = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
-# be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PRIVATE        = YES
-
-# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
-# scope will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PACKAGE        = YES
-
-# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
-# included in the documentation.
-# The default value is: NO.
-
-EXTRACT_STATIC         = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO,
-# only classes defined in header files are included. Does not have any effect
-# for Java sources.
-# The default value is: YES.
-
-EXTRACT_LOCAL_CLASSES  = YES
-
-# This flag is only useful for Objective-C code. If set to YES, local methods,
-# which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO, only methods in the interface are
-# included.
-# The default value is: NO.
-
-EXTRACT_LOCAL_METHODS  = YES
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base name of
-# the file that contains the anonymous namespace. By default anonymous namespace
-# are hidden.
-# The default value is: NO.
-
-EXTRACT_ANON_NSPACES   = YES
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
-# undocumented members inside documented classes or files. If set to NO these
-# members will be included in the various overviews, but no documentation
-# section is generated. This option has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_MEMBERS     = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy. If set
-# to NO, these classes will be included in the various overviews. This option
-# has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_CLASSES     = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# (class|struct|union) declarations. If set to NO, these declarations will be
-# included in the documentation.
-# The default value is: NO.
-
-HIDE_FRIEND_COMPOUNDS  = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO, these
-# blocks will be appended to the function's detailed documentation block.
-# The default value is: NO.
-
-HIDE_IN_BODY_DOCS      = NO
-
-# The INTERNAL_DOCS tag determines if documentation that is typed after a
-# \internal command is included. If the tag is set to NO then the documentation
-# will be excluded. Set it to YES to include the internal documentation.
-# The default value is: NO.
-
-INTERNAL_DOCS          = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
-# names in lower-case letters. If set to YES, upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-# The default value is: system dependent.
-
-CASE_SENSE_NAMES       = NO
-
-# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES, the
-# scope will be hidden.
-# The default value is: NO.
-
-HIDE_SCOPE_NAMES       = YES
-
-# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
-# append additional text to a page's title, such as Class Reference. If set to
-# YES the compound reference will be hidden.
-# The default value is: NO.
-
-HIDE_COMPOUND_REFERENCE= NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
-# the files that are included by a file in the documentation of that file.
-# The default value is: YES.
-
-SHOW_INCLUDE_FILES     = YES
-
-# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
-# grouped member an include statement to the documentation, telling the reader
-# which file to include in order to use the member.
-# The default value is: NO.
-
-SHOW_GROUPED_MEMB_INC  = NO
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
-# files with double quotes in the documentation rather than with sharp brackets.
-# The default value is: NO.
-
-FORCE_LOCAL_INCLUDES   = NO
-
-# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
-# documentation for inline members.
-# The default value is: YES.
-
-INLINE_INFO            = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
-# (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order.
-# The default value is: YES.
-
-SORT_MEMBER_DOCS       = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
-# descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order. Note that
-# this will also influence the order of the classes in the class list.
-# The default value is: NO.
-
-SORT_BRIEF_DOCS        = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
-# (brief and detailed) documentation of class members so that constructors and
-# destructors are listed first. If set to NO the constructors will appear in the
-# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
-# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
-# member documentation.
-# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
-# detailed member documentation.
-# The default value is: NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
-# of group names into alphabetical order. If set to NO the group names will
-# appear in their defined order.
-# The default value is: NO.
-
-SORT_GROUP_NAMES       = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
-# fully-qualified names, including namespaces. If set to NO, the class list will
-# be sorted only by class name, not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the alphabetical
-# list.
-# The default value is: NO.
-
-SORT_BY_SCOPE_NAME     = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
-# type resolution of all parameters of a function it will reject a match between
-# the prototype and the implementation of a member function even if there is
-# only one candidate or it is obvious which candidate to choose by doing a
-# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
-# accept a match between prototype and implementation in such cases.
-# The default value is: NO.
-
-STRICT_PROTO_MATCHING  = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
-# list. This list is created by putting \todo commands in the documentation.
-# The default value is: YES.
-
-GENERATE_TODOLIST      = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
-# list. This list is created by putting \test commands in the documentation.
-# The default value is: YES.
-
-GENERATE_TESTLIST      = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
-# list. This list is created by putting \bug commands in the documentation.
-# The default value is: YES.
-
-GENERATE_BUGLIST       = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
-# the deprecated list. This list is created by putting \deprecated commands in
-# the documentation.
-# The default value is: YES.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional documentation
-# sections, marked by \if <section_label> ... \endif and \cond <section_label>
-# ... \endcond blocks.
-
-ENABLED_SECTIONS       =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
-# initial value of a variable or macro / define can have for it to appear in the
-# documentation. If the initializer consists of more lines than specified here
-# it will be hidden. Use a value of 0 to hide initializers completely. The
-# appearance of the value of individual variables and macros / defines can be
-# controlled using \showinitializer or \hideinitializer command in the
-# documentation regardless of this setting.
-# Minimum value: 0, maximum value: 10000, default value: 30.
-
-MAX_INITIALIZER_LINES  = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES, the
-# list will mention the files that were used to generate the documentation.
-# The default value is: YES.
-
-SHOW_USED_FILES        = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
-# will remove the Files entry from the Quick Index and from the Folder Tree View
-# (if specified).
-# The default value is: YES.
-
-SHOW_FILES             = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
-# page. This will remove the Namespaces entry from the Quick Index and from the
-# Folder Tree View (if specified).
-# The default value is: YES.
-
-SHOW_NAMESPACES        = NO
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command command input-file, where command is the value of the
-# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
-# by doxygen. Whatever the program writes to standard output is used as the file
-# version. For an example see the documentation.
-
-FILE_VERSION_FILTER    =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option. You can
-# optionally specify a file name after the option, if omitted DoxygenLayout.xml
-# will be used as the name of the layout file.
-#
-# Note that if you run doxygen from a directory containing a file called
-# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
-# tag is left empty.
-
-LAYOUT_FILE            =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
-# the reference definitions. This must be a list of .bib files. The .bib
-# extension is automatically appended if omitted. This requires the bibtex tool
-# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
-# For LaTeX the style of the bibliography can be controlled using
-# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. See also \cite for info how to create references.
-
-CITE_BIB_FILES         =
-
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated to
-# standard output by doxygen. If QUIET is set to YES this implies that the
-# messages are off.
-# The default value is: NO.
-
-QUIET                  = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
-# this implies that the warnings are on.
-#
-# Tip: Turn warnings on while writing the documentation.
-# The default value is: YES.
-
-WARNINGS               = YES
-
-# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
-# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
-# will automatically be disabled.
-# The default value is: YES.
-
-WARN_IF_UNDOCUMENTED   = YES
-
-# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some parameters
-# in a documented function, or documenting parameters that don't exist or using
-# markup commands wrongly.
-# The default value is: YES.
-
-WARN_IF_DOC_ERROR      = YES
-
-# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
-# are documented, but have no documentation for their parameters or return
-# value. If set to NO, doxygen will only warn about wrong or incomplete
-# parameter documentation, but not about the absence of documentation.
-# The default value is: NO.
-
-WARN_NO_PARAMDOC       = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that doxygen
-# can produce. The string should contain the $file, $line, and $text tags, which
-# will be replaced by the file and line number from which the warning originated
-# and the warning text. Optionally the format may contain $version, which will
-# be replaced by the version of the file (if it could be obtained via
-# FILE_VERSION_FILTER)
-# The default value is: $file:$line: $text.
-
-WARN_FORMAT            = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning and error
-# messages should be written. If left blank the output is written to standard
-# error (stderr).
-
-WARN_LOGFILE           =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag is used to specify the files and/or directories that contain
-# documented source files. You may enter file names like myfile.cpp or
-# directories like /usr/src/myproject. Separate the files or directories with
-# spaces.
-# Note: If this tag is empty the current directory is searched.
-
-INPUT                  = .
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
-# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see: http://www.gnu.org/software/libiconv) for the list of
-# possible encodings.
-# The default value is: UTF-8.
-
-INPUT_ENCODING         = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank the
-# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
-# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
-# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
-# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
-# *.qsf, *.as and *.js.
-
-FILE_PATTERNS          = *.php
-
-# The RECURSIVE tag can be used to specify whether or not subdirectories should
-# be searched for input files as well.
-# The default value is: NO.
-
-RECURSIVE              = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-#
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE                = vendor \
-                         data \
-                         tpl \
-                         inc \
-                         doc \
-                         tmp
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-# The default value is: NO.
-
-EXCLUDE_SYMLINKS       = YES
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories use the pattern */test/*
-
-EXCLUDE_SYMBOLS        =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or directories
-# that contain example code fragments that are included (see the \include
-# command).
-
-EXAMPLE_PATH           =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank all
-# files are included.
-
-EXAMPLE_PATTERNS       = *
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude commands
-# irrespective of the value of the RECURSIVE tag.
-# The default value is: NO.
-
-EXAMPLE_RECURSIVE      = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or directories
-# that contain images that are to be included in the documentation (see the
-# \image command).
-
-IMAGE_PATH             =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command:
-#
-# <filter> <input-file>
-#
-# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
-# name of an input file. Doxygen will then use the output that the filter
-# program writes to standard output. If FILTER_PATTERNS is specified, this tag
-# will be ignored.
-#
-# Note that the filter must not add or remove lines; it is applied before the
-# code is scanned, but not when the output code is generated. If lines are added
-# or removed, the anchors will not be placed correctly.
-
-INPUT_FILTER           =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form: pattern=filter
-# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
-# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
-# patterns match the file name, INPUT_FILTER is applied.
-
-FILTER_PATTERNS        =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will also be used to filter the input files that are used for
-# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
-# The default value is: NO.
-
-FILTER_SOURCE_FILES    = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
-# it is also possible to disable source filtering for a specific pattern using
-# *.ext= (so without naming a filter).
-# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-
-FILTER_SOURCE_PATTERNS =
-
-# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page
-# (index.html). This can be useful if you have a project on for instance GitHub
-# and want to reuse the introduction page also for the doxygen output.
-
-USE_MDFILE_AS_MAINPAGE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
-# generated. Documented entities will be cross-referenced with these sources.
-#
-# Note: To get rid of all source code in the generated output, make sure that
-# also VERBATIM_HEADERS is set to NO.
-# The default value is: NO.
-
-SOURCE_BROWSER         = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body of functions,
-# classes and enums directly into the documentation.
-# The default value is: NO.
-
-INLINE_SOURCES         = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
-# special comment blocks from generated source code fragments. Normal C, C++ and
-# Fortran comments will always remain visible.
-# The default value is: YES.
-
-STRIP_CODE_COMMENTS    = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# function all documented functions referencing it will be listed.
-# The default value is: NO.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES then for each documented function
-# all documented entities called/used by that function will be listed.
-# The default value is: NO.
-
-REFERENCES_RELATION    = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES then the hyperlinks from functions in REFERENCES_RELATION and
-# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
-# link to the documentation.
-# The default value is: YES.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
-# source code will show a tooltip with additional information such as prototype,
-# brief description and links to the definition and documentation. Since this
-# will make the HTML file larger and loading of large files a bit slower, you
-# can opt to disable this feature.
-# The default value is: YES.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-SOURCE_TOOLTIPS        = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code will
-# point to the HTML generated by the htags(1) tool instead of doxygen built-in
-# source browser. The htags tool is part of GNU's global source tagging system
-# (see http://www.gnu.org/software/global/global.html). You will need version
-# 4.8.6 or higher.
-#
-# To use it do the following:
-# - Install the latest version of global
-# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
-# - Make sure the INPUT points to the root of the source tree
-# - Run doxygen as normal
-#
-# Doxygen will invoke htags (and that will in turn invoke gtags), so these
-# tools must be available from the command line (i.e. in the search path).
-#
-# The result: instead of the source browser generated by doxygen, the links to
-# source code will now point to the output of htags.
-# The default value is: NO.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-USE_HTAGS              = NO
-
-# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
-# verbatim copy of the header file for each class for which an include is
-# specified. Set to NO to disable this.
-# See also: Section \class.
-# The default value is: YES.
-
-VERBATIM_HEADERS       = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
-# compounds will be generated. Enable this if the project contains a lot of
-# classes, structs, unions or interfaces.
-# The default value is: YES.
-
-ALPHABETICAL_INDEX     = YES
-
-# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
-# which the alphabetical index list will be split.
-# Minimum value: 1, maximum value: 20, default value: 5.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-COLS_IN_ALPHA_INDEX    = 5
-
-# In case all classes in a project start with a common prefix, all classes will
-# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
-# can be used to specify a prefix (or a list of prefixes) that should be ignored
-# while generating the index headers.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-IGNORE_PREFIX          =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
-# The default value is: YES.
-
-GENERATE_HTML          = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_OUTPUT            = doxygen
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
-# generated HTML page (for example: .htm, .php, .asp).
-# The default value is: .html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FILE_EXTENSION    = .html
-
-# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
-# each generated HTML page. If the tag is left blank doxygen will generate a
-# standard header.
-#
-# To get valid HTML the header file that includes any scripts and style sheets
-# that doxygen needs, which is dependent on the configuration options used (e.g.
-# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
-# default header using
-# doxygen -w html new_header.html new_footer.html new_stylesheet.css
-# YourConfigFile
-# and then modify the file new_header.html. See also section "Doxygen usage"
-# for information on how to generate the default header that doxygen normally
-# uses.
-# Note: The header is subject to change so you typically have to regenerate the
-# default header when upgrading to a newer version of doxygen. For a description
-# of the possible markers and block names see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_HEADER            =
-
-# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
-# generated HTML page. If the tag is left blank doxygen will generate a standard
-# footer. See HTML_HEADER for more information on how to generate a default
-# footer and what special commands can be used inside the footer. See also
-# section "Doxygen usage" for information on how to generate the default footer
-# that doxygen normally uses.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FOOTER            =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
-# sheet that is used by each HTML page. It can be used to fine-tune the look of
-# the HTML output. If left blank doxygen will generate a default style sheet.
-# See also section "Doxygen usage" for information on how to generate the style
-# sheet that doxygen normally uses.
-# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
-# it is more robust and this tag (HTML_STYLESHEET) will in the future become
-# obsolete.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_STYLESHEET        =
-
-# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# cascading style sheets that are included after the standard style sheets
-# created by doxygen. Using this option one can overrule certain style aspects.
-# This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefore more robust against future updates.
-# Doxygen will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list). For an example see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_STYLESHEET  =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
-# files will be copied as-is; there are no commands or markers available.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_FILES       =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the style sheet and background images according to
-# this color. Hue is specified as an angle on a colorwheel, see
-# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
-# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
-# purple, and 360 is red again.
-# Minimum value: 0, maximum value: 359, default value: 220.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_HUE    = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
-# in the HTML output. For a value of 0 the output will use grayscales only. A
-# value of 255 will produce the most vivid colors.
-# Minimum value: 0, maximum value: 255, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_SAT    = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
-# luminance component of the colors in the HTML output. Values below 100
-# gradually make the output lighter, whereas values above 100 make the output
-# darker. The value divided by 100 is the actual gamma applied, so 80 represents
-# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
-# change the gamma.
-# Minimum value: 40, maximum value: 240, default value: 80.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_GAMMA  = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_TIMESTAMP         = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_DYNAMIC_SECTIONS  = NO
-
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
-# shown in the various tree structured indices initially; the user can expand
-# and collapse entries dynamically later on. Doxygen will expand the tree to
-# such a level that at most the specified number of entries are visible (unless
-# a fully collapsed tree already exceeds this amount). So setting the number of
-# entries 1 will produce a full collapsed tree by default. 0 is a special value
-# representing an infinite number of entries and will result in a full expanded
-# tree by default.
-# Minimum value: 0, maximum value: 9999, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files will be
-# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see: http://developer.apple.com/tools/xcode/), introduced with
-# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
-# Makefile in the HTML output directory. Running make will produce the docset in
-# that directory and running make install will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
-# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_DOCSET        = NO
-
-# This tag determines the name of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# The default value is: Doxygen generated docs.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_FEEDNAME        = "Doxygen generated docs"
-
-# This tag specifies a string that should uniquely identify the documentation
-# set bundle. This should be a reverse domain-name style string, e.g.
-# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_BUNDLE_ID       = org.doxygen.Project
-
-# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-# The default value is: org.doxygen.Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
-
-# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
-# The default value is: Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_NAME  = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
-# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
-# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
-# Windows.
-#
-# The HTML Help Workshop contains a compiler that can convert all HTML output
-# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
-# files are now used as the Windows 98 help format, and will replace the old
-# Windows help format (.hlp) on all Windows platforms in the future. Compressed
-# HTML files also contain an index, a table of contents, and you can search for
-# words in the documentation. The HTML workshop also contains a viewer for
-# compressed HTML files.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_HTMLHELP      = NO
-
-# The CHM_FILE tag can be used to specify the file name of the resulting .chm
-# file. You can add a path in front of the file if the result should not be
-# written to the html output directory.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_FILE               =
-
-# The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler (hhc.exe). If non-empty,
-# doxygen will try to run the HTML help compiler on the generated index.hhp.
-# The file has to be specified with full path.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-HHC_LOCATION           =
-
-# The GENERATE_CHI flag controls if a separate .chi index file is generated
-# (YES) or that it should be included in the master .chm file (NO).
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-GENERATE_CHI           = NO
-
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
-# and project file content.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_INDEX_ENCODING     =
-
-# The BINARY_TOC flag controls whether a binary table of contents is generated
-# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
-# enables the Previous and Next buttons.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-BINARY_TOC             = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members to
-# the table of contents of the HTML help documentation and to the tree view.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-TOC_EXPAND             = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
-# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
-# (.qch) of the generated HTML documentation.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_QHP           = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
-# the file name of the resulting .qch file. The path specified is relative to
-# the HTML output folder.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QCH_FILE               =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
-# Project output. For more information please see Qt Help Project / Namespace
-# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_NAMESPACE          = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
-# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
-# folders).
-# The default value is: doc.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_VIRTUAL_FOLDER     = doc
-
-# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
-# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_NAME   =
-
-# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_ATTRS  =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_SECT_FILTER_ATTRS  =
-
-# The QHG_LOCATION tag can be used to specify the location of Qt's
-# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
-# generated .qhp file.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHG_LOCATION           =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
-# generated, together with the HTML files, they form an Eclipse help plugin. To
-# install this plugin and make it available under the help contents menu in
-# Eclipse, the contents of the directory containing the HTML and XML files needs
-# to be copied into the plugins directory of eclipse. The name of the directory
-# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
-# After copying Eclipse needs to be restarted before the help appears.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_ECLIPSEHELP   = NO
-
-# A unique identifier for the Eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have this
-# name. Each documentation set should have its own identifier.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
-
-ECLIPSE_DOC_ID         = org.doxygen.Project
-
-# If you want full control over the layout of the generated HTML pages it might
-# be necessary to disable the index and replace it with your own. The
-# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
-# of each HTML page. A value of NO enables the index and the value YES disables
-# it. Since the tabs in the index contain the same information as the navigation
-# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-DISABLE_INDEX          = NO
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information. If the tag
-# value is set to YES, a side panel will be generated containing a tree-like
-# index structure (just like the one that is generated for HTML Help). For this
-# to work a browser that supports JavaScript, DHTML, CSS and frames is required
-# (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
-# further fine-tune the look of the index. As an example, the default style
-# sheet generated by doxygen has an example that shows how to put an image at
-# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
-# the same information as the tab index, you could consider setting
-# DISABLE_INDEX to YES when enabling this option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_TREEVIEW      = YES
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
-# doxygen will group on one line in the generated HTML documentation.
-#
-# Note that a value of 0 will completely suppress the enum values from appearing
-# in the overview section.
-# Minimum value: 0, maximum value: 20, default value: 4.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-ENUM_VALUES_PER_LINE   = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
-# to set the initial width (in pixels) of the frame in which the tree is shown.
-# Minimum value: 0, maximum value: 1500, default value: 250.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-TREEVIEW_WIDTH         = 250
-
-# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
-# external symbols imported via tag files in a separate window.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-EXT_LINKS_IN_WINDOW    = NO
-
-# Use this tag to change the font size of LaTeX formulas included as images in
-# the HTML documentation. When you change the font size after a successful
-# doxygen run you need to manually remove any form_*.png images from the HTML
-# output directory to force them to be regenerated.
-# Minimum value: 8, maximum value: 50, default value: 10.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_FONTSIZE       = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are not
-# supported properly for IE 6.0, but are supported on all modern browsers.
-#
-# Note that when changing this option you need to delete any form_*.png files in
-# the HTML output directory before the changes have effect.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_TRANSPARENT    = YES
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# http://www.mathjax.org) which uses client side Javascript for the rendering
-# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
-# installed or if you want to formulas look prettier in the HTML output. When
-# enabled you may also need to install MathJax separately and configure the path
-# to it using the MATHJAX_RELPATH option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-USE_MATHJAX            = NO
-
-# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. See the MathJax site (see:
-# http://docs.mathjax.org/en/latest/output.html) for more details.
-# Possible values are: HTML-CSS (which is slower, but has the best
-# compatibility), NativeMML (i.e. MathML) and SVG.
-# The default value is: HTML-CSS.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_FORMAT         = HTML-CSS
-
-# When MathJax is enabled you need to specify the location relative to the HTML
-# output directory using the MATHJAX_RELPATH option. The destination directory
-# should contain the MathJax.js script. For instance, if the mathjax directory
-# is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
-# Content Delivery Network so you can quickly see the result without installing
-# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from http://www.mathjax.org before deployment.
-# The default value is: http://cdn.mathjax.org/mathjax/latest.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
-# extension names that should be enabled during MathJax rendering. For example
-# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_EXTENSIONS     =
-
-# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
-# of code that will be used on startup of the MathJax code. See the MathJax site
-# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
-# example see the documentation.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_CODEFILE       =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
-# the HTML output. The underlying search engine uses javascript and DHTML and
-# should work on any modern browser. Note that when using HTML help
-# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
-# there is already a search function so this one should typically be disabled.
-# For large projects the javascript based search engine can be slow, then
-# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
-# search using the keyboard; to jump to the search box use <access key> + S
-# (what the <access key> is depends on the OS and browser, but it is typically
-# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
-# key> to jump into the search results window, the results can be navigated
-# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
-# the search. The filter options can be selected when the cursor is inside the
-# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
-# to select a filter and <Enter> or <escape> to activate or cancel the filter
-# option.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-SEARCHENGINE           = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript. There
-# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
-# setting. When disabled, doxygen will generate a PHP script for searching and
-# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
-# and searching needs to be provided by external tools. See the section
-# "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SERVER_BASED_SEARCH    = NO
-
-# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
-# script for searching. Instead the search results are written to an XML file
-# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
-# search results.
-#
-# Doxygen ships with an example indexer (doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/).
-#
-# See the section "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH        = NO
-
-# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will return the search results when EXTERNAL_SEARCH is enabled.
-#
-# Doxygen ships with an example indexer (doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/). See the section "External Indexing and
-# Searching" for details.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHENGINE_URL       =
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
-# search data is written to a file for indexing by an external tool. With the
-# SEARCHDATA_FILE tag the name of this file can be specified.
-# The default file is: searchdata.xml.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHDATA_FILE        = searchdata.xml
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
-# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
-# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
-# projects and redirect the results back to the right project.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH_ID     =
-
-# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
-# projects other than the one defined by this configuration file, but that are
-# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
-# to a relative location where the documentation can be found. The format is:
-# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTRA_SEARCH_MAPPINGS  =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
-# The default value is: YES.
-
-GENERATE_LATEX         = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_OUTPUT           = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked.
-#
-# Note that when enabling USE_PDFLATEX this option is only used for generating
-# bitmaps for formulas in the HTML output, but not in the Makefile that is
-# written to the output directory.
-# The default file is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_CMD_NAME         = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
-# index for LaTeX.
-# The default file is: makeindex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-MAKEINDEX_CMD_NAME     = makeindex
-
-# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-COMPACT_LATEX          = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used by the
-# printer.
-# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
-# 14 inches) and executive (7.25 x 10.5 inches).
-# The default value is: a4.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PAPER_TYPE             = a4
-
-# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
-# that should be included in the LaTeX output. To get the times font for
-# instance you can specify
-# EXTRA_PACKAGES=times
-# If left blank no extra packages will be included.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-EXTRA_PACKAGES         =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
-# generated LaTeX document. The header should contain everything until the first
-# chapter. If it is left blank doxygen will generate a standard header. See
-# section "Doxygen usage" for information on how to let doxygen write the
-# default header to a separate file.
-#
-# Note: Only use a user-defined header if you know what you are doing! The
-# following commands have a special meaning inside the header: $title,
-# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
-# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
-# string, for the replacement values of the other commands the user is referred
-# to HTML_HEADER.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HEADER           =
-
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
-# generated LaTeX document. The footer should contain everything after the last
-# chapter. If it is left blank doxygen will generate a standard footer. See
-# LATEX_HEADER for more information on how to generate a default footer and what
-# special commands can be used inside the footer.
-#
-# Note: Only use a user-defined footer if you know what you are doing!
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_FOOTER           =
-
-# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# LaTeX style sheets that are included after the standard style sheets created
-# by doxygen. Using this option one can overrule certain style aspects. Doxygen
-# will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list).
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_STYLESHEET =
-
-# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the LATEX_OUTPUT output
-# directory. Note that the files will be copied as-is; there are no commands or
-# markers available.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_FILES      =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
-# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
-# contain links (just like the HTML output) instead of page references. This
-# makes the output suitable for online browsing using a PDF viewer.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PDF_HYPERLINKS         = YES
-
-# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
-# the PDF file directly from the LaTeX files. Set this option to YES, to get a
-# higher quality PDF documentation.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-USE_PDFLATEX           = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
-# command to the generated LaTeX files. This will instruct LaTeX to keep running
-# if errors occur, instead of asking the user for help. This option is also used
-# when generating formulas in HTML.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BATCHMODE        = NO
-
-# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
-# index chapters (such as File Index, Compound Index, etc.) in the output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HIDE_INDICES     = NO
-
-# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
-# code with syntax highlighting in the LaTeX output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_SOURCE_CODE      = NO
-
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. See
-# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
-# The default value is: plain.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BIB_STYLE        = plain
-
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
-# RTF output is optimized for Word 97 and may not look too pretty with other RTF
-# readers/editors.
-# The default value is: NO.
-
-GENERATE_RTF           = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: rtf.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_OUTPUT             = rtf
-
-# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-COMPACT_RTF            = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
-# contain hyperlink fields. The RTF file will contain links (just like the HTML
-# output) instead of page references. This makes the output suitable for online
-# browsing using Word or some other Word compatible readers that support those
-# fields.
-#
-# Note: WordPad (write) and others do not support links.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_HYPERLINKS         = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's config
-# file, i.e. a series of assignments. You only have to provide replacements,
-# missing definitions are set to their default value.
-#
-# See also section "Doxygen usage" for information on how to generate the
-# default style sheet that doxygen normally uses.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_STYLESHEET_FILE    =
-
-# Set optional variables used in the generation of an RTF document. Syntax is
-# similar to doxygen's config file. A template extensions file can be generated
-# using doxygen -e rtf extensionFile.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_EXTENSIONS_FILE    =
-
-# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
-# with syntax highlighting in the RTF output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_SOURCE_CODE        = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
-# classes and files.
-# The default value is: NO.
-
-GENERATE_MAN           = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it. A directory man3 will be created inside the directory specified by
-# MAN_OUTPUT.
-# The default directory is: man.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_OUTPUT             = man
-
-# The MAN_EXTENSION tag determines the extension that is added to the generated
-# man pages. In case the manual section does not start with a number, the number
-# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
-# optional.
-# The default value is: .3.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_EXTENSION          = .3
-
-# The MAN_SUBDIR tag determines the name of the directory created within
-# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
-# MAN_EXTENSION with the initial . removed.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_SUBDIR             =
-
-# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
-# will generate one additional man file for each entity documented in the real
-# man page(s). These additional files only source the real man page, but without
-# them the man command would be unable to find the correct page.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_LINKS              = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
-# captures the structure of the code including all documentation.
-# The default value is: NO.
-
-GENERATE_XML           = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: xml.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_OUTPUT             = xml
-
-# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
-# listings (including syntax highlighting and cross-referencing information) to
-# the XML output. Note that enabling this will significantly increase the size
-# of the XML output.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
-# that can be used to generate PDF.
-# The default value is: NO.
-
-GENERATE_DOCBOOK       = NO
-
-# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
-# front of it.
-# The default directory is: docbook.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_OUTPUT         = docbook
-
-# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
-# program listings (including syntax highlighting and cross-referencing
-# information) to the DOCBOOK output. Note that enabling this will significantly
-# increase the size of the DOCBOOK output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_PROGRAMLISTING = NO
-
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
-# AutoGen Definitions (see http://autogen.sf.net) file that captures the
-# structure of the code including all documentation. Note that this feature is
-# still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_AUTOGEN_DEF   = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
-# file that captures the structure of the code including all documentation.
-#
-# Note that this feature is still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_PERLMOD       = NO
-
-# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
-# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
-# output from the Perl module output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_LATEX          = NO
-
-# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
-# formatted so it can be parsed by a human reader. This is useful if you want to
-# understand what is going on. On the other hand, if this tag is set to NO, the
-# size of the Perl module output will be much smaller and Perl will parse it
-# just the same.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_PRETTY         = YES
-
-# The names of the make variables in the generated doxyrules.make file are
-# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
-# so different doxyrules.make files included by the same Makefile don't
-# overwrite each other's variables.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
-# C-preprocessor directives found in the sources and include files.
-# The default value is: YES.
-
-ENABLE_PREPROCESSING   = YES
-
-# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
-# in the source code. If set to NO, only conditional compilation will be
-# performed. Macro expansion can be done in a controlled way by setting
-# EXPAND_ONLY_PREDEF to YES.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-MACRO_EXPANSION        = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
-# the macro expansion is limited to the macros specified with the PREDEFINED and
-# EXPAND_AS_DEFINED tags.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_ONLY_PREDEF     = NO
-
-# If the SEARCH_INCLUDES tag is set to YES, the include files in the
-# INCLUDE_PATH will be searched if a #include is found.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SEARCH_INCLUDES        = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by the
-# preprocessor.
-# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-
-INCLUDE_PATH           =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will be
-# used.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-INCLUDE_FILE_PATTERNS  =
-
-# The PREDEFINED tag can be used to specify one or more macro names that are
-# defined before the preprocessor is started (similar to the -D option of e.g.
-# gcc). The argument of the tag is a list of macros of the form: name or
-# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
-# is assumed. To prevent a macro definition from being undefined via #undef or
-# recursively expanded use the := operator instead of the = operator.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-PREDEFINED             =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
-# tag can be used to specify a list of macro names that should be expanded. The
-# macro definition that is found in the sources will be used. Use the PREDEFINED
-# tag if you want to use a different macro definition that overrules the
-# definition found in the source code.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_AS_DEFINED      =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
-# remove all references to function-like macros that are alone on a line, have
-# an all uppercase name, and do not end with a semicolon. Such function macros
-# are typically used for boiler-plate code, and will confuse the parser if not
-# removed.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SKIP_FUNCTION_MACROS   = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES tag can be used to specify one or more tag files. For each tag
-# file the location of the external documentation should be added. The format of
-# a tag file without this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where loc1 and loc2 can be relative or absolute paths or URLs. See the
-# section "Linking to external documentation" for more information about the use
-# of tag files.
-# Note: Each tag file must have a unique name (where the name does NOT include
-# the path). If a tag file is not located in the directory in which doxygen is
-# run, you must also specify the path to the tagfile here.
-
-TAGFILES               =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
-# tag file that is based on the input files it reads. See section "Linking to
-# external documentation" for more information about the usage of tag files.
-
-GENERATE_TAGFILE       =
-
-# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
-# the class index. If set to NO, only the inherited external classes will be
-# listed.
-# The default value is: NO.
-
-ALLEXTERNALS           = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will be
-# listed.
-# The default value is: YES.
-
-EXTERNAL_GROUPS        = YES
-
-# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
-# the related pages index. If set to NO, only the current project's pages will
-# be listed.
-# The default value is: YES.
-
-EXTERNAL_PAGES         = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH              = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
-# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
-# NO turns the diagrams off. Note that this option also works with HAVE_DOT
-# disabled, but it is recommended to install and use dot, since it yields more
-# powerful graphs.
-# The default value is: YES.
-
-CLASS_DIAGRAMS         = NO
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH            =
-
-# You can include diagrams made with dia in doxygen documentation. Doxygen will
-# then run dia to produce the diagram and insert it in the documentation. The
-# DIA_PATH tag allows you to specify the directory where the dia binary resides.
-# If left empty dia is assumed to be found in the default search path.
-
-DIA_PATH               =
-
-# If set to YES the inheritance and collaboration graphs will hide inheritance
-# and usage relations if the target is undocumented or is not a class.
-# The default value is: YES.
-
-HIDE_UNDOC_RELATIONS   = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz (see:
-# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
-# Bell Labs. The other options in this section have no effect if this option is
-# set to NO
-# The default value is: NO.
-
-HAVE_DOT               = NO
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
-# to run in parallel. When set to 0 doxygen will base this on the number of
-# processors available in the system. You can set it explicitly to a value
-# larger than 0 to get control over the balance between CPU load and processing
-# speed.
-# Minimum value: 0, maximum value: 32, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_NUM_THREADS        = 0
-
-# When you want a differently looking font in the dot files that doxygen
-# generates you can specify the font name using DOT_FONTNAME. You need to make
-# sure dot is able to find the font, which can be done by putting it in a
-# standard location or by setting the DOTFONTPATH environment variable or by
-# setting DOT_FONTPATH to the directory containing the font.
-# The default value is: Helvetica.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTNAME           = Helvetica
-
-# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
-# dot graphs.
-# Minimum value: 4, maximum value: 24, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTSIZE           = 10
-
-# By default doxygen will tell dot to use the default font as specified with
-# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
-# the path where dot can find it using this tag.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTPATH           =
-
-# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
-# each documented class showing the direct and indirect inheritance relations.
-# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CLASS_GRAPH            = YES
-
-# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
-# graph for each documented class showing the direct and indirect implementation
-# dependencies (inheritance, containment, and class references variables) of the
-# class with other documented classes.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-COLLABORATION_GRAPH    = YES
-
-# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
-# groups, showing the direct groups dependencies.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GROUP_GRAPHS           = YES
-
-# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LOOK               = NO
-
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
-# class node. If there are many fields or methods and many nodes the graph may
-# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
-# number of items for each type to make the size more manageable. Set this to 0
-# for no limit. Note that the threshold may be exceeded by 50% before the limit
-# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
-# but if the number exceeds 15, the total amount of fields shown is limited to
-# 10.
-# Minimum value: 0, maximum value: 100, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LIMIT_NUM_FIELDS   = 10
-
-# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
-# collaboration graphs will show the relations between templates and their
-# instances.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-TEMPLATE_RELATIONS     = NO
-
-# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
-# YES then doxygen will generate a graph for each documented file showing the
-# direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDE_GRAPH          = YES
-
-# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
-# set to YES then doxygen will generate a graph for each documented file showing
-# the direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDED_BY_GRAPH      = YES
-
-# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALL_GRAPH             = NO
-
-# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable caller graphs for selected
-# functions only using the \callergraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALLER_GRAPH           = NO
-
-# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
-# hierarchy of all classes instead of a textual one.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GRAPHICAL_HIERARCHY    = YES
-
-# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
-# dependencies a directory has on other directories in a graphical way. The
-# dependency relations are determined by the #include relations between the
-# files in the directories.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DIRECTORY_GRAPH        = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot.
-# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
-# to make the SVG files visible in IE 9+ (other browsers do not have this
-# requirement).
-# Possible values are: png, jpg, gif and svg.
-# The default value is: png.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_IMAGE_FORMAT       = png
-
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-#
-# Note that this requires a modern browser other than Internet Explorer. Tested
-# and working are Firefox, Chrome, Safari, and Opera.
-# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
-# the SVG files visible. Older versions of IE do not have SVG support.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INTERACTIVE_SVG        = NO
-
-# The DOT_PATH tag can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_PATH               =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the \dotfile
-# command).
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOTFILE_DIRS           =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the \mscfile
-# command).
-
-MSCFILE_DIRS           =
-
-# The DIAFILE_DIRS tag can be used to specify one or more directories that
-# contain dia files that are included in the documentation (see the \diafile
-# command).
-
-DIAFILE_DIRS           =
-
-# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
-# path where java can find the plantuml.jar file. If left blank, it is assumed
-# PlantUML is not used or called during a preprocessing step. Doxygen will
-# generate a warning when it encounters a \startuml command in this case and
-# will not generate output for the diagram.
-
-PLANTUML_JAR_PATH      =
-
-# When using plantuml, the specified paths are searched for files specified by
-# the !include statement in a plantuml block.
-
-PLANTUML_INCLUDE_PATH  =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
-# that will be shown in the graph. If the number of nodes in a graph becomes
-# larger than this value, doxygen will truncate the graph, which is visualized
-# by representing a node as a red box. Note that doxygen if the number of direct
-# children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
-# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-# Minimum value: 0, maximum value: 10000, default value: 50.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_GRAPH_MAX_NODES    = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
-# generated by dot. A depth value of 3 means that only nodes reachable from the
-# root by following a path via at most 3 edges will be shown. Nodes that lay
-# further from the root node will be omitted. Note that setting this option to 1
-# or 2 may greatly reduce the computation time needed for large code bases. Also
-# note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-# Minimum value: 0, maximum value: 1000, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-MAX_DOT_GRAPH_DEPTH    = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not seem
-# to support this out of the box.
-#
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_TRANSPARENT        = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10) support
-# this, this feature is disabled by default.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_MULTI_TARGETS      = NO
-
-# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
-# explaining the meaning of the various boxes and arrows in the dot generated
-# graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GENERATE_LEGEND        = YES
-
-# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
-# files that are used to generate the various graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_CLEANUP            = YES
index b0cdadf0ce4f5f9db35789bba103455a0b30c63b..286d2c904f711d2a04c9e15da59d1067b6ca0b4a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,6 @@
 # Makefile for PHP code analysis & testing, documentation and release generation
 
 BIN = vendor/bin
-PHP_SOURCE = index.php application tests plugins
-PHP_COMMA_SOURCE = index.php,application,tests,plugins
 
 all: static_analysis_summary check_permissions test
 
@@ -17,14 +15,6 @@ docker_%:
        rsync -az /shaarli/ ~/shaarli/
        cd ~/shaarli && make $*
 
-##
-# Concise status of the project
-# These targets are non-blocking: || exit 0
-##
-
-static_analysis_summary: code_sniffer_source copy_paste mess_detector_summary
-       @echo
-
 ##
 # PHP_CodeSniffer
 # Detects PHP syntax errors
@@ -32,70 +22,26 @@ static_analysis_summary: code_sniffer_source copy_paste mess_detector_summary
 # - http://pear.php.net/manual/en/package.php.php-codesniffer.usage.php
 # - http://pear.php.net/manual/en/package.php.php-codesniffer.reporting.php
 ##
+PHPCS := $(BIN)/phpcs
 
-code_sniffer: code_sniffer_full
+code_sniffer:
+       @$(PHPCS)
 
 ### - errors filtered by coding standard: PEAR, PSR1, PSR2, Zend...
 PHPCS_%:
-       @$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200 --standard=$*
+       @$(PHPCS) --report-full --report-width=200 --standard=$*
 
 ### - errors by Git author
 code_sniffer_blame:
-       @$(BIN)/phpcs $(PHP_SOURCE) --report-gitblame
+       @$(PHPCS) --report-gitblame
 
 ### - all errors/warnings
 code_sniffer_full:
-       @$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200
+       @$(PHPCS) --report-full --report-width=200
 
 ### - errors grouped by kind
 code_sniffer_source:
-       @$(BIN)/phpcs $(PHP_SOURCE) --report-source || exit 0
-
-##
-# PHP Copy/Paste Detector
-# Detects code redundancy
-# Documentation: https://github.com/sebastianbergmann/phpcpd
-##
-
-copy_paste:
-       @echo "-----------------------"
-       @echo "PHP COPY/PASTE DETECTOR"
-       @echo "-----------------------"
-       @$(BIN)/phpcpd $(PHP_SOURCE) || exit 0
-       @echo
-
-##
-# PHP Mess Detector
-# Detects PHP syntax errors, sorted by category
-# Rules documentation: http://phpmd.org/rules/index.html
-##
-MESS_DETECTOR_RULES = cleancode,codesize,controversial,design,naming,unusedcode
-
-mess_title:
-       @echo "-----------------"
-       @echo "PHP MESS DETECTOR"
-       @echo "-----------------"
-
-###  - all warnings
-mess_detector: mess_title
-       @$(BIN)/phpmd $(PHP_COMMA_SOURCE) text $(MESS_DETECTOR_RULES) | sed 's_.*\/__'
-
-### - all warnings + HTML output contains links to PHPMD's documentation
-mess_detector_html:
-       @$(BIN)/phpmd $(PHP_COMMA_SOURCE) html $(MESS_DETECTOR_RULES) \
-       --reportfile phpmd.html || exit 0
-
-### - warnings grouped by message, sorted by descending frequency order
-mess_detector_grouped: mess_title
-       @$(BIN)/phpmd $(PHP_SOURCE) text $(MESS_DETECTOR_RULES) \
-       | cut -f 2 | sort | uniq -c | sort -nr
-
-### - summary: number of warnings by rule set
-mess_detector_summary: mess_title
-       @for rule in $$(echo $(MESS_DETECTOR_RULES) | tr ',' ' '); do \
-               warnings=$$($(BIN)/phpmd $(PHP_COMMA_SOURCE) text $$rule | wc -l); \
-               printf "$$warnings\t$$rule\n"; \
-       done;
+       @$(PHPCS) --report-source || exit 0
 
 ##
 # Checks source file & script permissions
@@ -170,6 +116,7 @@ release_tar: composer_dependencies htmldoc translate build_frontend
        git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).tar HEAD
        tar rvf $(ARCHIVE_VERSION).tar --transform "s|^vendor|$(ARCHIVE_PREFIX)vendor|" vendor/
        tar rvf $(ARCHIVE_VERSION).tar --transform "s|^doc/html|$(ARCHIVE_PREFIX)doc/html|" doc/html/
+       tar rvf $(ARCHIVE_VERSION).tar --transform "s|^tpl|$(ARCHIVE_PREFIX)tpl|" tpl/
        gzip $(ARCHIVE_VERSION).tar
 
 ### generate a release zip and include 3rd-party dependencies and translations
@@ -180,6 +127,8 @@ release_zip: composer_dependencies htmldoc translate build_frontend
        zip -r $(ARCHIVE_VERSION).zip $(ARCHIVE_PREFIX)doc/
        rsync -a vendor/ $(ARCHIVE_PREFIX)vendor/
        zip -r $(ARCHIVE_VERSION).zip $(ARCHIVE_PREFIX)vendor/
+       rsync -a tpl/ $(ARCHIVE_PREFIX)tpl/
+       zip -r $(ARCHIVE_VERSION).zip $(ARCHIVE_PREFIX)tpl/
        rm -rf $(ARCHIVE_PREFIX)
 
 ##
@@ -197,10 +146,9 @@ authors:
        @git shortlog -sne > AUTHORS
        @rm .mailmap
 
-### generate Doxygen documentation
-doxygen: clean
-       @rm -rf doxygen
-       @doxygen Doxyfile
+### generate phpDocumentor documentation
+phpdoc: clean
+       @docker run --rm -v $(PWD):/data -u `id -u`:`id -g` phpdoc/phpdoc
 
 ### generate HTML documentation from Markdown pages with MkDocs
 htmldoc:
index 8199e3f8e1fdab412fe3627e1594163386103159..0e23e33d395a1d8bf4d52b6c1af46ad1a5dc0fb2 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,10 +6,10 @@ _Do you want to share the links you discover?_
 _Shaarli is a minimalist link sharing service that you can install on your own server._
 _It is designed to be personal (single-user), fast and handy._
 
-[![](https://img.shields.io/badge/stable-v0.8.7-blue.svg)](https://github.com/shaarli/Shaarli/releases/tag/v0.8.7)
+[![](https://img.shields.io/badge/stable-v0.9.7-blue.svg)](https://github.com/shaarli/Shaarli/releases/tag/v0.9.7)
 [![](https://img.shields.io/travis/shaarli/Shaarli/stable.svg?label=stable)](https://travis-ci.org/shaarli/Shaarli)
 &bull;
-[![](https://img.shields.io/badge/latest-v0.9.7-blue.svg)](https://github.com/shaarli/Shaarli/releases/tag/v0.9.7)
+[![](https://img.shields.io/badge/latest-v0.10.2-blue.svg)](https://github.com/shaarli/Shaarli/releases/tag/v0.10.2)
 [![](https://img.shields.io/travis/shaarli/Shaarli/latest.svg?label=latest)](https://travis-ci.org/shaarli/Shaarli)
 &bull;
 [![](https://img.shields.io/badge/master-v0.10.x-blue.svg)](https://github.com/shaarli/Shaarli)
index 911873a071ca7813f7ef9e3fa75d8ce18b2f8ec8..7fe3cb3245a9791f2a0324a3f6fd3ec377421cfc 100644 (file)
@@ -1,4 +1,9 @@
 <?php
+namespace Shaarli;
+
+use Exception;
+use Shaarli\Config\ConfigManager;
+
 /**
  * Shaarli (application) utilities
  */
@@ -24,7 +29,7 @@ class ApplicationUtils
      *
      * @return mixed the version code from the repository if available, else 'false'
      */
-    public static function getLatestGitVersionCode($url, $timeout=2)
+    public static function getLatestGitVersionCode($url, $timeout = 2)
     {
         list($headers, $data) = get_http_response($url, $timeout);
 
@@ -51,7 +56,7 @@ class ApplicationUtils
                 return false;
             }
         } else {
-            if (! is_file($remote)) {
+            if (!is_file($remote)) {
                 return false;
             }
             $data = file_get_contents($remote);
@@ -86,17 +91,18 @@ class ApplicationUtils
      *
      * @return mixed the new version code if available and greater, else 'false'
      */
-    public static function checkUpdate($currentVersion,
-                                       $updateFile,
-                                       $checkInterval,
-                                       $enableCheck,
-                                       $isLoggedIn,
-                                       $branch='stable')
-    {
+    public static function checkUpdate(
+        $currentVersion,
+        $updateFile,
+        $checkInterval,
+        $enableCheck,
+        $isLoggedIn,
+        $branch = 'stable'
+    ) {
         // Do not check versions for visitors
         // Do not check if the user doesn't want to
         // Do not check with dev version
-        if (! $isLoggedIn || empty($enableCheck) || $currentVersion === 'dev') {
+        if (!$isLoggedIn || empty($enableCheck) || $currentVersion === 'dev') {
             return false;
         }
 
@@ -110,7 +116,7 @@ class ApplicationUtils
             return false;
         }
 
-        if (! in_array($branch, self::$GIT_BRANCHES)) {
+        if (!in_array($branch, self::$GIT_BRANCHES)) {
             throw new Exception(
                 'Invalid branch selected for updates: "' . $branch . '"'
             );
@@ -122,7 +128,7 @@ class ApplicationUtils
             self::$GIT_URL . '/' . $branch . '/' . self::$VERSION_FILE
         );
 
-        if (! $latestVersion) {
+        if (!$latestVersion) {
             // Only update the file's modification date
             file_put_contents($updateFile, $currentVersion);
             return false;
@@ -151,9 +157,9 @@ class ApplicationUtils
         if (version_compare($curVersion, $minVersion) < 0) {
             $msg = t(
                 'Your PHP version is obsolete!'
-                 . ' Shaarli requires at least PHP %s, and thus cannot run.'
-                 . ' Your PHP version has known security vulnerabilities and should be'
-                 . ' updated as soon as possible.'
+                . ' Shaarli requires at least PHP %s, and thus cannot run.'
+                . ' Your PHP version has known security vulnerabilities and should be'
+                . ' updated as soon as possible.'
             );
             throw new Exception(sprintf($msg, $minVersion));
         }
@@ -173,50 +179,50 @@ class ApplicationUtils
 
         // Check script and template directories are readable
         foreach (array(
-            'application',
-            'inc',
-            'plugins',
-            $rainTplDir,
-            $rainTplDir.'/'.$conf->get('resource.theme'),
-        ) as $path) {
-            if (! is_readable(realpath($path))) {
-                $errors[] = '"'.$path.'" '. t('directory is not readable');
+                     'application',
+                     'inc',
+                     'plugins',
+                     $rainTplDir,
+                     $rainTplDir . '/' . $conf->get('resource.theme'),
+                 ) as $path) {
+            if (!is_readable(realpath($path))) {
+                $errors[] = '"' . $path . '" ' . t('directory is not readable');
             }
         }
 
         // Check cache and data directories are readable and writable
         foreach (array(
-            $conf->get('resource.thumbnails_cache'),
-            $conf->get('resource.data_dir'),
-            $conf->get('resource.page_cache'),
-            $conf->get('resource.raintpl_tmp'),
-        ) as $path) {
-            if (! is_readable(realpath($path))) {
-                $errors[] = '"'.$path.'" '. t('directory is not readable');
+                     $conf->get('resource.thumbnails_cache'),
+                     $conf->get('resource.data_dir'),
+                     $conf->get('resource.page_cache'),
+                     $conf->get('resource.raintpl_tmp'),
+                 ) as $path) {
+            if (!is_readable(realpath($path))) {
+                $errors[] = '"' . $path . '" ' . t('directory is not readable');
             }
-            if (! is_writable(realpath($path))) {
-                $errors[] = '"'.$path.'" '. t('directory is not writable');
+            if (!is_writable(realpath($path))) {
+                $errors[] = '"' . $path . '" ' . t('directory is not writable');
             }
         }
 
         // Check configuration files are readable and writable
         foreach (array(
-            $conf->getConfigFileExt(),
-            $conf->get('resource.datastore'),
-            $conf->get('resource.ban_file'),
-            $conf->get('resource.log'),
-            $conf->get('resource.update_check'),
-        ) as $path) {
-            if (! is_file(realpath($path))) {
+                     $conf->getConfigFileExt(),
+                     $conf->get('resource.datastore'),
+                     $conf->get('resource.ban_file'),
+                     $conf->get('resource.log'),
+                     $conf->get('resource.update_check'),
+                 ) as $path) {
+            if (!is_file(realpath($path))) {
                 # the file may not exist yet
                 continue;
             }
 
-            if (! is_readable(realpath($path))) {
-                $errors[] = '"'.$path.'" '. t('file is not readable');
+            if (!is_readable(realpath($path))) {
+                $errors[] = '"' . $path . '" ' . t('file is not readable');
             }
-            if (! is_writable(realpath($path))) {
-                $errors[] = '"'.$path.'" '. t('file is not writable');
+            if (!is_writable(realpath($path))) {
+                $errors[] = '"' . $path . '" ' . t('file is not writable');
             }
         }
 
index b89ea12bcc26cb7e67b09eaa60f11abf9b0c552a..30560bfc3a929a272a7932c893a7212f5d598da1 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 
-require_once 'exceptions/IOException.php';
+namespace Shaarli;
+
+use Shaarli\Exceptions\IOException;
 
 /**
  * Class FileUtils
@@ -44,7 +46,7 @@ class FileUtils
 
         return file_put_contents(
             $file,
-            self::$phpPrefix.base64_encode(gzdeflate(serialize($content))).self::$phpSuffix
+            self::$phpPrefix . base64_encode(gzdeflate(serialize($content))) . self::$phpSuffix
         );
     }
 
@@ -62,7 +64,7 @@ class FileUtils
     {
         // Note that gzinflate is faster than gzuncompress.
         // See: http://www.php.net/manual/en/function.gzdeflate.php#96439
-        if (! is_readable($file)) {
+        if (!is_readable($file)) {
             return $default;
         }
 
index 35ec016a9be27c374dec0e96cbcd0d27e20a119a..a58466528050e2efb4aee4dbccb59f3629e42041 100644 (file)
@@ -1,4 +1,8 @@
 <?php
+namespace Shaarli;
+
+use DateTime;
+use Exception;
 
 /**
  * Class History
@@ -66,7 +70,7 @@ class History
      * History constructor.
      *
      * @param string $historyFilePath History file path.
-     * @param int    $retentionTime   History content rentention time in seconds.
+     * @param int    $retentionTime   History content retention time in seconds.
      *
      * @throws Exception if something goes wrong.
      */
@@ -166,11 +170,11 @@ class History
      */
     protected function check()
     {
-        if (! is_file($this->historyFilePath)) {
+        if (!is_file($this->historyFilePath)) {
             FileUtils::writeFlatDB($this->historyFilePath, []);
         }
 
-        if (! is_writable($this->historyFilePath)) {
+        if (!is_writable($this->historyFilePath)) {
             throw new Exception(t('History file isn\'t readable or writable'));
         }
     }
@@ -191,7 +195,7 @@ class History
      */
     protected function write()
     {
-        $comparaison = new DateTime('-'. $this->retentionTime . ' seconds');
+        $comparaison = new DateTime('-' . $this->retentionTime . ' seconds');
         foreach ($this->history as $key => $value) {
             if ($value['datetime'] < $comparaison) {
                 unset($this->history[$key]);
index 4fa324265e9fa70a350e8173f5c8f7a06ced2bae..5cda802e0c1faaf57058e0dca653cc713c90c0c3 100644 (file)
@@ -3,7 +3,6 @@
 namespace Shaarli;
 
 use Gettext\GettextTranslator;
-use Gettext\Merge;
 use Gettext\Translations;
 use Gettext\Translator;
 use Gettext\TranslatorInterface;
@@ -92,7 +91,7 @@ class Languages
     /**
      * Initialize the translator using php gettext extension (gettext dependency act as a wrapper).
      */
-    protected function initGettextTranslator ()
+    protected function initGettextTranslator()
     {
         $this->translator = new GettextTranslator();
         $this->translator->setLanguage($this->language);
@@ -125,7 +124,8 @@ class Languages
             $translations = $translations->addFromPoFile('inc/languages/'. $this->language .'/LC_MESSAGES/shaarli.po');
             $translations->setDomain('shaarli');
             $this->translator->loadTranslations($translations);
-        } catch (\InvalidArgumentException $e) {}
+        } catch (\InvalidArgumentException $e) {
+        }
 
         // Default extension translation from the current theme
         $theme = $this->conf->get('theme');
@@ -137,7 +137,8 @@ class Languages
                 );
                 $translations->setDomain($theme);
                 $this->translator->loadTranslations($translations);
-            } catch (\InvalidArgumentException $e) {}
+            } catch (\InvalidArgumentException $e) {
+            }
         }
 
         // Extension translations (plugins, themes, etc.).
@@ -147,10 +148,13 @@ class Languages
             }
 
             try {
-                $extension = Translations::fromPoFile($translationPath . $this->language .'/LC_MESSAGES/'. $domain .'.po');
+                $extension = Translations::fromPoFile(
+                    $translationPath . $this->language .'/LC_MESSAGES/'. $domain .'.po'
+                );
                 $extension->setDomain($domain);
                 $this->translator->loadTranslations($extension);
-            } catch (\InvalidArgumentException $e) {}
+            } catch (\InvalidArgumentException $e) {
+            }
         }
     }
 
index 4df0387c56160f0f4a6998986fb6497d8f745139..05877acdb6d2bfd88979b16bae18ade4ca737b6e 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+namespace Shaarli;
 
 /**
  * Class Router
@@ -7,6 +8,8 @@
  */
 class Router
 {
+    public static $AJAX_THUMB_UPDATE = 'ajax_thumb_update';
+
     public static $PAGE_LOGIN = 'login';
 
     public static $PAGE_PICWALL = 'picwall';
@@ -35,6 +38,8 @@ class Router
 
     public static $PAGE_DELETELINK = 'delete_link';
 
+    public static $PAGE_PINLINK = 'pin';
+
     public static $PAGE_EXPORT = 'export';
 
     public static $PAGE_IMPORT = 'import';
@@ -47,6 +52,8 @@ class Router
 
     public static $PAGE_SAVE_PLUGINSADMIN = 'save_pluginadmin';
 
+    public static $PAGE_THUMBS_UPDATE = 'thumbs_update';
+
     public static $GET_TOKEN = 'token';
 
     /**
@@ -69,60 +76,68 @@ class Router
             return self::$PAGE_LINKLIST;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_LOGIN) && $loggedIn === false) {
+        if (startsWith($query, 'do=' . self::$PAGE_LOGIN) && $loggedIn === false) {
             return self::$PAGE_LOGIN;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_PICWALL)) {
+        if (startsWith($query, 'do=' . self::$PAGE_PICWALL)) {
             return self::$PAGE_PICWALL;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_TAGCLOUD)) {
+        if (startsWith($query, 'do=' . self::$PAGE_TAGCLOUD)) {
             return self::$PAGE_TAGCLOUD;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_TAGLIST)) {
+        if (startsWith($query, 'do=' . self::$PAGE_TAGLIST)) {
             return self::$PAGE_TAGLIST;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_OPENSEARCH)) {
+        if (startsWith($query, 'do=' . self::$PAGE_OPENSEARCH)) {
             return self::$PAGE_OPENSEARCH;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_DAILY)) {
+        if (startsWith($query, 'do=' . self::$PAGE_DAILY)) {
             return self::$PAGE_DAILY;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_FEED_ATOM)) {
+        if (startsWith($query, 'do=' . self::$PAGE_FEED_ATOM)) {
             return self::$PAGE_FEED_ATOM;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_FEED_RSS)) {
+        if (startsWith($query, 'do=' . self::$PAGE_FEED_RSS)) {
             return self::$PAGE_FEED_RSS;
         }
 
+        if (startsWith($query, 'do=' . self::$PAGE_THUMBS_UPDATE)) {
+            return self::$PAGE_THUMBS_UPDATE;
+        }
+
+        if (startsWith($query, 'do=' . self::$AJAX_THUMB_UPDATE)) {
+            return self::$AJAX_THUMB_UPDATE;
+        }
+
         // At this point, only loggedin pages.
         if (!$loggedIn) {
             return self::$PAGE_LINKLIST;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_TOOLS)) {
+        if (startsWith($query, 'do=' . self::$PAGE_TOOLS)) {
             return self::$PAGE_TOOLS;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_CHANGEPASSWORD)) {
+        if (startsWith($query, 'do=' . self::$PAGE_CHANGEPASSWORD)) {
             return self::$PAGE_CHANGEPASSWORD;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_CONFIGURE)) {
+        if (startsWith($query, 'do=' . self::$PAGE_CONFIGURE)) {
             return self::$PAGE_CONFIGURE;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_CHANGETAG)) {
+        if (startsWith($query, 'do=' . self::$PAGE_CHANGETAG)) {
             return self::$PAGE_CHANGETAG;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_ADDLINK)) {
+        if (startsWith($query, 'do=' . self::$PAGE_ADDLINK)) {
             return self::$PAGE_ADDLINK;
         }
 
@@ -134,23 +149,27 @@ class Router
             return self::$PAGE_DELETELINK;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_EXPORT)) {
+        if (startsWith($query, 'do=' . self::$PAGE_PINLINK)) {
+            return self::$PAGE_PINLINK;
+        }
+
+        if (startsWith($query, 'do=' . self::$PAGE_EXPORT)) {
             return self::$PAGE_EXPORT;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_IMPORT)) {
+        if (startsWith($query, 'do=' . self::$PAGE_IMPORT)) {
             return self::$PAGE_IMPORT;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_PLUGINSADMIN)) {
+        if (startsWith($query, 'do=' . self::$PAGE_PLUGINSADMIN)) {
             return self::$PAGE_PLUGINSADMIN;
         }
 
-        if (startsWith($query, 'do='. self::$PAGE_SAVE_PLUGINSADMIN)) {
+        if (startsWith($query, 'do=' . self::$PAGE_SAVE_PLUGINSADMIN)) {
             return self::$PAGE_SAVE_PLUGINSADMIN;
         }
 
-        if (startsWith($query, 'do='. self::$GET_TOKEN)) {
+        if (startsWith($query, 'do=' . self::$GET_TOKEN)) {
             return self::$GET_TOKEN;
         }
 
diff --git a/application/Thumbnailer.php b/application/Thumbnailer.php
new file mode 100644 (file)
index 0000000..a23f98e
--- /dev/null
@@ -0,0 +1,130 @@
+<?php
+
+namespace Shaarli;
+
+use Shaarli\Config\ConfigManager;
+use WebThumbnailer\Application\ConfigManager as WTConfigManager;
+use WebThumbnailer\Exception\WebThumbnailerException;
+use WebThumbnailer\WebThumbnailer;
+
+/**
+ * Class Thumbnailer
+ *
+ * Utility class used to retrieve thumbnails using web-thumbnailer dependency.
+ */
+class Thumbnailer
+{
+    const COMMON_MEDIA_DOMAINS = [
+        'imgur.com',
+        'flickr.com',
+        'youtube.com',
+        'wikimedia.org',
+        'redd.it',
+        'gfycat.com',
+        'media.giphy.com',
+        'twitter.com',
+        'twimg.com',
+        'instagram.com',
+        'pinterest.com',
+        'pinterest.fr',
+        'tumblr.com',
+        'deviantart.com',
+    ];
+
+    const MODE_ALL = 'all';
+    const MODE_COMMON = 'common';
+    const MODE_NONE = 'none';
+
+    /**
+     * @var WebThumbnailer instance.
+     */
+    protected $wt;
+
+    /**
+     * @var ConfigManager instance.
+     */
+    protected $conf;
+
+    /**
+     * Thumbnailer constructor.
+     *
+     * @param ConfigManager $conf instance.
+     */
+    public function __construct($conf)
+    {
+        $this->conf = $conf;
+
+        if (! $this->checkRequirements()) {
+            $this->conf->set('thumbnails.enabled', false);
+            $this->conf->write(true);
+            // TODO: create a proper error handling system able to catch exceptions...
+            die(t(
+                'php-gd extension must be loaded to use thumbnails. '
+                .'Thumbnails are now disabled. Please reload the page.'
+            ));
+        }
+
+        $this->wt = new WebThumbnailer();
+        WTConfigManager::addFile('inc/web-thumbnailer.json');
+        $this->wt->maxWidth($this->conf->get('thumbnails.width'))
+                 ->maxHeight($this->conf->get('thumbnails.height'))
+                 ->crop(true)
+                 ->debug($this->conf->get('dev.debug', false));
+    }
+
+    /**
+     * Retrieve a thumbnail for given URL
+     *
+     * @param string $url where to look for a thumbnail.
+     *
+     * @return bool|string The thumbnail relative cache file path, or false if none has been found.
+     */
+    public function get($url)
+    {
+        if ($this->conf->get('thumbnails.mode') === self::MODE_COMMON
+            && ! $this->isCommonMediaOrImage($url)
+        ) {
+            return false;
+        }
+
+        try {
+            return $this->wt->thumbnail($url);
+        } catch (WebThumbnailerException $e) {
+            // Exceptions are only thrown in debug mode.
+            error_log(get_class($e) . ': ' . $e->getMessage());
+        }
+        return false;
+    }
+
+    /**
+     * We check weather the given URL is from a common media domain,
+     * or if the file extension is an image.
+     *
+     * @param string $url to check
+     *
+     * @return bool true if it's an image or from a common media domain, false otherwise.
+     */
+    public function isCommonMediaOrImage($url)
+    {
+        foreach (self::COMMON_MEDIA_DOMAINS as $domain) {
+            if (strpos($url, $domain) !== false) {
+                return true;
+            }
+        }
+
+        if (endsWith($url, '.jpg') || endsWith($url, '.png') || endsWith($url, '.jpeg')) {
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Make sure that requirements are match to use thumbnails:
+     *   - php-gd is loaded
+     */
+    protected function checkRequirements()
+    {
+        return extension_loaded('gd');
+    }
+}
index 97b12fcf5b5e1d8beb94ab507f3f32479b89e747..925e1a22c909011a342b3dc3ced3c9f0f5d9a3da 100644 (file)
@@ -97,7 +97,7 @@ function escape($input)
 
     if (is_array($input)) {
         $out = array();
-        foreach($input as $key => $value) {
+        foreach ($input as $key => $value) {
             $out[$key] = escape($value);
         }
         return $out;
@@ -355,10 +355,13 @@ function return_bytes($val)
     $val = trim($val);
     $last = strtolower($val[strlen($val)-1]);
     $val = intval(substr($val, 0, -1));
-    switch($last) {
-        case 'g': $val *= 1024;
-        case 'm': $val *= 1024;
-        case 'k': $val *= 1024;
+    switch ($last) {
+        case 'g':
+            $val *= 1024;
+        case 'm':
+            $val *= 1024;
+        case 'k':
+            $val *= 1024;
     }
     return $val;
 }
@@ -452,6 +455,7 @@ function alphabetical_sort(&$data, $reverse = false, $byKeys = false)
  *
  * @return string Text translated.
  */
-function t($text, $nText = '', $nb = 1, $domain = 'shaarli') {
+function t($text, $nText = '', $nb = 1, $domain = 'shaarli')
+{
     return dn__($domain, $text, $nText, $nb);
 }
index ff2093930c69b5e5ad0c22f03eee816d2f27e8ce..5ffb8c6d06653fc527df1caca85d58004d41def8 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 namespace Shaarli\Api;
 
-use Shaarli\Api\Exceptions\ApiException;
 use Shaarli\Api\Exceptions\ApiAuthorizationException;
-
+use Shaarli\Api\Exceptions\ApiException;
 use Shaarli\Config\ConfigManager;
 use Slim\Container;
 use Slim\Http\Request;
@@ -65,7 +64,7 @@ class ApiMiddleware
         try {
             $this->checkRequest($request);
             $response = $next($request, $response);
-        } catch(ApiException $e) {
+        } catch (ApiException $e) {
             $e->setResponse($response);
             $e->setDebug($this->conf->get('dev.debug', false));
             $response = $e->getApiResponse();
@@ -98,7 +97,8 @@ class ApiMiddleware
      *
      * @throws ApiAuthorizationException The token couldn't be validated.
      */
-    protected function checkToken($request) {
+    protected function checkToken($request)
+    {
         if (! $request->hasHeader('Authorization')) {
             throw new ApiAuthorizationException('JWT token not provided');
         }
@@ -126,7 +126,7 @@ class ApiMiddleware
      */
     protected function setLinkDb($conf)
     {
-        $linkDb = new \LinkDB(
+        $linkDb = new \Shaarli\Bookmark\LinkDB(
             $conf->get('resource.datastore'),
             true,
             $conf->get('privacy.hide_public_links'),
index fc5ecaf1e75931d3a2006dae957be7129bb7df1e..1824b5d08171f19c27ebb28d3831eacbfc040538 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 namespace Shaarli\Api;
 
-use Shaarli\Base64Url;
 use Shaarli\Api\Exceptions\ApiAuthorizationException;
+use Shaarli\Http\Base64Url;
 
 /**
  * REST API utilities
@@ -12,7 +12,7 @@ class ApiUtils
     /**
      * Validates a JWT token authenticity.
      *
-     * @param string $token JWT token extracted from the headers.
+     * @param string $token  JWT token extracted from the headers.
      * @param string $secret API secret set in the settings.
      *
      * @throws ApiAuthorizationException the token is not valid.
@@ -50,7 +50,7 @@ class ApiUtils
     /**
      * Format a Link for the REST API.
      *
-     * @param array $link Link data read from the datastore.
+     * @param array  $link     Link data read from the datastore.
      * @param string $indexUrl Shaarli's index URL (used for relative URL).
      *
      * @return array Link data formatted for the REST API.
index 3be85b983a1fc62b6d2c272486c460e2f3664959..a6e7cbab23565007a71f85ac2338f54a930bae6f 100644 (file)
@@ -2,8 +2,9 @@
 
 namespace Shaarli\Api\Controllers;
 
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigManager;
-use \Slim\Container;
+use Slim\Container;
 
 /**
  * Abstract Class ApiController
@@ -25,12 +26,12 @@ abstract class ApiController
     protected $conf;
 
     /**
-     * @var \LinkDB
+     * @var LinkDB
      */
     protected $linkDb;
 
     /**
-     * @var \History
+     * @var HistoryController
      */
     protected $history;
 
@@ -41,7 +42,7 @@ abstract class ApiController
 
     /**
      * ApiController constructor.
-     * 
+     *
      * Note: enabling debug mode displays JSON with readable formatting.
      *
      * @param Container $ci Slim container.
similarity index 95%
rename from application/api/controllers/History.php
rename to application/api/controllers/HistoryController.php
index 5cc453bfadd1decd5649d5cceab43ab342140b53..9afcfa264430cd7af5910357bfcd07fbea797301 100644 (file)
@@ -14,7 +14,7 @@ use Slim\Http\Response;
  *
  * @package Shaarli\Api\Controllers
  */
-class History extends ApiController
+class HistoryController extends ApiController
 {
     /**
      * Service providing operation regarding Shaarli datastore and settings.
@@ -35,8 +35,7 @@ class History extends ApiController
         $offset = $request->getParam('offset');
         if (empty($offset)) {
             $offset = 0;
-        }
-        elseif (ctype_digit($offset)) {
+        } elseif (ctype_digit($offset)) {
             $offset = (int) $offset;
         } else {
             throw new ApiBadParametersException('Invalid offset');
index 25433f720cf972b7ac370e05a2c67835443d7194..f37dcae5330d77b67d7bcaf277f63178d0895703 100644 (file)
@@ -7,7 +7,7 @@ use Slim\Http\Response;
 
 /**
  * Class Info
- * 
+ *
  * REST API Controller: /info
  *
  * @package Api\Controllers
@@ -17,7 +17,7 @@ class Info extends ApiController
 {
     /**
      * Service providing various information about Shaarli instance.
-     * 
+     *
      * @param Request  $request  Slim request.
      * @param Response $response Slim response.
      *
index 6dd78750f37240e21fc437f1a410a171cd1020cf..82f3ef746dde8cd88ead34ac02c02f0b037e696e 100644 (file)
@@ -4,7 +4,6 @@ namespace Shaarli\Api\Controllers;
 
 use Shaarli\Api\ApiUtils;
 use Shaarli\Api\Exceptions\ApiBadParametersException;
-use Shaarli\Api\Exceptions\ApiLinkNotFoundException;
 use Shaarli\Api\Exceptions\ApiTagNotFoundException;
 use Slim\Http\Request;
 use Slim\Http\Response;
index c8490e0cb2e032f3a48ec29e1c6b4b8efd3dfaff..d6b66323279f86e4dd886c0477f9c41e4f67a9bb 100644 (file)
@@ -10,7 +10,8 @@ use Slim\Http\Response;
  * Parent Exception related to the API, able to generate a valid Response (ResponseInterface).
  * Also can include various information in debug mode.
  */
-abstract class ApiException extends \Exception {
+abstract class ApiException extends \Exception
+{
 
     /**
      * @var Response instance from Slim.
@@ -27,7 +28,7 @@ abstract class ApiException extends \Exception {
      *
      * @return Response Final response to give.
      */
-    public abstract function getApiResponse();
+    abstract public function getApiResponse();
 
     /**
      * Creates ApiResponse body.
@@ -36,7 +37,8 @@ abstract class ApiException extends \Exception {
      *
      * @return array|string response body
      */
-    protected function getApiResponseBody() {
+    protected function getApiResponseBody()
+    {
         if ($this->debug !== true) {
             return $this->getMessage();
         }
index de7e14f5c9cd16822bec865b5773a5d31ccc80d8..7c2bb56ed781b3a2b76e0a66b688b384e706ee2c 100644 (file)
@@ -2,9 +2,6 @@
 
 namespace Shaarli\Api\Exceptions;
 
-
-use Slim\Http\Response;
-
 /**
  * Class ApiLinkNotFoundException
  *
index eed5afa57c1ba1eafbb08806a8d5605819950afe..66ace8bfa51c5ea8906f57fb8bd9c905e143f84b 100644 (file)
@@ -2,9 +2,6 @@
 
 namespace Shaarli\Api\Exceptions;
 
-
-use Slim\Http\Response;
-
 /**
  * Class ApiTagNotFoundException
  *
similarity index 88%
rename from application/LinkDB.php
rename to application/bookmark/LinkDB.php
index cd0f29671f9b199c213b4333e8eeab23eedcadb7..c13a11417b5fb66af9a7df5597ad2f2a09298936 100644 (file)
@@ -1,4 +1,15 @@
 <?php
+
+namespace Shaarli\Bookmark;
+
+use ArrayAccess;
+use Countable;
+use DateTime;
+use Iterator;
+use Shaarli\Bookmark\Exception\LinkNotFoundException;
+use Shaarli\Exceptions\IOException;
+use Shaarli\FileUtils;
+
 /**
  * Data storage for links.
  *
@@ -107,8 +118,8 @@ class LinkDB implements Iterator, Countable, ArrayAccess
         $hidePublicLinks,
         $redirector = '',
         $redirectorEncode = true
-    )
-    {
+    ) {
+    
         $this->datastore = $datastore;
         $this->loggedIn = $isLoggedIn;
         $this->hidePublicLinks = $hidePublicLinks;
@@ -138,7 +149,7 @@ class LinkDB implements Iterator, Countable, ArrayAccess
         if (!isset($value['id']) || empty($value['url'])) {
             die(t('Internal Error: A link should always have an id and URL.'));
         }
-        if (($offset !== null && ! is_int($offset)) || ! is_int($value['id'])) {
+        if (($offset !== null && !is_int($offset)) || !is_int($value['id'])) {
             die(t('You must specify an integer as a key.'));
         }
         if ($offset !== null && $offset !== $value['id']) {
@@ -248,28 +259,31 @@ class LinkDB implements Iterator, Countable, ArrayAccess
         $this->links = array();
         $link = array(
             'id' => 1,
-            'title'=> t('The personal, minimalist, super-fast, database free, bookmarking service'),
-            'url'=>'https://shaarli.readthedocs.io',
-            'description'=>t('Welcome to Shaarli! This is your first public bookmark. To edit or delete me, you must first login.
+            'title' => t('The personal, minimalist, super-fast, database free, bookmarking service'),
+            'url' => 'https://shaarli.readthedocs.io',
+            'description' => t(
+                'Welcome to Shaarli! This is your first public bookmark. '
+                . 'To edit or delete me, you must first login.
 
 To learn how to use Shaarli, consult the link "Documentation" at the bottom of this page.
 
-You use the community supported version of the original Shaarli project, by Sebastien Sauvage.'),
-            'private'=>0,
-            'created'=> new DateTime(),
-            'tags'=>'opensource software'
+You use the community supported version of the original Shaarli project, by Sebastien Sauvage.'
+            ),
+            'private' => 0,
+            'created' => new DateTime(),
+            'tags' => 'opensource software'
         );
         $link['shorturl'] = link_small_hash($link['created'], $link['id']);
         $this->links[1] = $link;
 
         $link = array(
             'id' => 0,
-            'title'=> t('My secret stuff... - Pastebin.com'),
-            'url'=>'http://sebsauvage.net/paste/?8434b27936c09649#bR7XsXhoTiLcqCpQbmOpBi3rq2zzQUC5hBI7ZT1O3x8=',
-            'description'=> t('Shhhh! I\'m a private link only YOU can see. You can delete me too.'),
-            'private'=>1,
-            'created'=> new DateTime('1 minute ago'),
-            'tags'=>'secretstuff',
+            'title' => t('My secret stuff... - Pastebin.com'),
+            'url' => 'http://sebsauvage.net/paste/?8434b27936c09649#bR7XsXhoTiLcqCpQbmOpBi3rq2zzQUC5hBI7ZT1O3x8=',
+            'description' => t('Shhhh! I\'m a private link only YOU can see. You can delete me too.'),
+            'private' => 1,
+            'created' => new DateTime('1 minute ago'),
+            'tags' => 'secretstuff',
         );
         $link['shorturl'] = link_small_hash($link['created'], $link['id']);
         $this->links[0] = $link;
@@ -295,7 +309,7 @@ You use the community supported version of the original Shaarli project, by Seba
 
         $toremove = array();
         foreach ($this->links as $key => &$link) {
-            if (! $this->loggedIn && $link['private'] != 0) {
+            if (!$this->loggedIn && $link['private'] != 0) {
                 // Transition for not upgraded databases.
                 unset($this->links[$key]);
                 continue;
@@ -305,7 +319,7 @@ You use the community supported version of the original Shaarli project, by Seba
             sanitizeLink($link);
 
             // Remove private tags if the user is not logged in.
-            if (! $this->loggedIn) {
+            if (!$this->loggedIn) {
                 $link['tags'] = preg_replace('/(^|\s+)\.[^($|\s)]+\s*/', ' ', $link['tags']);
             }
 
@@ -317,16 +331,15 @@ You use the community supported version of the original Shaarli project, by Seba
                 } else {
                     $link['real_url'] .= $link['url'];
                 }
-            }
-            else {
+            } else {
                 $link['real_url'] = $link['url'];
             }
 
             // To be able to load links before running the update, and prepare the update
-            if (! isset($link['created'])) {
+            if (!isset($link['created'])) {
                 $link['id'] = $link['linkdate'];
                 $link['created'] = DateTime::createFromFormat(self::LINK_DATE_FORMAT, $link['linkdate']);
-                if (! empty($link['updated'])) {
+                if (!empty($link['updated'])) {
                     $link['updated'] = DateTime::createFromFormat(self::LINK_DATE_FORMAT, $link['updated']);
                 }
                 $link['shorturl'] = smallHash($link['linkdate']);
@@ -403,7 +416,8 @@ You use the community supported version of the original Shaarli project, by Seba
      *
      * @return array list of shaare found.
      */
-    public function filterDay($request) {
+    public function filterDay($request)
+    {
         $linkFilter = new LinkFilter($this->links);
         return $linkFilter->filter(LinkFilter::$FILTER_DAY, $request);
     }
@@ -411,17 +425,22 @@ You use the community supported version of the original Shaarli project, by Seba
     /**
      * Filter links according to search parameters.
      *
-     * @param array  $filterRequest Search request content. Supported keys:
+     * @param array  $filterRequest  Search request content. Supported keys:
      *                                - searchtags: list of tags
      *                                - searchterm: term search
-     * @param bool   $casesensitive Optional: Perform case sensitive filter
-     * @param string $visibility    return only all/private/public links
-     * @param string $untaggedonly  return only untagged links
+     * @param bool   $casesensitive  Optional: Perform case sensitive filter
+     * @param string $visibility     return only all/private/public links
+     * @param bool   $untaggedonly   return only untagged links
      *
      * @return array filtered links, all links if no suitable filter was provided.
      */
-    public function filterSearch($filterRequest = array(), $casesensitive = false, $visibility = 'all', $untaggedonly = false)
-    {
+    public function filterSearch(
+        $filterRequest = array(),
+        $casesensitive = false,
+        $visibility = 'all',
+        $untaggedonly = false
+    ) {
+    
         // Filter link database according to parameters.
         $searchtags = isset($filterRequest['searchtags']) ? escape($filterRequest['searchtags']) : '';
         $searchterm = isset($filterRequest['searchterm']) ? escape($filterRequest['searchterm']) : '';
@@ -437,8 +456,8 @@ You use the community supported version of the original Shaarli project, by Seba
     /**
      * Returns the list tags appearing in the links with the given tags
      *
-     * @param array $filteringTags tags selecting the links to consider
-     * @param string $visibility   process only all/private/public links
+     * @param array  $filteringTags tags selecting the links to consider
+     * @param string $visibility    process only all/private/public links
      *
      * @return array tag => linksCount
      */
@@ -492,8 +511,7 @@ You use the community supported version of the original Shaarli project, by Seba
         $delete = empty($to);
         // True for case-sensitive tag search.
         $linksToAlter = $this->filterSearch(['searchtags' => $from], true);
-        foreach($linksToAlter as $key => &$value)
-        {
+        foreach ($linksToAlter as $key => &$value) {
             $tags = preg_split('/\s+/', trim($value['tags']));
             if (($pos = array_search($from, $tags)) !== false) {
                 if ($delete) {
@@ -536,7 +554,10 @@ You use the community supported version of the original Shaarli project, by Seba
     {
         $order = $order === 'ASC' ? -1 : 1;
         // Reorder array by dates.
-        usort($this->links, function($a, $b) use ($order) {
+        usort($this->links, function ($a, $b) use ($order) {
+            if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) {
+                return $a['sticky'] ? -1 : 1;
+            }
             return $a['created'] < $b['created'] ? 1 * $order : -1 * $order;
         });
 
similarity index 90%
rename from application/LinkFilter.php
rename to application/bookmark/LinkFilter.php
index e52239b84c89f4c1b387b02dd399e3c25e4bf23a..9b96630737008cb2075886e339b85d6b2bbeb109 100644 (file)
@@ -1,5 +1,10 @@
 <?php
 
+namespace Shaarli\Bookmark;
+
+use Exception;
+use Shaarli\Bookmark\Exception\LinkNotFoundException;
+
 /**
  * Class LinkFilter.
  *
@@ -10,22 +15,22 @@ class LinkFilter
     /**
      * @var string permalinks.
      */
-    public static $FILTER_HASH   = 'permalink';
+    public static $FILTER_HASH = 'permalink';
 
     /**
      * @var string text search.
      */
-    public static $FILTER_TEXT   = 'fulltext';
+    public static $FILTER_TEXT = 'fulltext';
 
     /**
      * @var string tag filter.
      */
-    public static $FILTER_TAG    = 'tags';
+    public static $FILTER_TAG = 'tags';
 
     /**
      * @var string filter by day.
      */
-    public static $FILTER_DAY    = 'FILTER_DAY';
+    public static $FILTER_DAY = 'FILTER_DAY';
 
     /**
      * @var string Allowed characters for hashtags (regex syntax).
@@ -58,11 +63,11 @@ class LinkFilter
      */
     public function filter($type, $request, $casesensitive = false, $visibility = 'all', $untaggedonly = false)
     {
-        if (! in_array($visibility, ['all', 'public', 'private'])) {
+        if (!in_array($visibility, ['all', 'public', 'private'])) {
             $visibility = 'all';
         }
 
-        switch($type) {
+        switch ($type) {
             case self::$FILTER_HASH:
                 return $this->filterSmallHash($request);
             case self::$FILTER_TAG | self::$FILTER_TEXT: // == "vuotext"
@@ -117,7 +122,7 @@ class LinkFilter
         foreach ($this->links as $key => $value) {
             if ($value['private'] && $visibility === 'private') {
                 $out[$key] = $value;
-            } elseif (! $value['private'] && $visibility === 'public') {
+            } elseif (!$value['private'] && $visibility === 'public') {
                 $out[$key] = $value;
             }
         }
@@ -132,7 +137,7 @@ class LinkFilter
      *
      * @return array $filtered array containing permalink data.
      *
-     * @throws LinkNotFoundException if the smallhash doesn't match any link.
+     * @throws \Shaarli\Bookmark\Exception\LinkNotFoundException if the smallhash doesn't match any link.
      */
     private function filterSmallHash($smallHash)
     {
@@ -169,7 +174,7 @@ class LinkFilter
      *  - see https://github.com/shaarli/Shaarli/issues/75 for examples
      *
      * @param string $searchterms search query.
-     * @param string $visibility Optional: return only all/private/public links.
+     * @param string $visibility  Optional: return only all/private/public links.
      *
      * @return array search results.
      */
@@ -205,10 +210,9 @@ class LinkFilter
 
         // Iterate over every stored link.
         foreach ($this->links as $id => $link) {
-
             // ignore non private links when 'privatonly' is on.
             if ($visibility !== 'all') {
-                if (! $link['private'] && $visibility === 'private') {
+                if (!$link['private'] && $visibility === 'private') {
                     continue;
                 } elseif ($link['private'] && $visibility === 'public') {
                     continue;
@@ -251,17 +255,19 @@ class LinkFilter
 
     /**
      * generate a regex fragment out of a tag
+     *
      * @param string $tag to to generate regexs from. may start with '-' to negate, contain '*' as wildcard
+     *
      * @return string generated regex fragment
      */
     private static function tag2regex($tag)
     {
         $len = strlen($tag);
-        if(!$len || $tag === "-" || $tag === "*"){
+        if (!$len || $tag === "-" || $tag === "*") {
             // nothing to search, return empty regex
             return '';
         }
-        if($tag[0] === "-") {
+        if ($tag[0] === "-") {
             // query is negated
             $i = 1; // use offset to start after '-' character
             $regex = '(?!'; // create negative lookahead
@@ -271,14 +277,14 @@ class LinkFilter
         }
         $regex .= '.*(?:^| )'; // before tag may only be a space or the beginning
         // iterate over string, separating it into placeholder and content
-        for(; $i < $len; $i++){
-            if($tag[$i] === '*'){
+        for (; $i < $len; $i++) {
+            if ($tag[$i] === '*') {
                 // placeholder found
                 $regex .= '[^ ]*?';
             } else {
                 // regular characters
                 $offset = strpos($tag, '*', $i);
-                if($offset === false){
+                if ($offset === false) {
                     // no placeholder found, set offset to end of string
                     $offset = $len;
                 }
@@ -310,19 +316,19 @@ class LinkFilter
     {
         // get single tags (we may get passed an array, even though the docs say different)
         $inputTags = $tags;
-        if(!is_array($tags)) {
+        if (!is_array($tags)) {
             // we got an input string, split tags
             $inputTags = preg_split('/(?:\s+)|,/', $inputTags, -1, PREG_SPLIT_NO_EMPTY);
         }
 
-        if(!count($inputTags)){
+        if (!count($inputTags)) {
             // no input tags
             return $this->noFilter($visibility);
         }
 
         // build regex from all tags
         $re = '/^' . implode(array_map("self::tag2regex", $inputTags)) . '.*$/';
-        if(!$casesensitive) {
+        if (!$casesensitive) {
             // make regex case insensitive
             $re .= 'i';
         }
@@ -335,14 +341,14 @@ class LinkFilter
             // check level of visibility
             // ignore non private links when 'privateonly' is on.
             if ($visibility !== 'all') {
-                if (! $link['private'] && $visibility === 'private') {
+                if (!$link['private'] && $visibility === 'private') {
                     continue;
                 } elseif ($link['private'] && $visibility === 'public') {
                     continue;
                 }
             }
             $search = $link['tags']; // build search string, start with tags of current link
-            if(strlen(trim($link['description'])) && strpos($link['description'], '#') !== false){
+            if (strlen(trim($link['description'])) && strpos($link['description'], '#') !== false) {
                 // description given and at least one possible tag found
                 $descTags = array();
                 // find all tags in the form of #tag in the description
@@ -351,13 +357,13 @@ class LinkFilter
                     $link['description'],
                     $descTags
                 );
-                if(count($descTags[1])){
+                if (count($descTags[1])) {
                     // there were some tags in the description, add them to the search string
                     $search .= ' ' . implode(' ', $descTags[1]);
                 }
             };
             // match regular expression with search string
-            if(!preg_match($re, $search)){
+            if (!preg_match($re, $search)) {
                 // this entry does _not_ match our regex
                 continue;
             }
@@ -378,7 +384,7 @@ class LinkFilter
         $filtered = [];
         foreach ($this->links as $key => $link) {
             if ($visibility !== 'all') {
-                if (! $link['private'] && $visibility === 'private') {
+                if (!$link['private'] && $visibility === 'private') {
                     continue;
                 } elseif ($link['private'] && $visibility === 'public') {
                     continue;
@@ -407,7 +413,7 @@ class LinkFilter
      */
     public function filterDay($day)
     {
-        if (! checkDateFormat('Ymd', $day)) {
+        if (!checkDateFormat('Ymd', $day)) {
             throw new Exception('Invalid date format');
         }
 
@@ -441,14 +447,3 @@ class LinkFilter
         return preg_split('/\s+/', $tagsOut, -1, PREG_SPLIT_NO_EMPTY);
     }
 }
-
-class LinkNotFoundException extends Exception
-{
-    /**
-     * LinkNotFoundException constructor.
-     */
-    public function __construct()
-    {
-        $this->message =  t('The link you are trying to reach does not exist or has been deleted.');
-    }
-}
similarity index 95%
rename from application/LinkUtils.php
rename to application/bookmark/LinkUtils.php
index 4df5c0cababf247357d89ebd002e4b49a7910cf6..de5b61cbcaf6e8467d57eb9c49aa009d0a832754 100644 (file)
@@ -1,11 +1,13 @@
 <?php
 
+use Shaarli\Bookmark\LinkDB;
+
 /**
  * Get cURL callback function for CURLOPT_WRITEFUNCTION
  *
  * @param string $charset     to extract from the downloaded page (reference)
  * @param string $title       to extract from the downloaded page (reference)
- * @param string $curlGetInfo Optionnaly overrides curl_getinfo function
+ * @param string $curlGetInfo Optionally overrides curl_getinfo function
  *
  * @return Closure
  */
@@ -23,7 +25,7 @@ function get_curl_download_callback(&$charset, &$title, $curlGetInfo = 'curl_get
      *
      * @return int|bool length of $data or false if we need to stop the download
      */
-    return function(&$ch, $data) use ($curlGetInfo, &$charset, &$title, &$isRedirected) {
+    return function (&$ch, $data) use ($curlGetInfo, &$charset, &$title, &$isRedirected) {
         $responseCode = $curlGetInfo($ch, CURLINFO_RESPONSE_CODE);
         if (!empty($responseCode) && in_array($responseCode, [301, 302])) {
             $isRedirected = true;
@@ -196,12 +198,13 @@ function space2nbsp($text)
  *
  * @param string $description shaare's description.
  * @param string $redirector  if a redirector is set, use it to gerenate links.
- * @param bool   $urlEncode  Use `urlencode()` on the URL after the redirector or not.
+ * @param bool   $urlEncode   Use `urlencode()` on the URL after the redirector or not.
  * @param string $indexUrl    URL to Shaarli's index.
 
  * @return string formatted description.
  */
-function format_description($description, $redirector = '', $urlEncode = true, $indexUrl = '') {
+function format_description($description, $redirector = '', $urlEncode = true, $indexUrl = '')
+{
     return nl2br(space2nbsp(hashtag_autolink(text2clickable($description, $redirector, $urlEncode), $indexUrl)));
 }
 
diff --git a/application/bookmark/exception/LinkNotFoundException.php b/application/bookmark/exception/LinkNotFoundException.php
new file mode 100644 (file)
index 0000000..f941442
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+namespace Shaarli\Bookmark\Exception;
+
+use Exception;
+
+class LinkNotFoundException extends Exception
+{
+    /**
+     * LinkNotFoundException constructor.
+     */
+    public function __construct()
+    {
+        $this->message = t('The link you are trying to reach does not exist or has been deleted.');
+    }
+}
index 8c8d5610efb145c49c3b319514f7e3ba0dab68ca..4509357ce887ea8a28334a68c50f999294780243 100644 (file)
@@ -47,7 +47,7 @@ class ConfigJson implements ConfigIO
         $print = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
         $data = self::getPhpHeaders() . json_encode($conf, $print) . self::getPhpSuffix();
         if (!file_put_contents($filepath, $data)) {
-            throw new \IOException(
+            throw new \Shaarli\Exceptions\IOException(
                 $filepath,
                 t('Shaarli could not create the config file. '.
                   'Please make sure Shaarli has the right to write in the folder is it installed in.')
index 82f4a368e669d57316884a1deec581841813214f..e6c3507329dc7e39a162c6fc4ec1103da8fadff2 100644 (file)
@@ -147,6 +147,33 @@ class ConfigManager
         }
     }
 
+    /**
+     * Remove a config element from the config file.
+     *
+     * @param string $setting    Asked setting, keys separated with dots.
+     * @param bool   $write      Write the new setting in the config file, default false.
+     * @param bool   $isLoggedIn User login state, default false.
+     *
+     * @throws \Exception Invalid
+     */
+    public function remove($setting, $write = false, $isLoggedIn = false)
+    {
+        if (empty($setting) || ! is_string($setting)) {
+            throw new \Exception(t('Invalid setting key parameter. String expected, got: '). gettype($setting));
+        }
+
+        // During the ConfigIO transition, map legacy settings to the new ones.
+        if ($this->configIO instanceof ConfigPhp && isset(ConfigPhp::$LEGACY_KEYS_MAPPING[$setting])) {
+            $setting = ConfigPhp::$LEGACY_KEYS_MAPPING[$setting];
+        }
+
+        $settings = explode('.', $setting);
+        self::removeConfig($settings, $this->loadedConfig);
+        if ($write) {
+            $this->write($isLoggedIn);
+        }
+    }
+
     /**
      * Check if a settings exists.
      *
@@ -180,7 +207,7 @@ class ConfigManager
      *
      * @throws MissingFieldConfigException: a mandatory field has not been provided in $conf.
      * @throws UnauthorizedConfigException: user is not authorize to change configuration.
-     * @throws \IOException: an error occurred while writing the new config file.
+     * @throws \Shaarli\Exceptions\IOException: an error occurred while writing the new config file.
      */
     public function write($isLoggedIn)
     {
@@ -272,7 +299,7 @@ class ConfigManager
      *
      * @param array $settings Ordered array which contains keys to find.
      * @param mixed $value
-     * @param array $conf   Loaded settings, then sub-array.
+     * @param array $conf     Loaded settings, then sub-array.
      *
      * @return mixed Found setting or NOT_FOUND flag.
      */
@@ -289,6 +316,27 @@ class ConfigManager
         $conf[$setting] = $value;
     }
 
+    /**
+     * Recursive function which find asked setting in the loaded config and deletes it.
+     *
+     * @param array $settings Ordered array which contains keys to find.
+     * @param array $conf     Loaded settings, then sub-array.
+     *
+     * @return mixed Found setting or NOT_FOUND flag.
+     */
+    protected static function removeConfig($settings, &$conf)
+    {
+        if (!is_array($settings) || count($settings) == 0) {
+            return self::$NOT_FOUND;
+        }
+
+        $setting = array_shift($settings);
+        if (count($settings) > 0) {
+            return self::removeConfig($settings, $conf[$setting]);
+        }
+        unset($conf[$setting]);
+    }
+
     /**
      * Set a bunch of default values allowing Shaarli to start without a config file.
      */
@@ -333,12 +381,12 @@ class ConfigManager
         // default state of the 'remember me' checkbox of the login form
         $this->setEmpty('privacy.remember_user_default', true);
 
-        $this->setEmpty('thumbnail.enable_thumbnails', true);
-        $this->setEmpty('thumbnail.enable_localcache', true);
-
         $this->setEmpty('redirector.url', '');
         $this->setEmpty('redirector.encode_url', true);
 
+        $this->setEmpty('thumbnails.width', '125');
+        $this->setEmpty('thumbnails.height', '90');
+
         $this->setEmpty('translation.language', 'auto');
         $this->setEmpty('translation.mode', 'php');
         $this->setEmpty('translation.extensions', []);
index 8add8bcd776009e1cff804f3b8f47e5417ff4c6f..cad3459462b2f396039ddd8c085794fe555114be 100644 (file)
@@ -27,7 +27,7 @@ class ConfigPhp implements ConfigIO
     /**
      * Map legacy config keys with the new ones.
      * If ConfigPhp is used, getting <newkey> will actually look for <legacykey>.
-     * The Updater will use this array to transform keys when switching to JSON.
+     * The updater will use this array to transform keys when switching to JSON.
      *
      * @var array current key => legacy key.
      */
@@ -104,19 +104,27 @@ class ConfigPhp implements ConfigIO
 
         // Store all $conf['config']
         foreach ($conf['config'] as $key => $value) {
-            $configStr .= '$GLOBALS[\'config\'][\''. $key .'\'] = '.var_export($conf['config'][$key], true).';'. PHP_EOL;
+            $configStr .= '$GLOBALS[\'config\'][\''
+                . $key
+                .'\'] = '
+                .var_export($conf['config'][$key], true).';'
+                . PHP_EOL;
         }
 
         if (isset($conf['plugins'])) {
             foreach ($conf['plugins'] as $key => $value) {
-                $configStr .= '$GLOBALS[\'plugins\'][\''. $key .'\'] = '.var_export($conf['plugins'][$key], true).';'. PHP_EOL;
+                $configStr .= '$GLOBALS[\'plugins\'][\''
+                    . $key
+                    .'\'] = '
+                    .var_export($conf['plugins'][$key], true).';'
+                    . PHP_EOL;
             }
         }
 
         if (!file_put_contents($filepath, $configStr)
             || strcmp(file_get_contents($filepath), $configStr) != 0
         ) {
-            throw new \IOException(
+            throw new \Shaarli\Exceptions\IOException(
                 $filepath,
                 t('Shaarli could not create the config file. '.
                   'Please make sure Shaarli has the right to write in the folder is it installed in.')
index b3d9752bcb4a9ed276dd58026be69d256c1bdf1e..dbb249374a7262053b5e03000d38b746c9772563 100644 (file)
@@ -34,8 +34,7 @@ function save_plugin_config($formData)
         // If there is no order, it means a disabled plugin has been enabled.
         if (isset($formData['order_' . $key])) {
             $plugins[(int) $formData['order_' . $key]] = $key;
-        }
-        else {
+        } else {
             $newEnabledPlugins[] = $key;
         }
     }
index 18e46b77a2291999eb9b3ee8656de4c4cb17efe6..2aa25e5c55be709b4dfeb2c8c1451ef437597a40 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+namespace Shaarli\Exceptions;
+
+use Exception;
 
 /**
  * Exception class thrown when a filesystem access failure happens
@@ -17,6 +20,6 @@ class IOException extends Exception
     {
         $this->path = $path;
         $this->message = empty($message) ? t('Error accessing') : $message;
-        $this->message .= ' "' . $this->path .'"';
+        $this->message .= ' "' . $this->path . '"';
     }
 }
similarity index 93%
rename from application/CachedPage.php
rename to application/feed/CachedPage.php
index e11cc52d01e3aeac07142c476d76e35bf7b88229..d809bdd962ca901c54536309d17068652ff5f3bd 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+
+namespace Shaarli\Feed;
+
 /**
  * Simple cache system, mainly for the RSS/ATOM feeds
  */
@@ -24,7 +27,7 @@ class CachedPage
     {
         // TODO: check write access to the cache directory
         $this->cacheDir = $cacheDir;
-        $this->filename = $this->cacheDir.'/'.sha1($url).'.cache';
+        $this->filename = $this->cacheDir . '/' . sha1($url) . '.cache';
         $this->shouldBeCached = $shouldBeCached;
     }
 
similarity index 84%
rename from application/FeedBuilder.php
rename to application/feed/FeedBuilder.php
index ebae18b41c27ac011ff0cb12f8ad69fc6728d13e..b66f2f918edd494f1d11090892fbcfda7d073e59 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+namespace Shaarli\Feed;
+
+use DateTime;
 
 /**
  * FeedBuilder class.
@@ -28,7 +31,7 @@ class FeedBuilder
     public static $DEFAULT_NB_LINKS = 50;
 
     /**
-     * @var LinkDB instance.
+     * @var \Shaarli\Bookmark\LinkDB instance.
      */
     protected $linkDB;
 
@@ -38,12 +41,12 @@ class FeedBuilder
     protected $feedType;
 
     /**
-     * @var array $_SERVER.
+     * @var array $_SERVER
      */
     protected $serverInfo;
 
     /**
-     * @var array $_GET.
+     * @var array $_GET
      */
     protected $userInput;
 
@@ -75,11 +78,12 @@ class FeedBuilder
     /**
      * Feed constructor.
      *
-     * @param LinkDB  $linkDB        LinkDB instance.
-     * @param string  $feedType      Type of feed.
-     * @param array   $serverInfo    $_SERVER.
-     * @param array   $userInput     $_GET.
-     * @param boolean $isLoggedIn True if the user is currently logged in, false otherwise.
+     * @param \Shaarli\Bookmark\LinkDB $linkDB     LinkDB instance.
+     * @param string                   $feedType   Type of feed.
+     * @param array                    $serverInfo $_SERVER.
+     * @param array                    $userInput  $_GET.
+     * @param boolean                  $isLoggedIn True if the user is currently logged in,
+     *                                             false otherwise.
      */
     public function __construct($linkDB, $feedType, $serverInfo, $userInput, $isLoggedIn)
     {
@@ -124,7 +128,7 @@ class FeedBuilder
         $data['show_dates'] = !$this->hideDates || $this->isLoggedIn;
         // Remove leading slash from REQUEST_URI.
         $data['self_link'] = escape(server_url($this->serverInfo))
-                           . escape($this->serverInfo['REQUEST_URI']);
+            . escape($this->serverInfo['REQUEST_URI']);
         $data['index_url'] = $pageaddr;
         $data['usepermalinks'] = $this->usePermalinks === true;
         $data['links'] = $linkDisplayed;
@@ -142,18 +146,18 @@ class FeedBuilder
      */
     protected function buildItem($link, $pageaddr)
     {
-        $link['guid'] = $pageaddr .'?'. $link['shorturl'];
+        $link['guid'] = $pageaddr . '?' . $link['shorturl'];
         // Check for both signs of a note: starting with ? and 7 chars long.
         if ($link['url'][0] === '?' && strlen($link['url']) === 7) {
             $link['url'] = $pageaddr . $link['url'];
         }
         if ($this->usePermalinks === true) {
-            $permalink = '<a href="'. $link['url'] .'" title="'. t('Direct link') .'">'. t('Direct link') .'</a>';
+            $permalink = '<a href="' . $link['url'] . '" title="' . t('Direct link') . '">' . t('Direct link') . '</a>';
         } else {
-            $permalink = '<a href="'. $link['guid'] .'" title="'. t('Permalink') .'">'. t('Permalink') .'</a>';
+            $permalink = '<a href="' . $link['guid'] . '" title="' . t('Permalink') . '">' . t('Permalink') . '</a>';
         }
-        $link['description']  = format_description($link['description'], '', false, $pageaddr);
-        $link['description'] .= PHP_EOL .'<br>&#8212; '. $permalink;
+        $link['description'] = format_description($link['description'], '', false, $pageaddr);
+        $link['description'] .= PHP_EOL . '<br>&#8212; ' . $permalink;
 
         $pubDate = $link['created'];
         $link['pub_iso_date'] = $this->getIsoDate($pubDate);
@@ -163,7 +167,7 @@ class FeedBuilder
             $upDate = $link['updated'];
             $link['up_iso_date'] = $this->getIsoDate($upDate, DateTime::ATOM);
         } else {
-            $link['up_iso_date'] = $this->getIsoDate($pubDate, DateTime::ATOM);;
+            $link['up_iso_date'] = $this->getIsoDate($pubDate, DateTime::ATOM);
         }
 
         // Save the more recent item.
@@ -222,11 +226,11 @@ class FeedBuilder
     public function getTypeLanguage()
     {
         // Use the locale do define the language, if available.
-        if (! empty($this->locale) && preg_match('/^\w{2}[_\-]\w{2}/', $this->locale)) {
-            $length = ($this->feedType == self::$FEED_RSS) ? 5 : 2;
+        if (!empty($this->locale) && preg_match('/^\w{2}[_\-]\w{2}/', $this->locale)) {
+            $length = ($this->feedType === self::$FEED_RSS) ? 5 : 2;
             return str_replace('_', '-', substr($this->locale, 0, $length));
         }
-        return ($this->feedType == self::$FEED_RSS) ? 'en-en' : 'en';
+        return ($this->feedType === self::$FEED_RSS) ? 'en-en' : 'en';
     }
 
     /**
@@ -261,7 +265,6 @@ class FeedBuilder
         }
         if ($this->feedType == self::$FEED_RSS) {
             return $date->format(DateTime::RSS);
-
         }
         return $date->format(DateTime::ATOM);
     }
@@ -287,7 +290,7 @@ class FeedBuilder
         }
 
         $intNb = intval($this->userInput['nb']);
-        if (! is_int($intNb) || $intNb == 0) {
+        if (!is_int($intNb) || $intNb == 0) {
             return self::$DEFAULT_NB_LINKS;
         }
 
similarity index 83%
rename from application/Base64Url.php
rename to application/http/Base64Url.php
index 61590e43769f5830fd7111c121147f73ad853a96..33fa7c1f8c8f3be693a4cbed58bf293be8277ae1 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 
-namespace Shaarli;
-
+namespace Shaarli\Http;
 
 /**
  * URL-safe Base64 operations
@@ -17,7 +16,8 @@ class Base64Url
      *
      * @return string Base64Url-encoded data
      */
-    public static function encode($data) {
+    public static function encode($data)
+    {
         return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
     }
 
@@ -28,7 +28,8 @@ class Base64Url
      *
      * @return string Decoded data
      */
-    public static function decode($data) {
+    public static function decode($data)
+    {
         return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
     }
 }
similarity index 94%
rename from application/HttpUtils.php
rename to application/http/HttpUtils.php
index e9282506188f4d19969e9a49ac27664171c79938..2ea9195d3550bfd4bfd912ef35cb4b669a5c83c2 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+
+use Shaarli\Http\Url;
+
 /**
  * GET an HTTP URL to retrieve its content
  * Uses the cURL library or a fallback method
@@ -7,7 +10,8 @@
  * @param int             $timeout           network timeout (in seconds)
  * @param int             $maxBytes          maximum downloaded bytes (default: 4 MiB)
  * @param callable|string $curlWriteFunction Optional callback called during the download (cURL CURLOPT_WRITEFUNCTION).
- *                                           Can be used to add download conditions on the headers (response code, content type, etc.).
+ *                                           Can be used to add download conditions on the
+ *                                           headers (response code, content type, etc.).
  *
  * @return array HTTP response headers, downloaded content
  *
@@ -37,7 +41,7 @@ function get_http_response($url, $timeout = 30, $maxBytes = 4194304, $curlWriteF
     $cleanUrl = $urlObj->idnToAscii();
 
     if (!filter_var($cleanUrl, FILTER_VALIDATE_URL) || !$urlObj->isHttp()) {
-        return array(array(0 => 'Invalid HTTP Url'), false);
+        return array(array(0 => 'Invalid HTTP UrlUtils'), false);
     }
 
     $userAgent =
@@ -64,29 +68,30 @@ function get_http_response($url, $timeout = 30, $maxBytes = 4194304, $curlWriteF
     }
 
     // General cURL settings
-    curl_setopt($ch, CURLOPT_AUTOREFERER,       true);
-    curl_setopt($ch, CURLOPT_FOLLOWLOCATION,    true);
-    curl_setopt($ch, CURLOPT_HEADER,            true);
+    curl_setopt($ch, CURLOPT_AUTOREFERER, true);
+    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+    curl_setopt($ch, CURLOPT_HEADER, true);
     curl_setopt(
         $ch,
         CURLOPT_HTTPHEADER,
         array('Accept-Language: ' . $acceptLanguage)
     );
-    curl_setopt($ch, CURLOPT_MAXREDIRS,         $maxRedirs);
-    curl_setopt($ch, CURLOPT_RETURNTRANSFER,    true);
-    curl_setopt($ch, CURLOPT_TIMEOUT,           $timeout);
-    curl_setopt($ch, CURLOPT_USERAGENT,         $userAgent);
+    curl_setopt($ch, CURLOPT_MAXREDIRS, $maxRedirs);
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+    curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
+    curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
 
     if (is_callable($curlWriteFunction)) {
         curl_setopt($ch, CURLOPT_WRITEFUNCTION, $curlWriteFunction);
     }
 
     // Max download size management
-    curl_setopt($ch, CURLOPT_BUFFERSIZE,        1024*16);
-    curl_setopt($ch, CURLOPT_NOPROGRESS,        false);
-    curl_setopt($ch, CURLOPT_PROGRESSFUNCTION,
-        function($arg0, $arg1, $arg2, $arg3, $arg4 = 0) use ($maxBytes)
-        {
+    curl_setopt($ch, CURLOPT_BUFFERSIZE, 1024*16);
+    curl_setopt($ch, CURLOPT_NOPROGRESS, false);
+    curl_setopt(
+        $ch,
+        CURLOPT_PROGRESSFUNCTION,
+        function ($arg0, $arg1, $arg2, $arg3, $arg4 = 0) use ($maxBytes) {
             if (version_compare(phpversion(), '5.5', '<')) {
                 // PHP version lower than 5.5
                 // Callback has 4 arguments
@@ -232,7 +237,6 @@ function get_redirected_headers($url, $redirectionLimit = 3)
         && !empty($headers)
         && (strpos($headers[0], '301') !== false || strpos($headers[0], '302') !== false)
         && !empty($headers['Location'])) {
-
         $redirection = is_array($headers['Location']) ? end($headers['Location']) : $headers['Location'];
         if ($redirection != $url) {
             $redirection = getAbsoluteUrl($url, $redirection);
similarity index 62%
rename from application/Url.php
rename to application/http/Url.php
index 6b9870f0c1bb468ebafd67e2d71123411f598a0c..90444a2f4beaf0ad15df3be06ff36d4431d61811 100644 (file)
@@ -1,91 +1,6 @@
 <?php
-/**
- * Converts an array-represented URL to a string
- *
- * Source: http://php.net/manual/en/function.parse-url.php#106731
- *
- * @see http://php.net/manual/en/function.parse-url.php
- *
- * @param array $parsedUrl an array-represented URL
- *
- * @return string the string representation of the URL
- */
-function unparse_url($parsedUrl)
-{
-    $scheme   = isset($parsedUrl['scheme']) ? $parsedUrl['scheme'].'://' : '';
-    $host     = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
-    $port     = isset($parsedUrl['port']) ? ':'.$parsedUrl['port'] : '';
-    $user     = isset($parsedUrl['user']) ? $parsedUrl['user'] : '';
-    $pass     = isset($parsedUrl['pass']) ? ':'.$parsedUrl['pass']  : '';
-    $pass     = ($user || $pass) ? "$pass@" : '';
-    $path     = isset($parsedUrl['path']) ? $parsedUrl['path'] : '';
-    $query    = isset($parsedUrl['query']) ? '?'.$parsedUrl['query'] : '';
-    $fragment = isset($parsedUrl['fragment']) ? '#'.$parsedUrl['fragment'] : '';
-
-    return "$scheme$user$pass$host$port$path$query$fragment";
-}
-
-/**
- * Removes undesired query parameters and fragments
- *
- * @param string url Url to be cleaned
- *
- * @return string the string representation of this URL after cleanup
- */
-function cleanup_url($url)
-{
-  $obj_url = new Url($url);
-  return $obj_url->cleanup();
-}
 
-/**
- * Get URL scheme.
- *
- * @param string url Url for which the scheme is requested
- *
- * @return mixed the URL scheme or false if none is provided.
- */
-function get_url_scheme($url)
-{
-  $obj_url = new Url($url);
-  return $obj_url->getScheme();
-}
-
-/**
- * Adds a trailing slash at the end of URL if necessary.
- *
- * @param string $url URL to check/edit.
- *
- * @return string $url URL with a end trailing slash.
- */
-function add_trailing_slash($url)
-{
-    return $url . (!endsWith($url, '/') ? '/' : '');
-}
-
-/**
- * Replace not whitelisted protocols by 'http://' from given URL.
- *
- * @param string $url       URL to clean
- * @param array  $protocols List of allowed protocols (aside from http(s)).
- *
- * @return string URL with allowed protocol
- */
-function whitelist_protocols($url, $protocols)
-{
-    if (startsWith($url, '?') || startsWith($url, '/')) {
-        return $url;
-    }
-    $protocols = array_merge(['http', 'https'], $protocols);
-    $protocol = preg_match('#^(\w+):/?/?#', $url, $match);
-    // Protocol not allowed: we remove it and replace it with http
-    if ($protocol === 1 && ! in_array($match[1], $protocols)) {
-        $url = str_replace($match[0], 'http://', $url);
-    } elseif ($protocol !== 1) {
-        $url = 'http://' . $url;
-    }
-    return $url;
-}
+namespace Shaarli\Http;
 
 /**
  * URL representation and cleanup utilities
@@ -182,7 +97,7 @@ class Url
         }
         return $input;
     }
-    
+
     /**
      * Returns a string representation of this URL
      */
@@ -196,7 +111,7 @@ class Url
      */
     protected function cleanupQuery()
     {
-        if (! isset($this->parts['query'])) {
+        if (!isset($this->parts['query'])) {
             return;
         }
 
@@ -217,14 +132,14 @@ class Url
         }
 
         $this->parts['query'] = implode('&', $queryParams);
-    }    
+    }
 
     /**
      * Removes undesired fragments
      */
     protected function cleanupFragment()
     {
-        if (! isset($this->parts['fragment'])) {
+        if (!isset($this->parts['fragment'])) {
             return;
         }
 
@@ -257,7 +172,7 @@ class Url
     public function idnToAscii()
     {
         $out = $this->cleanup();
-        if (! function_exists('idn_to_ascii') || ! isset($this->parts['host'])) {
+        if (!function_exists('idn_to_ascii') || !isset($this->parts['host'])) {
             return $out;
         }
         $asciiHost = idn_to_ascii($this->parts['host'], 0, INTL_IDNA_VARIANT_UTS46);
@@ -269,7 +184,8 @@ class Url
      *
      * @return string the URL scheme or false if none is provided.
      */
-    public function getScheme() {
+    public function getScheme()
+    {
         if (!isset($this->parts['scheme'])) {
             return false;
         }
@@ -281,7 +197,8 @@ class Url
      *
      * @return string the URL host or false if none is provided.
      */
-    public function getHost() {
+    public function getHost()
+    {
         if (empty($this->parts['host'])) {
             return false;
         }
@@ -289,11 +206,12 @@ class Url
     }
 
     /**
-     * Test if the Url is an HTTP one.
+     * Test if the UrlUtils is an HTTP one.
      *
      * @return true is HTTP, false otherwise.
      */
-    public function isHttp() {
+    public function isHttp()
+    {
         return strpos(strtolower($this->parts['scheme']), 'http') !== false;
     }
 }
diff --git a/application/http/UrlUtils.php b/application/http/UrlUtils.php
new file mode 100644 (file)
index 0000000..4bc84b8
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Converts an array-represented URL to a string
+ *
+ * Source: http://php.net/manual/en/function.parse-url.php#106731
+ *
+ * @see http://php.net/manual/en/function.parse-url.php
+ *
+ * @param array $parsedUrl an array-represented URL
+ *
+ * @return string the string representation of the URL
+ */
+function unparse_url($parsedUrl)
+{
+    $scheme   = isset($parsedUrl['scheme']) ? $parsedUrl['scheme'].'://' : '';
+    $host     = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
+    $port     = isset($parsedUrl['port']) ? ':'.$parsedUrl['port'] : '';
+    $user     = isset($parsedUrl['user']) ? $parsedUrl['user'] : '';
+    $pass     = isset($parsedUrl['pass']) ? ':'.$parsedUrl['pass']  : '';
+    $pass     = ($user || $pass) ? "$pass@" : '';
+    $path     = isset($parsedUrl['path']) ? $parsedUrl['path'] : '';
+    $query    = isset($parsedUrl['query']) ? '?'.$parsedUrl['query'] : '';
+    $fragment = isset($parsedUrl['fragment']) ? '#'.$parsedUrl['fragment'] : '';
+
+    return "$scheme$user$pass$host$port$path$query$fragment";
+}
+
+/**
+ * Removes undesired query parameters and fragments
+ *
+ * @param string url UrlUtils to be cleaned
+ *
+ * @return string the string representation of this URL after cleanup
+ */
+function cleanup_url($url)
+{
+    $obj_url = new \Shaarli\Http\Url($url);
+    return $obj_url->cleanup();
+}
+
+/**
+ * Get URL scheme.
+ *
+ * @param string url UrlUtils for which the scheme is requested
+ *
+ * @return mixed the URL scheme or false if none is provided.
+ */
+function get_url_scheme($url)
+{
+    $obj_url = new \Shaarli\Http\Url($url);
+    return $obj_url->getScheme();
+}
+
+/**
+ * Adds a trailing slash at the end of URL if necessary.
+ *
+ * @param string $url URL to check/edit.
+ *
+ * @return string $url URL with a end trailing slash.
+ */
+function add_trailing_slash($url)
+{
+    return $url . (!endsWith($url, '/') ? '/' : '');
+}
+
+/**
+ * Replace not whitelisted protocols by 'http://' from given URL.
+ *
+ * @param string $url       URL to clean
+ * @param array  $protocols List of allowed protocols (aside from http(s)).
+ *
+ * @return string URL with allowed protocol
+ */
+function whitelist_protocols($url, $protocols)
+{
+    if (startsWith($url, '?') || startsWith($url, '/')) {
+        return $url;
+    }
+    $protocols = array_merge(['http', 'https'], $protocols);
+    $protocol = preg_match('#^(\w+):/?/?#', $url, $match);
+    // Protocol not allowed: we remove it and replace it with http
+    if ($protocol === 1 && ! in_array($match[1], $protocols)) {
+        $url = str_replace($match[0], 'http://', $url);
+    } elseif ($protocol !== 1) {
+        $url = 'http://' . $url;
+    }
+    return $url;
+}
similarity index 87%
rename from application/NetscapeBookmarkUtils.php
rename to application/netscape/NetscapeBookmarkUtils.php
index b4d16d00bb991e2e9b031a2bb9f5c1d352030176..2fb1a4a6943674c557188e28bb5df206867f3857 100644 (file)
@@ -1,9 +1,16 @@
 <?php
 
+namespace Shaarli\Netscape;
+
+use DateTime;
+use DateTimeZone;
+use Exception;
+use Katzgrau\KLogger\Logger;
 use Psr\Log\LogLevel;
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigManager;
+use Shaarli\History;
 use Shaarli\NetscapeBookmarkParser\NetscapeBookmarkParser;
-use Katzgrau\KLogger\Logger;
 
 /**
  * Utilities to import and export bookmarks using the Netscape format
@@ -31,8 +38,8 @@ class NetscapeBookmarkUtils
     public static function filterAndFormat($linkDb, $selection, $prependNoteUrl, $indexUrl)
     {
         // see tpl/export.html for possible values
-        if (! in_array($selection, array('all', 'public', 'private'))) {
-            throw new Exception(t('Invalid export selection:') .' "'.$selection.'"');
+        if (!in_array($selection, array('all', 'public', 'private'))) {
+            throw new Exception(t('Invalid export selection:') . ' "' . $selection . '"');
         }
 
         $bookmarkLinks = array();
@@ -72,18 +79,20 @@ class NetscapeBookmarkUtils
     private static function importStatus(
         $filename,
         $filesize,
-        $importCount=0,
-        $overwriteCount=0,
-        $skipCount=0,
-        $duration=0
-    )
-    {
+        $importCount = 0,
+        $overwriteCount = 0,
+        $skipCount = 0,
+        $duration = 0
+    ) {
         $status = sprintf(t('File %s (%d bytes) '), $filename, $filesize);
         if ($importCount == 0 && $overwriteCount == 0 && $skipCount == 0) {
             $status .= t('has an unknown file format. Nothing was imported.');
         } else {
             $status .= vsprintf(
-                t('was successfully processed in %d seconds: %d links imported, %d links overwritten, %d links skipped.'),
+                t(
+                    'was successfully processed in %d seconds: '
+                    . '%d links imported, %d links overwritten, %d links skipped.'
+                ),
                 [$duration, $importCount, $overwriteCount, $skipCount]
             );
         }
@@ -93,11 +102,11 @@ class NetscapeBookmarkUtils
     /**
      * Imports Web bookmarks from an uploaded Netscape bookmark dump
      *
-     * @param array         $post      Server $_POST parameters
-     * @param array         $files     Server $_FILES parameters
-     * @param LinkDB        $linkDb    Loaded LinkDB instance
-     * @param ConfigManager $conf      instance
-     * @param History       $history   History instance
+     * @param array         $post    Server $_POST parameters
+     * @param array         $files   Server $_FILES parameters
+     * @param LinkDB        $linkDb  Loaded LinkDB instance
+     * @param ConfigManager $conf    instance
+     * @param History       $history History instance
      *
      * @return string Summary of the bookmark import status
      */
@@ -113,7 +122,7 @@ class NetscapeBookmarkUtils
         }
 
         // Overwrite existing links?
-        $overwrite = ! empty($post['overwrite']);
+        $overwrite = !empty($post['overwrite']);
 
         // Add tags to all imported links?
         if (empty($post['default_tags'])) {
@@ -136,7 +145,7 @@ class NetscapeBookmarkUtils
         );
         $logger = new Logger(
             $conf->get('resource.data_dir'),
-            ! $conf->get('dev.debug') ? LogLevel::INFO : LogLevel::DEBUG,
+            !$conf->get('dev.debug') ? LogLevel::INFO : LogLevel::DEBUG,
             [
                 'prefix' => 'import.',
                 'extension' => 'log',
@@ -191,7 +200,7 @@ class NetscapeBookmarkUtils
             }
 
             // Add a new link - @ used for UNIX timestamps
-            $newLinkDate = new DateTime('@'.strval($bkm['time']));
+            $newLinkDate = new DateTime('@' . strval($bkm['time']));
             $newLinkDate->setTimezone(new DateTimeZone(date_default_timezone_get()));
             $newLink['created'] = $newLinkDate;
             $newLink['id'] = $linkDb->getNextId();
similarity index 86%
rename from application/PluginManager.php
rename to application/plugin/PluginManager.php
index cf6038453e499e7e4030b68b1fffd13bfadbb79b..f7b24a8e88c979031873ee1a8a59fe88503c4bf5 100644 (file)
@@ -1,4 +1,8 @@
 <?php
+namespace Shaarli\Plugin;
+
+use Shaarli\Config\ConfigManager;
+use Shaarli\Plugin\Exception\PluginFileNotFoundException;
 
 /**
  * Class PluginManager
@@ -9,12 +13,14 @@ class PluginManager
 {
     /**
      * List of authorized plugins from configuration file.
+     *
      * @var array $authorizedPlugins
      */
     private $authorizedPlugins;
 
     /**
      * List of loaded plugins.
+     *
      * @var array $loadedPlugins
      */
     private $loadedPlugins = array();
@@ -31,12 +37,14 @@ class PluginManager
 
     /**
      * Plugins subdirectory.
+     *
      * @var string $PLUGINS_PATH
      */
     public static $PLUGINS_PATH = 'plugins';
 
     /**
      * Plugins meta files extension.
+     *
      * @var string $META_EXT
      */
     public static $META_EXT = 'meta';
@@ -75,8 +83,7 @@ class PluginManager
 
             try {
                 $this->loadPlugin($dirs[$index], $plugin);
-            }
-            catch (PluginFileNotFoundException $e) {
+            } catch (PluginFileNotFoundException $e) {
                 error_log($e->getMessage());
             }
         }
@@ -85,9 +92,9 @@ class PluginManager
     /**
      * Execute all plugins registered hook.
      *
-     * @param string        $hook   name of the hook to trigger.
-     * @param array         $data   list of data to manipulate passed by reference.
-     * @param array         $params additional parameters such as page target.
+     * @param string $hook   name of the hook to trigger.
+     * @param array  $data   list of data to manipulate passed by reference.
+     * @param array  $params additional parameters such as page target.
      *
      * @return void
      */
@@ -119,7 +126,7 @@ class PluginManager
      * @param string $pluginName plugin's name.
      *
      * @return void
-     * @throws PluginFileNotFoundException - plugin files not found.
+     * @throws \Shaarli\Plugin\Exception\PluginFileNotFoundException - plugin files not found.
      */
     private function loadPlugin($dir, $pluginName)
     {
@@ -205,8 +212,8 @@ class PluginManager
 
                 $metaData[$plugin]['parameters'][$param]['value'] = '';
                 // Optional parameter description in parameter.PARAM_NAME=
-                if (isset($metaData[$plugin]['parameter.'. $param])) {
-                    $metaData[$plugin]['parameters'][$param]['desc'] = t($metaData[$plugin]['parameter.'. $param]);
+                if (isset($metaData[$plugin]['parameter.' . $param])) {
+                    $metaData[$plugin]['parameters'][$param]['desc'] = t($metaData[$plugin]['parameter.' . $param]);
                 }
             }
         }
@@ -224,22 +231,3 @@ class PluginManager
         return $this->errors;
     }
 }
-
-/**
- * Class PluginFileNotFoundException
- *
- * Raise when plugin files can't be found.
- */
-class PluginFileNotFoundException extends Exception
-{
-    /**
-     * Construct exception with plugin name.
-     * Generate message.
-     *
-     * @param string $pluginName name of the plugin not found
-     */
-    public function __construct($pluginName)
-    {
-        $this->message = sprintf(t('Plugin "%s" files not found.'), $pluginName);
-    }
-}
diff --git a/application/plugin/exception/PluginFileNotFoundException.php b/application/plugin/exception/PluginFileNotFoundException.php
new file mode 100644 (file)
index 0000000..e5386f0
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+namespace Shaarli\Plugin\Exception;
+
+use Exception;
+
+/**
+ * Class PluginFileNotFoundException
+ *
+ * Raise when plugin files can't be found.
+ */
+class PluginFileNotFoundException extends Exception
+{
+    /**
+     * Construct exception with plugin name.
+     * Generate message.
+     *
+     * @param string $pluginName name of the plugin not found
+     */
+    public function __construct($pluginName)
+    {
+        $this->message = sprintf(t('Plugin "%s" files not found.'), $pluginName);
+    }
+}
similarity index 75%
rename from application/PageBuilder.php
rename to application/render/PageBuilder.php
index a4483870497961a210f82fa619f730f207c7d601..0569b67f93e4ded88780e1d52ee2c22a4e2054e1 100644 (file)
@@ -1,6 +1,13 @@
 <?php
 
+namespace Shaarli\Render;
+
+use Exception;
+use RainTPL;
+use Shaarli\ApplicationUtils;
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigManager;
+use Shaarli\Thumbnailer;
 
 /**
  * This class is in charge of building the final page.
@@ -21,26 +28,41 @@ class PageBuilder
      */
     protected $conf;
 
+    /**
+     * @var array $_SESSION
+     */
+    protected $session;
+
     /**
      * @var LinkDB $linkDB instance.
      */
     protected $linkDB;
-    
-    /** @var bool $isLoggedIn Whether the user is logged in **/
+
+    /**
+     * @var null|string XSRF token
+     */
+    protected $token;
+
+    /**
+     * @var bool $isLoggedIn Whether the user is logged in
+     */
     protected $isLoggedIn = false;
 
     /**
      * PageBuilder constructor.
      * $tpl is initialized at false for lazy loading.
      *
-     * @param ConfigManager $conf   Configuration Manager instance (reference).
-     * @param LinkDB        $linkDB instance.
-     * @param string        $token  Session token
+     * @param ConfigManager $conf       Configuration Manager instance (reference).
+     * @param array         $session    $_SESSION array
+     * @param LinkDB        $linkDB     instance.
+     * @param string        $token      Session token
+     * @param bool          $isLoggedIn
      */
-    public function __construct(&$conf, $linkDB = null, $token = null, $isLoggedIn = false)
+    public function __construct(&$conf, $session, $linkDB = null, $token = null, $isLoggedIn = false)
     {
         $this->tpl = false;
         $this->conf = $conf;
+        $this->session = $session;
         $this->linkDB = $linkDB;
         $this->token = $token;
         $this->isLoggedIn = $isLoggedIn;
@@ -64,7 +86,6 @@ class PageBuilder
             );
             $this->tpl->assign('newVersion', escape($version));
             $this->tpl->assign('versionError', '');
-
         } catch (Exception $exc) {
             logm($this->conf->get('resource.log'), $_SERVER['REMOTE_ADDR'], $exc->getMessage());
             $this->tpl->assign('newVersion', '');
@@ -87,8 +108,8 @@ class PageBuilder
             'version_hash',
             ApplicationUtils::getVersionHash(SHAARLI_VERSION, $this->conf->get('credentials.salt'))
         );
-        $this->tpl->assign('scripturl', index_url($_SERVER));
-        $visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '';
+        $this->tpl->assign('index_url', index_url($_SERVER));
+        $visibility = !empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '';
         $this->tpl->assign('visibility', $visibility);
         $this->tpl->assign('untaggedonly', !empty($_SESSION['untaggedonly']));
         $this->tpl->assign('pagetitle', $this->conf->get('general.title', 'Shaarli'));
@@ -105,6 +126,19 @@ class PageBuilder
         if ($this->linkDB !== null) {
             $this->tpl->assign('tags', $this->linkDB->linksCountPerTag());
         }
+
+        $this->tpl->assign(
+            'thumbnails_enabled',
+            $this->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE
+        );
+        $this->tpl->assign('thumbnails_width', $this->conf->get('thumbnails.width'));
+        $this->tpl->assign('thumbnails_height', $this->conf->get('thumbnails.height'));
+
+        if (!empty($_SESSION['warnings'])) {
+            $this->tpl->assign('global_warnings', $_SESSION['warnings']);
+            unset($_SESSION['warnings']);
+        }
+
         // To be removed with a proper theme configuration.
         $this->tpl->assign('conf', $this->conf);
     }
@@ -136,7 +170,7 @@ class PageBuilder
             $this->initialize();
         }
 
-        if (empty($data) || !is_array($data)){
+        if (empty($data) || !is_array($data)) {
             return false;
         }
 
@@ -163,16 +197,16 @@ class PageBuilder
 
     /**
      * Render a 404 page (uses the template : tpl/404.tpl)
-     * usage : $PAGE->render404('The link was deleted')
+     * usage: $PAGE->render404('The link was deleted')
      *
-     * @param string $message A messate to display what is not found
+     * @param string $message A message to display what is not found
      */
     public function render404($message = '')
     {
         if (empty($message)) {
             $message = t('The page you are trying to reach does not exist or has been deleted.');
         }
-        header($_SERVER['SERVER_PROTOCOL'] .' '. t('404 Not Found'));
+        header($_SERVER['SERVER_PROTOCOL'] . ' ' . t('404 Not Found'));
         $this->tpl->assign('error_message', $message);
         $this->renderPage('404');
     }
similarity index 96%
rename from application/ThemeUtils.php
rename to application/render/ThemeUtils.php
index 16f2f6a2742c701f79d671bcf4d89359584fc4d9..86096c64476bf655626633efb692b0a9b352eacc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-namespace Shaarli;
+namespace Shaarli\Render;
 
 /**
  * Class ThemeUtils
index 5a58926dd16b441fa4b36db5e2c87d790c8ed07d..1ff3d0be84ad89bbdd9bec265569b53d3eef43cc 100644 (file)
@@ -98,7 +98,6 @@ class LoginManager
             // The user client has a valid stay-signed-in cookie
             // Session information is updated with the current client information
             $this->sessionManager->storeLoginInfo($clientIpId);
-
         } elseif ($this->sessionManager->hasSessionExpired()
             || $this->sessionManager->hasClientIpChanged($clientIpId)
         ) {
similarity index 81%
rename from application/Updater.php
rename to application/updater/Updater.php
index dece2c020d297fdf13bf8773b76cb37895328025..f12e351673640ddff963981d1232543a4f17979a 100644 (file)
@@ -1,10 +1,24 @@
 <?php
+
+namespace Shaarli\Updater;
+
+use Exception;
+use RainTPL;
+use ReflectionClass;
+use ReflectionException;
+use ReflectionMethod;
+use Shaarli\ApplicationUtils;
+use Shaarli\Bookmark\LinkDB;
+use Shaarli\Bookmark\LinkFilter;
 use Shaarli\Config\ConfigJson;
-use Shaarli\Config\ConfigPhp;
 use Shaarli\Config\ConfigManager;
+use Shaarli\Config\ConfigPhp;
+use Shaarli\Exceptions\IOException;
+use Shaarli\Thumbnailer;
+use Shaarli\Updater\Exception\UpdaterException;
 
 /**
- * Class Updater.
+ * Class updater.
  * Used to update stuff when a new Shaarli's version is reached.
  * Update methods are ran only once, and the stored in a JSON file.
  */
@@ -30,6 +44,11 @@ class Updater
      */
     protected $isLoggedIn;
 
+    /**
+     * @var array $_SESSION
+     */
+    protected $session;
+
     /**
      * @var ReflectionMethod[] List of current class methods.
      */
@@ -42,13 +61,17 @@ class Updater
      * @param LinkDB        $linkDB      LinkDB instance.
      * @param ConfigManager $conf        Configuration Manager instance.
      * @param boolean       $isLoggedIn  True if the user is logged in.
+     * @param array         $session     $_SESSION (by reference)
+     *
+     * @throws ReflectionException
      */
-    public function __construct($doneUpdates, $linkDB, $conf, $isLoggedIn)
+    public function __construct($doneUpdates, $linkDB, $conf, $isLoggedIn, &$session = [])
     {
         $this->doneUpdates = $doneUpdates;
         $this->linkDB = $linkDB;
         $this->conf = $conf;
         $this->isLoggedIn = $isLoggedIn;
+        $this->session = &$session;
 
         // Retrieve all update methods.
         $class = new ReflectionClass($this);
@@ -73,12 +96,12 @@ class Updater
         }
 
         if ($this->methods === null) {
-            throw new UpdaterException(t('Couldn\'t retrieve Updater class methods.'));
+            throw new UpdaterException(t('Couldn\'t retrieve updater class methods.'));
         }
 
         foreach ($this->methods as $method) {
             // Not an update method or already done, pass.
-            if (! startsWith($method->getName(), 'updateMethod')
+            if (!startsWith($method->getName(), 'updateMethod')
                 || in_array($method->getName(), $this->doneUpdates)
             ) {
                 continue;
@@ -129,7 +152,7 @@ class Updater
                 }
             }
             $this->conf->write($this->isLoggedIn);
-            unlink($this->conf->get('resource.data_dir').'/options.php');
+            unlink($this->conf->get('resource.data_dir') . '/options.php');
         }
 
         return true;
@@ -164,16 +187,16 @@ class Updater
         $subConfig = array('config', 'plugins');
         foreach ($subConfig as $sub) {
             foreach ($oldConfig[$sub] as $key => $value) {
-                if (isset($legacyMap[$sub .'.'. $key])) {
-                    $configKey = $legacyMap[$sub .'.'. $key];
+                if (isset($legacyMap[$sub . '.' . $key])) {
+                    $configKey = $legacyMap[$sub . '.' . $key];
                 } else {
-                    $configKey = $sub .'.'. $key;
+                    $configKey = $sub . '.' . $key;
                 }
                 $this->conf->set($configKey, $value);
             }
         }
 
-        try{
+        try {
             $this->conf->write($this->isLoggedIn);
             return true;
         } catch (IOException $e) {
@@ -223,7 +246,7 @@ class Updater
             return true;
         }
 
-        $save = $this->conf->get('resource.data_dir') .'/datastore.'. date('YmdHis') .'.php';
+        $save = $this->conf->get('resource.data_dir') . '/datastore.' . date('YmdHis') . '.php';
         copy($this->conf->get('resource.datastore'), $save);
 
         $links = array();
@@ -297,7 +320,7 @@ class Updater
         // We run the update only if this folder still contains the template files.
         $tplDir = $this->conf->get('resource.raintpl_tpl');
         $tplFile = $tplDir . '/linklist.html';
-        if (! file_exists($tplFile)) {
+        if (!file_exists($tplFile)) {
             return true;
         }
 
@@ -321,7 +344,7 @@ class Updater
      */
     public function updateMethodMoveUserCss()
     {
-        if (! is_file('inc/user.css')) {
+        if (!is_file('inc/user.css')) {
             return true;
         }
 
@@ -357,11 +380,11 @@ class Updater
      */
     public function updateMethodPiwikUrl()
     {
-        if (! $this->conf->exists('plugins.PIWIK_URL') || startsWith($this->conf->get('plugins.PIWIK_URL'), 'http')) {
+        if (!$this->conf->exists('plugins.PIWIK_URL') || startsWith($this->conf->get('plugins.PIWIK_URL'), 'http')) {
             return true;
         }
 
-        $this->conf->set('plugins.PIWIK_URL', 'http://'. $this->conf->get('plugins.PIWIK_URL'));
+        $this->conf->set('plugins.PIWIK_URL', 'http://' . $this->conf->get('plugins.PIWIK_URL'));
         $this->conf->write($this->isLoggedIn);
 
         return true;
@@ -471,109 +494,60 @@ class Updater
             return true;
         }
 
-        if (! $this->conf->exists('general.download_max_size')) {
-            $this->conf->set('general.download_max_size', 1024*1024*4);
+        if (!$this->conf->exists('general.download_max_size')) {
+            $this->conf->set('general.download_max_size', 1024 * 1024 * 4);
         }
 
-        if (! $this->conf->exists('general.download_timeout')) {
+        if (!$this->conf->exists('general.download_timeout')) {
             $this->conf->set('general.download_timeout', 30);
         }
 
         $this->conf->write($this->isLoggedIn);
-
         return true;
     }
-}
-
-/**
- * Class UpdaterException.
- */
-class UpdaterException extends Exception
-{
-    /**
-     * @var string Method where the error occurred.
-     */
-    protected $method;
-
-    /**
-     * @var Exception The parent exception.
-     */
-    protected $previous;
-
-    /**
-     * Constructor.
-     *
-     * @param string         $message  Force the error message if set.
-     * @param string         $method   Method where the error occurred.
-     * @param Exception|bool $previous Parent exception.
-     */
-    public function __construct($message = '', $method = '', $previous = false)
-    {
-        $this->method = $method;
-        $this->previous = $previous;
-        $this->message = $this->buildMessage($message);
-    }
 
     /**
-     * Build the exception error message.
-     *
-     * @param string $message Optional given error message.
-     *
-     * @return string The built error message.
+     * * Move thumbnails management to WebThumbnailer, coming with new settings.
      */
-    private function buildMessage($message)
+    public function updateMethodWebThumbnailer()
     {
-        $out = '';
-        if (! empty($message)) {
-            $out .= $message . PHP_EOL;
+        if ($this->conf->exists('thumbnails.mode')) {
+            return true;
         }
 
-        if (! empty($this->method)) {
-            $out .= t('An error occurred while running the update ') . $this->method . PHP_EOL;
-        }
+        $thumbnailsEnabled = extension_loaded('gd') && $this->conf->get('thumbnail.enable_thumbnails', true);
+        $this->conf->set('thumbnails.mode', $thumbnailsEnabled ? Thumbnailer::MODE_ALL : Thumbnailer::MODE_NONE);
+        $this->conf->set('thumbnails.width', 125);
+        $this->conf->set('thumbnails.height', 90);
+        $this->conf->remove('thumbnail');
+        $this->conf->write(true);
 
-        if (! empty($this->previous)) {
-            $out .= '  '. $this->previous->getMessage();
+        if ($thumbnailsEnabled) {
+            $this->session['warnings'][] = t(
+                'You have enabled or changed thumbnails mode. <a href="?do=thumbs_update">Please synchronize them</a>.'
+            );
         }
 
-        return $out;
+        return true;
     }
-}
 
-/**
- * Read the updates file, and return already done updates.
- *
* @param string $updatesFilepath Updates file path.
- *
- * @return array Already done update methods.
- */
-function read_updates_file($updatesFilepath)
-{
-    if (! empty($updatesFilepath) && is_file($updatesFilepath)) {
-        $content = file_get_contents($updatesFilepath);
-        if (! empty($content)) {
-            return explode(';', $content);
+    /**
+     * Set sticky = false on all links
    *
    * @return bool true if the update is successful, false otherwise.
+     */
+    public function updateMethodSetSticky()
+    {
+        foreach ($this->linkDB as $key => $link) {
+            if (isset($link['sticky'])) {
+                return true;
+            }
+            $link['sticky'] = false;
+            $this->linkDB[$key] = $link;
         }
-    }
-    return array();
-}
 
-/**
- * Write updates file.
- *
- * @param string $updatesFilepath Updates file path.
- * @param array  $updates         Updates array to write.
- *
- * @throws Exception Couldn't write version number.
- */
-function write_updates_file($updatesFilepath, $updates)
-{
-    if (empty($updatesFilepath)) {
-        throw new Exception(t('Updates file path is not set, can\'t write updates.'));
-    }
+        $this->linkDB->save($this->conf->get('resource.page_cache'));
 
-    $res = file_put_contents($updatesFilepath, implode(';', $updates));
-    if ($res === false) {
-        throw new Exception(t('Unable to write updates in '. $updatesFilepath . '.'));
+        return true;
     }
 }
diff --git a/application/updater/UpdaterUtils.php b/application/updater/UpdaterUtils.php
new file mode 100644 (file)
index 0000000..34d4f42
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+
+/**
+ * Read the updates file, and return already done updates.
+ *
+ * @param string $updatesFilepath Updates file path.
+ *
+ * @return array Already done update methods.
+ */
+function read_updates_file($updatesFilepath)
+{
+    if (! empty($updatesFilepath) && is_file($updatesFilepath)) {
+        $content = file_get_contents($updatesFilepath);
+        if (! empty($content)) {
+            return explode(';', $content);
+        }
+    }
+    return array();
+}
+
+/**
+ * Write updates file.
+ *
+ * @param string $updatesFilepath Updates file path.
+ * @param array  $updates         Updates array to write.
+ *
+ * @throws Exception Couldn't write version number.
+ */
+function write_updates_file($updatesFilepath, $updates)
+{
+    if (empty($updatesFilepath)) {
+        throw new Exception(t('Updates file path is not set, can\'t write updates.'));
+    }
+
+    $res = file_put_contents($updatesFilepath, implode(';', $updates));
+    if ($res === false) {
+        throw new Exception(t('Unable to write updates in '. $updatesFilepath . '.'));
+    }
+}
diff --git a/application/updater/exception/UpdaterException.php b/application/updater/exception/UpdaterException.php
new file mode 100644 (file)
index 0000000..20acecc
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+
+namespace Shaarli\Updater\Exception;
+
+use Exception;
+
+/**
+ * Class UpdaterException.
+ */
+class UpdaterException extends Exception
+{
+    /**
+     * @var string Method where the error occurred.
+     */
+    protected $method;
+
+    /**
+     * @var Exception The parent exception.
+     */
+    protected $previous;
+
+    /**
+     * Constructor.
+     *
+     * @param string         $message  Force the error message if set.
+     * @param string         $method   Method where the error occurred.
+     * @param Exception|bool $previous Parent exception.
+     */
+    public function __construct($message = '', $method = '', $previous = false)
+    {
+        $this->method = $method;
+        $this->previous = $previous;
+        $this->message = $this->buildMessage($message);
+    }
+
+    /**
+     * Build the exception error message.
+     *
+     * @param string $message Optional given error message.
+     *
+     * @return string The built error message.
+     */
+    private function buildMessage($message)
+    {
+        $out = '';
+        if (!empty($message)) {
+            $out .= $message . PHP_EOL;
+        }
+
+        if (!empty($this->method)) {
+            $out .= t('An error occurred while running the update ') . $this->method . PHP_EOL;
+        }
+
+        if (!empty($this->previous)) {
+            $out .= '  ' . $this->previous->getMessage();
+        }
+
+        return $out;
+    }
+}
diff --git a/assets/common/js/picwall.js b/assets/common/js/picwall.js
deleted file mode 100644 (file)
index 87a93fc..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-import Blazy from 'blazy';
-
-(() => {
-  const picwall = document.getElementById('picwall_container');
-  if (picwall != null) {
-    // Suppress ESLint error because that's how bLazy works
-    /* eslint-disable no-new */
-    new Blazy();
-  }
-})();
diff --git a/assets/common/js/thumbnails-update.js b/assets/common/js/thumbnails-update.js
new file mode 100644 (file)
index 0000000..b66ca3a
--- /dev/null
@@ -0,0 +1,51 @@
+/**
+ * Script used in the thumbnails update page.
+ *
+ * It retrieves the list of link IDs to update, and execute AJAX requests
+ * to update their thumbnails, while updating the progress bar.
+ */
+
+/**
+ * Update the thumbnail of the link with the current i index in ids.
+ * It contains a recursive call to retrieve the thumb of the next link when it succeed.
+ * It also update the progress bar and other visual feedback elements.
+ *
+ * @param {array}  ids      List of LinkID to update
+ * @param {int}    i        Current index in ids
+ * @param {object} elements List of DOM element to avoid retrieving them at each iteration
+ */
+function updateThumb(ids, i, elements) {
+  const xhr = new XMLHttpRequest();
+  xhr.open('POST', '?do=ajax_thumb_update');
+  xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+  xhr.responseType = 'json';
+  xhr.onload = () => {
+    if (xhr.status !== 200) {
+      alert(`An error occurred. Return code: ${xhr.status}`);
+    } else {
+      const { response } = xhr;
+      i += 1;
+      elements.progressBar.style.width = `${(i * 100) / ids.length}%`;
+      elements.current.innerHTML = i;
+      elements.title.innerHTML = response.title;
+      if (response.thumbnail !== false) {
+        elements.thumbnail.innerHTML = `<img src="${response.thumbnail}">`;
+      }
+      if (i < ids.length) {
+        updateThumb(ids, i, elements);
+      }
+    }
+  };
+  xhr.send(`id=${ids[i]}`);
+}
+
+(() => {
+  const ids = document.getElementsByName('ids')[0].value.split(',');
+  const elements = {
+    progressBar: document.querySelector('.progressbar > div'),
+    current: document.querySelector('.progress-current'),
+    thumbnail: document.querySelector('.thumbnail-placeholder'),
+    title: document.querySelector('.thumbnail-link-title'),
+  };
+  updateThumb(ids, 0, elements);
+})();
diff --git a/assets/common/js/thumbnails.js b/assets/common/js/thumbnails.js
new file mode 100644 (file)
index 0000000..c28322b
--- /dev/null
@@ -0,0 +1,7 @@
+import Blazy from 'blazy';
+
+(() => {
+  // Suppress ESLint error because that's how bLazy works
+  /* eslint-disable no-new */
+  new Blazy();
+})();
index 5cf037c2c99a6ad620a86bee4a88447d1c0a6b12..99e03370a763c0bdd8214ce43a18a6eccaab394c 100644 (file)
@@ -98,29 +98,6 @@ function htmlEntities(str) {
   return str.replace(/[\u00A0-\u9999<>&]/gim, i => `&#${i.charCodeAt(0)};`);
 }
 
-function activateFirefoxSocial(node) {
-  const loc = location.href;
-  const baseURL = loc.substring(0, loc.lastIndexOf('/') + 1);
-
-  const data = {
-    name: document.title,
-    description: document.getElementById('translation-delete-link').innerHTML,
-    author: 'Shaarli',
-    version: '1.0.0',
-
-    iconURL: `${baseURL}/images/favicon.ico`,
-    icon32URL: `${baseURL}/images/favicon.ico`,
-    icon64URL: `${baseURL}/images/favicon.ico`,
-
-    shareURL: `${baseURL}?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi`,
-    homepageURL: baseURL,
-  };
-  node.setAttribute('data-service', JSON.stringify(data));
-
-  const activate = new CustomEvent('ActivateSocialFeature');
-  node.dispatchEvent(activate);
-}
-
 /**
  * Add the class 'hidden' to city options not attached to the current selected continent.
  *
@@ -433,16 +410,6 @@ function init(description) {
     });
   });
 
-  /**
-   * Firefox Social
-   */
-  const ffButton = document.getElementById('ff-social-button');
-  if (ffButton != null) {
-    ffButton.addEventListener('click', (event) => {
-      activateFirefoxSocial(event.target);
-    });
-  }
-
   const continent = document.getElementById('continent');
   const city = document.getElementById('city');
   if (continent != null && city != null) {
@@ -455,12 +422,12 @@ function init(description) {
   /**
    * Bulk actions
    */
-  const linkCheckboxes = document.querySelectorAll('.delete-checkbox');
+  const linkCheckboxes = document.querySelectorAll('.link-checkbox');
   const bar = document.getElementById('actions');
   [...linkCheckboxes].forEach((checkbox) => {
     checkbox.style.display = 'inline-block';
-    checkbox.addEventListener('click', () => {
-      const linkCheckedCheckboxes = document.querySelectorAll('.delete-checkbox:checked');
+    checkbox.addEventListener('change', () => {
+      const linkCheckedCheckboxes = document.querySelectorAll('.link-checkbox:checked');
       const count = [...linkCheckedCheckboxes].length;
       if (count === 0 && bar.classList.contains('open')) {
         bar.classList.toggle('open');
@@ -477,7 +444,7 @@ function init(description) {
       event.preventDefault();
 
       const links = [];
-      const linkCheckedCheckboxes = document.querySelectorAll('.delete-checkbox:checked');
+      const linkCheckedCheckboxes = document.querySelectorAll('.link-checkbox:checked');
       [...linkCheckedCheckboxes].forEach((checkbox) => {
         links.push({
           id: checkbox.value,
@@ -499,6 +466,25 @@ function init(description) {
     });
   }
 
+  /**
+   * Select all button
+   */
+  const selectAllButtons = document.querySelectorAll('.select-all-button');
+  [...selectAllButtons].forEach((selectAllButton) => {
+    selectAllButton.addEventListener('click', (e) => {
+      e.preventDefault();
+      const checked = selectAllButton.classList.contains('filter-off');
+      [...selectAllButtons].forEach((selectAllButton2) => {
+        selectAllButton2.classList.toggle('filter-off');
+        selectAllButton2.classList.toggle('filter-on');
+      });
+      [...linkCheckboxes].forEach((linkCheckbox) => {
+        linkCheckbox.checked = checked;
+        linkCheckbox.dispatchEvent(new Event('change'));
+      });
+    });
+  });
+
   /**
    * Tag list operations
    *
@@ -581,7 +567,7 @@ function init(description) {
       event.preventDefault();
       const block = findParent(event.target, 'div', { class: 'tag-list-item' });
       const tag = block.getAttribute('data-tag');
-      const refreshedToken = document.getElementById('token');
+      const refreshedToken = document.getElementById('token').value;
 
       if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) {
         const xhr = new XMLHttpRequest();
index 09d5efbefb19a0f1e6fb60ff3e664927b574203d..760d8d6ab7272a5d8c929ccb8425fc5a8f7f054d 100644 (file)
@@ -146,6 +146,17 @@ body,
   background-color: $main-green;
 }
 
+.pure-alert-warning {
+  a {
+    color: $warning-text;
+    font-weight: bold;
+  }
+}
+
+.page-single-alert {
+  margin-top: 100px;
+}
+
 .anchor {
   &:target {
     padding-top: 40px;
@@ -370,8 +381,6 @@ body,
   box-shadow: 0 1px 0 $light-shadow, 0 1px 4px $dark-shadow inset;
   background: $almost-white;
   padding: 5px 5px 3px 15px;
-  width: 20%;
-  height: 20px;
   color: $dark-grey;
 }
 
@@ -625,23 +634,22 @@ body,
 }
 
 .linklist-item {
+  position: relative;
   margin: 0 0 10px;
   box-shadow: 1px 1px 3px $light-grey;
   background: $almost-white;
 
   &.private {
-    .linklist-item-title {
-      &::before {
-        @extend %private-border;
-        margin-top: 3px;
-      }
-    }
-
-    .linklist-item-description {
-      &::before {
-        @extend %private-border;
-        height: 100%;
-      }
+    &::before {
+      display: block;
+      position: absolute;
+      top: 0;
+      left: 0;
+      z-index: 1;
+      background: $orange;
+      width: 2px;
+      height: 100%;
+      content: '';
     }
   }
 }
@@ -732,7 +740,7 @@ body,
     font-size: 1em;
   }
 
-  .delete-checkbox {
+  .link-checkbox {
     display: none;
   }
 }
@@ -747,6 +755,14 @@ body,
   font-size: 1.3em;
 }
 
+.pin-link {
+  font-size: 1.3em;
+}
+
+.pinned-link {
+  color: $blue !important;
+}
+
 .linklist-item-description {
   position: relative;
   padding: 0 10px;
@@ -840,6 +856,10 @@ body,
   margin: 0 7px;
 }
 
+.ctrl-delete {
+  margin: 0 7px 0 0;
+}
+
 // 64em -> lg
 @media screen and (max-width: 64em) {
   .linklist-item-infos-url {
@@ -1543,3 +1563,40 @@ form {
 .pure-button-shaarli {
   background-color: $main-green;
 }
+
+.progressbar {
+  border-radius: 6px;
+  background-color: $main-green;
+  padding: 1px;
+
+  > div {
+    border-radius: 10px;
+    background: repeating-linear-gradient(
+      -45deg,
+      $almost-white,
+      $almost-white 6px,
+      $background-color 6px,
+      $background-color 12px
+    );
+    width: 0%;
+    height: 10px;
+  }
+}
+
+.thumbnails-page-container {
+  .progress-counter {
+    padding: 10px 0 20px;
+  }
+
+  .thumbnail-placeholder {
+    margin: 10px auto;
+    background-color: $light-grey;
+  }
+
+  .thumbnail-link-title {
+    padding-bottom: 20px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+}
index c919339b95ca3b10f064227fcf029add52135540..87c440c86f702958224c7c5a334802ca7f817196 100644 (file)
@@ -701,8 +701,8 @@ a.bigbutton, #pageheader a.bigbutton {
     position: relative;
     display: table-cell;
     vertical-align: middle;
-    width: 90px;
-    height: 90px;
+    width: 120px;
+    height: 120px;
     overflow: hidden;
     text-align: center;
     float: left;
@@ -739,9 +739,9 @@ a.bigbutton, #pageheader a.bigbutton {
     position: absolute;
     top: 0;
     left: 0;
-    width: 90px;
+    width: 120px;
     font-weight: bold;
-    font-size: 8pt;
+    font-size: 9pt;
     color: #fff;
     text-align: left;
     background-color: transparent;
@@ -1210,3 +1210,43 @@ ul.errors {
     width: 13px;
     height: 13px;
 }
+
+.thumbnails-update-container {
+    padding: 20px 0;
+    width: 50%;
+    margin: auto;
+}
+
+.thumbnails-update-container .thumbnail-placeholder {
+    background: grey;
+    margin: auto;
+}
+
+.thumbnails-update-container .thumbnail-link-title {
+    width: 75%;
+    margin: auto;
+
+    padding-bottom: 20px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+
+.progressbar {
+    border-radius: 6px;
+    background-color: #111;
+    padding: 1px;
+}
+
+.progressbar > div {
+    border-radius: 10px;
+    background: repeating-linear-gradient(
+        -45deg,
+        #f5f5f5,
+        #f5f5f5 6px,
+        #d0d0d0 6px,
+        #d0d0d0 12px
+    );
+    width: 0%;
+    height: 10px;
+}
index 0d4c623c8b181bc2aa5a7433de4a40290b6b3420..c23b8252a0411b396ceb8871f96f5eef6f2dd971 100644 (file)
     },
     "require": {
         "php": ">=5.6",
-        "shaarli/netscape-bookmark-parser": "^2.0",
+        "ext-json": "*",
+        "ext-zlib": "*",
+        "shaarli/netscape-bookmark-parser": "^2.1",
         "erusev/parsedown": "^1.6",
         "slim/slim": "^3.0",
+        "arthurhoaro/web-thumbnailer": "^1.1",
         "pubsubhubbub/publisher": "dev-master",
         "gettext/gettext": "^4.4"
     },
     "require-dev": {
-        "phpmd/phpmd" : "@stable",
+        "roave/security-advisories": "dev-master",
+        "phpunit/phpcov": "*",
         "phpunit/phpunit": "^5.0",
-        "sebastian/phpcpd": "*",
-        "squizlabs/php_codesniffer": "2.*",
-        "phpunit/phpcov": "*"
+        "squizlabs/php_codesniffer": "2.*"
+    },
+    "suggest": {
+        "ext-curl": "Allows fetching web pages and thumbnails in a more robust way",
+        "ext-gd": "Required for thumbnail generation",
+        "ext-gettext": "Enables faster translation system in gettext mode",
+        "ext-intl": "Provides localized text sorting",
+        "ext-mbstring": "Provides multibyte (Unicode) string support"
     },
     "autoload": {
         "psr-4": {
             "Shaarli\\Api\\": "application/api/",
             "Shaarli\\Api\\Controllers\\": "application/api/controllers",
             "Shaarli\\Api\\Exceptions\\": "application/api/exceptions",
+            "Shaarli\\Bookmark\\": "application/bookmark",
+            "Shaarli\\Bookmark\\Exception\\": "application/bookmark/exception",
             "Shaarli\\Config\\": "application/config/",
             "Shaarli\\Config\\Exception\\": "application/config/exception",
-            "Shaarli\\Security\\": "application/security"
+            "Shaarli\\Exceptions\\": "application/exceptions",
+            "Shaarli\\Feed\\": "application/feed",
+            "Shaarli\\Http\\": "application/http",
+            "Shaarli\\Netscape\\": "application/netscape",
+            "Shaarli\\Plugin\\": "application/plugin",
+            "Shaarli\\Plugin\\Exception\\": "application/plugin/exception",
+            "Shaarli\\Plugin\\Wallabag\\": "plugins/wallabag",
+            "Shaarli\\Render\\": "application/render",
+            "Shaarli\\Security\\": "application/security",
+            "Shaarli\\Updater\\": "application/updater",
+            "Shaarli\\Updater\\Exception\\": "application/updater/exception"
         }
     }
 }
index ee762c0e7f2df026045d272aa7295ba2615cf7a0..5cbcbc4a3ffc9d54010d06f1d03d6317bedc5b56 100644 (file)
@@ -1,11 +1,59 @@
 {
     "_readme": [
         "This file locks the dependencies of your project to a known state",
-        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "308a35eab91602fbb449f2c669c445ed",
+    "content-hash": "432005c9db3e890f42fde27036d2a70f",
     "packages": [
+        {
+            "name": "arthurhoaro/web-thumbnailer",
+            "version": "v1.3.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/ArthurHoaro/web-thumbnailer.git",
+                "reference": "7142bd94ec93719a756a7012ebb8e1c5813c6860"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/ArthurHoaro/web-thumbnailer/zipball/7142bd94ec93719a756a7012ebb8e1c5813c6860",
+                "reference": "7142bd94ec93719a756a7012ebb8e1c5813c6860",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.6",
+                "phpunit/php-text-template": "^1.2"
+            },
+            "conflict": {
+                "phpunit/php-timer": ">=2"
+            },
+            "require-dev": {
+                "php-coveralls/php-coveralls": "^2.0",
+                "phpunit/phpunit": "5.2.*",
+                "squizlabs/php_codesniffer": "^3.2"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "WebThumbnailer\\": [
+                        "src/",
+                        "tests/"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Arthur Hoaro",
+                    "homepage": "http://hoa.ro"
+                }
+            ],
+            "description": "PHP library which will retrieve a thumbnail for any given URL",
+            "time": "2018-08-11T12:21:52+00:00"
+        },
         {
             "name": "container-interop/container-interop",
             "version": "1.2.0",
         },
         {
             "name": "gettext/gettext",
-            "version": "v4.4.4",
+            "version": "v4.6.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/oscarotero/Gettext.git",
-                "reference": "ab5e863de2f60806d02e6e6081e21efd45249168"
+                "reference": "93176b272d61fb58a9767be71c50d19149cb1e48"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/oscarotero/Gettext/zipball/ab5e863de2f60806d02e6e6081e21efd45249168",
-                "reference": "ab5e863de2f60806d02e6e6081e21efd45249168",
+                "url": "https://api.github.com/repos/oscarotero/Gettext/zipball/93176b272d61fb58a9767be71c50d19149cb1e48",
+                "reference": "93176b272d61fb58a9767be71c50d19149cb1e48",
                 "shasum": ""
             },
             "require": {
             },
             "require-dev": {
                 "illuminate/view": "*",
-                "phpunit/phpunit": "^4.8|^5.7",
+                "phpunit/phpunit": "^4.8|^5.7|^6.5",
                 "squizlabs/php_codesniffer": "^3.0",
                 "symfony/yaml": "~2",
                 "twig/extensions": "*",
                 "po",
                 "translation"
             ],
-            "time": "2018-02-21T18:49:59+00:00"
+            "time": "2019-01-12T18:40:56+00:00"
         },
         {
             "name": "gettext/languages",
-            "version": "2.3.0",
+            "version": "2.5.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/mlocati/cldr-to-gettext-plural-rules.git",
-                "reference": "49c39e51569963cc917a924b489e7025bfb9d8c7"
+                "reference": "78db2d17933f0765a102f368a6663f057162ddbd"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/mlocati/cldr-to-gettext-plural-rules/zipball/49c39e51569963cc917a924b489e7025bfb9d8c7",
-                "reference": "49c39e51569963cc917a924b489e7025bfb9d8c7",
+                "url": "https://api.github.com/repos/mlocati/cldr-to-gettext-plural-rules/zipball/78db2d17933f0765a102f368a6663f057162ddbd",
+                "reference": "78db2d17933f0765a102f368a6663f057162ddbd",
                 "shasum": ""
             },
             "require": {
                 "translations",
                 "unicode"
             ],
-            "time": "2017-03-23T17:02:28+00:00"
+            "time": "2018-11-13T22:06:07+00:00"
         },
         {
             "name": "katzgrau/klogger",
             ],
             "time": "2018-02-13T20:26:39+00:00"
         },
+        {
+            "name": "phpunit/php-text-template",
+            "version": "1.2.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-text-template.git",
+                "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+                "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Simple template engine.",
+            "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+            "keywords": [
+                "template"
+            ],
+            "time": "2015-06-21T13:50:34+00:00"
+        },
         {
             "name": "pimple/pimple",
             "version": "v3.2.3",
         },
         {
             "name": "psr/log",
-            "version": "1.0.2",
+            "version": "1.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/php-fig/log.git",
-                "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+                "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
-                "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+                "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
+                "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
                 "shasum": ""
             },
             "require": {
                 "psr",
                 "psr-3"
             ],
-            "time": "2016-10-10T12:19:37+00:00"
+            "time": "2018-11-20T15:27:04+00:00"
         },
         {
             "name": "pubsubhubbub/publisher",
             "source": {
                 "type": "git",
                 "url": "https://github.com/pubsubhubbub/php-publisher.git",
-                "reference": "0d224daebd504ab61c22fee4db58f8d1fc18945f"
+                "reference": "047b0faf6219071527a45942d6fef4dbc6d1d884"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/pubsubhubbub/php-publisher/zipball/0d224daebd504ab61c22fee4db58f8d1fc18945f",
-                "reference": "0d224daebd504ab61c22fee4db58f8d1fc18945f",
+                "url": "https://api.github.com/repos/pubsubhubbub/php-publisher/zipball/047b0faf6219071527a45942d6fef4dbc6d1d884",
+                "reference": "047b0faf6219071527a45942d6fef4dbc6d1d884",
                 "shasum": ""
             },
             "require": {
+                "ext-curl": "*",
                 "php": "~5.4 || ~7.0"
             },
             "type": "library",
                 "data",
                 "feeds",
                 "publishers",
-                "pubsubhubbub"
+                "pubsubhubbub",
+                "websub"
             ],
-            "time": "2017-10-08T10:59:41+00:00"
+            "time": "2018-10-09T05:20:28+00:00"
         },
         {
             "name": "shaarli/netscape-bookmark-parser",
-            "version": "v2.0.5",
+            "version": "v2.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/shaarli/netscape-bookmark-parser.git",
-                "reference": "ea6911a0ea3dd372fa7002593c5aef9c15a49315"
+                "reference": "819008ee42c4dd7e45d988176a4a22d6ed689577"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/shaarli/netscape-bookmark-parser/zipball/ea6911a0ea3dd372fa7002593c5aef9c15a49315",
-                "reference": "ea6911a0ea3dd372fa7002593c5aef9c15a49315",
+                "url": "https://api.github.com/repos/shaarli/netscape-bookmark-parser/zipball/819008ee42c4dd7e45d988176a4a22d6ed689577",
+                "reference": "819008ee42c4dd7e45d988176a4a22d6ed689577",
                 "shasum": ""
             },
             "require": {
                 "katzgrau/klogger": "~1.0",
-                "php": ">=5.3.4"
+                "php": ">=5.6"
             },
             "require-dev": {
-                "phpunit/phpunit": "4.8.*"
+                "phpunit/phpunit": "^5.0"
             },
             "type": "library",
             "autoload": {
                 "bookmark",
                 "link",
                 "netscape",
-                "parse"
+                "parser"
             ],
-            "time": "2018-01-30T17:34:48+00:00"
+            "time": "2018-10-06T14:43:38+00:00"
         },
         {
             "name": "slim/slim",
-            "version": "3.9.2",
+            "version": "3.12.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/slimphp/Slim.git",
-                "reference": "4086d0106cf5a7135c69fce4161fe355a8feb118"
+                "reference": "f4947cc900b6e51cbfda58b9f1247bca2f76f9f0"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/slimphp/Slim/zipball/4086d0106cf5a7135c69fce4161fe355a8feb118",
-                "reference": "4086d0106cf5a7135c69fce4161fe355a8feb118",
+                "url": "https://api.github.com/repos/slimphp/Slim/zipball/f4947cc900b6e51cbfda58b9f1247bca2f76f9f0",
+                "reference": "f4947cc900b6e51cbfda58b9f1247bca2f76f9f0",
                 "shasum": ""
             },
             "require": {
                 "micro",
                 "router"
             ],
-            "time": "2017-11-26T19:13:09+00:00"
+            "time": "2019-01-15T13:21:25+00:00"
         }
     ],
     "packages-dev": [
             ],
             "time": "2017-10-19T19:58:43+00:00"
         },
-        {
-            "name": "pdepend/pdepend",
-            "version": "2.5.2",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/pdepend/pdepend.git",
-                "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/pdepend/pdepend/zipball/9daf26d0368d4a12bed1cacae1a9f3a6f0adf239",
-                "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.7",
-                "symfony/config": "^2.3.0|^3|^4",
-                "symfony/dependency-injection": "^2.3.0|^3|^4",
-                "symfony/filesystem": "^2.3.0|^3|^4"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^4.8|^5.7",
-                "squizlabs/php_codesniffer": "^2.0.0"
-            },
-            "bin": [
-                "src/bin/pdepend"
-            ],
-            "type": "library",
-            "autoload": {
-                "psr-4": {
-                    "PDepend\\": "src/main/php/PDepend"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "description": "Official version of pdepend to be handled with Composer",
-            "time": "2017-12-13T13:21:38+00:00"
-        },
         {
             "name": "phpdocumentor/reflection-common",
             "version": "1.0.1",
             ],
             "time": "2017-07-14T14:27:02+00:00"
         },
-        {
-            "name": "phpmd/phpmd",
-            "version": "2.6.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/phpmd/phpmd.git",
-                "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/phpmd/phpmd/zipball/4e9924b2c157a3eb64395460fcf56b31badc8374",
-                "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374",
-                "shasum": ""
-            },
-            "require": {
-                "ext-xml": "*",
-                "pdepend/pdepend": "^2.5",
-                "php": ">=5.3.9"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^4.0",
-                "squizlabs/php_codesniffer": "^2.0"
-            },
-            "bin": [
-                "src/bin/phpmd"
-            ],
-            "type": "project",
-            "autoload": {
-                "psr-0": {
-                    "PHPMD\\": "src/main/php"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Manuel Pichler",
-                    "email": "github@manuel-pichler.de",
-                    "homepage": "https://github.com/manuelpichler",
-                    "role": "Project Founder"
-                },
-                {
-                    "name": "Other contributors",
-                    "homepage": "https://github.com/phpmd/phpmd/graphs/contributors",
-                    "role": "Contributors"
-                },
-                {
-                    "name": "Marc Würth",
-                    "email": "ravage@bluewin.ch",
-                    "homepage": "https://github.com/ravage84",
-                    "role": "Project Maintainer"
-                }
-            ],
-            "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.",
-            "homepage": "http://phpmd.org/",
-            "keywords": [
-                "mess detection",
-                "mess detector",
-                "pdepend",
-                "phpmd",
-                "pmd"
-            ],
-            "time": "2017-01-20T14:41:10+00:00"
-        },
         {
             "name": "phpspec/prophecy",
-            "version": "1.7.5",
+            "version": "1.8.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpspec/prophecy.git",
-                "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401"
+                "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401",
-                "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401",
+                "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
+                "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
                 "shasum": ""
             },
             "require": {
                 "doctrine/instantiator": "^1.0.2",
                 "php": "^5.3|^7.0",
                 "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
-                "sebastian/comparator": "^1.1|^2.0",
+                "sebastian/comparator": "^1.1|^2.0|^3.0",
                 "sebastian/recursion-context": "^1.0|^2.0|^3.0"
             },
             "require-dev": {
                 "phpspec/phpspec": "^2.5|^3.2",
-                "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
+                "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
             },
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.7.x-dev"
+                    "dev-master": "1.8.x-dev"
                 }
             },
             "autoload": {
                 "spy",
                 "stub"
             ],
-            "time": "2018-02-19T10:16:54+00:00"
+            "time": "2018-08-05T17:53:17+00:00"
         },
         {
             "name": "phpunit/php-code-coverage",
             ],
             "time": "2017-11-27T13:52:08+00:00"
         },
-        {
-            "name": "phpunit/php-text-template",
-            "version": "1.2.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/php-text-template.git",
-                "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
-                "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.3"
-            },
-            "type": "library",
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de",
-                    "role": "lead"
-                }
-            ],
-            "description": "Simple template engine.",
-            "homepage": "https://github.com/sebastianbergmann/php-text-template/",
-            "keywords": [
-                "template"
-            ],
-            "time": "2015-06-21T13:50:34+00:00"
-        },
         {
             "name": "phpunit/php-timer",
             "version": "1.0.9",
             ],
             "time": "2017-06-30T09:13:00+00:00"
         },
+        {
+            "name": "roave/security-advisories",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/Roave/SecurityAdvisories.git",
+                "reference": "d155baccb43ba2542941fbcba258b85ce7786419"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/d155baccb43ba2542941fbcba258b85ce7786419",
+                "reference": "d155baccb43ba2542941fbcba258b85ce7786419",
+                "shasum": ""
+            },
+            "conflict": {
+                "3f/pygmentize": "<1.2",
+                "adodb/adodb-php": "<5.20.12",
+                "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1",
+                "amphp/artax": "<1.0.6|>=2,<2.0.6",
+                "amphp/http": "<1.0.1",
+                "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6",
+                "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99",
+                "aws/aws-sdk-php": ">=3,<3.2.1",
+                "brightlocal/phpwhois": "<=4.2.5",
+                "bugsnag/bugsnag-laravel": ">=2,<2.0.2",
+                "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4|>=3.4,<3.4.14|>=3.5,<3.5.17|>=3.6,<3.6.4",
+                "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4",
+                "cartalyst/sentry": "<=2.1.6",
+                "codeigniter/framework": "<=3.0.6",
+                "composer/composer": "<=1.0.0-alpha11",
+                "contao-components/mediaelement": ">=2.14.2,<2.21.1",
+                "contao/core": ">=2,<3.5.35",
+                "contao/core-bundle": ">=4,<4.4.18|>=4.5,<4.5.8",
+                "contao/listing-bundle": ">=4,<4.4.8",
+                "contao/newsletter-bundle": ">=4,<4.1",
+                "david-garcia/phpwhois": "<=4.3.1",
+                "doctrine/annotations": ">=1,<1.2.7",
+                "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2",
+                "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1",
+                "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2",
+                "doctrine/doctrine-bundle": "<1.5.2",
+                "doctrine/doctrine-module": "<=0.7.1",
+                "doctrine/mongodb-odm": ">=1,<1.0.2",
+                "doctrine/mongodb-odm-bundle": ">=2,<3.0.1",
+                "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1",
+                "dompdf/dompdf": ">=0.6,<0.6.2",
+                "drupal/core": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2",
+                "drupal/drupal": ">=7,<7.60|>=8,<8.5.8|>=8.6,<8.6.2",
+                "erusev/parsedown": "<1.7",
+                "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1",
+                "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.12.3|>=2011,<2017.12.4.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3",
+                "ezsystems/repository-forms": ">=2.3,<2.3.2.1",
+                "ezyang/htmlpurifier": "<4.1.1",
+                "firebase/php-jwt": "<2",
+                "fooman/tcpdf": "<6.2.22",
+                "fossar/tcpdf-parser": "<6.2.22",
+                "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2",
+                "friendsofsymfony/user-bundle": ">=1.2,<1.3.5",
+                "fuel/core": "<1.8.1",
+                "gree/jose": "<=2.2",
+                "gregwar/rst": "<1.0.3",
+                "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1",
+                "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10",
+                "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30",
+                "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29",
+                "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15",
+                "ivankristianto/phpwhois": "<=4.3",
+                "james-heinrich/getid3": "<1.9.9",
+                "joomla/session": "<1.3.1",
+                "jsmitty12/phpwhois": "<5.1",
+                "kazist/phpwhois": "<=4.2.6",
+                "kreait/firebase-php": ">=3.2,<3.8.1",
+                "la-haute-societe/tcpdf": "<6.2.22",
+                "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30",
+                "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10",
+                "league/commonmark": ">=0.15.6,<0.18.1",
+                "magento/magento1ce": "<1.9.4",
+                "magento/magento1ee": ">=1.9,<1.14.4",
+                "magento/product-community-edition": ">=2,<2.2.7",
+                "monolog/monolog": ">=1.8,<1.12",
+                "namshi/jose": "<2.2",
+                "onelogin/php-saml": "<2.10.4",
+                "openid/php-openid": "<2.3",
+                "oro/crm": ">=1.7,<1.7.4",
+                "oro/platform": ">=1.7,<1.7.4",
+                "padraic/humbug_get_contents": "<1.1.2",
+                "pagarme/pagarme-php": ">=0,<3",
+                "paragonie/random_compat": "<2",
+                "paypal/merchant-sdk-php": "<3.12",
+                "pear/archive_tar": "<1.4.4",
+                "phpmailer/phpmailer": ">=5,<5.2.27|>=6,<6.0.6",
+                "phpoffice/phpexcel": "<=1.8.1",
+                "phpoffice/phpspreadsheet": "<=1.5",
+                "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3",
+                "phpwhois/phpwhois": "<=4.2.5",
+                "phpxmlrpc/extras": "<0.6.1",
+                "propel/propel": ">=2.0.0-alpha1,<=2.0.0-alpha7",
+                "propel/propel1": ">=1,<=1.7.1",
+                "pusher/pusher-php-server": "<2.2.1",
+                "robrichards/xmlseclibs": ">=1,<3.0.2",
+                "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9",
+                "sensiolabs/connect": "<4.2.3",
+                "serluck/phpwhois": "<=4.2.6",
+                "shopware/shopware": "<5.3.7",
+                "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11",
+                "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3",
+                "silverstripe/framework": ">=3,<3.3",
+                "silverstripe/userforms": "<3",
+                "simple-updates/phpwhois": "<=1",
+                "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4",
+                "simplesamlphp/simplesamlphp": "<1.16.3",
+                "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1",
+                "slim/slim": "<2.6",
+                "smarty/smarty": "<3.1.33",
+                "socalnick/scn-social-auth": "<1.15.2",
+                "spoonity/tcpdf": "<6.2.22",
+                "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1",
+                "stormpath/sdk": ">=0,<9.9.99",
+                "swiftmailer/swiftmailer": ">=4,<5.4.5",
+                "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2",
+                "sylius/sylius": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2",
+                "symfony/dependency-injection": ">=2,<2.0.17",
+                "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1",
+                "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2",
+                "symfony/http-foundation": ">=2,<2.7.49|>=2.8,<2.8.44|>=3,<3.3.18|>=3.4,<3.4.14|>=4,<4.0.14|>=4.1,<4.1.3",
+                "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8",
+                "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13",
+                "symfony/polyfill": ">=1,<1.10",
+                "symfony/polyfill-php55": ">=1,<1.10",
+                "symfony/routing": ">=2,<2.0.19",
+                "symfony/security": ">=2,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.19|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1",
+                "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
+                "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7",
+                "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
+                "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
+                "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1",
+                "symfony/serializer": ">=2,<2.0.11",
+                "symfony/symfony": ">=2,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1",
+                "symfony/translation": ">=2,<2.0.17",
+                "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3",
+                "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4",
+                "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7",
+                "tecnickcom/tcpdf": "<6.2.22",
+                "thelia/backoffice-default-template": ">=2.1,<2.1.2",
+                "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2",
+                "theonedemon/phpwhois": "<=4.2.5",
+                "titon/framework": ">=0,<9.9.99",
+                "truckersmp/phpwhois": "<=4.3.1",
+                "twig/twig": "<1.20",
+                "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.21|>=9,<9.5.2",
+                "typo3/cms-core": ">=8,<8.7.21|>=9,<9.5.2",
+                "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5",
+                "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4",
+                "ua-parser/uap-php": "<3.8",
+                "wallabag/tcpdf": "<6.2.22",
+                "willdurand/js-translation-bundle": "<2.1.1",
+                "yiisoft/yii": ">=1.1.14,<1.1.15",
+                "yiisoft/yii2": "<2.0.15",
+                "yiisoft/yii2-bootstrap": "<2.0.4",
+                "yiisoft/yii2-dev": "<2.0.15",
+                "yiisoft/yii2-elasticsearch": "<2.0.5",
+                "yiisoft/yii2-gii": "<2.0.4",
+                "yiisoft/yii2-jui": "<2.0.4",
+                "yiisoft/yii2-redis": "<2.0.8",
+                "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3",
+                "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2",
+                "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2",
+                "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5",
+                "zendframework/zend-diactoros": ">=1,<1.8.4",
+                "zendframework/zend-feed": ">=1,<2.10.3",
+                "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1",
+                "zendframework/zend-http": ">=1,<2.8.1",
+                "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6",
+                "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3",
+                "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2",
+                "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1",
+                "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4",
+                "zendframework/zend-validator": ">=2.3,<2.3.6",
+                "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1",
+                "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6",
+                "zendframework/zendframework": "<2.5.1",
+                "zendframework/zendframework1": "<1.12.20",
+                "zendframework/zendopenid": ">=2,<2.0.2",
+                "zendframework/zendxml": ">=1,<1.0.1",
+                "zetacomponents/mail": "<1.8.2",
+                "zf-commons/zfc-user": "<1.2.2",
+                "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3",
+                "zfr/zfr-oauth2-server-module": "<0.1.2"
+            },
+            "type": "metapackage",
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Marco Pivetta",
+                    "email": "ocramius@gmail.com",
+                    "role": "maintainer"
+                }
+            ],
+            "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
+            "time": "2019-01-15T19:39:37+00:00"
+        },
         {
             "name": "sebastian/code-unit-reverse-lookup",
             "version": "1.0.1",
             "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
             "time": "2017-02-18T15:18:39+00:00"
         },
-        {
-            "name": "sebastian/phpcpd",
-            "version": "3.0.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/sebastianbergmann/phpcpd.git",
-                "reference": "dfed51c1288790fc957c9433e2f49ab152e8a564"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/dfed51c1288790fc957c9433e2f49ab152e8a564",
-                "reference": "dfed51c1288790fc957c9433e2f49ab152e8a564",
-                "shasum": ""
-            },
-            "require": {
-                "php": "^5.6|^7.0",
-                "phpunit/php-timer": "^1.0.6",
-                "sebastian/finder-facade": "^1.1",
-                "sebastian/version": "^1.0|^2.0",
-                "symfony/console": "^2.7|^3.0|^4.0"
-            },
-            "bin": [
-                "phpcpd"
-            ],
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "3.0-dev"
-                }
-            },
-            "autoload": {
-                "classmap": [
-                    "src/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD-3-Clause"
-            ],
-            "authors": [
-                {
-                    "name": "Sebastian Bergmann",
-                    "email": "sebastian@phpunit.de",
-                    "role": "lead"
-                }
-            ],
-            "description": "Copy/Paste Detector (CPD) for PHP code.",
-            "homepage": "https://github.com/sebastianbergmann/phpcpd",
-            "time": "2017-11-16T08:49:28+00:00"
-        },
         {
             "name": "sebastian/recursion-context",
             "version": "2.0.0",
         },
         {
             "name": "squizlabs/php_codesniffer",
-            "version": "2.9.1",
+            "version": "2.9.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
-                "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62"
+                "reference": "2acf168de78487db620ab4bc524135a13cfe6745"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62",
-                "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62",
+                "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745",
+                "reference": "2acf168de78487db620ab4bc524135a13cfe6745",
                 "shasum": ""
             },
             "require": {
                 "phpcs",
                 "standards"
             ],
-            "time": "2017-05-22T02:43:20+00:00"
-        },
-        {
-            "name": "symfony/config",
-            "version": "v3.4.6",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/symfony/config.git",
-                "reference": "05e10567b529476a006b00746c5f538f1636810e"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/symfony/config/zipball/05e10567b529476a006b00746c5f538f1636810e",
-                "reference": "05e10567b529476a006b00746c5f538f1636810e",
-                "shasum": ""
-            },
-            "require": {
-                "php": "^5.5.9|>=7.0.8",
-                "symfony/filesystem": "~2.8|~3.0|~4.0"
-            },
-            "conflict": {
-                "symfony/dependency-injection": "<3.3",
-                "symfony/finder": "<3.3"
-            },
-            "require-dev": {
-                "symfony/dependency-injection": "~3.3|~4.0",
-                "symfony/event-dispatcher": "~3.3|~4.0",
-                "symfony/finder": "~3.3|~4.0",
-                "symfony/yaml": "~3.0|~4.0"
-            },
-            "suggest": {
-                "symfony/yaml": "To use the yaml reference dumper"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "3.4-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Symfony\\Component\\Config\\": ""
-                },
-                "exclude-from-classmap": [
-                    "/Tests/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Fabien Potencier",
-                    "email": "fabien@symfony.com"
-                },
-                {
-                    "name": "Symfony Community",
-                    "homepage": "https://symfony.com/contributors"
-                }
-            ],
-            "description": "Symfony Config Component",
-            "homepage": "https://symfony.com",
-            "time": "2018-02-14T10:03:57+00:00"
+            "time": "2018-11-07T22:31:41+00:00"
         },
         {
             "name": "symfony/console",
-            "version": "v3.4.6",
+            "version": "v3.4.21",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/console.git",
-                "reference": "067339e9b8ec30d5f19f5950208893ff026b94f7"
+                "reference": "a700b874d3692bc8342199adfb6d3b99f62cc61a"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/console/zipball/067339e9b8ec30d5f19f5950208893ff026b94f7",
-                "reference": "067339e9b8ec30d5f19f5950208893ff026b94f7",
+                "url": "https://api.github.com/repos/symfony/console/zipball/a700b874d3692bc8342199adfb6d3b99f62cc61a",
+                "reference": "a700b874d3692bc8342199adfb6d3b99f62cc61a",
                 "shasum": ""
             },
             "require": {
                 "symfony/process": "~3.3|~4.0"
             },
             "suggest": {
-                "psr/log": "For using the console logger",
+                "psr/log-implementation": "For using the console logger",
                 "symfony/event-dispatcher": "",
                 "symfony/lock": "",
                 "symfony/process": ""
             ],
             "description": "Symfony Console Component",
             "homepage": "https://symfony.com",
-            "time": "2018-02-26T15:46:28+00:00"
+            "time": "2019-01-04T04:42:43+00:00"
         },
         {
             "name": "symfony/debug",
-            "version": "v3.4.6",
+            "version": "v3.4.21",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/debug.git",
-                "reference": "9b1071f86e79e1999b3d3675d2e0e7684268b9bc"
+                "reference": "26d7f23b9bd0b93bee5583e4d6ca5cb1ab31b186"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/debug/zipball/9b1071f86e79e1999b3d3675d2e0e7684268b9bc",
-                "reference": "9b1071f86e79e1999b3d3675d2e0e7684268b9bc",
+                "url": "https://api.github.com/repos/symfony/debug/zipball/26d7f23b9bd0b93bee5583e4d6ca5cb1ab31b186",
+                "reference": "26d7f23b9bd0b93bee5583e4d6ca5cb1ab31b186",
                 "shasum": ""
             },
             "require": {
             ],
             "description": "Symfony Debug Component",
             "homepage": "https://symfony.com",
-            "time": "2018-02-28T21:49:22+00:00"
+            "time": "2019-01-01T13:45:19+00:00"
         },
         {
-            "name": "symfony/dependency-injection",
-            "version": "v3.4.6",
+            "name": "symfony/finder",
+            "version": "v3.4.21",
             "source": {
                 "type": "git",
-                "url": "https://github.com/symfony/dependency-injection.git",
-                "reference": "12e901abc1cb0d637a0e5abe9923471361d96b07"
+                "url": "https://github.com/symfony/finder.git",
+                "reference": "3f2a2ab6315dd7682d4c16dcae1e7b95c8b8555e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/12e901abc1cb0d637a0e5abe9923471361d96b07",
-                "reference": "12e901abc1cb0d637a0e5abe9923471361d96b07",
+                "url": "https://api.github.com/repos/symfony/finder/zipball/3f2a2ab6315dd7682d4c16dcae1e7b95c8b8555e",
+                "reference": "3f2a2ab6315dd7682d4c16dcae1e7b95c8b8555e",
                 "shasum": ""
             },
             "require": {
-                "php": "^5.5.9|>=7.0.8",
-                "psr/container": "^1.0"
-            },
-            "conflict": {
-                "symfony/config": "<3.3.7",
-                "symfony/finder": "<3.3",
-                "symfony/proxy-manager-bridge": "<3.4",
-                "symfony/yaml": "<3.4"
-            },
-            "provide": {
-                "psr/container-implementation": "1.0"
-            },
-            "require-dev": {
-                "symfony/config": "~3.3|~4.0",
-                "symfony/expression-language": "~2.8|~3.0|~4.0",
-                "symfony/yaml": "~3.4|~4.0"
-            },
-            "suggest": {
-                "symfony/config": "",
-                "symfony/expression-language": "For using expressions in service container configuration",
-                "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required",
-                "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
-                "symfony/yaml": ""
+                "php": "^5.5.9|>=7.0.8"
             },
             "type": "library",
             "extra": {
             },
             "autoload": {
                 "psr-4": {
-                    "Symfony\\Component\\DependencyInjection\\": ""
+                    "Symfony\\Component\\Finder\\": ""
                 },
                 "exclude-from-classmap": [
                     "/Tests/"
                     "homepage": "https://symfony.com/contributors"
                 }
             ],
-            "description": "Symfony DependencyInjection Component",
+            "description": "Symfony Finder Component",
             "homepage": "https://symfony.com",
-            "time": "2018-03-04T03:54:53+00:00"
+            "time": "2019-01-01T13:45:19+00:00"
         },
         {
-            "name": "symfony/filesystem",
-            "version": "v3.4.6",
+            "name": "symfony/polyfill-ctype",
+            "version": "v1.10.0",
             "source": {
                 "type": "git",
-                "url": "https://github.com/symfony/filesystem.git",
-                "reference": "253a4490b528597aa14d2bf5aeded6f5e5e4a541"
+                "url": "https://github.com/symfony/polyfill-ctype.git",
+                "reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/filesystem/zipball/253a4490b528597aa14d2bf5aeded6f5e5e4a541",
-                "reference": "253a4490b528597aa14d2bf5aeded6f5e5e4a541",
+                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19",
+                "reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
                 "shasum": ""
             },
             "require": {
-                "php": "^5.5.9|>=7.0.8"
+                "php": ">=5.3.3"
+            },
+            "suggest": {
+                "ext-ctype": "For best performance"
             },
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "3.4-dev"
+                    "dev-master": "1.9-dev"
                 }
             },
             "autoload": {
                 "psr-4": {
-                    "Symfony\\Component\\Filesystem\\": ""
+                    "Symfony\\Polyfill\\Ctype\\": ""
                 },
-                "exclude-from-classmap": [
-                    "/Tests/"
+                "files": [
+                    "bootstrap.php"
                 ]
             },
             "notification-url": "https://packagist.org/downloads/",
                 "MIT"
             ],
             "authors": [
-                {
-                    "name": "Fabien Potencier",
-                    "email": "fabien@symfony.com"
-                },
                 {
                     "name": "Symfony Community",
                     "homepage": "https://symfony.com/contributors"
-                }
-            ],
-            "description": "Symfony Filesystem Component",
-            "homepage": "https://symfony.com",
-            "time": "2018-02-22T10:48:49+00:00"
-        },
-        {
-            "name": "symfony/finder",
-            "version": "v3.4.6",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/symfony/finder.git",
-                "reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/symfony/finder/zipball/a479817ce0a9e4adfd7d39c6407c95d97c254625",
-                "reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625",
-                "shasum": ""
-            },
-            "require": {
-                "php": "^5.5.9|>=7.0.8"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "3.4-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Symfony\\Component\\Finder\\": ""
-                },
-                "exclude-from-classmap": [
-                    "/Tests/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Fabien Potencier",
-                    "email": "fabien@symfony.com"
                 },
                 {
-                    "name": "Symfony Community",
-                    "homepage": "https://symfony.com/contributors"
+                    "name": "Gert de Pagter",
+                    "email": "BackEndTea@gmail.com"
                 }
             ],
-            "description": "Symfony Finder Component",
+            "description": "Symfony polyfill for ctype functions",
             "homepage": "https://symfony.com",
-            "time": "2018-03-05T18:28:11+00:00"
+            "keywords": [
+                "compatibility",
+                "ctype",
+                "polyfill",
+                "portable"
+            ],
+            "time": "2018-08-06T14:22:27+00:00"
         },
         {
             "name": "symfony/polyfill-mbstring",
-            "version": "v1.7.0",
+            "version": "v1.10.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-mbstring.git",
-                "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b"
+                "reference": "c79c051f5b3a46be09205c73b80b346e4153e494"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b",
-                "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494",
+                "reference": "c79c051f5b3a46be09205c73b80b346e4153e494",
                 "shasum": ""
             },
             "require": {
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.7-dev"
+                    "dev-master": "1.9-dev"
                 }
             },
             "autoload": {
                 "portable",
                 "shim"
             ],
-            "time": "2018-01-30T19:27:44+00:00"
+            "time": "2018-09-21T13:07:52+00:00"
         },
         {
             "name": "symfony/yaml",
-            "version": "v3.4.6",
+            "version": "v3.4.21",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/yaml.git",
-                "reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb"
+                "reference": "554a59a1ccbaac238a89b19c8e551a556fd0e2ea"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/yaml/zipball/6af42631dcf89e9c616242c900d6c52bd53bd1bb",
-                "reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb",
+                "url": "https://api.github.com/repos/symfony/yaml/zipball/554a59a1ccbaac238a89b19c8e551a556fd0e2ea",
+                "reference": "554a59a1ccbaac238a89b19c8e551a556fd0e2ea",
                 "shasum": ""
             },
             "require": {
-                "php": "^5.5.9|>=7.0.8"
+                "php": "^5.5.9|>=7.0.8",
+                "symfony/polyfill-ctype": "~1.8"
             },
             "conflict": {
                 "symfony/console": "<3.4"
             ],
             "description": "Symfony Yaml Component",
             "homepage": "https://symfony.com",
-            "time": "2018-02-16T09:50:28+00:00"
+            "time": "2019-01-01T13:45:19+00:00"
         },
         {
             "name": "theseer/fdomdocument",
         },
         {
             "name": "webmozart/assert",
-            "version": "1.3.0",
+            "version": "1.4.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/webmozart/assert.git",
-                "reference": "0df1908962e7a3071564e857d86874dad1ef204a"
+                "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a",
-                "reference": "0df1908962e7a3071564e857d86874dad1ef204a",
+                "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9",
+                "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9",
                 "shasum": ""
             },
             "require": {
-                "php": "^5.3.3 || ^7.0"
+                "php": "^5.3.3 || ^7.0",
+                "symfony/polyfill-ctype": "^1.8"
             },
             "require-dev": {
                 "phpunit/phpunit": "^4.6",
                 "check",
                 "validate"
             ],
-            "time": "2018-01-29T19:49:41+00:00"
+            "time": "2018-12-25T11:19:39+00:00"
         }
     ],
     "aliases": [],
     "minimum-stability": "stable",
     "stability-flags": {
         "pubsubhubbub/publisher": 20,
-        "phpmd/phpmd": 0
+        "roave/security-advisories": 20
     },
     "prefer-stable": false,
     "prefer-lowest": false,
     "platform": {
-        "php": ">=5.6"
+        "php": ">=5.6",
+        "ext-json": "*",
+        "ext-zlib": "*"
     },
     "platform-dev": [],
     "platform-overrides": {
diff --git a/doc/custom_theme/main.html b/doc/custom_theme/main.html
new file mode 100644 (file)
index 0000000..cc2a703
--- /dev/null
@@ -0,0 +1,23 @@
+{% extends "base.html" %}
+
+{#
+The entry point for the ReadTheDocs Theme.
+Any theme customisations should override this file to redefine blocks defined in
+the various templates. The custom theme should only need to define a main.html
+which `{% extends "base.html" %}` and defines various blocks which will replace
+the blocks defined in base.html and its included child templates.
+#}
+
+{%- block site_meta %}
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+{%- if 'media.readthedocs.org' not in config.extra_css[0] %}
+<meta name="robots" content="noindex, nofollow">
+{%- endif %}
+
+{% if page and page.is_homepage %}<meta name="description" content="{{ config.site_description }}">{% endif %}
+{% if config.site_author %}<meta name="author" content="{{ config.site_author }}">{% endif %}
+{%- endblock %}
index 49c20c9cebcdfcef5fbb530327af74f86ebbde52..c66d1c7039d1f67d2629f01953e2875acd23dcd0 100644 (file)
@@ -22,7 +22,8 @@ See [REST API](REST-API) for a list of official and community clients.
 - [shaarli2twitter](https://github.com/ArthurHoaro/shaarli2twitter) by [@ArthurHoaro](https://github.com/ArthurHoaro) - Automatically tweet your shared links from Shaarli
 - [shaarli2mastodon](https://github.com/kalvn/shaarli2mastodon) by [@kalvn](https://github.com/kalvn) - This Shaarli plugin allows you to automatically publish links you post on your Mastodon timeline.
 - [shaarli-descriptor](https://github.com/immanuelfodor/shaarli-descriptor) by [@immanuelfodor](https://github.com/immanuelfodor) - Customize the default height/number of rows of the Description field when editing a link.
-
+- [urlextern](https://github.com/trailjeep/shaarli-urlextern) by [@trailjeep](https://github.com/trailjeep) - Shaarli plugin to open external links in a new tab/window.
+- [favicons](https://github.com/trailjeep/shaarli-favicons) by [@trailjeep](https://github.com/trailjeep) - Shaarli plugin to add favicon/filetype icons to links.
 
 ### Third-party themes
 See [Theming](Theming) for a list of community-contributed themes, and an installation guide.
@@ -51,7 +52,7 @@ See [Theming](Theming) for a list of community-contributed themes, and an instal
 - [Shaarlo](https://github.com/DMeloni/shaarlo) - An aggregator for shaarlis with many features (a very popular running instance among French shaarliers: [shaarli.fr](http://shaarli.fr/))
 - [Shaarlimages](https://github.com/BoboTiG/shaarlimages) - An image-oriented aggregator for Shaarlis
 - [mknexen/shaarli-api](https://github.com/mknexen/shaarli-api) - A REST API for Shaarli
-- [Self dead link](https://github.com/qwertygc/shaarli-dev-code/blob/master/self-dead-link.php) - Detect dead links on shaarli. This version use the database of shaarli. [Another version](https://github.com/qwertygc/shaarli-dev-code/blob/master/dead-link.php), can be used for other shaarli instances (but is more resource consuming).
+- [Self dead link](https://framagit.org/qwertygc/shaarli-dev-code/blob/master/self-dead-link.php) - Detect dead links on shaarli. This version use the database of shaarli. [Another version](https://framagit.org/qwertygc/shaarli-dev-code/blob/master/dead-link.php), can be used for other shaarli instances (but is more resource consuming).
 - [Bookmark Archiver](https://github.com/pirate/bookmark-archiver) - Save an archived copy of all websites starred using browser bookmarks/Shaarli/Delicious/Instapaper/Unmark.it/Pocket/Pinboard. Outputs browseable html. 
 
 ## Alternatives to Shaarli
diff --git a/doc/md/Link-structure.md b/doc/md/Link-structure.md
new file mode 100644 (file)
index 0000000..0a2d0f8
--- /dev/null
@@ -0,0 +1,18 @@
+## Link structure
+
+Every link available through the `LinkDB` object is represented as an array 
+containing the following fields:
+
+  * `id` (integer): Unique identifier.
+  * `title` (string): Title of the link.
+  * `url` (string): URL of the link. Used for displayable links (without redirector, url encoding, etc.).  
+           Can be absolute or relative for Notes.
+  * `real_url` (string): Real destination URL, can be redirected, encoded, etc.
+  * `shorturl` (string): Permalink small hash.
+  * `description` (string): Link text description.
+  * `private` (boolean): whether the link is private or not.
+  * `tags` (string): all link tags separated by a single space
+  * `thumbnail` (string|boolean): relative path of the thumbnail cache file, or false if there isn't any.
+  * `created` (DateTime): link creation date time.
+  * `updated` (DateTime): last modification date time.
+  
\ No newline at end of file
index c016de56a6ff031a77fb4bffe7cb514b52a1878f..11bd1cd22f9a62a275ef3b5ce8570849545bb00e 100644 (file)
@@ -152,3 +152,22 @@ See the reference API client:
 
 - [Documentation](http://python-shaarli-client.readthedocs.io/en/latest/) on ReadTheDocs
 - [python-shaarli-client](https://github.com/shaarli/python-shaarli-client) on Github
+
+## Troubleshooting
+
+### Debug mode
+
+> This should never be used in a production environment.
+
+For security reasons, authentication issues will always return an `HTTP 401` error code without any detail.
+
+It is possible to enable the debug mode in `config.json.php` 
+to get the actual error message in the HTTP response body with:
+
+```json
+{
+  "dev": {
+    "debug": true
+  }
+}
+```
index ca82b2ec7cd63c558717cee9ffb430a8459d4578..78083a466729e2b7466f9d017823a99edaa160fa 100644 (file)
@@ -18,7 +18,7 @@ Version | Status | Shaarli compatibility
 7.2 | Supported | Yes
 7.1 | Supported | Yes
 7.0 | Supported | Yes
-5.6 | Supported | Yes
+5.6 | EOL: 2018-12-31 | Yes (up to Shaarli 0.10.x)
 5.5 | EOL: 2016-07-10 | Yes
 5.4 | EOL: 2015-09-14 | Yes (up to Shaarli 0.8.x)
 5.3 | EOL: 2014-08-14 | Yes (up to Shaarli 0.8.x)
@@ -29,7 +29,7 @@ Extension | Required? | Usage
 ---|:---:|---
 [`openssl`](http://php.net/manual/en/book.openssl.php) | All | OpenSSL, HTTPS
 [`php-mbstring`](http://php.net/manual/en/book.mbstring.php) | CentOS, Fedora, RHEL, Windows, some hosting providers | multibyte (Unicode) string support
-[`php-gd`](http://php.net/manual/en/book.image.php) | optional | thumbnail resizing
+[`php-gd`](http://php.net/manual/en/book.image.php) | optional | required to use thumbnails
 [`php-intl`](http://php.net/manual/en/book.intl.php) | optional | localized text sorting (e.g. `e->è->f`)
 [`php-curl`](http://php.net/manual/en/book.curl.php) | optional | using cURL for fetching webpages and thumbnails in a more robust way
 [`php-gettext`](http://php.net/manual/en/book.gettext.php) | optional | Use the translation system in gettext mode (faster)
@@ -397,6 +397,7 @@ http {
 ```
 
 ## Proxies
+
 If Shaarli is served behind a proxy (i.e. there is a proxy server between clients and the web server hosting Shaarli), please refer to the proxy server documentation for proper configuration. In particular, you have to ensure that the following server variables are properly set:
 
 - `X-Forwarded-Proto`
@@ -405,6 +406,12 @@ If Shaarli is served behind a proxy (i.e. there is a proxy server between client
 
 See also [proxy-related](https://github.com/shaarli/Shaarli/issues?utf8=%E2%9C%93&q=label%3Aproxy+) issues.
 
+## Robots and crawlers
+
+Shaarli disallows indexing and crawling of your local documentation pages by search engines, using `<meta name="robots">` HTML tags.
+Your Shaarli instance and other pages you host may still be indexed by various robots on the public Internet.
+You may want to setup a robots.txt file or other crawler control mechanism on your server.
+See [[1]](https://en.wikipedia.org/wiki/Robots_exclusion_standard), [[2]](https://support.google.com/webmasters/answer/6062608?hl=en) and [[3]](https://developers.google.com/search/reference/robots_meta_tag)
 
 ## See also
 
index 4910ff6c67ea44bd5171c67adfcc33ac1c094c08..9a16fc621944f0e40477eff39e5ee4ea30ee2b68 100644 (file)
@@ -15,7 +15,6 @@ While logged in to your Shaarli, you can add new Shaares in several ways:
 
  * [+Shaare button](#shaare-button)
  * [Bookmarklet](#bookmarklet)
- * [Firefox Share](#firefox-share)
  * Third-party [apps and browser addons](Community-&-Related-software.md#mobile-apps)
  * [REST API](https://shaarli.github.io/api-documentation/)
 
@@ -52,22 +51,6 @@ bookmarklet in your browser! The same `New Shaare` dialog as above is displayed.
 ![](images/bookmarklet.png)
 
 
-### Firefox Share
-
-Before using Firefox Share, you must first add Shaarli as a sharing provider:
-
-- Click the `Tools` button in the top bar
-- Click the `✚Add to Firefox social` button and accept the activation.
-
-Once this is done, you can share any URL you are visiting by clicking the Firefox
-_Share_ button ![images/firefoxshare.png](images/firefoxshare.png)
-
-| Note | Firefox Share is no longer available for Firefox 57 and later versions. |
-|---------|---------|
-
-| Note | Your Shaarli instance must be hosted on an HTTPS (SSL/TLS secure connection) enabled server for Firefox Share to work. Firefox Share will not work over plaintext HTTP connections. |
-|---------|---------|
-
 --------------------------------------------------------------------------------
 
 ## Editing Shaares
diff --git a/doc/md/guides/images/01-create-droplet-distro.jpg b/doc/md/guides/images/01-create-droplet-distro.jpg
new file mode 100644 (file)
index 0000000..63682ba
Binary files /dev/null and b/doc/md/guides/images/01-create-droplet-distro.jpg differ
diff --git a/doc/md/guides/images/02-create-droplet-region.jpg b/doc/md/guides/images/02-create-droplet-region.jpg
new file mode 100644 (file)
index 0000000..135a78b
Binary files /dev/null and b/doc/md/guides/images/02-create-droplet-region.jpg differ
diff --git a/doc/md/guides/images/03-create-droplet-size.jpg b/doc/md/guides/images/03-create-droplet-size.jpg
new file mode 100644 (file)
index 0000000..aa5b2fd
Binary files /dev/null and b/doc/md/guides/images/03-create-droplet-size.jpg differ
diff --git a/doc/md/guides/images/04-finalize.jpg b/doc/md/guides/images/04-finalize.jpg
new file mode 100644 (file)
index 0000000..68ec0dc
Binary files /dev/null and b/doc/md/guides/images/04-finalize.jpg differ
diff --git a/doc/md/guides/images/05-droplet.jpg b/doc/md/guides/images/05-droplet.jpg
new file mode 100644 (file)
index 0000000..44e93a1
Binary files /dev/null and b/doc/md/guides/images/05-droplet.jpg differ
diff --git a/doc/md/guides/images/06-domain.jpg b/doc/md/guides/images/06-domain.jpg
new file mode 100644 (file)
index 0000000..5827dd9
Binary files /dev/null and b/doc/md/guides/images/06-domain.jpg differ
diff --git a/doc/md/guides/images/07-installation.jpg b/doc/md/guides/images/07-installation.jpg
new file mode 100644 (file)
index 0000000..42cc9f1
Binary files /dev/null and b/doc/md/guides/images/07-installation.jpg differ
diff --git a/doc/md/guides/install-shaarli-with-debian9-and-docker.md b/doc/md/guides/install-shaarli-with-debian9-and-docker.md
new file mode 100644 (file)
index 0000000..f1b26d4
--- /dev/null
@@ -0,0 +1,257 @@
+_Last updated on 2018-07-01._
+
+## Goals
+- Getting a Virtual Private Server (VPS)
+- Running Shaarli:
+    - as a Docker container,
+    - using the Træfik reverse proxy,
+    - securized with TLS certificates from Let's Encrypt.
+
+
+The following components and tools will be used:
+
+- [Debian](https://www.debian.org/), a GNU/Linux distribution widely used in
+  server environments;
+- [Docker](https://docs.docker.com/engine/docker-overview/), an open platform
+  for developing, shipping, and running applications;
+- [Docker Compose](https://docs.docker.com/compose/), a tool for defining and
+  running multi-container Docker applications.
+
+
+More information can be found in the [Resources](#resources) section at the
+bottom of the guide.
+
+## Getting a Virtual Private Server
+For this guide, I went for the smallest VPS available from DigitalOcean,
+a Droplet with 1 CPU, 1 GiB RAM and 25 GiB SSD storage, which costs
+$5/month ($0.007/hour):
+
+- [Droplets Overview](https://www.digitalocean.com/docs/droplets/overview/)
+- [Pricing](https://www.digitalocean.com/pricing/)
+- [How to Create a Droplet from the DigitalOcean Control Panel](https://www.digitalocean.com/docs/droplets/how-to/create/)
+- [How to Add SSH Keys to Droplets](https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/)
+- [Initial Server Setup with Debian 8](https://www.digitalocean.com/community/tutorials/initial-server-setup-with-debian-8) (also applies to Debian 9)
+- [An Introduction to Securing your Linux VPS](https://www.digitalocean.com/community/tutorials/an-introduction-to-securing-your-linux-vps)
+
+### Creating a Droplet
+Select `Debian 9` as the Droplet distribution:
+
+<img src="../images/01-create-droplet-distro.jpg"
+     width="500px"
+     alt="Droplet distribution" />
+
+Choose a region that is geographically close to you:
+
+<img src="../images/02-create-droplet-region.jpg"
+     width="500px"
+     alt="Droplet region" />
+
+Choose a Droplet size that corresponds to your usage and budget:
+
+<img src="../images/03-create-droplet-size.jpg"
+     width="500px"
+     alt="Droplet size" />
+
+Finalize the Droplet creation:
+
+<img src="../images/04-finalize.jpg"
+     width="500px"
+     alt="Droplet finalization" />
+
+Droplet information is displayed on the Control Panel:
+
+<img src="../images/05-droplet.jpg"
+     width="500px"
+     alt="Droplet summary" />
+
+Once your VPS has been created, you will receive an e-mail with connection
+instructions.
+
+## Obtaining a domain name
+After creating your VPS, it will be reachable using its IP address; some hosting
+providers also create a DNS record, e.g. `ns4853142.ip-01-47-127.eu`.
+
+A domain name (DNS record) is required to obtain a certificate and setup HTTPS
+(HTTP with TLS encryption).
+
+Domain names can be obtained from registrars through hosting providers such as
+[Gandi](https://www.gandi.net/en/domain).
+
+Once you have your own domain, you need to create a new DNS record that points
+to your VPS' IP address:
+
+<img src="../images/06-domain.jpg"
+     width="650px"
+     alt="Domain configuration" />
+
+## Host setup
+Now's the time to connect to your freshly created VPS!
+
+```shell
+$ ssh root@188.166.85.8
+
+Linux stretch-shaarli-02 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64
+
+The programs included with the Debian GNU/Linux system are free software;
+the exact distribution terms for each program are described in the
+individual files in /usr/share/doc/*/copyright.
+
+Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
+permitted by applicable law.
+Last login: Sun Jul  1 11:20:18 2018 from <REDACTED>
+
+root@stretch-shaarli-02:~$
+```
+
+### Updating the system
+```shell
+root@stretch-shaarli-02:~$ apt update && apt upgrade -y
+```
+
+### Setting up Docker
+_The following instructions are from the
+[Get Docker CE for Debian](https://docs.docker.com/install/linux/docker-ce/debian/)
+guide._
+
+Install package dependencies:
+
+```shell
+root@stretch-shaarli-02:~$ apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
+```
+
+Add Docker's package repository GPG key:
+
+```shell
+root@stretch-shaarli-02:~$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
+```
+
+Add Docker's package repository:
+
+```shell
+root@stretch-shaarli-02:~$ add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable"
+```
+
+Update package lists and install Docker:
+
+```shell
+root@stretch-shaarli-02:~$ apt update && apt install -y docker-ce
+```
+
+Verify Docker is properly configured by running the `hello-world` image:
+
+```shell
+root@stretch-shaarli-02:~$ docker run hello-world
+```
+
+### Setting up Docker Compose
+_The following instructions are from the
+[Install Docker Compose](https://docs.docker.com/compose/install/)
+guide._
+
+Download the current version from the release page:
+
+```shell
+root@stretch-shaarli-02:~$ curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
+root@stretch-shaarli-02:~$ chmod +x /usr/local/bin/docker-compose
+```
+
+## Running Shaarli
+Shaarli comes with a configuration file for Docker Compose, that will setup:
+
+- a local Docker network
+- a Docker [volume](https://docs.docker.com/storage/volumes/) to store Shaarli data
+- a Docker [volume](https://docs.docker.com/storage/volumes/) to store Træfik TLS configuration and certificates
+- a [Shaarli](https://hub.docker.com/r/shaarli/shaarli/) instance
+- a [Træfik](https://hub.docker.com/_/traefik/) instance
+
+[Træfik](https://docs.traefik.io/) is a modern HTTP reverse proxy, with native
+support for Docker and [Let's Encrypt](https://letsencrypt.org/).
+
+### Compose configuration
+Create a new directory to store the configuration:
+
+```shell
+root@stretch-shaarli-02:~$ mkdir shaarli && cd shaarli
+root@stretch-shaarli-02:~/shaarli$
+```
+
+Download the current version of Shaarli's `docker-compose.yml`:
+
+```shell
+root@stretch-shaarli-02:~/shaarli$ curl -L https://raw.githubusercontent.com/shaarli/Shaarli/master/docker-compose.yml -o docker-compose.yml
+```
+
+Create the `.env` file and fill in your VPS and domain information (replace
+`<MY_SHAARLI_DOMAIN>` and `<MY_CONTACT_EMAIL>` with your actual information):
+
+```shell
+root@stretch-shaarli-02:~/shaarli$ vim .env
+```
+
+```shell
+SHAARLI_VIRTUAL_HOST=<MY_SHAARLI_DOMAIN>
+SHAARLI_LETSENCRYPT_EMAIL=<MY_CONTACT_EMAIL>
+```
+
+### Pull the Docker images
+```shell
+root@stretch-shaarli-02:~/shaarli$ docker-compose pull
+Pulling shaarli ... done
+Pulling traefik ... done
+```
+
+### Run!
+```shell
+root@stretch-shaarli-02:~/shaarli$ docker-compose up -d
+Creating network "shaarli_http-proxy" with the default driver
+Creating volume "shaarli_traefik-acme" with default driver
+Creating volume "shaarli_shaarli-data" with default driver
+Creating shaarli_shaarli_1 ... done
+Creating shaarli_traefik_1 ... done
+```
+
+## Conclusion
+Congratulations! Your Shaarli instance should be up and running, and available
+at `https://<MY_SHAARLI_DOMAIN>`.
+
+<img src="../images/07-installation.jpg"
+     width="500px"
+     alt="Shaarli installation page" />
+
+## Resources
+### Related Shaarli documentation
+- [Docker 101](../docker/docker-101.md)
+- [Shaarli images](../docker/shaarli-images.md)
+
+### Hosting providers
+- [DigitalOcean](https://www.digitalocean.com/)
+- [Gandi](https://www.gandi.net/en)
+- [OVH](https://www.ovh.co.uk/)
+- [RackSpace](https://www.rackspace.com/)
+- etc.
+
+### Domain Names and Registrars
+- [Introduction to the Domain Name System (DNS)](https://opensource.com/article/17/4/introduction-domain-name-system-dns)
+- [ICANN](https://www.icann.org/)
+- [Domain name registrar](https://en.wikipedia.org/wiki/Domain_name_registrar)
+- [OVH Domain Registration](https://www.ovh.co.uk/domains/)
+- [Gandi Domain Registration](https://www.gandi.net/en/domain)
+
+### HTTPS and Security
+- [Transport Layer Security](https://en.wikipedia.org/wiki/Transport_Layer_Security)
+- [Let's Encrypt](https://letsencrypt.org/)
+
+### Docker
+- [Docker Overview](https://docs.docker.com/engine/docker-overview/)
+- [Docker Documentation](https://docs.docker.com/)
+- [Get Docker CE for Debian](https://docs.docker.com/install/linux/docker-ce/debian/)
+- [docker logs](https://docs.docker.com/engine/reference/commandline/logs/)
+- [Volumes](https://docs.docker.com/storage/volumes/)
+- [Install Docker Compose](https://docs.docker.com/compose/install/)
+- [docker-compose logs](https://docs.docker.com/compose/reference/logs/)
+
+### Træfik
+- [Getting Started](https://docs.traefik.io/)
+- [Docker backend](https://docs.traefik.io/configuration/backends/docker/)
+- [Let's Encrypt and Docker](https://docs.traefik.io/user-guide/docker-and-lets-encrypt/)
+- [traefik](https://hub.docker.com/_/traefik/) Docker image
diff --git a/doc/md/images/icon.png b/doc/md/images/icon.png
new file mode 100644 (file)
index 0000000..530d746
Binary files /dev/null and b/doc/md/images/icon.png differ
index c18332b410feba194590b221e1150e4e073c50de..220eeec144b85ddd787f7235d328182c607853db 100644 (file)
@@ -1,25 +1,19 @@
-# [Shaarli](https://github.com/shaarli/Shaarli/) documentation
+# <img src="images/icon.png" width="20px" height="20px"> Shaarli
 
 The personal, minimalist, super-fast, database free, bookmarking service.
 
 Do you want to share the links you discover?
-Shaarli is a minimalist link sharing service that you can install on your own server.
+Shaarli is a minimalist bookmark manager and link sharing service that you can install on your own server.
 It is designed to be personal (single-user), fast and handy.
 
 <!-- TODO screenshots -->
 
-Here you can find some info on how to use, configure, tweak and solve problems with your Shaarli.
-For general information, read the [README](https://github.com/shaarli/Shaarli/blob/master/README.md).
+Visit the pages in the sidebar to find information on how to setup, use, configure, tweak and troubleshoot Shaarli.
 
-If you have any questions or ideas, please join the [chat](https://gitter.im/shaarli/Shaarli) (also reachable via [IRC](https://irc.gitter.im/)), post them in our [general discussion](https://github.com/shaarli/Shaarli/issues/308) or read the current [issues](https://github.com/shaarli/Shaarli/issues).
-
-If you've found a bug, please create a [new issue](https://github.com/shaarli/Shaarli/issues/new).
-
-If you would like a feature added to Shaarli, check the issues labeled [`feature`](https://github.com/shaarli/Shaarli/labels/feature), [`enhancement`](https://github.com/shaarli/Shaarli/labels/enhancement), and [`plugin`](https://github.com/shaarli/Shaarli/labels/plugin).
 
 * [GitHub project page](https://github.com/shaarli/Shaarli)
-* [Online documentation](https://shaarli.readthedocs.io/) (this page)
-* [Latest Shaarli releases](https://github.com/shaarli/Shaarli/releases)
+* [Online documentation](https://shaarli.readthedocs.io/)
+* [Latest releases](https://github.com/shaarli/Shaarli/releases)
 * [Changelog](https://github.com/shaarli/Shaarli/blob/master/CHANGELOG.md)
 
 
@@ -30,87 +24,70 @@ It runs the latest development version of Shaarli and is updated/reset daily.
 
 Login: `demo`; Password: `demo`
 
-<!-- TODO review everything below this point -->
-
-
 ## Features
 
 Shaarli can be used:
 
-- to share, comment and save interesting links and news.
-- to bookmark useful/frequent personal links (as private links) and share them between computers.
-- as a minimal blog/microblog/writing platform (no character limit).
-- as a read-it-later list (for example items tagged `readlater`).
-- to draft and save articles/posts/ideas.
-- to keep code snippets.
-- to keep notes and documentation.
-- as a shared clipboard/notepad/pastebin between machines.
-- as a todo list.
-- to store playlists (e.g. with the `music` or `video` tags).
+- to share, comment and save interesting links and news
+- to bookmark useful/frequent links and share them between computers
+- as a minimal blog/microblog/writing platform
+- as a read-it-later list
+- to draft and save articles/posts/ideas
+- to keep notes, documentation and code snippets
+- as a shared clipboard/notepad/pastebin between machines
+- as a todo list
+- to store media playlists
 - to keep extracts/comments from webpages that may disappear.
-- to keep track of ongoing discussions (for example items tagged `discussion`).
-- [to feed RSS aggregators](http://shaarli.chassegnouf.net/?9Efeiw) (planets) with specific tags.
-- to feed other social networks, blogs... using RSS feeds and external services (dlvr.it, ifttt.com ...).
+- to keep track of ongoing discussions
+- to feed other blogs, aggregators, social networks... using RSS feeds
 
-### Interface
+### Edit, view and search your links
 
-- minimalist design (simple is beautiful)
+- Minimalist design
 - FAST
-- ATOM and RSS feeds
-- views:
-    - paginated link list (with image and video thumbnails)
-    - tag cloud
-    - picture wall: image and video thumbnails (with lazy loading)
-    - daily: newspaper-like daily digest
-    - daily RSS feed
-- permalinks for easy reference
-- links can be public or private
-- thumbnail generation for images and video services
+- Customizable link titles and descriptions
+- Tags to organize your links (features tag autocompletion, renaming, merging and deletion)
+- Search by tag or using the full-text search
+- Public and private links (visible only to logged-in users)
+- Unique permalinks for easy reference
+- Paginated link list (with image and video thumbnails)
+- Tag cloud and list views
+- Picture wall: image and video thumbnails view (with lazy loading)
+- ATOM and RSS feeds (can also be filtered using tags or text search)
+- Daily: newspaper-like daily digest (and daily RSS feed)
 - URL cleanup: automatic removal of `?utm_source=...`, `fb=...`
-- extensible through [plugins](https://shaarli.readthedocs.io/en/master/Plugins/#plugin-usage)
-
-### Tag, view and search your links
-
-- add a custom title and description to archived links
-- add tags to classify and search links
-  - features tag autocompletion, renaming, merging and deletion
-- full-text and tag search
+- Extensible through [plugins](https://shaarli.readthedocs.io/en/master/Plugins/#plugin-usage)
 
 ### Easy setup
 
-- dead-simple installation: drop the files, open the page
-- links are stored in a file
-    - compact storage
-    - no database required
-    - easy backup: simply copy the datastore file
-- import and export links as Netscape bookmarks
+- Dead-simple installation: drop the files, open the page
+- Links are stored in a file (no database required, easy backup: simply copy the datastore file)
+- Import and export links as Netscape bookmarks compatible with most Web browsers
 
 ### Accessibility
 
-- bookmarlet to share links in one click
-- support for mobile browsers
-- degrades gracefully with Javascript disabled
-- easy page customization through HTML/CSS/RainTPL
+- Bookmarklet and other tools to share links in one click
+- Support for mobile browsers
+- Degrades gracefully with Javascript disabled
+- Easy page customization through HTML/CSS/RainTPL
 
 ### Security
 
-- discreet pop-up notification when a new release is available
-- bruteforce protection on the login form
-- protected against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) and session cookie hijacking
+- Discreet pop-up notification when a new release is available
+- Bruteforce protection on the login form
+- Protected against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) and session cookie hijacking
 
 <!-- TODO Limitations -->
 
 ### REST API
 
-Easily extensible by any client using the REST API exposed by Shaarli.
-
-See the [API documentation](http://shaarli.github.io/api-documentation/).
+- Easily extensible by any client using the REST API exposed by Shaarli ([API documentation](http://shaarli.github.io/api-documentation/)).
 
 ## About
 
 ### Shaarli community fork
 
-This friendly fork is maintained by the Shaarli community at https://github.com/shaarli/Shaarli
+This friendly fork is maintained by the Shaarli community at <https://github.com/shaarli/Shaarli>
 
 This is a community fork of the original [Shaarli](https://github.com/sebsauvage/Shaarli/) project by [Sébastien Sauvage](http://sebsauvage.net/).
 
@@ -123,16 +100,15 @@ in this repository, and will keep maintaining the project for the foreseeable
 future, while keeping Shaarli simple and efficient.
 
 
-### Contributing
+### Contributing and getting help
 
-If you'd like to help, please:
+Feedback is very appreciated!
 
-- have a look at the open [issues](https://github.com/shaarli/Shaarli/issues)
-and [pull requests](https://github.com/shaarli/Shaarli/pulls)
-- feel free to report bugs (feedback is much appreciated)
-- suggest new features and improvements to both code and [documentation](https://github.com/shaarli/Shaarli/tree/master/doc/md/)
-- propose solutions to existing problems
-- submit pull requests :-)
+- If you have any questions or ideas, please join the [chat](https://gitter.im/shaarli/Shaarli) (also reachable via [IRC](https://irc.gitter.im/)), post them in our [general discussion](https://github.com/shaarli/Shaarli/issues/308) or read the current [issues](https://github.com/shaarli/Shaarli/issues).
+- Have a look at the open [issues](https://github.com/shaarli/Shaarli/issues) and [pull requests](https://github.com/shaarli/Shaarli/pulls)
+- If you would like a feature added to Shaarli, check the issues labeled [`feature`](https://github.com/shaarli/Shaarli/labels/feature), [`enhancement`](https://github.com/shaarli/Shaarli/labels/enhancement), and [`plugin`](https://github.com/shaarli/Shaarli/labels/plugin).
+- If you've found a bug, please create a [new issue](https://github.com/shaarli/Shaarli/issues/new).
+- Feel free to propose solutions to existing problems, help us improve the documentation and translations, and submit pull requests :-)
 
 
 ### License
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644 (file)
index 0000000..e8ea427
--- /dev/null
@@ -0,0 +1,61 @@
+---
+# Shaarli - Docker Compose example configuration
+#
+# See:
+# - https://shaarli.readthedocs.io/en/master/docker/shaarli-images/
+# - https://shaarli.readthedocs.io/en/master/guides/install-shaarli-with-debian9-and-docker/
+#
+# Environment variables:
+# - SHAARLI_VIRTUAL_HOST      Fully Qualified Domain Name for the Shaarli instance
+# - SHAARLI_LETSENCRYPT_EMAIL Contact email for certificate renewal
+version: '3'
+
+networks:
+  http-proxy:
+
+volumes:
+  traefik-acme:
+  shaarli-cache:
+  shaarli-data:
+
+services:
+  shaarli:
+    image: shaarli/shaarli:master
+    build: ./
+    networks:
+      - http-proxy
+    volumes:
+      - shaarli-cache:/var/www/shaarli/cache
+      - shaarli-data:/var/www/shaarli/data
+    labels:
+      traefik.domain: "${SHAARLI_VIRTUAL_HOST}"
+      traefik.backend: shaarli
+      traefik.frontend.rule: "Host:${SHAARLI_VIRTUAL_HOST}"
+
+  traefik:
+    image: traefik
+    command:
+      - "--defaultentrypoints=http,https"
+      - "--entrypoints=Name:http Address::80 Redirect.EntryPoint:https"
+      - "--entrypoints=Name:https Address::443 TLS"
+      - "--retry"
+      - "--docker"
+      - "--docker.domain=docker.localhost"
+      - "--docker.exposedbydefault=true"
+      - "--docker.watch=true"
+      - "--acme"
+      - "--acme.domains=${SHAARLI_VIRTUAL_HOST}"
+      - "--acme.email=${SHAARLI_LETSENCRYPT_EMAIL}"
+      - "--acme.entrypoint=https"
+      - "--acme.onhostrule=true"
+      - "--acme.storage=/acme/acme.json"
+      - "--acme.httpchallenge"
+      - "--acme.httpchallenge.entrypoint=http"
+    networks:
+      - http-proxy
+    ports:
+      - 80:80
+      - 443:443
+    volumes:
+      - /var/run/docker.sock:/var/run/docker.sock:ro
+      - traefik-acme:/acme
index 2ebeccbc2d4c9629033c1a52670860b0e46786f4..102c80da93636a5de87d265c4cbc25100dd739de 100644 (file)
@@ -1,15 +1,15 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: Shaarli\n"
-"POT-Creation-Date: 2018-01-24 18:43+0100\n"
-"PO-Revision-Date: 2018-03-06 18:44+0100\n"
+"POT-Creation-Date: 2018-10-06 13:08+0200\n"
+"PO-Revision-Date: 2018-10-06 13:08+0200\n"
 "Last-Translator: \n"
 "Language-Team: Shaarli\n"
 "Language: fr_FR\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 2.1.1\n"
 "X-Poedit-Basepath: ../../../..\n"
 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
 "X-Poedit-SourceCharset: UTF-8\n"
@@ -48,7 +48,7 @@ msgstr "le fichier n'est pas accessible en écriture"
 #: application/Cache.php:16
 #, php-format
 msgid "Cannot purge %s: no directory"
-msgstr "Impossible de purger %s: le répertoire n'existe pas"
+msgstr "Impossible de purger %s : le répertoire n'existe pas"
 
 #: application/FeedBuilder.php:151
 msgid "Direct link"
@@ -56,7 +56,7 @@ msgstr "Liens directs"
 
 #: application/FeedBuilder.php:153
 #: tmp/daily.b91ef64efc3688266305ea9b42e5017e.rtpl.php:88
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:178
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:177
 msgid "Permalink"
 msgstr "Permalien"
 
@@ -68,18 +68,22 @@ msgstr "Le fichier d'historique n'est pas accessible en lecture ou en écriture"
 msgid "Could not parse history file"
 msgstr "Format incorrect pour le fichier d'historique"
 
-#: application/Languages.php:161
+#: application/Languages.php:177
 msgid "Automatic"
 msgstr "Automatique"
 
-#: application/Languages.php:162
+#: application/Languages.php:178
 msgid "English"
 msgstr "Anglais"
 
-#: application/Languages.php:163
+#: application/Languages.php:179
 msgid "French"
 msgstr "Français"
 
+#: application/Languages.php:180
+msgid "German"
+msgstr "Allemand"
+
 #: application/LinkDB.php:136
 msgid "You are not authorized to add a link."
 msgstr "Vous n'êtes pas autorisé à ajouter un lien."
@@ -94,17 +98,15 @@ msgstr "Vous devez utiliser un entier comme clé."
 
 #: application/LinkDB.php:145
 msgid "Array offset and link ID must be equal."
-msgstr "La clé du tableau et l'ID du lien doivent être égaux."
+msgstr "La clé du tableau et l'ID du lien doivent être identiques."
 
 #: application/LinkDB.php:251
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:14
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:48
 msgid ""
 "The personal, minimalist, super-fast, database free, bookmarking service"
 msgstr ""
-"Le gestionnaire de marque-page personnel, minimaliste, et sans base de "
+"Le gestionnaire de marque-pages personnel, minimaliste, et sans base de "
 "données"
 
 #: application/LinkDB.php:253
@@ -121,11 +123,11 @@ msgstr ""
 "Bienvenue sur Shaarli ! Ceci est votre premier marque-page public. Pour me "
 "modifier ou me supprimer, vous devez d'abord vous connecter.\n"
 "\n"
-"Pour apprendre comment utiliser Shaarli, consultez le lien « Documentation » "
-"en bas de page.\n"
+"Pour apprendre à utiliser Shaarli, consultez le lien « Documentation » en "
+"bas de page.\n"
 "\n"
 "Vous utilisez la version supportée par la communauté du projet original "
-"Shaarli, de Sébastien Sauvage."
+"Shaarli de Sébastien Sauvage."
 
 #: application/LinkDB.php:267
 msgid "My secret stuff... - Pastebin.com"
@@ -163,11 +165,11 @@ msgstr ""
 "a été importé avec succès en %d secondes : %d liens importés, %d liens "
 "écrasés, %d liens ignorés."
 
-#: application/PageBuilder.php:168
+#: application/PageBuilder.php:200
 msgid "The page you are trying to reach does not exist or has been deleted."
 msgstr "La page que vous essayez de consulter n'existe pas ou a été supprimée."
 
-#: application/PageBuilder.php:170
+#: application/PageBuilder.php:202
 msgid "404 Not Found"
 msgstr "404 Introuvable"
 
@@ -176,21 +178,37 @@ msgstr "404 Introuvable"
 msgid "Plugin \"%s\" files not found."
 msgstr "Les fichiers de l'extension \"%s\" sont introuvables."
 
-#: application/Updater.php:76
+#: application/Thumbnailer.php:61
+msgid ""
+"php-gd extension must be loaded to use thumbnails. Thumbnails are now "
+"disabled. Please reload the page."
+msgstr ""
+"l'extension php-gd doit être chargée pour utiliser les miniatures. Les "
+"miniatures sont désormais désactivées. Rechargez la page."
+
+#: application/Updater.php:86
 msgid "Couldn't retrieve Updater class methods."
 msgstr "Impossible de récupérer les méthodes de la classe Updater."
 
-#: application/Updater.php:506
+#: application/Updater.php:514 index.php:1022
+msgid ""
+"You have enabled or changed thumbnails mode. <a href=\"?do=thumbs_update"
+"\">Please synchronize them</a>."
+msgstr ""
+"Vous avez activé ou changé le mode de miniatures. <a href=\"?do=thumbs_update"
+"\">Merci de les synchroniser</a>."
+
+#: application/Updater.php:586
 msgid "An error occurred while running the update "
 msgstr "Une erreur s'est produite lors de l'exécution de la mise à jour "
 
-#: application/Updater.php:546
+#: application/Updater.php:626
 msgid "Updates file path is not set, can't write updates."
 msgstr ""
 "Le chemin vers le fichier de mise à jour n'est pas défini, impossible "
 "d'écrire les mises à jour."
 
-#: application/Updater.php:551
+#: application/Updater.php:631
 msgid "Unable to write updates in "
 msgstr "Impossible d'écrire les mises à jour dans "
 
@@ -230,6 +248,7 @@ msgstr ""
 "Shaarli a les droits d'écriture dans le dossier dans lequel il est installé."
 
 #: application/config/ConfigManager.php:135
+#: application/config/ConfigManager.php:162
 msgid "Invalid setting key parameter. String expected, got: "
 msgstr "Clé de paramétrage invalide. Chaîne de caractères obtenue, attendu : "
 
@@ -251,135 +270,128 @@ msgstr "Vous n'êtes pas autorisé à modifier la configuration."
 msgid "Error accessing"
 msgstr "Une erreur s'est produite en accédant à"
 
-#: index.php:142
+#: index.php:143
 msgid "Shared links on "
 msgstr "Liens partagés sur "
 
-#: index.php:164
+#: index.php:165
 msgid "Insufficient permissions:"
 msgstr "Permissions insuffisantes :"
 
-#: index.php:303
+#: index.php:201
 msgid "I said: NO. You are banned for the moment. Go away."
 msgstr "NON. Vous êtes banni pour le moment. Revenez plus tard."
 
-#: index.php:368
+#: index.php:273
 msgid "Wrong login/password."
-msgstr "Nom d'utilisateur ou mot de passe incorrects."
+msgstr "Nom d'utilisateur ou mot de passe incorrect(s)."
 
-#: index.php:576 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:42
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:42
+#: index.php:482 tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:46
 msgid "Daily"
 msgstr "Quotidien"
 
-#: index.php:681 tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:28
+#: index.php:588 tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:28
 #: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:44
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:71
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:95
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:71
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:95
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:75
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:99
 msgid "Login"
 msgstr "Connexion"
 
-#: index.php:722 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:39
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:39
+#: index.php:605 tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:41
 msgid "Picture wall"
 msgstr "Mur d'images"
 
-#: index.php:770 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:36
+#: index.php:682 tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:36
 #: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
 msgid "Tag cloud"
 msgstr "Nuage de tags"
 
-#: index.php:803 tmp/tag.list.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
+#: index.php:715 tmp/tag.list.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
 msgid "Tag list"
 msgstr "Liste des tags"
 
-#: index.php:1028 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:31
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:31
+#: index.php:940 tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:31
 msgid "Tools"
 msgstr "Outils"
 
-#: index.php:1037
+#: index.php:949
 msgid "You are not supposed to change a password on an Open Shaarli."
 msgstr ""
 "Vous n'êtes pas censé modifier le mot de passe d'un Shaarli en mode ouvert."
 
-#: index.php:1042 index.php:1084 index.php:1162 index.php:1193 index.php:1293
+#: index.php:954 index.php:996 index.php:1084 index.php:1116 index.php:1221
 msgid "Wrong token."
 msgstr "Jeton invalide."
 
-#: index.php:1047
+#: index.php:959
 msgid "The old password is not correct."
 msgstr "L'ancien mot de passe est incorrect."
 
-#: index.php:1067
+#: index.php:979
 msgid "Your password has been changed"
 msgstr "Votre mot de passe a été modifié"
 
-#: index.php:1072
-#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
+#: index.php:984 tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
 msgid "Change password"
-msgstr "Modification du mot de passe"
+msgstr "Modifier le mot de passe"
 
-#: index.php:1121
+#: index.php:1042
 msgid "Configuration was saved."
-msgstr "La configuration a été sauvegardé."
+msgstr "La configuration a été sauvegardée."
 
-#: index.php:1145 tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
+#: index.php:1067 tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
 msgid "Configure"
 msgstr "Configurer"
 
-#: index.php:1156 tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
+#: index.php:1078 tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
 msgid "Manage tags"
 msgstr "Gérer les tags"
 
-#: index.php:1174
+#: index.php:1097
 #, php-format
 msgid "The tag was removed from %d link."
 msgid_plural "The tag was removed from %d links."
 msgstr[0] "Le tag a été supprimé de %d lien."
 msgstr[1] "Le tag a été supprimé de %d liens."
 
-#: index.php:1175
+#: index.php:1098
 #, php-format
 msgid "The tag was renamed in %d link."
 msgid_plural "The tag was renamed in %d links."
 msgstr[0] "Le tag a été renommé dans %d lien."
 msgstr[1] "Le tag a été renommé dans %d liens."
 
-#: index.php:1183 tmp/addlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
+#: index.php:1106 tmp/addlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
 msgid "Shaare a new link"
 msgstr "Partager un nouveau lien"
 
-#: index.php:1353 tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:170
+#: index.php:1281 tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:169
 msgid "Edit"
 msgstr "Modifier"
 
-#: index.php:1353 index.php:1418
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26
+#: index.php:1281 index.php:1351
 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:26
 msgid "Shaare"
 msgstr "Shaare"
 
-#: index.php:1387
+#: index.php:1320
 msgid "Note: "
 msgstr "Note : "
 
-#: index.php:1427 tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:65
+#: index.php:1359
+msgid "Invalid link ID provided"
+msgstr ""
+
+#: index.php:1379
 msgid "Export"
 msgstr "Exporter"
 
-#: index.php:1489 tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:83
+#: index.php:1441
 msgid "Import"
 msgstr "Importer"
 
-#: index.php:1499
+#: index.php:1451
 #, php-format
 msgid ""
 "The file you are trying to upload is probably bigger than what this "
@@ -389,16 +401,20 @@ msgstr ""
 "le serveur web peut accepter (%s). Merci de l'envoyer en parties plus "
 "légères."
 
-#: index.php:1538 tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26
+#: index.php:1490 tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26
 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:22
 msgid "Plugin administration"
-msgstr "Administration des extensions"
+msgstr "Administration des plugins"
 
-#: index.php:1703
+#: index.php:1542 tmp/thumbnails.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
+msgid "Thumbnails update"
+msgstr "Mise à jour des miniatures"
+
+#: index.php:1714
 msgid "Search: "
 msgstr "Recherche : "
 
-#: index.php:1930
+#: index.php:1754
 #, php-format
 msgid ""
 "<pre>Sessions do not seem to work correctly on your server.<br>Make sure the "
@@ -408,16 +424,16 @@ msgid ""
 "custom hostname without a dot causes cookie storage to fail. We recommend "
 "accessing your server via it's IP address or Fully Qualified Domain Name.<br>"
 msgstr ""
-"<pre>Les sesssions ne semble pas fonctionner sur ce serveur.<br>Assurez vous "
-"que la variable « session.save_path » est correctement définie dans votre "
-"fichier de configuration PHP, et que vous y avez les droits d'écriture."
-"<br>Ce paramètre pointe actuellement sur %s.<br>Sur certains navigateurs, "
-"accéder à votre serveur depuis un nom d'hôte comme « localhost » ou autre "
-"nom personnalisé sans point '.' entraine l'échec de la sauvegarde des "
-"cookies. Nous vous recommandons d'accéder à votre serveur depuis son adresse "
-"IP ou un <em>Fully Qualified Domain Name</em>.<br>"
-
-#: index.php:1940
+"<pre>Les sesssions ne semblent pas fonctionner sur ce serveur.<br>Assurez "
+"vous que la variable « session.save_path » est correctement définie dans "
+"votre fichier de configuration PHP, et que vous avez les droits d'écriture "
+"dessus.<br>Ce paramètre pointe actuellement sur %s.<br>Sur certains "
+"navigateurs, accéder à votre serveur depuis un nom d'hôte comme « localhost "
+"» ou autre nom personnalisé sans point '.' entraine l'échec de la sauvegarde "
+"des cookies. Nous vous recommandons d'accéder à votre serveur depuis son "
+"adresse IP ou un <em>Fully Qualified Domain Name</em>.<br>"
+
+#: index.php:1764
 msgid "Click to try again."
 msgstr "Cliquer ici pour réessayer."
 
@@ -432,7 +448,7 @@ msgstr "Shaare"
 
 #: plugins/addlink_toolbar/addlink_toolbar.php:50
 msgid "Adds the addlink input on the linklist page."
-msgstr "Ajout le formulaire d'ajout de liens sur la page principale."
+msgstr "Ajoute le formulaire d'ajout de liens sur la page principale."
 
 #: plugins/archiveorg/archiveorg.php:23
 msgid "View on archive.org"
@@ -448,7 +464,7 @@ msgid ""
 "developers."
 msgstr ""
 "Une extension de démonstration couvrant tous les cas d'utilisation pour les "
-"designers et les développeurs."
+"designers de thèmes et les développeurs d'extensions."
 
 #: plugins/isso/isso.php:20
 msgid ""
@@ -458,28 +474,29 @@ msgstr ""
 "Erreur de l'extension Isso : Merci de définir le paramètre « ISSO_SERVER » "
 "dans la page d'administration des extensions."
 
-#: plugins/isso/isso.php:63
+#: plugins/isso/isso.php:90
 msgid "Let visitor comment your shaares on permalinks with Isso."
 msgstr ""
-"Permet aux visiteurs de commenter vos shaares sur les permaliens avec Isso."
+"Permettre aux visiteurs de commenter vos shaares sur les permaliens avec "
+"Isso."
 
-#: plugins/isso/isso.php:64
+#: plugins/isso/isso.php:91
 msgid "Isso server URL (without 'http://')"
 msgstr "URL du serveur Isso (sans 'http://')"
 
-#: plugins/markdown/markdown.php:158
+#: plugins/markdown/markdown.php:161
 msgid "Description will be rendered with"
 msgstr "La description sera générée avec"
 
-#: plugins/markdown/markdown.php:159
+#: plugins/markdown/markdown.php:162
 msgid "Markdown syntax documentation"
 msgstr "Documentation sur la syntaxe Markdown"
 
-#: plugins/markdown/markdown.php:160
+#: plugins/markdown/markdown.php:163
 msgid "Markdown syntax"
 msgstr "la syntaxe Markdown"
 
-#: plugins/markdown/markdown.php:339
+#: plugins/markdown/markdown.php:347
 msgid ""
 "Render shaare description with Markdown syntax.<br><strong>Warning</"
 "strong>:\n"
@@ -555,7 +572,7 @@ msgstr "Active la publication de flux vers PubSubHubbub."
 
 #: plugins/qrcode/qrcode.php:69 plugins/wallabag/wallabag.php:68
 msgid "For each link, add a QRCode icon."
-msgstr "Pour chaque liens, ajouter une icône de QRCode."
+msgstr "Pour chaque lien, ajouter une icône de QRCode."
 
 #: plugins/wallabag/wallabag.php:21
 msgid ""
@@ -577,38 +594,20 @@ msgstr "URL de l'API Wallabag"
 msgid "Wallabag API version (1 or 2)"
 msgstr "Version de l'API Wallabag (1 ou 2)"
 
-#: tests/LanguagesTest.php:188 tests/LanguagesTest.php:201
+#: tests/LanguagesTest.php:214 tests/LanguagesTest.php:227
 #: tests/languages/fr/LanguagesFrTest.php:160
 #: tests/languages/fr/LanguagesFrTest.php:173
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:81
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:81
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:85
 msgid "Search"
 msgid_plural "Search"
 msgstr[0] "Rechercher"
 msgstr[1] "Rechercher"
 
-#: tmp/404.b91ef64efc3688266305ea9b42e5017e.rtpl.php:12
-msgid "Sorry, nothing to see here."
-msgstr "Désolé, il y a rien à voir ici."
-
 #: tmp/addlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
 msgid "URL or leave empty to post a note"
 msgstr "URL ou laisser vide pour créer une note"
 
-#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
-msgid "Current password"
-msgstr "Mot de passe actuel"
-
-#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
-msgid "New password"
-msgstr "Nouveau mot de passe"
-
-#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:23
-msgid "Change"
-msgstr "Changer"
-
 #: tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:77
 msgid "Tag"
 msgstr "Tag"
 
@@ -625,8 +624,8 @@ msgid "Rename"
 msgstr "Renommer"
 
 #: tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:35
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:79
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:172
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:77
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:171
 msgid "Delete"
 msgstr "Supprimer"
 
@@ -638,6 +637,34 @@ msgstr "Vous pouvez aussi modifier les tags dans la"
 msgid "tag list"
 msgstr "liste des tags"
 
+#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:143
+#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:296
+msgid "All"
+msgstr "Tous"
+
+#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:147
+#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:300
+msgid "Only common media hosts"
+msgstr "Seulement les hébergeurs de média connus"
+
+#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:151
+#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:304
+msgid "None"
+msgstr "Aucune"
+
+#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:158
+#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:281
+msgid "You need to enable the extension <code>php-gd</code> to use thumbnails."
+msgstr ""
+"Vous devez activer l'extension <code>php-gd</code> pour utiliser les "
+"miniatures."
+
+#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:162
+#, fuzzy
+#| msgid "Enable thumbnails"
+msgid "Synchonize thumbnails"
+msgstr "Activer les miniatures"
+
 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
 msgid "title"
 msgstr "titre"
@@ -655,22 +682,18 @@ msgid "Theme"
 msgstr "Thème"
 
 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:87
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:78
 msgid "Language"
 msgstr "Langue"
 
 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:116
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:102
 msgid "Timezone"
 msgstr "Fuseau horaire"
 
 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:117
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:103
 msgid "Continent"
 msgstr "Continent"
 
 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:117
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:103
 msgid "City"
 msgstr "Ville"
 
@@ -711,33 +734,38 @@ msgid "Do not show any links if the user is not logged in"
 msgstr "N'afficher aucun lien sans être connecté"
 
 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:231
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:150
 msgid "Check updates"
 msgstr "Vérifier les mises à jour"
 
 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:232
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:152
 msgid "Notify me when a new release is ready"
 msgstr "Me notifier lorsqu'une nouvelle version est disponible"
 
 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:247
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:169
 msgid "Enable REST API"
 msgstr "Activer l'API REST"
 
 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:248
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:170
 msgid "Allow third party software to use Shaarli such as mobile application"
 msgstr ""
-"Permets aux applications tierces d'utiliser Shaarli, par exemple les "
+"Permet aux applications tierces d'utiliser Shaarli, par exemple les "
 "applications mobiles"
 
 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:263
 msgid "API secret"
 msgstr "Clé d'API secrète"
 
-#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:274
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:74
+#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:277
+msgid "Enable thumbnails"
+msgstr "Activer les miniatures"
+
+#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:285
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:56
+msgid "Synchronize thumbnails"
+msgstr "Synchroniser les miniatures"
+
+#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:312
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72
 #: tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:139
 #: tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:199
 msgid "Save"
@@ -763,25 +791,27 @@ msgstr "Tous les liens d'un jour sur une page."
 msgid "Next day"
 msgstr "Jour suivant"
 
-#: tpl/editlink.html
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
 msgid "Edit Shaare"
 msgstr "Modifier le Shaare"
+
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
 msgid "New Shaare"
 msgstr "Nouveau Shaare"
 
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:25
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:23
 msgid "Created:"
 msgstr "Création :"
 
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:28
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26
 msgid "URL"
 msgstr "URL"
 
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:34
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:32
 msgid "Title"
 msgstr "Titre"
 
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:40
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:38
 #: tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:42
 #: tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:75
 #: tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:99
@@ -789,140 +819,40 @@ msgstr "Titre"
 msgid "Description"
 msgstr "Description"
 
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:46
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:44
 msgid "Tags"
 msgstr "Tags"
 
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:59
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:168
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:57
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:167
 msgid "Private"
 msgstr "Privé"
 
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:74
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72
 msgid "Apply Changes"
-msgstr "Appliquer"
-
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
-msgid "Export Database"
-msgstr "Exporter les données"
-
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
-msgid "Selection"
-msgstr "Choisir"
-
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:31
-msgid "All"
-msgstr "Tous"
-
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
-msgid "Public"
-msgstr "Publics"
-
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:52
-msgid "Prepend note permalinks with this Shaarli instance's URL"
-msgstr "Préfixer les liens de notes avec l'URL de l'instance de Shaarli"
-
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:53
-msgid "Useful to import bookmarks in a web browser"
-msgstr "Utile pour importer les marques-pages dans un navigateur"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
-msgid "Import Database"
-msgstr "Importer des données"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:23
-msgid "Maximum size allowed:"
-msgstr "Taille maximum autorisée :"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
-msgid "Visibility"
-msgstr "Visibilité"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
-msgid "Use values from the imported file, default to public"
-msgstr ""
-"Utiliser les valeurs présentes dans le fichier d'import, public par défaut"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
-msgid "Import all bookmarks as private"
-msgstr "Importer tous les liens comme privés"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:46
-msgid "Import all bookmarks as public"
-msgstr "Importer tous les liens comme publics"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:57
-msgid "Overwrite existing bookmarks"
-msgstr "Remplacer les liens existants"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:58
-msgid "Duplicates based on URL"
-msgstr "Les doublons s'appuient sur les URL"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72
-msgid "Add default tags"
-msgstr "Ajouter des tags par défaut"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:22
-msgid "Install Shaarli"
-msgstr "Installation de Shaarli"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:25
-msgid "It looks like it's the first time you run Shaarli. Please configure it."
-msgstr ""
-"Il semblerait que ça soit la première fois que vous lancez Shaarli. Merci de "
-"le configurer."
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:33
-#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:30
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:147
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:147
-msgid "Username"
-msgstr "Nom d'utilisateur"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
-#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:34
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:148
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:148
-msgid "Password"
-msgstr "Mot de passe"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:63
-msgid "Shaarli title"
-msgstr "Titre du Shaarli"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:69
-msgid "My links"
-msgstr "Mes liens"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:182
-msgid "Install"
-msgstr "Installer"
+msgstr "Appliquer les changements"
 
 #: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:80
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:79
 msgid "shaare"
 msgid_plural "shaares"
 msgstr[0] "shaare"
 msgstr[1] "shaares"
 
 #: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:18
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:84
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:83
 msgid "private link"
 msgid_plural "private links"
 msgstr[0] "lien privé"
 msgstr[1] "liens privés"
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:31
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:117
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:117
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:30
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:121
 msgid "Search text"
 msgstr "Recherche texte"
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:38
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:124
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:124
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:37
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:128
 #: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
 #: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:64
 #: tmp/tag.list.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
@@ -930,85 +860,84 @@ msgstr "Recherche texte"
 msgid "Filter by tag"
 msgstr "Filtrer par tag"
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:111
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:110
 msgid "Nothing found."
 msgstr "Aucun résultat."
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:119
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:118
 #, php-format
 msgid "%s result"
 msgid_plural "%s results"
 msgstr[0] "%s résultat"
 msgstr[1] "%s résultats"
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:123
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:122
 msgid "for"
 msgstr "pour"
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:130
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:129
 msgid "tagged"
 msgstr "taggé"
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:134
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:133
 msgid "Remove tag"
 msgstr "Retirer le tag"
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:143
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:142
 msgid "with status"
 msgstr "avec le statut"
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:154
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:153
 msgid "without any tag"
 msgstr "sans tag"
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:174
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:42
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:173
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:42
 msgid "Fold"
 msgstr "Replier"
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:176
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:175
 msgid "Edited: "
 msgstr "Modifié : "
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:180
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:179
 msgid "permalink"
 msgstr "permalien"
 
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:182
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:181
 msgid "Add tag"
 msgstr "Ajouter un tag"
 
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:7
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:183
+msgid "Toggle sticky"
+msgstr "Changer statut épinglé"
+
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:185
+msgid "Sticky"
+msgstr "Épinglé"
+
 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:7
 msgid "Filters"
 msgstr "Filtres"
 
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:12
 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:12
 msgid "Only display private links"
 msgstr "Afficher uniquement les liens privés"
 
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:15
 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:15
 msgid "Only display public links"
 msgstr "Afficher uniquement les liens publics"
 
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:20
 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:20
 msgid "Filter untagged links"
 msgstr "Filtrer par liens privés"
 
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:76
 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:24
 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:76
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:43
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:43
 msgid "Fold all"
 msgstr "Replier tout"
 
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:69
 #: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:69
 msgid "Links per page"
 msgstr "Liens par page"
@@ -1017,71 +946,85 @@ msgstr "Liens par page"
 msgid ""
 "You have been banned after too many failed login attempts. Try again later."
 msgstr ""
-"Vous avez été banni après trop d'échec d'authentification. Merci de "
+"Vous avez été banni après trop d'échecs d'authentification. Merci de "
 "réessayer plus tard."
 
-#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:151
+#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:30
 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:151
+msgid "Username"
+msgstr "Nom d'utilisateur"
+
+#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:34
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:152
+msgid "Password"
+msgstr "Mot de passe"
+
+#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:155
 msgid "Remember me"
 msgstr "Rester connecté"
 
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:14
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:48
 msgid "by the Shaarli community"
 msgstr "par la communauté Shaarli"
 
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:15
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:15
 msgid "Documentation"
 msgstr "Documentation"
 
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:44
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:44
 msgid "Expand"
 msgstr "Déplier"
 
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:45
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:45
 msgid "Expand all"
 msgstr "Déplier tout"
 
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:46
 #: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:46
 msgid "Are you sure you want to delete this link?"
 msgstr "Êtes-vous sûr de vouloir supprimer ce lien ?"
 
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:61
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:86
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:61
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:86
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:65
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:90
 msgid "RSS Feed"
 msgstr "Flux RSS"
 
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:66
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:102
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:66
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:102
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:70
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:106
 msgid "Logout"
 msgstr "Déconnexion"
 
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:169
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:169
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:173
 msgid "is available"
 msgstr "est disponible"
 
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:176
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:176
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:180
 msgid "Error"
 msgstr "Erreur"
 
-#: tmp/picwall.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
+#: tmp/picwall.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
+msgid "Picture wall unavailable (thumbnails are disabled)."
+msgstr ""
+"Le mur d'images n'est pas disponible (les miniatures sont désactivées)."
+
+#: tmp/picwall.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
+#, fuzzy
+#| msgid ""
+#| "You don't have any cached thumbnail. Try to <a href=\"?do=thumbs_update"
+#| "\">synchronize them</a>."
+msgid ""
+"There is no cached thumbnail. Try to <a href=\"?do=thumbs_update"
+"\">synchronize them</a>."
+msgstr ""
+"Il n'y a aucune miniature en cache. Essayer de <a href=\"?do=thumbs_update"
+"\">les synchroniser</a>."
+
+#: tmp/picwall.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
 msgid "Picture Wall"
 msgstr "Mur d'images"
 
-#: tmp/picwall.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
+#: tmp/picwall.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
 msgid "pics"
 msgstr "images"
 
@@ -1155,22 +1098,18 @@ msgstr "tags"
 msgid "List all links with those tags"
 msgstr "Lister tous les liens avec ces tags"
 
-#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:3
 #: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:3
 msgid "Sort by:"
 msgstr "Trier par :"
 
-#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:5
 #: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:5
 msgid "Cloud"
 msgstr "Nuage"
 
-#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:6
 #: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:6
 msgid "Most used"
 msgstr "Plus utilisés"
 
-#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:7
 #: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:7
 msgid "Alphabetical"
 msgstr "Alphabétique"
@@ -1185,7 +1124,7 @@ msgstr "Changer les paramètres de Shaarli : titre, fuseau horaire, etc."
 
 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:17
 msgid "Configure your Shaarli"
-msgstr "Conguration de Shaarli"
+msgstr "Configurer Shaarli"
 
 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:21
 msgid "Enable, disable and configure plugins"
@@ -1193,51 +1132,63 @@ msgstr "Activer, désactiver et configurer les extensions"
 
 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:28
 msgid "Change your password"
-msgstr "Modification du mot de passe"
+msgstr "Modifier le mot de passe"
 
 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:35
 msgid "Rename or delete a tag in all links"
-msgstr "Rename or delete a tag in all links"
+msgstr "Renommer ou supprimer un tag dans tous les liens"
 
 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
+#, fuzzy
+#| msgid ""
+#| "Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, "
+#| "delicious…)"
 msgid ""
 "Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, "
 "delicious...)"
 msgstr ""
 "Importer des marques pages au format Netscape HTML (comme exportés depuis "
-"Firefox, Chrome, Opera, delicious...)"
+"Firefox, Chrome, Opera, delicious)"
 
 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:42
 msgid "Import links"
 msgstr "Importer des liens"
 
 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:47
+#, fuzzy
+#| msgid ""
+#| "Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, "
+#| "Opera, delicious…)"
 msgid ""
 "Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, "
 "Opera, delicious...)"
 msgstr ""
 "Exporter les marques pages au format Netscape HTML (comme exportés depuis "
-"Firefox, Chrome, Opera, delicious...)"
+"Firefox, Chrome, Opera, delicious)"
 
 #: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
 msgid "Export database"
 msgstr "Exporter les données"
 
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:71
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:55
+msgid "Synchronize all link thumbnails"
+msgstr "Synchroniser toutes les miniatures"
+
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:81
 msgid ""
 "Drag one of these button to your bookmarks toolbar or right-click it and "
 "\"Bookmark This Link\""
 msgstr ""
-"Glisser un de ces bouttons dans votre barre de favoris ou cliquer droit "
+"Glisser un de ces boutons dans votre barre de favoris ou cliquer droit "
 "dessus et « Ajouter aux favoris »"
 
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:82
 msgid "then click on the bookmarklet in any page you want to share."
 msgstr ""
-"puis cliquer sur le marque page depuis un site que vous souhaitez partager."
+"puis cliquer sur le marque-page depuis un site que vous souhaitez partager."
 
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:76
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:100
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:86
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:110
 msgid ""
 "Drag this link to your bookmarks toolbar or right-click it and Bookmark This "
 "Link"
@@ -1245,57 +1196,40 @@ msgstr ""
 "Glisser ce lien dans votre barre de favoris ou cliquer droit dessus et « "
 "Ajouter aux favoris »"
 
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:77
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:87
 msgid "then click ✚Shaare link button in any page you want to share"
 msgstr "puis cliquer sur ✚Shaare depuis un site que vous souhaitez partager"
 
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:86
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:108
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:96
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:118
 msgid "The selected text is too long, it will be truncated."
 msgstr "Le texte sélectionné est trop long, il sera tronqué."
 
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:96
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:106
 msgid "Shaare link"
 msgstr "Shaare"
 
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:101
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:111
 msgid ""
 "Then click ✚Add Note button anytime to start composing a private Note (text "
 "post) to your Shaarli"
 msgstr ""
 "Puis cliquer sur ✚Add Note pour commencer à rédiger une Note sur Shaarli"
 
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:117
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:127
 msgid "Add Note"
 msgstr "Ajouter une Note"
 
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:129
-msgid ""
-"You need to browse your Shaarli over <strong>HTTPS</strong> to use this "
-"functionality."
-msgstr ""
-"Vous devez utiliser Shaarli en <strong>HTTPS</strong> pour utiliser cette "
-"fonctionalité."
-
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:134
-msgid "Add to"
-msgstr "Ajouter à"
-
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:145
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:136
 msgid "3rd party"
 msgstr "Applications tierces"
 
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:147
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:153
-msgid "Plugin"
-msgstr "Extension"
-
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:148
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:154
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:139
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:144
 msgid "plugin"
 msgstr "extension"
 
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:175
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:169
 msgid ""
 "Drag this link to your bookmarks toolbar, or right-click it and choose "
 "Bookmark This Link"
@@ -1303,6 +1237,107 @@ msgstr ""
 "Glisser ce lien dans votre barre de favoris ou cliquer droit dessus et « "
 "Ajouter aux favoris »"
 
+#~ msgid "Sorry, nothing to see here."
+#~ msgstr "Désolé, il y a rien à voir ici."
+
+#~ msgid "Current password"
+#~ msgstr "Mot de passe actuel"
+
+#~ msgid "New password"
+#~ msgstr "Nouveau mot de passe"
+
+#~ msgid "Change"
+#~ msgstr "Changer"
+
+#~ msgid "Export Database"
+#~ msgstr "Exporter les données"
+
+#~ msgid "Selection"
+#~ msgstr "Choisir"
+
+#~ msgid "Public"
+#~ msgstr "Publics"
+
+#~ msgid "Prepend note permalinks with this Shaarli instance's URL"
+#~ msgstr "Préfixer les liens de note avec l'URL de l'instance de Shaarli"
+
+#~ msgid "Useful to import bookmarks in a web browser"
+#~ msgstr "Utile pour importer les marques-pages dans un navigateur"
+
+#~ msgid "Import Database"
+#~ msgstr "Importer des données"
+
+#~ msgid "Maximum size allowed:"
+#~ msgstr "Taille maximum autorisée :"
+
+#~ msgid "Visibility"
+#~ msgstr "Visibilité"
+
+#~ msgid "Use values from the imported file, default to public"
+#~ msgstr ""
+#~ "Utiliser les valeurs présentes dans le fichier d'import, public par défaut"
+
+#~ msgid "Import all bookmarks as private"
+#~ msgstr "Importer tous les liens comme privés"
+
+#~ msgid "Import all bookmarks as public"
+#~ msgstr "Importer tous les liens comme publics"
+
+#~ msgid "Overwrite existing bookmarks"
+#~ msgstr "Remplacer les liens existants"
+
+#~ msgid "Duplicates based on URL"
+#~ msgstr "Les doublons s'appuient sur les URL"
+
+#~ msgid "Add default tags"
+#~ msgstr "Ajouter des tags par défaut"
+
+#~ msgid "Install Shaarli"
+#~ msgstr "Installation de Shaarli"
+
+#~ msgid ""
+#~ "It looks like it's the first time you run Shaarli. Please configure it."
+#~ msgstr ""
+#~ "Il semblerait que ça soit la première fois que vous lancez Shaarli. Merci "
+#~ "de le configurer."
+
+#~ msgid "Shaarli title"
+#~ msgstr "Titre du Shaarli"
+
+#~ msgid "My links"
+#~ msgstr "Mes liens"
+
+#~ msgid "Install"
+#~ msgstr "Installer"
+
+#~ msgid ""
+#~ "You need to browse your Shaarli over <strong>HTTPS</strong> to use this "
+#~ "functionality."
+#~ msgstr ""
+#~ "Vous devez utiliser Shaarli en <strong>HTTPS</strong> pour utiliser cette "
+#~ "fonctionalité."
+
+#~ msgid "Add to"
+#~ msgstr "Ajouter à"
+
+#~ msgid "Plugin"
+#~ msgstr "Extension"
+
+#~ msgid "Warning: "
+#~ msgstr "Attention : "
+
+#~ msgid ""
+#~ "It's recommended to visit the picture wall after enabling this feature."
+#~ msgstr ""
+#~ "Il est recommandé de visiter le Mur d'images après avoir activé cette "
+#~ "fonctionnalité."
+
+#~ msgid ""
+#~ "If you have a large database, the first retrieval may take a few minutes."
+#~ msgstr ""
+#~ "Si vous avez beaucoup de liens, la première récupération peut prendre "
+#~ "plusieurs minutes."
+
 #, fuzzy
 #~| msgid "Change"
 #~ msgid "range"
@@ -1360,7 +1395,8 @@ msgstr ""
 #~ "\n"
 
 #~ msgid "Sessions do not seem to work correctly on your server."
-#~ msgstr "Les sessions ne semblent "
+#~ msgstr ""
+#~ "Les sessions ne semblent pas fonctionner correctement sur votre serveur."
 
 #~ msgid "Tag was renamed in "
 #~ msgstr "Le tag a été renommé dans "
diff --git a/inc/web-thumbnailer.json b/inc/web-thumbnailer.json
new file mode 100644 (file)
index 0000000..dcaa149
--- /dev/null
@@ -0,0 +1,13 @@
+{
+  "settings": {
+    "default": {
+      "download_mode": "DOWNLOAD",
+      "_comment": "infinite cache",
+      "cache_duration": -1,
+      "timeout": 10
+    },
+    "path": {
+      "cache": "cache/"
+    }
+  }
+}
index 29d67f62cf396de9b45ce278c2db5a0c196d64ee..633ab89e6386e90eaa02f76d5a1880cb9366dccb 100644 (file)
--- a/index.php
+++ b/index.php
@@ -28,7 +28,7 @@ if (date_default_timezone_get() == '') {
 define('WEB_PATH', substr($_SERVER['REQUEST_URI'], 0, 1+strrpos($_SERVER['REQUEST_URI'], '/', 0)));
 
 // High execution time in case of problematic imports/exports.
-ini_set('max_input_time','60');
+ini_set('max_input_time', '60');
 
 // Try to set max upload file size and read
 ini_set('memory_limit', '128M');
@@ -56,35 +56,38 @@ require_once 'inc/rain.tpl.class.php';
 require_once __DIR__ . '/vendor/autoload.php';
 
 // Shaarli library
-require_once 'application/ApplicationUtils.php';
-require_once 'application/Cache.php';
-require_once 'application/CachedPage.php';
+require_once 'application/bookmark/LinkUtils.php';
 require_once 'application/config/ConfigPlugin.php';
-require_once 'application/FeedBuilder.php';
+require_once 'application/feed/Cache.php';
+require_once 'application/http/HttpUtils.php';
+require_once 'application/http/UrlUtils.php';
+require_once 'application/updater/UpdaterUtils.php';
 require_once 'application/FileUtils.php';
-require_once 'application/History.php';
-require_once 'application/HttpUtils.php';
-require_once 'application/LinkDB.php';
-require_once 'application/LinkFilter.php';
-require_once 'application/LinkUtils.php';
-require_once 'application/NetscapeBookmarkUtils.php';
-require_once 'application/PageBuilder.php';
 require_once 'application/TimeZone.php';
-require_once 'application/Url.php';
 require_once 'application/Utils.php';
-require_once 'application/PluginManager.php';
-require_once 'application/Router.php';
-require_once 'application/Updater.php';
-use \Shaarli\Languages;
-use \Shaarli\ThemeUtils;
+
+use \Shaarli\ApplicationUtils;
+use \Shaarli\Bookmark\Exception\LinkNotFoundException;
+use \Shaarli\Bookmark\LinkDB;
 use \Shaarli\Config\ConfigManager;
+use \Shaarli\Feed\CachedPage;
+use \Shaarli\Feed\FeedBuilder;
+use \Shaarli\History;
+use \Shaarli\Languages;
+use \Shaarli\Netscape\NetscapeBookmarkUtils;
+use \Shaarli\Plugin\PluginManager;
+use \Shaarli\Render\PageBuilder;
+use \Shaarli\Render\ThemeUtils;
+use \Shaarli\Router;
 use \Shaarli\Security\LoginManager;
 use \Shaarli\Security\SessionManager;
+use \Shaarli\Thumbnailer;
+use \Shaarli\Updater\Updater;
 
 // Ensure the PHP version is supported
 try {
     ApplicationUtils::checkPHPVersion('5.5', PHP_VERSION);
-} catch(Exception $exc) {
+} catch (Exception $exc) {
     header('Content-Type: text/plain; charset=utf-8');
     echo $exc->getMessage();
     exit;
@@ -110,7 +113,7 @@ ini_set('session.use_trans_sid', false);
 
 session_name('shaarli');
 // Start session if needed (Some server auto-start sessions).
-if (session_id() == '') {
+if (session_status() == PHP_SESSION_NONE) {
     session_start();
 }
 
@@ -222,7 +225,6 @@ if (isset($_POST['login'])) {
                 $expirationTime,
                 WEB_PATH
             );
-
         } else {
             // Standard session expiration (=when browser closes)
             $expirationTime = 0;
@@ -256,7 +258,8 @@ if (isset($_POST['login'])) {
                 exit;
             }
         }
-        header('Location: ?'); exit;
+        header('Location: ?');
+        exit;
     } else {
         $loginManager->handleFailedLogin($_SERVER);
         $redir = '&username='. urlencode($_POST['login']);
@@ -277,7 +280,9 @@ if (isset($_POST['login'])) {
 // ------------------------------------------------------------------------------------------
 // Token management for XSRF protection
 // Token should be used in any form which acts on data (create,update,delete,import...).
-if (!isset($_SESSION['tokens'])) $_SESSION['tokens']=array();  // Token are attached to the session.
+if (!isset($_SESSION['tokens'])) {
+    $_SESSION['tokens']=array();  // Token are attached to the session.
+}
 
 /**
  * Daily RSS feed: 1 RSS entry per day giving all the links on that day.
@@ -287,13 +292,14 @@ if (!isset($_SESSION['tokens'])) $_SESSION['tokens']=array();  // Token are atta
  * @param ConfigManager $conf         Configuration Manager instance
  * @param LoginManager  $loginManager LoginManager instance
  */
-function showDailyRSS($conf, $loginManager) {
+function showDailyRSS($conf, $loginManager)
+{
     // Cache system
     $query = $_SERVER['QUERY_STRING'];
     $cache = new CachedPage(
         $conf->get('config.PAGE_CACHE'),
         page_url($_SERVER),
-        startsWith($query,'do=dailyrss') && !$loginManager->isLoggedIn()
+        startsWith($query, 'do=dailyrss') && !$loginManager->isLoggedIn()
     );
     $cached = $cache->cachedVersion();
     if (!empty($cached)) {
@@ -355,7 +361,6 @@ function showDailyRSS($conf, $loginManager) {
                 $conf->get('redirector.url'),
                 $conf->get('redirector.encode_url')
             );
-            $link['thumbnail'] = thumbnail($conf, $link['url']);
             $link['timestamp'] = $link['created']->getTimestamp();
             if (startsWith($link['url'], '?')) {
                 $link['url'] = index_url($_SERVER) . $link['url'];  // make permalink URL absolute
@@ -370,6 +375,7 @@ function showDailyRSS($conf, $loginManager) {
         $tpl->assign('links', $links);
         $tpl->assign('rssdate', escape($dayDate->format(DateTime::RSS)));
         $tpl->assign('hide_timestamps', $conf->get('privacy.hide_timestamps', false));
+        $tpl->assign('index_url', $pageaddr);
         $html = $tpl->draw('dailyrss', true);
 
         echo $html . PHP_EOL;
@@ -394,7 +400,7 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
 {
     $day = date('Ymd', strtotime('-1 day')); // Yesterday, in format YYYYMMDD.
     if (isset($_GET['day'])) {
-      $day = $_GET['day'];
+        $day = $_GET['day'];
     }
 
     $days = $LINKSDB->days();
@@ -412,7 +418,7 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
              $previousday=$days[$i - 1];
         }
         if ($i < count($days) - 1) {
-          $nextday = $days[$i + 1];
+            $nextday = $days[$i + 1];
         }
     }
     try {
@@ -423,8 +429,8 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
     }
 
     // We pre-format some fields for proper output.
-    foreach($linksToDisplay as $key => $link) {
-        $taglist = explode(' ',$link['tags']);
+    foreach ($linksToDisplay as $key => $link) {
+        $taglist = explode(' ', $link['tags']);
         uasort($taglist, 'strcasecmp');
         $linksToDisplay[$key]['taglist']=$taglist;
         $linksToDisplay[$key]['formatedDescription'] = format_description(
@@ -432,7 +438,6 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
             $conf->get('redirector.url'),
             $conf->get('redirector.encode_url')
         );
-        $linksToDisplay[$key]['thumbnail'] = thumbnail($conf, $link['url']);
         $linksToDisplay[$key]['timestamp'] =  $link['created']->getTimestamp();
     }
 
@@ -457,14 +462,14 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
     */
     $columns = array(array(), array(), array()); // Entries to display, for each column.
     $fill = array(0, 0, 0);  // Rough estimate of columns fill.
-    foreach($data['linksToDisplay'] as $key => $link) {
+    foreach ($data['linksToDisplay'] as $key => $link) {
         // Roughly estimate length of entry (by counting characters)
         // Title: 30 chars = 1 line. 1 line is 30 pixels height.
         // Description: 836 characters gives roughly 342 pixel height.
         // This is not perfect, but it's usually OK.
         $length = strlen($link['title']) + (342 * strlen($link['description'])) / 836;
         if ($link['thumbnail']) {
-          $length += 100; // 1 thumbnails roughly takes 100 pixels height.
+            $length += 100; // 1 thumbnails roughly takes 100 pixels height.
         }
         // Then put in column which is the less filled:
         $smallest = min($fill); // find smallest value in array.
@@ -492,8 +497,9 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
  * @param ConfigManager $conf    Configuration Manager instance.
  * @param PluginManager $pluginManager Plugin Manager instance.
  */
-function showLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager) {
-    buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager, $loginManager);
+function showLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager)
+{
+    buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager);
     $PAGE->renderPage('linklist');
 }
 
@@ -513,7 +519,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         read_updates_file($conf->get('resource.updates')),
         $LINKSDB,
         $conf,
-        $loginManager->isLoggedIn()
+        $loginManager->isLoggedIn(),
+        $_SESSION
     );
     try {
         $newUpdates = $updater->update();
@@ -523,12 +530,11 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
                 $updater->getDoneUpdates()
             );
         }
-    }
-    catch(Exception $e) {
+    } catch (Exception $e) {
         die($e->getMessage());
     }
 
-    $PAGE = new PageBuilder($conf, $LINKSDB, $sessionManager->generateToken(), $loginManager->isLoggedIn());
+    $PAGE = new PageBuilder($conf, $_SESSION, $LINKSDB, $sessionManager->generateToken(), $loginManager->isLoggedIn());
     $PAGE->assign('linkcount', count($LINKSDB));
     $PAGE->assign('privateLinkcount', count_private($LINKSDB));
     $PAGE->assign('plugin_errors', $pluginManager->getErrors());
@@ -537,8 +543,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     $query = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : '';
     $targetPage = Router::findPage($query, $_GET, $loginManager->isLoggedIn());
 
-    if (
-        // if the user isn't logged in
+    if (// if the user isn't logged in
         !$loginManager->isLoggedIn() &&
         // and Shaarli doesn't have public content...
         $conf->get('privacy.hide_public_links') &&
@@ -562,9 +567,11 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         'footer',
     );
 
-    foreach($common_hooks as $name) {
+    foreach ($common_hooks as $name) {
         $plugin_data = array();
-        $pluginManager->executeHooks('render_' . $name, $plugin_data,
+        $pluginManager->executeHooks(
+            'render_' . $name,
+            $plugin_data,
             array(
                 'target' => $targetPage,
                 'loggedin' => $loginManager->isLoggedIn()
@@ -574,13 +581,15 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- Display login form.
-    if ($targetPage == Router::$PAGE_LOGIN)
-    {
-        if ($conf->get('security.open_shaarli')) { header('Location: ?'); exit; }  // No need to login for open Shaarli
+    if ($targetPage == Router::$PAGE_LOGIN) {
+        if ($conf->get('security.open_shaarli')) {
+            header('Location: ?');
+            exit;
+        }  // No need to login for open Shaarli
         if (isset($_GET['username'])) {
             $PAGE->assign('username', escape($_GET['username']));
         }
-        $PAGE->assign('returnurl',(isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']):''));
+        $PAGE->assign('returnurl', (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']):''));
         // add default state of the 'remember me' checkbox
         $PAGE->assign('remember_user_default', $conf->get('privacy.remember_user_default'));
         $PAGE->assign('user_can_login', $loginManager->canLogin($_SERVER));
@@ -589,8 +598,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         exit;
     }
     // -------- User wants to logout.
-    if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=logout'))
-    {
+    if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=logout')) {
         invalidateCaches($conf->get('resource.page_cache'));
         $sessionManager->logout();
         setcookie(LoginManager::$STAY_SIGNED_IN_COOKIE, 'false', 0, WEB_PATH);
@@ -599,21 +607,23 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- Picture wall
-    if ($targetPage == Router::$PAGE_PICWALL)
-    {
+    if ($targetPage == Router::$PAGE_PICWALL) {
+        $PAGE->assign('pagetitle', t('Picture wall') .' - '. $conf->get('general.title', 'Shaarli'));
+        if (! $conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) === Thumbnailer::MODE_NONE) {
+            $PAGE->assign('linksToDisplay', []);
+            $PAGE->renderPage('picwall');
+            exit;
+        }
+
         // Optionally filter the results:
         $links = $LINKSDB->filterSearch($_GET);
         $linksToDisplay = array();
 
         // Get only links which have a thumbnail.
-        foreach($links as $link)
-        {
-            $permalink='?'.$link['shorturl'];
-            $thumb=lazyThumbnail($conf, $link['url'],$permalink);
-            if ($thumb!='') // Only output links which have a thumbnail.
-            {
-                $link['thumbnail']=$thumb; // Thumbnail HTML code.
-                $linksToDisplay[]=$link; // Add to array.
+        // Note: we do not retrieve thumbnails here, the request is too heavy.
+        foreach ($links as $key => $link) {
+            if (isset($link['thumbnail']) && $link['thumbnail'] !== false) {
+                $linksToDisplay[] = $link; // Add to array.
             }
         }
 
@@ -626,14 +636,13 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $PAGE->assign($key, $value);
         }
 
-        $PAGE->assign('pagetitle', t('Picture wall') .' - '. $conf->get('general.title', 'Shaarli'));
+
         $PAGE->renderPage('picwall');
         exit;
     }
 
     // -------- Tag cloud
-    if ($targetPage == Router::$PAGE_TAGCLOUD)
-    {
+    if ($targetPage == Router::$PAGE_TAGCLOUD) {
         $visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '';
         $filteringTags = isset($_GET['searchtags']) ? explode(' ', $_GET['searchtags']) : [];
         $tags = $LINKSDB->linksCountPerTag($filteringTags, $visibility);
@@ -648,7 +657,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         alphabetical_sort($tags, false, true);
 
         $tagList = array();
-        foreach($tags as $key => $value) {
+        foreach ($tags as $key => $value) {
             if (in_array($key, $filteringTags)) {
                 continue;
             }
@@ -680,8 +689,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- Tag list
-    if ($targetPage == Router::$PAGE_TAGLIST)
-    {
+    if ($targetPage == Router::$PAGE_TAGLIST) {
         $visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '';
         $filteringTags = isset($_GET['searchtags']) ? explode(' ', $_GET['searchtags']) : [];
         $tags = $LINKSDB->linksCountPerTag($filteringTags, $visibility);
@@ -727,7 +735,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         $cache = new CachedPage(
             $conf->get('resource.page_cache'),
             page_url($_SERVER),
-            startsWith($query,'do='. $targetPage) && !$loginManager->isLoggedIn()
+            startsWith($query, 'do='. $targetPage) && !$loginManager->isLoggedIn()
         );
         $cached = $cache->cachedVersion();
         if (!empty($cached)) {
@@ -765,11 +773,14 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- User clicks on a tag in a link: The tag is added to the list of searched tags (searchtags=...)
-    if (isset($_GET['addtag']))
-    {
+    if (isset($_GET['addtag'])) {
         // Get previous URL (http_referer) and add the tag to the searchtags parameters in query.
-        if (empty($_SERVER['HTTP_REFERER'])) { header('Location: ?searchtags='.urlencode($_GET['addtag'])); exit; } // In case browser does not send HTTP_REFERER
-        parse_str(parse_url($_SERVER['HTTP_REFERER'],PHP_URL_QUERY), $params);
+        if (empty($_SERVER['HTTP_REFERER'])) {
+            // In case browser does not send HTTP_REFERER
+            header('Location: ?searchtags='.urlencode($_GET['addtag']));
+            exit;
+        }
+        parse_str(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY), $params);
 
         // Prevent redirection loop
         if (isset($params['addtag'])) {
@@ -793,12 +804,14 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         // Append the tag if necessary
         if (empty($params['searchtags'])) {
             $params['searchtags'] = trim($_GET['addtag']);
-        }
-        elseif ($addtag) {
+        } elseif ($addtag) {
             $params['searchtags'] = trim($params['searchtags']).' '.trim($_GET['addtag']);
         }
 
-        unset($params['page']); // We also remove page (keeping the same page has no sense, since the results are different)
+        // We also remove page (keeping the same page has no sense, since the
+        // results are different)
+        unset($params['page']);
+
         header('Location: ?'.http_build_query($params));
         exit;
     }
@@ -823,13 +836,15 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $tags = explode(' ', $params['searchtags']);
             // Remove value from array $tags.
             $tags = array_diff($tags, array($_GET['removetag']));
-            $params['searchtags'] = implode(' ',$tags);
+            $params['searchtags'] = implode(' ', $tags);
 
             if (empty($params['searchtags'])) {
                 unset($params['searchtags']);
             }
 
-            unset($params['page']); // We also remove page (keeping the same page has no sense, since the results are different)
+            // We also remove page (keeping the same page has no sense, since
+            // the results are different)
+            unset($params['page']);
         }
         header('Location: ?'.http_build_query($params));
         exit;
@@ -892,12 +907,10 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- Handle other actions allowed for non-logged in users:
-    if (!$loginManager->isLoggedIn())
-    {
+    if (!$loginManager->isLoggedIn()) {
         // User tries to post new link but is not logged in:
         // Show login screen, then redirect to ?post=...
-        if (isset($_GET['post']))
-        {
+        if (isset($_GET['post'])) {
             header( // Redirect to login page, then back to post link.
                 'Location: ?do=login&post='.urlencode($_GET['post']).
                 (!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').
@@ -920,8 +933,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     // -------- All other functions are reserved for the registered user:
 
     // -------- Display the Tools menu if requested (import/export/bookmarklet...)
-    if ($targetPage == Router::$PAGE_TOOLS)
-    {
+    if ($targetPage == Router::$PAGE_TOOLS) {
         $data = [
             'pageabsaddr' => index_url($_SERVER),
             'sslenabled' => is_https($_SERVER),
@@ -938,30 +950,40 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- User wants to change his/her password.
-    if ($targetPage == Router::$PAGE_CHANGEPASSWORD)
-    {
+    if ($targetPage == Router::$PAGE_CHANGEPASSWORD) {
         if ($conf->get('security.open_shaarli')) {
             die(t('You are not supposed to change a password on an Open Shaarli.'));
         }
 
-        if (!empty($_POST['setpassword']) && !empty($_POST['oldpassword']))
-        {
-            if (!$sessionManager->checkToken($_POST['token'])) die(t('Wrong token.')); // Go away!
+        if (!empty($_POST['setpassword']) && !empty($_POST['oldpassword'])) {
+            if (!$sessionManager->checkToken($_POST['token'])) {
+                die(t('Wrong token.')); // Go away!
+            }
 
             // Make sure old password is correct.
-            $oldhash = sha1($_POST['oldpassword'].$conf->get('credentials.login').$conf->get('credentials.salt'));
-            if ($oldhash!= $conf->get('credentials.hash')) {
-                echo '<script>alert("'. t('The old password is not correct.') .'");document.location=\'?do=changepasswd\';</script>';
+            $oldhash = sha1(
+                $_POST['oldpassword'].$conf->get('credentials.login').$conf->get('credentials.salt')
+            );
+            if ($oldhash != $conf->get('credentials.hash')) {
+                echo '<script>alert("'
+                    . t('The old password is not correct.')
+                    .'");document.location=\'?do=changepasswd\';</script>';
                 exit;
             }
             // Save new password
             // Salt renders rainbow-tables attacks useless.
             $conf->set('credentials.salt', sha1(uniqid('', true) .'_'. mt_rand()));
-            $conf->set('credentials.hash', sha1($_POST['setpassword'] . $conf->get('credentials.login') . $conf->get('credentials.salt')));
+            $conf->set(
+                'credentials.hash',
+                sha1(
+                    $_POST['setpassword']
+                    . $conf->get('credentials.login')
+                    . $conf->get('credentials.salt')
+                )
+            );
             try {
                 $conf->write($loginManager->isLoggedIn());
-            }
-            catch(Exception $e) {
+            } catch (Exception $e) {
                 error_log(
                     'ERROR while writing config file after changing password.' . PHP_EOL .
                     $e->getMessage()
@@ -973,9 +995,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             }
             echo '<script>alert("'. t('Your password has been changed') .'");document.location=\'?do=tools\';</script>';
             exit;
-        }
-        else // show the change password form.
-        {
+        } else {
+            // show the change password form.
             $PAGE->assign('pagetitle', t('Change password') .' - '. $conf->get('general.title', 'Shaarli'));
             $PAGE->renderPage('changepassword');
             exit;
@@ -983,10 +1004,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- User wants to change configuration
-    if ($targetPage == Router::$PAGE_CONFIGURE)
-    {
-        if (!empty($_POST['title']) )
-        {
+    if ($targetPage == Router::$PAGE_CONFIGURE) {
+        if (!empty($_POST['title'])) {
             if (!$sessionManager->checkToken($_POST['token'])) {
                 die(t('Wrong token.')); // Go away!
             }
@@ -1009,12 +1028,22 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $conf->set('api.secret', escape($_POST['apiSecret']));
             $conf->set('translation.language', escape($_POST['language']));
 
+            $thumbnailsMode = extension_loaded('gd') ? $_POST['enableThumbnails'] : Thumbnailer::MODE_NONE;
+            if ($thumbnailsMode !== Thumbnailer::MODE_NONE
+                && $thumbnailsMode !== $conf->get('thumbnails.mode', Thumbnailer::MODE_NONE)
+            ) {
+                $_SESSION['warnings'][] = t(
+                    'You have enabled or changed thumbnails mode. '
+                    .'<a href="?do=thumbs_update">Please synchronize them</a>.'
+                );
+            }
+            $conf->set('thumbnails.mode', $thumbnailsMode);
+
             try {
                 $conf->write($loginManager->isLoggedIn());
                 $history->updateSettings();
                 invalidateCaches($conf->get('resource.page_cache'));
-            }
-            catch(Exception $e) {
+            } catch (Exception $e) {
                 error_log(
                     'ERROR while writing config file after configuration update.' . PHP_EOL .
                     $e->getMessage()
@@ -1026,9 +1055,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             }
             echo '<script>alert("'. t('Configuration was saved.') .'");document.location=\'?do=configure\';</script>';
             exit;
-        }
-        else // Show the configuration form.
-        {
+        } else {
+            // Show the configuration form.
             $PAGE->assign('title', $conf->get('general.title'));
             $PAGE->assign('theme', $conf->get('resource.theme'));
             $PAGE->assign('theme_available', ThemeUtils::getThemes($conf->get('resource.raintpl_tpl')));
@@ -1047,6 +1075,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $PAGE->assign('api_secret', $conf->get('api.secret'));
             $PAGE->assign('languages', Languages::getAvailableLanguages());
             $PAGE->assign('language', $conf->get('translation.language'));
+            $PAGE->assign('gd_enabled', extension_loaded('gd'));
+            $PAGE->assign('thumbnails_mode', $conf->get('thumbnails.mode', Thumbnailer::MODE_NONE));
             $PAGE->assign('pagetitle', t('Configure') .' - '. $conf->get('general.title', 'Shaarli'));
             $PAGE->renderPage('configure');
             exit;
@@ -1054,8 +1084,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- User wants to rename a tag or delete it
-    if ($targetPage == Router::$PAGE_CHANGETAG)
-    {
+    if ($targetPage == Router::$PAGE_CHANGETAG) {
         if (empty($_POST['fromtag']) || (empty($_POST['totag']) && isset($_POST['renametag']))) {
             $PAGE->assign('fromtag', ! empty($_GET['fromtag']) ? escape($_GET['fromtag']) : '');
             $PAGE->assign('pagetitle', t('Manage tags') .' - '. $conf->get('general.title', 'Shaarli'));
@@ -1067,7 +1096,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             die(t('Wrong token.'));
         }
 
-        $alteredLinks = $LINKSDB->renameTag(escape($_POST['fromtag']), escape($_POST['totag']));
+        $toTag = isset($_POST['totag']) ? escape($_POST['totag']) : null;
+        $alteredLinks = $LINKSDB->renameTag(escape($_POST['fromtag']), $toTag);
         $LINKSDB->save($conf->get('resource.page_cache'));
         foreach ($alteredLinks as $link) {
             $history->updateLink($link);
@@ -1083,16 +1113,14 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- User wants to add a link without using the bookmarklet: Show form.
-    if ($targetPage == Router::$PAGE_ADDLINK)
-    {
+    if ($targetPage == Router::$PAGE_ADDLINK) {
         $PAGE->assign('pagetitle', t('Shaare a new link') .' - '. $conf->get('general.title', 'Shaarli'));
         $PAGE->renderPage('addlink');
         exit;
     }
 
     // -------- User clicked the "Save" button when editing a link: Save link to database.
-    if (isset($_POST['save_edit']))
-    {
+    if (isset($_POST['save_edit'])) {
         // Go away!
         if (! $sessionManager->checkToken($_POST['token'])) {
             die(t('Wrong token.'));
@@ -1103,7 +1131,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         // Linkdate is kept here to:
         //   - use the same permalink for notes as they're displayed when creating them
         //   - let users hack creation date of their posts
-        //     See: https://shaarli.readthedocs.io/en/master/Various-hacks/#changing-the-timestamp-for-a-shaare
+        //     See: https://shaarli.readthedocs.io/en/master/guides/various-hacks/#changing-the-timestamp-for-a-shaare
         $linkdate = escape($_POST['lf_linkdate']);
         if (isset($LINKSDB[$id])) {
             // Edit
@@ -1148,6 +1176,11 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $link['title'] = $link['url'];
         }
 
+        if ($conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE) {
+            $thumbnailer = new Thumbnailer($conf);
+            $link['thumbnail'] = $thumbnailer->get($url);
+        }
+
         $pluginManager->executeHooks('save_link', $link);
 
         $LINKSDB[$id] = $link;
@@ -1174,14 +1207,16 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- User clicked the "Cancel" button when editing a link.
-    if (isset($_POST['cancel_edit']))
-    {
+    if (isset($_POST['cancel_edit'])) {
         $id = isset($_POST['lf_id']) ? (int) escape($_POST['lf_id']) : false;
         if (! isset($LINKSDB[$id])) {
             header('Location: ?');
         }
         // If we are called from the bookmarklet, we must close the popup:
-        if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo '<script>self.close();</script>'; exit; }
+        if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) {
+            echo '<script>self.close();</script>';
+            exit;
+        }
         $link = $LINKSDB[$id];
         $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
         // Scroll to the link which has been edited.
@@ -1192,8 +1227,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- User clicked the "Delete" button when editing a link: Delete link from database.
-    if ($targetPage == Router::$PAGE_DELETELINK)
-    {
+    if ($targetPage == Router::$PAGE_DELETELINK) {
         if (! $sessionManager->checkToken($_GET['token'])) {
             die(t('Wrong token.'));
         }
@@ -1207,28 +1241,31 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $ids = [$ids];
         }
         // assert at least one id is given
-        if(!count($ids)){
+        if (!count($ids)) {
             die('no id provided');
         }
         foreach ($ids as $id) {
             $id = (int) escape($id);
             $link = $LINKSDB[$id];
             $pluginManager->executeHooks('delete_link', $link);
+            $history->deleteLink($link);
             unset($LINKSDB[$id]);
         }
         $LINKSDB->save($conf->get('resource.page_cache')); // save to disk
-        $history->deleteLink($link);
 
         // If we are called from the bookmarklet, we must close the popup:
-        if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo '<script>self.close();</script>'; exit; }
+        if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) {
+            echo '<script>self.close();</script>';
+            exit;
+        }
 
         $location = '?';
         if (isset($_SERVER['HTTP_REFERER'])) {
             // Don't redirect to where we were previously if it was a permalink or an edit_link, because it would 404.
             $location = generateLocation(
-                    $_SERVER['HTTP_REFERER'],
-                    $_SERVER['HTTP_HOST'],
-                    ['delete_link', 'edit_link', $link['shorturl']]
+                $_SERVER['HTTP_REFERER'],
+                $_SERVER['HTTP_HOST'],
+                ['delete_link', 'edit_link', $link['shorturl']]
             );
         }
 
@@ -1237,11 +1274,13 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     }
 
     // -------- User clicked the "EDIT" button on a link: Display link edit form.
-    if (isset($_GET['edit_link']))
-    {
+    if (isset($_GET['edit_link'])) {
         $id = (int) escape($_GET['edit_link']);
         $link = $LINKSDB[$id];  // Read database
-        if (!$link) { header('Location: ?'); exit; } // Link not found in database.
+        if (!$link) {
+            header('Location: ?');
+            exit;
+        } // Link not found in database.
         $link['linkdate'] = $link['created']->format(LinkDB::LINK_DATE_FORMAT);
         $data = array(
             'link' => $link,
@@ -1267,8 +1306,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         $link_is_new = false;
         // Check if URL is not already in database (in this case, we will edit the existing link)
         $link = $LINKSDB->getLinkFromUrl($url);
-        if (! $link)
-        {
+        if (! $link) {
             $link_is_new = true;
             $linkdate = strval(date(LinkDB::LINK_DATE_FORMAT));
             // Get title if it was provided in URL (by the bookmarklet).
@@ -1277,7 +1315,9 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $description = empty($_GET['description']) ? '' : escape($_GET['description']);
             $tags = empty($_GET['tags']) ? '' : escape($_GET['tags']);
             $private = !empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0;
-            // If this is an HTTP(S) link, we try go get the page to extract the title (otherwise we will to straight to the edit form.)
+
+            // If this is an HTTP(S) link, we try go get the page to extract
+            // the title (otherwise we will to straight to the edit form.)
             if (empty($title) && strpos(get_url_scheme($url), 'http') !== false) {
                 // Short timeout to keep the application responsive
                 // The callback will fill $charset and $title with data from the downloaded page.
@@ -1330,6 +1370,25 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         exit;
     }
 
+    if ($targetPage == Router::$PAGE_PINLINK) {
+        if (! isset($_GET['id']) || empty($LINKSDB[$_GET['id']])) {
+            // FIXME! Use a proper error system.
+            $msg = t('Invalid link ID provided');
+            echo '<script>alert("'. $msg .'");document.location=\''. index_url($_SERVER) .'\';</script>';
+            exit;
+        }
+        if (! $sessionManager->checkToken($_GET['token'])) {
+            die('Wrong token.');
+        }
+
+        $link = $LINKSDB[$_GET['id']];
+        $link['sticky'] = ! $link['sticky'];
+        $LINKSDB[(int) $_GET['id']] = $link;
+        $LINKSDB->save($conf->get('resource.page_cache'));
+        header('Location: '.index_url($_SERVER));
+        exit;
+    }
+
     if ($targetPage == Router::$PAGE_EXPORT) {
         // Export links as a Netscape Bookmarks file
 
@@ -1366,7 +1425,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         header('Content-Type: text/html; charset=utf-8');
         header(
             'Content-disposition: attachment; filename=bookmarks_'
-           .$selection.'_'.$now->format(LinkDB::LINK_DATE_FORMAT).'.html'
+            .$selection.'_'.$now->format(LinkDB::LINK_DATE_FORMAT).'.html'
         );
         $PAGE->assign('date', $now->format(DateTime::RFC822));
         $PAGE->assign('eol', PHP_EOL);
@@ -1434,14 +1493,20 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         $pluginMeta = $pluginManager->getPluginsMeta();
 
         // Split plugins into 2 arrays: ordered enabled plugins and disabled.
-        $enabledPlugins = array_filter($pluginMeta, function($v) { return $v['order'] !== false; });
+        $enabledPlugins = array_filter($pluginMeta, function ($v) {
+            return $v['order'] !== false;
+        });
         // Load parameters.
         $enabledPlugins = load_plugin_parameter_values($enabledPlugins, $conf->get('plugins', array()));
         uasort(
             $enabledPlugins,
-            function($a, $b) { return $a['order'] - $b['order']; }
+            function ($a, $b) {
+                return $a['order'] - $b['order'];
+            }
         );
-        $disabledPlugins = array_filter($pluginMeta, function($v) { return $v['order'] === false; });
+        $disabledPlugins = array_filter($pluginMeta, function ($v) {
+            return $v['order'] === false;
+        });
 
         $PAGE->assign('enabledPlugins', $enabledPlugins);
         $PAGE->assign('disabledPlugins', $disabledPlugins);
@@ -1458,21 +1523,23 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
                 foreach ($_POST as $param => $value) {
                     $conf->set('plugins.'. $param, escape($value));
                 }
-            }
-            else {
+            } else {
                 $conf->set('general.enabled_plugins', save_plugin_config($_POST));
             }
             $conf->write($loginManager->isLoggedIn());
             $history->updateSettings();
-        }
-        catch (Exception $e) {
+        } catch (Exception $e) {
             error_log(
                 'ERROR while saving plugin configuration:.' . PHP_EOL .
                 $e->getMessage()
             );
 
             // TODO: do not handle exceptions/errors in JS.
-            echo '<script>alert("'. $e->getMessage() .'");document.location=\'?do='. Router::$PAGE_PLUGINSADMIN .'\';</script>';
+            echo '<script>alert("'
+                . $e->getMessage()
+                .'");document.location=\'?do='
+                . Router::$PAGE_PLUGINSADMIN
+                .'\';</script>';
             exit;
         }
         header('Location: ?do='. Router::$PAGE_PLUGINSADMIN);
@@ -1486,6 +1553,43 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         exit;
     }
 
+    // -------- Thumbnails Update
+    if ($targetPage == Router::$PAGE_THUMBS_UPDATE) {
+        $ids = [];
+        foreach ($LINKSDB as $link) {
+            // A note or not HTTP(S)
+            if ($link['url'][0] === '?' || ! startsWith(strtolower($link['url']), 'http')) {
+                continue;
+            }
+            $ids[] = $link['id'];
+        }
+        $PAGE->assign('ids', $ids);
+        $PAGE->assign('pagetitle', t('Thumbnails update') .' - '. $conf->get('general.title', 'Shaarli'));
+        $PAGE->renderPage('thumbnails');
+        exit;
+    }
+
+    // -------- Single Thumbnail Update
+    if ($targetPage == Router::$AJAX_THUMB_UPDATE) {
+        if (! isset($_POST['id']) || ! ctype_digit($_POST['id'])) {
+            http_response_code(400);
+            exit;
+        }
+        $id = (int) $_POST['id'];
+        if (empty($LINKSDB[$id])) {
+            http_response_code(404);
+            exit;
+        }
+        $thumbnailer = new Thumbnailer($conf);
+        $link = $LINKSDB[$id];
+        $link['thumbnail'] = $thumbnailer->get($link['url']);
+        $LINKSDB[$id] = $link;
+        $LINKSDB->save($conf->get('resource.page_cache'));
+
+        echo json_encode($link);
+        exit;
+    }
+
     // -------- Otherwise, simply display search form and links:
     showLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager);
     exit;
@@ -1549,9 +1653,14 @@ function buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager)
     // Start index.
     $i = ($page-1) * $_SESSION['LINKS_PER_PAGE'];
     $end = $i + $_SESSION['LINKS_PER_PAGE'];
+
+    $thumbnailsEnabled = $conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE;
+    if ($thumbnailsEnabled) {
+        $thumbnailer = new Thumbnailer($conf);
+    }
+
     $linkDisp = array();
-    while ($i<$end && $i<count($keys))
-    {
+    while ($i<$end && $i<count($keys)) {
         $link = $linksToDisplay[$keys[$i]];
         $link['description'] = format_description(
             $link['description'],
@@ -1569,9 +1678,21 @@ function buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager)
         $taglist = preg_split('/\s+/', $link['tags'], -1, PREG_SPLIT_NO_EMPTY);
         uasort($taglist, 'strcasecmp');
         $link['taglist'] = $taglist;
+
+        // Logged in, thumbnails enabled, not a note,
+        // and (never retrieved yet or no valid cache file)
+        if ($loginManager->isLoggedIn() && $thumbnailsEnabled && $link['url'][0] != '?'
+            && (! isset($link['thumbnail']) || ($link['thumbnail'] !== false && ! is_file($link['thumbnail'])))
+        ) {
+            $elem = $LINKSDB[$keys[$i]];
+            $elem['thumbnail'] = $thumbnailer->get($link['url']);
+            $LINKSDB[$keys[$i]] = $elem;
+            $updateDB = true;
+            $link['thumbnail'] = $elem['thumbnail'];
+        }
+
         // Check for both signs of a note: starting with ? and 7 chars long.
-        if ($link['url'][0] === '?' &&
-            strlen($link['url']) === 7) {
+        if ($link['url'][0] === '?' && strlen($link['url']) === 7) {
             $link['url'] = index_url($_SERVER) . $link['url'];
         }
 
@@ -1579,6 +1700,11 @@ function buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager)
         $i++;
     }
 
+    // If we retrieved new thumbnails, we update the database.
+    if (!empty($updateDB)) {
+        $LINKSDB->save($conf->get('resource.page_cache'));
+    }
+
     // Compute paging navigation
     $searchtagsUrl = $searchtags === '' ? '' : '&searchtags=' . urlencode($searchtags);
     $searchtermUrl = empty($searchterm) ? '' : '&searchterm=' . urlencode($searchterm);
@@ -1629,194 +1755,6 @@ function buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager)
     return;
 }
 
-/**
- * Compute the thumbnail for a link.
- *
- * With a link to the original URL.
- * Understands various services (youtube.com...)
- * Input: $url = URL for which the thumbnail must be found.
- *        $href = if provided, this URL will be followed instead of $url
- * Returns an associative array with thumbnail attributes (src,href,width,height,style,alt)
- * Some of them may be missing.
- * Return an empty array if no thumbnail available.
- *
- * @param ConfigManager $conf Configuration Manager instance.
- * @param string        $url
- * @param string|bool   $href
- *
- * @return array
- */
-function computeThumbnail($conf, $url, $href = false)
-{
-    if (!$conf->get('thumbnail.enable_thumbnails')) return array();
-    if ($href==false) $href=$url;
-
-    // For most hosts, the URL of the thumbnail can be easily deduced from the URL of the link.
-    // (e.g. http://www.youtube.com/watch?v=spVypYk4kto --->  http://img.youtube.com/vi/spVypYk4kto/default.jpg )
-    //                                     ^^^^^^^^^^^                                 ^^^^^^^^^^^
-    $domain = parse_url($url,PHP_URL_HOST);
-    if ($domain=='youtube.com' || $domain=='www.youtube.com')
-    {
-        parse_str(parse_url($url,PHP_URL_QUERY), $params); // Extract video ID and get thumbnail
-        if (!empty($params['v'])) return array('src'=>'https://img.youtube.com/vi/'.$params['v'].'/default.jpg',
-                                               'href'=>$href,'width'=>'120','height'=>'90','alt'=>'YouTube thumbnail');
-    }
-    if ($domain=='youtu.be') // Youtube short links
-    {
-        $path = parse_url($url,PHP_URL_PATH);
-        return array('src'=>'https://img.youtube.com/vi'.$path.'/default.jpg',
-                     'href'=>$href,'width'=>'120','height'=>'90','alt'=>'YouTube thumbnail');
-    }
-    if ($domain=='pix.toile-libre.org') // pix.toile-libre.org image hosting
-    {
-        parse_str(parse_url($url,PHP_URL_QUERY), $params); // Extract image filename.
-        if (!empty($params) && !empty($params['img'])) return array('src'=>'http://pix.toile-libre.org/upload/thumb/'.urlencode($params['img']),
-                                                                    'href'=>$href,'style'=>'max-width:120px; max-height:150px','alt'=>'pix.toile-libre.org thumbnail');
-    }
-
-    if ($domain=='imgur.com')
-    {
-        $path = parse_url($url,PHP_URL_PATH);
-        if (startsWith($path,'/a/')) return array(); // Thumbnails for albums are not available.
-        if (startsWith($path,'/r/')) return array('src'=>'https://i.imgur.com/'.basename($path).'s.jpg',
-                                                  'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');
-        if (startsWith($path,'/gallery/')) return array('src'=>'https://i.imgur.com'.substr($path,8).'s.jpg',
-                                                        'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');
-
-        if (substr_count($path,'/')==1) return array('src'=>'https://i.imgur.com/'.substr($path,1).'s.jpg',
-                                                     'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');
-    }
-    if ($domain=='i.imgur.com')
-    {
-        $pi = pathinfo(parse_url($url,PHP_URL_PATH));
-        if (!empty($pi['filename'])) return array('src'=>'https://i.imgur.com/'.$pi['filename'].'s.jpg',
-                                                  'href'=>$href,'width'=>'90','height'=>'90','alt'=>'imgur.com thumbnail');
-    }
-    if ($domain=='dailymotion.com' || $domain=='www.dailymotion.com')
-    {
-        if (strpos($url,'dailymotion.com/video/')!==false)
-        {
-            $thumburl=str_replace('dailymotion.com/video/','dailymotion.com/thumbnail/video/',$url);
-            return array('src'=>$thumburl,
-                         'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'DailyMotion thumbnail');
-        }
-    }
-    if (endsWith($domain,'.imageshack.us'))
-    {
-        $ext=strtolower(pathinfo($url,PATHINFO_EXTENSION));
-        if ($ext=='jpg' || $ext=='jpeg' || $ext=='png' || $ext=='gif')
-        {
-            $thumburl = substr($url,0,strlen($url)-strlen($ext)).'th.'.$ext;
-            return array('src'=>$thumburl,
-                         'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'imageshack.us thumbnail');
-        }
-    }
-
-    // Some other hosts are SLOW AS HELL and usually require an extra HTTP request to get the thumbnail URL.
-    // So we deport the thumbnail generation in order not to slow down page generation
-    // (and we also cache the thumbnail)
-
-    if (! $conf->get('thumbnail.enable_localcache')) return array(); // If local cache is disabled, no thumbnails for services which require the use a local cache.
-
-    if ($domain=='flickr.com' || endsWith($domain,'.flickr.com')
-        || $domain=='vimeo.com'
-        || $domain=='ted.com' || endsWith($domain,'.ted.com')
-        || $domain=='xkcd.com' || endsWith($domain,'.xkcd.com')
-    )
-    {
-        if ($domain=='vimeo.com')
-        {   // Make sure this vimeo URL points to a video (/xxx... where xxx is numeric)
-            $path = parse_url($url,PHP_URL_PATH);
-            if (!preg_match('!/\d+.+?!',$path)) return array(); // This is not a single video URL.
-        }
-        if ($domain=='xkcd.com' || endsWith($domain,'.xkcd.com'))
-        {   // Make sure this URL points to a single comic (/xxx... where xxx is numeric)
-            $path = parse_url($url,PHP_URL_PATH);
-            if (!preg_match('!/\d+.+?!',$path)) return array();
-        }
-        if ($domain=='ted.com' || endsWith($domain,'.ted.com'))
-        {   // Make sure this TED URL points to a video (/talks/...)
-            $path = parse_url($url,PHP_URL_PATH);
-            if ("/talks/" !== substr($path,0,7)) return array(); // This is not a single video URL.
-        }
-        $sign = hash_hmac('sha256', $url, $conf->get('credentials.salt')); // We use the salt to sign data (it's random, secret, and specific to each installation)
-        return array('src'=>index_url($_SERVER).'?do=genthumbnail&hmac='.$sign.'&url='.urlencode($url),
-                     'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'thumbnail');
-    }
-
-    // For all other, we try to make a thumbnail of links ending with .jpg/jpeg/png/gif
-    // Technically speaking, we should download ALL links and check their Content-Type to see if they are images.
-    // But using the extension will do.
-    $ext=strtolower(pathinfo($url,PATHINFO_EXTENSION));
-    if ($ext=='jpg' || $ext=='jpeg' || $ext=='png' || $ext=='gif')
-    {
-        $sign = hash_hmac('sha256', $url, $conf->get('credentials.salt')); // We use the salt to sign data (it's random, secret, and specific to each installation)
-        return array('src'=>index_url($_SERVER).'?do=genthumbnail&hmac='.$sign.'&url='.urlencode($url),
-                     'href'=>$href,'width'=>'120','style'=>'height:auto;','alt'=>'thumbnail');
-    }
-    return array(); // No thumbnail.
-
-}
-
-
-// Returns the HTML code to display a thumbnail for a link
-// with a link to the original URL.
-// Understands various services (youtube.com...)
-// Input: $url = URL for which the thumbnail must be found.
-//        $href = if provided, this URL will be followed instead of $url
-// Returns '' if no thumbnail available.
-function thumbnail($url,$href=false)
-{
-    // FIXME!
-    global $conf;
-    $t = computeThumbnail($conf, $url,$href);
-    if (count($t)==0) return ''; // Empty array = no thumbnail for this URL.
-
-    $html='<a href="'.escape($t['href']).'"><img src="'.escape($t['src']).'"';
-    if (!empty($t['width']))  $html.=' width="'.escape($t['width']).'"';
-    if (!empty($t['height'])) $html.=' height="'.escape($t['height']).'"';
-    if (!empty($t['style']))  $html.=' style="'.escape($t['style']).'"';
-    if (!empty($t['alt']))    $html.=' alt="'.escape($t['alt']).'"';
-    $html.='></a>';
-    return $html;
-}
-
-// Returns the HTML code to display a thumbnail for a link
-// for the picture wall (using lazy image loading)
-// Understands various services (youtube.com...)
-// Input: $url = URL for which the thumbnail must be found.
-//        $href = if provided, this URL will be followed instead of $url
-// Returns '' if no thumbnail available.
-function lazyThumbnail($conf, $url,$href=false)
-{
-    // FIXME!
-    global $conf;
-    $t = computeThumbnail($conf, $url,$href);
-    if (count($t)==0) return ''; // Empty array = no thumbnail for this URL.
-
-    $html='<a href="'.escape($t['href']).'">';
-
-    // Lazy image
-    $html.='<img class="b-lazy" src="#" data-src="'.escape($t['src']).'"';
-
-    if (!empty($t['width']))  $html.=' width="'.escape($t['width']).'"';
-    if (!empty($t['height'])) $html.=' height="'.escape($t['height']).'"';
-    if (!empty($t['style']))  $html.=' style="'.escape($t['style']).'"';
-    if (!empty($t['alt']))    $html.=' alt="'.escape($t['alt']).'"';
-    $html.='>';
-
-    // No-JavaScript fallback.
-    $html.='<noscript><img src="'.escape($t['src']).'"';
-    if (!empty($t['width']))  $html.=' width="'.escape($t['width']).'"';
-    if (!empty($t['height'])) $html.=' height="'.escape($t['height']).'"';
-    if (!empty($t['style']))  $html.=' style="'.escape($t['style']).'"';
-    if (!empty($t['alt']))    $html.=' alt="'.escape($t['alt']).'"';
-    $html.='></noscript></a>';
-
-    return $html;
-}
-
-
 /**
  * Installation
  * This function should NEVER be called if the file data/config.php exists.
@@ -1825,16 +1763,19 @@ function lazyThumbnail($conf, $url,$href=false)
  * @param SessionManager $sessionManager SessionManager instance
  * @param LoginManager   $loginManager   LoginManager instance
  */
-function install($conf, $sessionManager, $loginManager) {
+function install($conf, $sessionManager, $loginManager)
+{
     // On free.fr host, make sure the /sessions directory exists, otherwise login will not work.
-    if (endsWith($_SERVER['HTTP_HOST'],'.free.fr') && !is_dir($_SERVER['DOCUMENT_ROOT'].'/sessions')) mkdir($_SERVER['DOCUMENT_ROOT'].'/sessions',0705);
+    if (endsWith($_SERVER['HTTP_HOST'], '.free.fr') && !is_dir($_SERVER['DOCUMENT_ROOT'].'/sessions')) {
+        mkdir($_SERVER['DOCUMENT_ROOT'].'/sessions', 0705);
+    }
 
 
     // This part makes sure sessions works correctly.
     // (Because on some hosts, session.save_path may not be set correctly,
     // or we may not have write access to it.)
-    if (isset($_GET['test_session']) && ( !isset($_SESSION) || !isset($_SESSION['session_tested']) || $_SESSION['session_tested']!='Working'))
-    {
+    if (isset($_GET['test_session'])
+        && ( !isset($_SESSION) || !isset($_SESSION['session_tested']) || $_SESSION['session_tested']!='Working')) {
         // Step 2: Check if data in session is correct.
         $msg = t(
             '<pre>Sessions do not seem to work correctly on your server.<br>'.
@@ -1850,19 +1791,18 @@ function install($conf, $sessionManager, $loginManager) {
         echo '<br><a href="?">'. t('Click to try again.') .'</a></pre>';
         die;
     }
-    if (!isset($_SESSION['session_tested']))
-    {   // Step 1 : Try to store data in session and reload page.
+    if (!isset($_SESSION['session_tested'])) {
+        // Step 1 : Try to store data in session and reload page.
         $_SESSION['session_tested'] = 'Working';  // Try to set a variable in session.
         header('Location: '.index_url($_SERVER).'?test_session');  // Redirect to check stored data.
     }
-    if (isset($_GET['test_session']))
-    {   // Step 3: Sessions are OK. Remove test parameter from URL.
+    if (isset($_GET['test_session'])) {
+        // Step 3: Sessions are OK. Remove test parameter from URL.
         header('Location: '.index_url($_SERVER));
     }
 
 
-    if (!empty($_POST['setlogin']) && !empty($_POST['setpassword']))
-    {
+    if (!empty($_POST['setlogin']) && !empty($_POST['setpassword'])) {
         $tz = 'UTC';
         if (!empty($_POST['continent']) && !empty($_POST['city'])
             && isTimeZoneValid($_POST['continent'], $_POST['city'])
@@ -1893,22 +1833,24 @@ function install($conf, $sessionManager, $loginManager) {
         try {
             // Everything is ok, let's create config file.
             $conf->write($loginManager->isLoggedIn());
-        }
-        catch(Exception $e) {
+        } catch (Exception $e) {
             error_log(
-                    'ERROR while writing config file after installation.' . PHP_EOL .
+                'ERROR while writing config file after installation.' . PHP_EOL .
                     $e->getMessage()
-                );
+            );
 
             // TODO: do not handle exceptions/errors in JS.
             echo '<script>alert("'. $e->getMessage() .'");document.location=\'?\';</script>';
             exit;
         }
-        echo '<script>alert("Shaarli is now configured. Please enter your login/password and start shaaring your links!");document.location=\'?do=login\';</script>';
+        echo '<script>alert('
+            .'"Shaarli is now configured. '
+            .'Please enter your login/password and start shaaring your links!"'
+            .');document.location=\'?do=login\';</script>';
         exit;
     }
 
-    $PAGE = new PageBuilder($conf, null, $sessionManager->generateToken());
+    $PAGE = new PageBuilder($conf, $_SESSION, null, $sessionManager->generateToken());
     list($continents, $cities) = generateTimeZoneData(timezone_identifiers_list(), date_default_timezone_get());
     $PAGE->assign('continents', $continents);
     $PAGE->assign('cities', $cities);
@@ -1917,240 +1859,18 @@ function install($conf, $sessionManager, $loginManager) {
     exit;
 }
 
-/**
- * Because some f*cking services like flickr require an extra HTTP request to get the thumbnail URL,
- * I have deported the thumbnail URL code generation here, otherwise this would slow down page generation.
- * The following function takes the URL a link (e.g. a flickr page) and return the proper thumbnail.
- * This function is called by passing the URL:
- * http://mywebsite.com/shaarli/?do=genthumbnail&hmac=[HMAC]&url=[URL]
- * [URL] is the URL of the link (e.g. a flickr page)
- * [HMAC] is the signature for the [URL] (so that these URL cannot be forged).
- * The function below will fetch the image from the webservice and store it in the cache.
- *
- * @param ConfigManager $conf Configuration Manager instance,
- */
-function genThumbnail($conf)
-{
-    // Make sure the parameters in the URL were generated by us.
-    $sign = hash_hmac('sha256', $_GET['url'], $conf->get('credentials.salt'));
-    if ($sign!=$_GET['hmac']) die('Naughty boy!');
-
-    $cacheDir = $conf->get('resource.thumbnails_cache', 'cache');
-    // Let's see if we don't already have the image for this URL in the cache.
-    $thumbname=hash('sha1',$_GET['url']).'.jpg';
-    if (is_file($cacheDir .'/'. $thumbname))
-    {   // We have the thumbnail, just serve it:
-        header('Content-Type: image/jpeg');
-        echo file_get_contents($cacheDir .'/'. $thumbname);
-        return;
-    }
-    // We may also serve a blank image (if service did not respond)
-    $blankname=hash('sha1',$_GET['url']).'.gif';
-    if (is_file($cacheDir .'/'. $blankname))
-    {
-        header('Content-Type: image/gif');
-        echo file_get_contents($cacheDir .'/'. $blankname);
-        return;
-    }
-
-    // Otherwise, generate the thumbnail.
-    $url = $_GET['url'];
-    $domain = parse_url($url,PHP_URL_HOST);
-
-    if ($domain=='flickr.com' || endsWith($domain,'.flickr.com'))
-    {
-        // Crude replacement to handle new flickr domain policy (They prefer www. now)
-        $url = str_replace('http://flickr.com/','http://www.flickr.com/',$url);
-
-        // Is this a link to an image, or to a flickr page ?
-        $imageurl='';
-        if (endsWith(parse_url($url, PHP_URL_PATH), '.jpg'))
-        {  // This is a direct link to an image. e.g. http://farm1.staticflickr.com/5/5921913_ac83ed27bd_o.jpg
-            preg_match('!(http://farm\d+\.staticflickr\.com/\d+/\d+_\w+_)\w.jpg!',$url,$matches);
-            if (!empty($matches[1])) $imageurl=$matches[1].'m.jpg';
-        }
-        else // This is a flickr page (html)
-        {
-            // Get the flickr html page.
-            list($headers, $content) = get_http_response($url, 20);
-            if (strpos($headers[0], '200 OK') !== false)
-            {
-                // flickr now nicely provides the URL of the thumbnail in each flickr page.
-                preg_match('!<link rel=\"image_src\" href=\"(.+?)\"!', $content, $matches);
-                if (!empty($matches[1])) $imageurl=$matches[1];
-
-                // In albums (and some other pages), the link rel="image_src" is not provided,
-                // but flickr provides:
-                // <meta property="og:image" content="http://farm4.staticflickr.com/3398/3239339068_25d13535ff_z.jpg" />
-                if ($imageurl=='')
-                {
-                    preg_match('!<meta property=\"og:image\" content=\"(.+?)\"!', $content, $matches);
-                    if (!empty($matches[1])) $imageurl=$matches[1];
-                }
-            }
-        }
-
-        if ($imageurl!='')
-        {   // Let's download the image.
-            // Image is 240x120, so 10 seconds to download should be enough.
-            list($headers, $content) = get_http_response($imageurl, 10);
-            if (strpos($headers[0], '200 OK') !== false) {
-                // Save image to cache.
-                file_put_contents($cacheDir .'/'. $thumbname, $content);
-                header('Content-Type: image/jpeg');
-                echo $content;
-                return;
-            }
-        }
-    }
-
-    elseif ($domain=='vimeo.com' )
-    {
-        // This is more complex: we have to perform a HTTP request, then parse the result.
-        // Maybe we should deport this to JavaScript ? Example: http://stackoverflow.com/questions/1361149/get-img-thumbnails-from-vimeo/4285098#4285098
-        $vid = substr(parse_url($url,PHP_URL_PATH),1);
-        list($headers, $content) = get_http_response('https://vimeo.com/api/v2/video/'.escape($vid).'.php', 5);
-        if (strpos($headers[0], '200 OK') !== false) {
-            $t = unserialize($content);
-            $imageurl = $t[0]['thumbnail_medium'];
-            // Then we download the image and serve it to our client.
-            list($headers, $content) = get_http_response($imageurl, 10);
-            if (strpos($headers[0], '200 OK') !== false) {
-                // Save image to cache.
-                file_put_contents($cacheDir .'/'. $thumbname, $content);
-                header('Content-Type: image/jpeg');
-                echo $content;
-                return;
-            }
-        }
-    }
-
-    elseif ($domain=='ted.com' || endsWith($domain,'.ted.com'))
-    {
-        // The thumbnail for TED talks is located in the <link rel="image_src" [...]> tag on that page
-        // http://www.ted.com/talks/mikko_hypponen_fighting_viruses_defending_the_net.html
-        // <link rel="image_src" href="http://images.ted.com/images/ted/28bced335898ba54d4441809c5b1112ffaf36781_389x292.jpg" />
-        list($headers, $content) = get_http_response($url, 5);
-        if (strpos($headers[0], '200 OK') !== false) {
-            // Extract the link to the thumbnail
-            preg_match('!link rel="image_src" href="(http://images.ted.com/images/ted/.+_\d+x\d+\.jpg)"!', $content, $matches);
-            if (!empty($matches[1]))
-            {   // Let's download the image.
-                $imageurl=$matches[1];
-                // No control on image size, so wait long enough
-                list($headers, $content) = get_http_response($imageurl, 20);
-                if (strpos($headers[0], '200 OK') !== false) {
-                    $filepath = $cacheDir .'/'. $thumbname;
-                    file_put_contents($filepath, $content); // Save image to cache.
-                    if (resizeImage($filepath))
-                    {
-                        header('Content-Type: image/jpeg');
-                        echo file_get_contents($filepath);
-                        return;
-                    }
-                }
-            }
-        }
-    }
-
-    elseif ($domain=='xkcd.com' || endsWith($domain,'.xkcd.com'))
-    {
-        // There is no thumbnail available for xkcd comics, so download the whole image and resize it.
-        // http://xkcd.com/327/
-        // <img src="http://imgs.xkcd.com/comics/exploits_of_a_mom.png" title="<BLABLA>" alt="<BLABLA>" />
-        list($headers, $content) = get_http_response($url, 5);
-        if (strpos($headers[0], '200 OK') !== false) {
-            // Extract the link to the thumbnail
-            preg_match('!<img src="(http://imgs.xkcd.com/comics/.*)" title="[^s]!', $content, $matches);
-            if (!empty($matches[1]))
-            {   // Let's download the image.
-                $imageurl=$matches[1];
-                // No control on image size, so wait long enough
-                list($headers, $content) = get_http_response($imageurl, 20);
-                if (strpos($headers[0], '200 OK') !== false) {
-                    $filepath = $cacheDir.'/'.$thumbname;
-                    // Save image to cache.
-                    file_put_contents($filepath, $content);
-                    if (resizeImage($filepath))
-                    {
-                        header('Content-Type: image/jpeg');
-                        echo file_get_contents($filepath);
-                        return;
-                    }
-                }
-            }
-        }
-    }
-
-    else
-    {
-        // For all other domains, we try to download the image and make a thumbnail.
-        // We allow 30 seconds max to download (and downloads are limited to 4 Mb)
-        list($headers, $content) = get_http_response($url, 30);
-        if (strpos($headers[0], '200 OK') !== false) {
-            $filepath = $cacheDir .'/'.$thumbname;
-            // Save image to cache.
-            file_put_contents($filepath, $content);
-            if (resizeImage($filepath))
-            {
-                header('Content-Type: image/jpeg');
-                echo file_get_contents($filepath);
-                return;
-            }
-        }
-    }
-
-
-    // Otherwise, return an empty image (8x8 transparent gif)
-    $blankgif = base64_decode('R0lGODlhCAAIAIAAAP///////yH5BAEKAAEALAAAAAAIAAgAAAIHjI+py+1dAAA7');
-    // Also put something in cache so that this URL is not requested twice.
-    file_put_contents($cacheDir .'/'. $blankname, $blankgif);
-    header('Content-Type: image/gif');
-    echo $blankgif;
-}
-
-// Make a thumbnail of the image (to width: 120 pixels)
-// Returns true if success, false otherwise.
-function resizeImage($filepath)
-{
-    if (!function_exists('imagecreatefromjpeg')) return false; // GD not present: no thumbnail possible.
-
-    // Trick: some stupid people rename GIF as JPEG... or else.
-    // So we really try to open each image type whatever the extension is.
-    $header=file_get_contents($filepath,false,NULL,0,256); // Read first 256 bytes and try to sniff file type.
-    $im=false;
-    $i=strpos($header,'GIF8'); if (($i!==false) && ($i==0)) $im = imagecreatefromgif($filepath); // Well this is crude, but it should be enough.
-    $i=strpos($header,'PNG'); if (($i!==false) && ($i==1)) $im = imagecreatefrompng($filepath);
-    $i=strpos($header,'JFIF'); if ($i!==false) $im = imagecreatefromjpeg($filepath);
-    if (!$im) return false;  // Unable to open image (corrupted or not an image)
-    $w = imagesx($im);
-    $h = imagesy($im);
-    $ystart = 0; $yheight=$h;
-    if ($h>$w) { $ystart= ($h/2)-($w/2); $yheight=$w/2; }
-    $nw = 120;   // Desired width
-    $nh = min(floor(($h*$nw)/$w),120); // Compute new width/height, but maximum 120 pixels height.
-    // Resize image:
-    $im2 = imagecreatetruecolor($nw,$nh);
-    imagecopyresampled($im2, $im, 0, 0, 0, $ystart, $nw, $nh, $w, $yheight);
-    imageinterlace($im2,true); // For progressive JPEG.
-    $tempname=$filepath.'_TEMP.jpg';
-    imagejpeg($im2, $tempname, 90);
-    imagedestroy($im);
-    imagedestroy($im2);
-    unlink($filepath);
-    rename($tempname,$filepath);  // Overwrite original picture with thumbnail.
-    return true;
+if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=dailyrss')) {
+    showDailyRSS($conf, $loginManager);
+    exit;
 }
 
-if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=genthumbnail')) { genThumbnail($conf); exit; }  // Thumbnail generation/cache does not need the link database.
-if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=dailyrss')) { showDailyRSS($conf); exit; }
 if (!isset($_SESSION['LINKS_PER_PAGE'])) {
     $_SESSION['LINKS_PER_PAGE'] = $conf->get('general.links_per_page', 20);
 }
 
 try {
     $history = new History($conf->get('resource.history'));
-} catch(Exception $e) {
+} catch (Exception $e) {
     die($e->getMessage());
 }
 
@@ -2169,7 +1889,7 @@ $container['history'] = $history;
 $app = new \Slim\App($container);
 
 // REST API routes
-$app->group('/api/v1', function() {
+$app->group('/api/v1', function () {
     $this->get('/info', '\Shaarli\Api\Controllers\Info:getInfo')->setName('getInfo');
     $this->get('/links', '\Shaarli\Api\Controllers\Links:getLinks')->setName('getLinks');
     $this->get('/links/{id:[\d]+}', '\Shaarli\Api\Controllers\Links:getLink')->setName('getLink');
@@ -2186,6 +1906,7 @@ $app->group('/api/v1', function() {
 })->add('\Shaarli\Api\ApiMiddleware');
 
 $response = $app->run(true);
+
 // Hack to make Slim and Shaarli router work together:
 // If a Slim route isn't found and NOT API call, we call renderPage().
 if ($response->getStatusCode() == 404 && strpos($_SERVER['REQUEST_URI'], '/api/v1') === false) {
@@ -2193,5 +1914,12 @@ if ($response->getStatusCode() == 404 && strpos($_SERVER['REQUEST_URI'], '/api/v
     header('Content-Type: text/html; charset=utf-8');
     renderPage($conf, $pluginManager, $linkDb, $history, $sessionManager, $loginManager);
 } else {
+    $response = $response
+        ->withHeader('Access-Control-Allow-Origin', '*')
+        ->withHeader(
+            'Access-Control-Allow-Headers',
+            'X-Requested-With, Content-Type, Accept, Origin, Authorization'
+        )
+        ->withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
     $app->respond($response);
 }
index a1226e8fb19e2066b3d503e3274b415bdae41fb7..248fdbfe3923dafab6cca711a4f4278eaf6a583b 100644 (file)
@@ -2,10 +2,15 @@ site_name: Shaarli Documentation
 repo_url: https://github.com/shaarli/Shaarli
 edit_uri: edit/master/doc/md
 site_description: The personal, minimalist, super-fast, database free, bookmarking service
-theme: readthedocs
+theme:
+  name: readthedocs
+  custom_dir: doc/custom_theme/
 docs_dir: doc/md
 site_dir: doc/html
-strict: true
+# Disable strict mode until ReadTheDocs provides up-to-date MkDocs settings:
+# - https://github.com/shaarli/Shaarli/issues/1179
+# - https://github.com/rtfd/readthedocs.org/issues/4314
+# strict: true
 
 pages:
 - Home: index.md
@@ -27,14 +32,16 @@ pages:
     - RSS feeds: RSS-feeds.md
     - REST API: REST-API.md
     - Community & Related software: Community-&-Related-software.md
-- How To:
-    - Backup, restore, import and export: Backup,-restore,-import-and-export.md
-    - Various hacks: Various-hacks.md
+- Guides:
+    - Install Shaarli on Debian 9 with Docker: guides/install-shaarli-with-debian9-and-docker.md
+    - Backup, restore, import and export: guides/backup-restore-import-export.md
+    - Various hacks: guides/various-hacks.md
 - Development:
     - Development guidelines: Development-guidelines.md
     - Continuous integration tools: Continuous-integration-tools.md
     - GnuPG signature: GnuPG-signature.md
     - Directory structure: Directory-structure.md
+    - Link Structure: Link-structure.md
     - 3rd party libraries: 3rd-party-libraries.md
     - Plugin System: Plugin-System.md
     - Release Shaarli: Release-Shaarli.md
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644 (file)
index 0000000..29b95d5
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<ruleset name="Shaarli">
+  <description>The Shaarli coding standards</description>
+
+  <file>index.php</file>
+  <file>application</file>
+  <file>plugins</file>
+  <file>tests</file>
+
+  <exclude-pattern>*/*.css</exclude-pattern>
+  <exclude-pattern>*/*.js</exclude-pattern>
+
+  <arg name="colors"/>
+
+  <rule ref="PSR1"/>
+  <rule ref="PSR2"/>
+</ruleset>
diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml
new file mode 100644 (file)
index 0000000..3878550
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<phpdoc>
+  <title><![CDATA[Shaarli API Reference]]></title>
+  <parser>
+    <encoding>utf8</encoding>
+    <markers>
+      <item>FIXME</item>
+      <item>TODO</item>
+      <item>WIP</item>
+    </markers>
+    <target>doc/phpdoc</target>
+  </parser>
+  <transformer>
+    <target>doc/phpdoc</target>
+  </transformer>
+  <files>
+    <file>index.php</file>
+    <directory>application</directory>
+    <directory>plugins</directory>
+  </files>
+</phpdoc>
index 8c05a23176ba960f8efaf61f5194a679bb1f7f36..8bf4ed46d6cd5afded8fd8d551361b0e93bcef76 100644 (file)
@@ -5,6 +5,8 @@
  * Adds the addlink input on the linklist page.
  */
 
+use Shaarli\Router;
+
 /**
  * When linklist is displayed, add play videos to header's toolbar.
  *
index cda35751041933c6caffd061c59121da5833c24f..0ee1c73c9333ef0fd9635db3ededbc64fb44521e 100644 (file)
@@ -5,6 +5,8 @@
  * Add an icon in the link list for archive.org.
  */
 
+use Shaarli\Plugin\PluginManager;
+
 /**
  * Add archive.org icon to link_plugin when rendering linklist.
  *
@@ -17,7 +19,7 @@ function hook_archiveorg_render_linklist($data)
     $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html');
 
     foreach ($data['links'] as &$value) {
-        if($value['private'] && preg_match('/^\?[a-zA-Z0-9-_@]{6}($|&|#)/', $value['real_url'])) {
+        if ($value['private'] && preg_match('/^\?[a-zA-Z0-9-_@]{6}($|&|#)/', $value['real_url'])) {
             continue;
         }
         $archive = sprintf($archive_html, $value['url'], t('View on archive.org'));
index f3a63b6aeb26a9a003271f981e16ac32761623d6..95ea7fe2d029767f16c000d1672e9aa0bacf4cd4 100644 (file)
@@ -15,6 +15,8 @@
  */
 
 use Shaarli\Config\ConfigManager;
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Router;
 
 /**
  * In the footer hook, there is a working example of a translation extension for Shaarli.
@@ -73,7 +75,6 @@ function hook_demo_plugin_render_header($data)
 {
     // Only execute when linklist is rendered.
     if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
-
         // If loggedin
         if ($data['_LOGGEDIN_'] === true) {
             /*
@@ -109,10 +110,10 @@ function hook_demo_plugin_render_header($data)
          *      ],
          *  ]
          * This example renders as:
-         *      <form form-attribute-1="form attribute 1 value" form-attribute-2="form attribute 2 value">
-         *          <input input-1-attribute-1="input 1 attribute 1 value" input-1-attribute-2="input 1 attribute 2 value">
-         *          <input input-2-attribute-1="input 2 attribute 1 value">
-         *      </form>
+         * <form form-attribute-1="form attribute 1 value" form-attribute-2="form attribute 2 value">
+         *   <input input-1-attribute-1="input 1 attribute 1 value" input-1-attribute-2="input 1 attribute 2 value">
+         *   <input input-2-attribute-1="input 2 attribute 1 value">
+         * </form>
          */
         $form = array(
             'attr' => array(
@@ -448,8 +449,7 @@ function hook_demo_plugin_render_feed($data)
     foreach ($data['links'] as &$link) {
         if ($data['_PAGE_'] == Router::$PAGE_FEED_ATOM) {
             $link['description'] .= ' - ATOM Feed' ;
-        }
-        elseif ($data['_PAGE_'] == Router::$PAGE_FEED_RSS) {
+        } elseif ($data['_PAGE_'] == Router::$PAGE_FEED_RSS) {
             $link['description'] .= ' - RSS Feed';
         }
     }
diff --git a/plugins/isso/comment.png b/plugins/isso/comment.png
new file mode 100644 (file)
index 0000000..0158c03
Binary files /dev/null and b/plugins/isso/comment.png differ
index 5bc1cce26e79d1be3cc64fa3bda9109a12c2ea3f..dab75dd55c5c0b06789da06e688664ef97256b54 100644 (file)
@@ -5,6 +5,8 @@
  */
 
 use Shaarli\Config\ConfigManager;
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Router;
 
 /**
  * Display an error everywhere if the plugin is enabled without configuration.
@@ -46,9 +48,36 @@ function hook_isso_render_linklist($data, $conf)
 
         $isso = sprintf($issoHtml, $issoUrl, $issoUrl, $link['id'], $link['id']);
         $data['plugin_end_zone'][] = $isso;
+    } else {
+        $button = '<span><a href="?%s#isso-thread">';
+        // For the default theme we use a FontAwesome icon which is better than an image
+        if ($conf->get('resource.theme') === 'default') {
+            $button .= '<i class="linklist-plugin-icon fa fa-comment"></i>';
+        } else {
+            $button .= '<img class="linklist-plugin-icon" src="plugins/isso/comment.png" ';
+            $button .= 'title="Comment on this shaare" alt="Comments" />';
+        }
+        $button .= '</a></span>';
+        foreach ($data['links'] as &$value) {
+            $commentLink = sprintf($button, $value['shorturl']);
+            $value['link_plugin'][] = $commentLink;
+        }
+    }
 
-        // Hackish way to include this CSS file only when necessary.
-        $data['plugins_includes']['css_files'][] = PluginManager::$PLUGINS_PATH . '/isso/isso.css';
+    return $data;
+}
+
+/**
+ * When linklist is displayed, include isso CSS file.
+ *
+ * @param array $data - header data.
+ *
+ * @return mixed - header data with isso CSS file added.
+ */
+function hook_isso_render_includes($data)
+{
+    if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
+        $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/isso/isso.css';
     }
 
     return $data;
diff --git a/plugins/isso/isso_button.html b/plugins/isso/isso_button.html
new file mode 100644 (file)
index 0000000..3f82848
--- /dev/null
@@ -0,0 +1,5 @@
+<span>
+  <a href="?%s#isso-thread">
+    <img class="linklist-plugin-icon" src="plugins/archiveorg/internetarchive.png" title="%s" alt="archive.org" />
+  </a>
+</span>
index 821bb12511bf15b98aba0dab6b757c0fc15079a5..628970d626ff4064b0daecc0b97fd40c855d3551 100644 (file)
@@ -7,6 +7,8 @@
  */
 
 use Shaarli\Config\ConfigManager;
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Router;
 
 /*
  * If this tag is used on a shaare, the description won't be processed by Parsedown.
@@ -28,6 +30,7 @@ function hook_markdown_render_linklist($data, $conf)
             $value = stripNoMarkdownTag($value);
             continue;
         }
+        $value['description_src'] = $value['description'];
         $value['description'] = process_markdown(
             $value['description'],
             $conf->get('security.markdown_escape', true),
@@ -138,7 +141,6 @@ function hook_markdown_render_includes($data)
         || $data['_PAGE_'] == Router::$PAGE_DAILY
         || $data['_PAGE_'] == Router::$PAGE_EDITLINK
     ) {
-
         $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/markdown/markdown.css';
     }
 
@@ -194,8 +196,7 @@ function reverse_text2clickable($description)
         // Detect and toggle block of code
         if (!$codeBlockOn) {
             $codeBlockOn = preg_match('/^```/', $descriptionLine) > 0;
-        }
-        elseif (preg_match('/^```/', $descriptionLine) > 0) {
+        } elseif (preg_match('/^```/', $descriptionLine) > 0) {
             $codeBlockOn = false;
         }
 
@@ -215,6 +216,15 @@ function reverse_text2clickable($description)
             $descriptionLine
         );
 
+        // Make hashtag links markdown ready, otherwise the links will be ignored with escape set to true
+        if (!$codeBlockOn && !$codeLineOn) {
+            $descriptionLine = preg_replace(
+                '#<a href="([^ ]*)"'. $hashtagTitle .'>([^<]+)</a>#m',
+                '[$2]($1)',
+                $descriptionLine
+            );
+        }
+
         $descriptionOut .= $descriptionLine;
         if ($lineCount++ < count($descriptionLines) - 1) {
             $descriptionOut .= PHP_EOL;
@@ -292,13 +302,17 @@ function sanitize_html($description)
     foreach ($escapeTags as $tag) {
         $description = preg_replace_callback(
             '#<\s*'. $tag .'[^>]*>(.*</\s*'. $tag .'[^>]*>)?#is',
-            function ($match) { return escape($match[0]); },
-            $description);
+            function ($match) {
+                return escape($match[0]);
+            },
+            $description
+        );
     }
     $description = preg_replace(
         '#(<[^>]+\s)on[a-z]*="?[^ "]*"?#is',
         '$1',
-        $description);
+        $description
+    );
     return $description;
 }
 
@@ -331,7 +345,7 @@ function process_markdown($description, $escape = true, $allowedProtocols = [])
         ->text($processedDescription);
     $processedDescription = sanitize_html($processedDescription);
 
-    if(!empty($processedDescription)){
+    if (!empty($processedDescription)) {
         $processedDescription = '<div class="markdown">'. $processedDescription . '</div>';
     }
 
index ca00c2be71f33dd566be43fb2fb2f791d41e26cf..17b1aeccf9926a2a908350ce9a3c448f285f641d 100644 (file)
@@ -4,6 +4,8 @@
  * Adds tracking code on each page.
  */
 
+use Shaarli\Plugin\PluginManager;
+
 /**
  * Initialization function.
  * It will be called when the plugin is loaded.
index c6d6b0cc6815e4f5c2547efdc395a67ccde08e3d..0341ed593abd19cb0afb5db4a092e4bb34944dd6 100644 (file)
@@ -6,6 +6,9 @@
  * Note: this plugin adds jQuery.
  */
 
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Router;
+
 /**
  * When linklist is displayed, add play videos to header's toolbar.
  *
index 184b588b7f44d62b89df0fc2f0e07094da0e8b41..2878c0505be296b486ab2b9ee4547a2851c7986b 100644 (file)
@@ -6,11 +6,14 @@
  * PubSub is a protocol which fasten up RSS fetching:
  *   - Every time a new link is posted, Shaarli notify the hub.
  *   - The hub notify all feed subscribers that a new link has been posted.
- *   - Subscribers retrieve the new link. 
+ *   - Subscribers retrieve the new link.
  */
 
 use pubsubhubbub\publisher\Publisher;
 use Shaarli\Config\ConfigManager;
+use Shaarli\Feed\FeedBuilder;
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Router;
 
 /**
  * Plugin init function - set the hub to the default appspot one.
@@ -82,7 +85,8 @@ function hook_pubsubhubbub_save_link($data, $conf)
  *
  * @throws Exception An error occurred.
  */
-function nocurl_http_post($url, $postString) {
+function nocurl_http_post($url, $postString)
+{
     $params = array('http' => array(
         'method' => 'POST',
         'content' => $postString,
index 0f96a106921e856eff1160cc0b881c1b68b2e75d..34eef8be3fe88ca23c0f00cdeaa9c444795075be 100644 (file)
@@ -5,6 +5,9 @@
  * Display a QRCode icon in link list.
  */
 
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Router;
+
 /**
  * Add qrcode icon to link_plugin when rendering linklist.
  *
@@ -17,7 +20,8 @@ function hook_qrcode_render_linklist($data)
     $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html');
 
     foreach ($data['links'] as &$value) {
-        $qrcode = sprintf($qrcode_html,
+        $qrcode = sprintf(
+            $qrcode_html,
             urlencode($value['url']),
             $value['url'],
             PluginManager::$PLUGINS_PATH
index eb8ab618f14f72a768b5851d4e804f1b5f0c2974..f4a0a92bdb8148a180fe169cfc2d2316d2cf1fd3 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+namespace Shaarli\Plugin\Wallabag;
 
 /**
  * Class WallabagInstance.
index 9dfd079eb21da9d027dc71a3aacfb9fe5d0608a0..bc35df08dcde122f0ca11e8fad30dc17e6f16baf 100644 (file)
@@ -1,11 +1,11 @@
 <?php
-
 /**
- * Plugin Wallabag.
+ * Wallabag plugin
  */
 
-require_once 'WallabagInstance.php';
 use Shaarli\Config\ConfigManager;
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Plugin\Wallabag\WallabagInstance;
 
 /**
  * Init function, return an error if the server is not set.
@@ -69,4 +69,3 @@ function wallabag_dummy_translation()
     t('Wallabag API URL');
     t('Wallabag API version (1 or 2)');
 }
-
index ff4c9e17944be6de5fa9e53f9574eb1baac5c665..82f8804d525867af42fa2345e2bdfd234adb5aae 100644 (file)
@@ -1,33 +1,14 @@
 <?php
-use Shaarli\Config\ConfigManager;
-
-/**
- * ApplicationUtils' tests
- */
+namespace Shaarli;
 
-require_once 'application/ApplicationUtils.php';
-
-/**
- * Fake ApplicationUtils class to avoid HTTP requests
- */
-class FakeApplicationUtils extends ApplicationUtils
-{
-    public static $VERSION_CODE = '';
-
-    /**
-     * Toggle HTTP requests, allow overriding the version code
-     */
-    public static function getVersion($url, $timeout=0)
-    {
-        return self::$VERSION_CODE;
-    }
-}
+use Shaarli\Config\ConfigManager;
 
+require_once 'tests/utils/FakeApplicationUtils.php';
 
 /**
  * Unitary tests for Shaarli utilities
  */
-class ApplicationUtilsTest extends PHPUnit_Framework_TestCase
+class ApplicationUtilsTest extends \PHPUnit\Framework\TestCase
 {
     protected static $testUpdateFile = 'sandbox/update.txt';
     protected static $testVersion = '0.5.0';
@@ -67,7 +48,7 @@ class ApplicationUtilsTest extends PHPUnit_Framework_TestCase
             '0.5.4',
             ApplicationUtils::getVersion(
                 'https://raw.githubusercontent.com/shaarli/Shaarli/'
-               .'v0.5.4/shaarli_version.php',
+                .'v0.5.4/shaarli_version.php',
                 $testTimeout
             )
         );
@@ -75,7 +56,7 @@ class ApplicationUtilsTest extends PHPUnit_Framework_TestCase
             self::$versionPattern,
             ApplicationUtils::getVersion(
                 'https://raw.githubusercontent.com/shaarli/Shaarli/'
-               .'latest/shaarli_version.php',
+                .'latest/shaarli_version.php',
                 $testTimeout
             )
         );
index d764e4953a1bff4870eaca13683e09864c736e42..57719175542c3562af141c0658a9b28e1ba96dcb 100644 (file)
@@ -1,13 +1,15 @@
 <?php
 
-require_once 'application/FileUtils.php';
+namespace Shaarli;
+
+use Exception;
 
 /**
  * Class FileUtilsTest
  *
  * Test file utility class.
  */
-class FileUtilsTest extends PHPUnit_Framework_TestCase
+class FileUtilsTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string Test file path.
@@ -48,7 +50,7 @@ class FileUtilsTest extends PHPUnit_Framework_TestCase
     /**
      * File not writable: raise an exception.
      *
-     * @expectedException IOException
+     * @expectedException Shaarli\Exceptions\IOException
      * @expectedExceptionMessage Error accessing "sandbox/flat.db"
      */
     public function testWriteWithoutPermission()
@@ -61,7 +63,7 @@ class FileUtilsTest extends PHPUnit_Framework_TestCase
     /**
      * Folder non existent: raise an exception.
      *
-     * @expectedException IOException
+     * @expectedException Shaarli\Exceptions\IOException
      * @expectedExceptionMessage Error accessing "nopefolder"
      */
     public function testWriteFolderDoesNotExist()
@@ -72,7 +74,7 @@ class FileUtilsTest extends PHPUnit_Framework_TestCase
     /**
      * Folder non writable: raise an exception.
      *
-     * @expectedException IOException
+     * @expectedException Shaarli\Exceptions\IOException
      * @expectedExceptionMessage Error accessing "sandbox"
      */
     public function testWriteFolderPermission()
index d3bef5a332cec8336455d00fc80c51d43b6bae23..8303e53a40b512386559aa2e665aeb88c28cbfa2 100644 (file)
@@ -1,9 +1,11 @@
 <?php
 
-require_once 'application/History.php';
+namespace Shaarli;
 
+use DateTime;
+use Exception;
 
-class HistoryTest extends PHPUnit_Framework_TestCase
+class HistoryTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string History file path
index 4951e09a3e2f31261ca9b119d700fb817a3e860f..de83f2913707aef08f52ff08474186e38210c9a8 100644 (file)
@@ -7,7 +7,7 @@ use Shaarli\Config\ConfigManager;
 /**
  * Class LanguagesTest.
  */
-class LanguagesTest extends \PHPUnit_Framework_TestCase
+class LanguagesTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string Config file path (without extension).
index 01de959c5266bb9e877f7e425e5a5af9e2cc673d..71761ac17db62f18eb199f4f85e32774b4ae2cf4 100644 (file)
@@ -1,16 +1,12 @@
 <?php
-use Shaarli\Config\ConfigManager;
+namespace Shaarli\Plugin;
 
-/**
- * Plugin Manager tests
- */
-
-require_once 'application/PluginManager.php';
+use Shaarli\Config\ConfigManager;
 
 /**
  * Unit tests for Plugins
  */
-class PluginManagerTest extends PHPUnit_Framework_TestCase
+class PluginManagerTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Path to tests plugin.
index 544bcf9c8890d6613f569795df1456107cee8b99..0cd49bb8fb2ea6951018e818bc3b8a9907c242d7 100644 (file)
@@ -1,15 +1,10 @@
 <?php
-
-/**
- * Router tests
- */
-
-require_once 'application/Router.php';
+namespace Shaarli;
 
 /**
  * Unit tests for Router
  */
-class RouterTest extends PHPUnit_Framework_TestCase
+class RouterTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Test findPage: login page output.
@@ -218,7 +213,6 @@ class RouterTest extends PHPUnit_Framework_TestCase
             Router::$PAGE_CHANGEPASSWORD,
             Router::findPage('do=changepasswd&stuff', array(), true)
         );
-
     }
 
     /**
diff --git a/tests/ThumbnailerTest.php b/tests/ThumbnailerTest.php
new file mode 100644 (file)
index 0000000..c01849f
--- /dev/null
@@ -0,0 +1,116 @@
+<?php
+
+namespace Shaarli;
+
+use PHPUnit\Framework\TestCase;
+use Shaarli\Config\ConfigManager;
+use WebThumbnailer\Application\ConfigManager as WTConfigManager;
+
+/**
+ * Class ThumbnailerTest
+ *
+ * We only make 1 thumb test because:
+ *
+ *   1. the thumbnailer library is itself tested
+ *   2. we don't want to make too many external requests during the tests
+ */
+class ThumbnailerTest extends TestCase
+{
+    const WIDTH = 190;
+
+    const HEIGHT = 210;
+
+    /**
+     * @var Thumbnailer;
+     */
+    protected $thumbnailer;
+
+    /**
+     * @var ConfigManager
+     */
+    protected $conf;
+
+    public function setUp()
+    {
+        $this->conf = new ConfigManager('tests/utils/config/configJson');
+        $this->conf->set('thumbnails.mode', Thumbnailer::MODE_ALL);
+        $this->conf->set('thumbnails.width', self::WIDTH);
+        $this->conf->set('thumbnails.height', self::HEIGHT);
+        $this->conf->set('dev.debug', true);
+
+        $this->thumbnailer = new Thumbnailer($this->conf);
+        // cache files in the sandbox
+        WTConfigManager::addFile('tests/utils/config/wt.json');
+    }
+
+    public function tearDown()
+    {
+        $this->rrmdirContent('sandbox/');
+    }
+
+    /**
+     * Test a thumbnail with a custom size in 'all' mode.
+     */
+    public function testThumbnailAllValid()
+    {
+        $thumb = $this->thumbnailer->get('https://github.com/shaarli/Shaarli/');
+        $this->assertNotFalse($thumb);
+        $image = imagecreatefromstring(file_get_contents($thumb));
+        $this->assertEquals(self::WIDTH, imagesx($image));
+        $this->assertEquals(self::HEIGHT, imagesy($image));
+    }
+
+    /**
+     * Test a thumbnail with a custom size in 'common' mode.
+     */
+    public function testThumbnailCommonValid()
+    {
+        $this->conf->set('thumbnails.mode', Thumbnailer::MODE_COMMON);
+        $thumb = $this->thumbnailer->get('https://imgur.com/jlFgGpe');
+        $this->assertNotFalse($thumb);
+        $image = imagecreatefromstring(file_get_contents($thumb));
+        $this->assertEquals(self::WIDTH, imagesx($image));
+        $this->assertEquals(self::HEIGHT, imagesy($image));
+    }
+
+    /**
+     * Test a thumbnail in 'common' mode which isn't include in common websites.
+     */
+    public function testThumbnailCommonInvalid()
+    {
+        $this->conf->set('thumbnails.mode', Thumbnailer::MODE_COMMON);
+        $thumb = $this->thumbnailer->get('https://github.com/shaarli/Shaarli/');
+        $this->assertFalse($thumb);
+    }
+
+    /**
+     * Test a thumbnail that can't be retrieved.
+     */
+    public function testThumbnailNotValid()
+    {
+        $oldlog = ini_get('error_log');
+        ini_set('error_log', '/dev/null');
+
+        $thumbnailer = new Thumbnailer(new ConfigManager());
+        $thumb = $thumbnailer->get('nope');
+        $this->assertFalse($thumb);
+
+        ini_set('error_log', $oldlog);
+    }
+
+    protected function rrmdirContent($dir)
+    {
+        if (is_dir($dir)) {
+            $objects = scandir($dir);
+            foreach ($objects as $object) {
+                if ($object != "." && $object != "..") {
+                    if (is_dir($dir."/".$object)) {
+                        $this->rrmdirContent($dir."/".$object);
+                    } else {
+                        unlink($dir."/".$object);
+                    }
+                }
+            }
+        }
+    }
+}
index 127fdc192ccab36ec57427ba270f444f9108b29f..02bf060f34a0a7a1be177b2ab96d10316c73b869 100644 (file)
@@ -8,7 +8,7 @@ require_once 'application/TimeZone.php';
 /**
  * Unitary tests for timezone utilities
  */
-class TimeZoneTest extends PHPUnit_Framework_TestCase
+class TimeZoneTest extends PHPUnit\Framework\TestCase
 {
     /**
      * @var array of timezones
index 6cd37a7afa27836249af244559fe23c93748e2bd..8225d95ae067d3c5db9fb4a352860bb341c8b961 100644 (file)
@@ -10,7 +10,7 @@ require_once 'application/Languages.php';
 /**
  * Unitary tests for Shaarli utilities
  */
-class UtilsTest extends PHPUnit_Framework_TestCase
+class UtilsTest extends PHPUnit\Framework\TestCase
 {
     // Log file
     protected static $testLogFile = 'tests.log';
@@ -187,7 +187,8 @@ class UtilsTest extends PHPUnit_Framework_TestCase
     /**
      * Test generate location with valid data.
      */
-    public function testGenerateLocation() {
+    public function testGenerateLocation()
+    {
         $ref = 'http://localhost/?test';
         $this->assertEquals($ref, generateLocation($ref, 'localhost'));
         $ref = 'http://localhost:8080/?test';
@@ -199,7 +200,8 @@ class UtilsTest extends PHPUnit_Framework_TestCase
     /**
      * Test generate location - anti loop.
      */
-    public function testGenerateLocationLoop() {
+    public function testGenerateLocationLoop()
+    {
         $ref = 'http://localhost/?test';
         $this->assertEquals('?', generateLocation($ref, 'localhost', array('test')));
     }
@@ -207,7 +209,8 @@ class UtilsTest extends PHPUnit_Framework_TestCase
     /**
      * Test generate location - from other domain.
      */
-    public function testGenerateLocationOut() {
+    public function testGenerateLocationOut()
+    {
         $ref = 'http://somewebsite.com/?test';
         $this->assertEquals('?', generateLocation($ref, 'localhost'));
     }
index 23a56b1cee4e78e90aec15941fb4b3927242b32e..0b9b03f28ec7c0d824e23484395d60dd867f06a4 100644 (file)
@@ -2,7 +2,6 @@
 namespace Shaarli\Api;
 
 use Shaarli\Config\ConfigManager;
-
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
@@ -18,7 +17,7 @@ use Slim\Http\Response;
  *
  * @package Api
  */
-class ApiMiddlewareTest extends \PHPUnit_Framework_TestCase
+class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
index 62baf4c52f606d9dd8918ac821cec6dbbc73a989..ea0ae50087d04ee5ac89c9a681f97f6676c88979 100644 (file)
@@ -2,13 +2,12 @@
 
 namespace Shaarli\Api;
 
-use Shaarli\Base64Url;
-
+use Shaarli\Http\Base64Url;
 
 /**
  * Class ApiUtilsTest
  */
-class ApiUtilsTest extends \PHPUnit_Framework_TestCase
+class ApiUtilsTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Force the timezone for ISO datetimes.
@@ -34,7 +33,7 @@ class ApiUtilsTest extends \PHPUnit_Framework_TestCase
         $payload = Base64Url::encode('{
             "iat": '. time() .'
         }');
-        $signature = Base64Url::encode(hash_hmac('sha512', $header .'.'. $payload , $secret, true));
+        $signature = Base64Url::encode(hash_hmac('sha512', $header .'.'. $payload, $secret, true));
         return $header .'.'. $payload .'.'. $signature;
     }
 
index 61046d9732e78439c10aa028c7ddb3720583d9aa..e287f239eea24fe746ccf894f1b464c3769206de 100644 (file)
@@ -1,10 +1,9 @@
 <?php
 
-
 namespace Shaarli\Api\Controllers;
 
-
 use Shaarli\Config\ConfigManager;
+use Shaarli\History;
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
@@ -12,7 +11,7 @@ use Slim\Http\Response;
 
 require_once 'tests/utils/ReferenceHistory.php';
 
-class HistoryTest extends \PHPUnit_Framework_TestCase
+class HistoryTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -35,7 +34,7 @@ class HistoryTest extends \PHPUnit_Framework_TestCase
     protected $container;
 
     /**
-     * @var History controller instance.
+     * @var HistoryController controller instance.
      */
     protected $controller;
 
@@ -50,9 +49,9 @@ class HistoryTest extends \PHPUnit_Framework_TestCase
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
         $this->container['db'] = true;
-        $this->container['history'] = new \History(self::$testHistory);
+        $this->container['history'] = new History(self::$testHistory);
 
-        $this->controller = new History($this->container);
+        $this->controller = new HistoryController($this->container);
     }
 
     /**
@@ -79,35 +78,35 @@ class HistoryTest extends \PHPUnit_Framework_TestCase
 
         $this->assertEquals($this->refHistory->count(), count($data));
 
-        $this->assertEquals(\History::DELETED, $data[0]['event']);
+        $this->assertEquals(History::DELETED, $data[0]['event']);
         $this->assertEquals(
             \DateTime::createFromFormat('Ymd_His', '20170303_121216')->format(\DateTime::ATOM),
             $data[0]['datetime']
         );
         $this->assertEquals(124, $data[0]['id']);
 
-        $this->assertEquals(\History::SETTINGS, $data[1]['event']);
+        $this->assertEquals(History::SETTINGS, $data[1]['event']);
         $this->assertEquals(
             \DateTime::createFromFormat('Ymd_His', '20170302_121215')->format(\DateTime::ATOM),
             $data[1]['datetime']
         );
         $this->assertNull($data[1]['id']);
 
-        $this->assertEquals(\History::UPDATED, $data[2]['event']);
+        $this->assertEquals(History::UPDATED, $data[2]['event']);
         $this->assertEquals(
             \DateTime::createFromFormat('Ymd_His', '20170301_121214')->format(\DateTime::ATOM),
             $data[2]['datetime']
         );
         $this->assertEquals(123, $data[2]['id']);
 
-        $this->assertEquals(\History::CREATED, $data[3]['event']);
+        $this->assertEquals(History::CREATED, $data[3]['event']);
         $this->assertEquals(
             \DateTime::createFromFormat('Ymd_His', '20170201_121214')->format(\DateTime::ATOM),
             $data[3]['datetime']
         );
         $this->assertEquals(124, $data[3]['id']);
 
-        $this->assertEquals(\History::CREATED, $data[4]['event']);
+        $this->assertEquals(History::CREATED, $data[4]['event']);
         $this->assertEquals(
             \DateTime::createFromFormat('Ymd_His', '20170101_121212')->format(\DateTime::ATOM),
             $data[4]['datetime']
@@ -132,7 +131,7 @@ class HistoryTest extends \PHPUnit_Framework_TestCase
 
         $this->assertEquals(1, count($data));
 
-        $this->assertEquals(\History::DELETED, $data[0]['event']);
+        $this->assertEquals(History::DELETED, $data[0]['event']);
         $this->assertEquals(
             \DateTime::createFromFormat('Ymd_His', '20170303_121216')->format(\DateTime::ATOM),
             $data[0]['datetime']
@@ -157,7 +156,7 @@ class HistoryTest extends \PHPUnit_Framework_TestCase
 
         $this->assertEquals(1, count($data));
 
-        $this->assertEquals(\History::CREATED, $data[0]['event']);
+        $this->assertEquals(History::CREATED, $data[0]['event']);
         $this->assertEquals(
             \DateTime::createFromFormat('Ymd_His', '20170101_121212')->format(\DateTime::ATOM),
             $data[0]['datetime']
@@ -182,7 +181,7 @@ class HistoryTest extends \PHPUnit_Framework_TestCase
 
         $this->assertEquals(1, count($data));
 
-        $this->assertEquals(\History::DELETED, $data[0]['event']);
+        $this->assertEquals(History::DELETED, $data[0]['event']);
         $this->assertEquals(
             \DateTime::createFromFormat('Ymd_His', '20170303_121216')->format(\DateTime::ATOM),
             $data[0]['datetime']
@@ -207,7 +206,7 @@ class HistoryTest extends \PHPUnit_Framework_TestCase
 
         $this->assertEquals(1, count($data));
 
-        $this->assertEquals(\History::SETTINGS, $data[0]['event']);
+        $this->assertEquals(History::SETTINGS, $data[0]['event']);
         $this->assertEquals(
             \DateTime::createFromFormat('Ymd_His', '20170302_121215')->format(\DateTime::ATOM),
             $data[0]['datetime']
index f7e63bfaf2623e498ce0f9605c76aad7e517975b..e70d371bf7ae650364444c0318b0ca7ddeb75d6d 100644 (file)
@@ -2,7 +2,6 @@
 namespace Shaarli\Api\Controllers;
 
 use Shaarli\Config\ConfigManager;
-
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
@@ -10,12 +9,12 @@ use Slim\Http\Response;
 
 /**
  * Class InfoTest
- * 
+ *
  * Test REST API controller Info.
- * 
+ *
  * @package Api\Controllers
  */
-class InfoTest extends \PHPUnit_Framework_TestCase
+class InfoTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -53,7 +52,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase
 
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
-        $this->container['db'] = new \LinkDB(self::$testDatastore, true, false);
+        $this->container['db'] = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false);
         $this->container['history'] = null;
 
         $this->controller = new Info($this->container);
index 7d79713779cc70bf1c18c3ae3803196be6af3990..90193e289ab95bf453c35de9af63250d3ea7800f 100644 (file)
@@ -3,13 +3,15 @@
 
 namespace Shaarli\Api\Controllers;
 
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigManager;
+use Shaarli\History;
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
 use Slim\Http\Response;
 
-class DeleteLinkTest extends \PHPUnit_Framework_TestCase
+class DeleteLinkTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -32,12 +34,12 @@ class DeleteLinkTest extends \PHPUnit_Framework_TestCase
     protected $refDB = null;
 
     /**
-     * @var \LinkDB instance.
+     * @var LinkDB instance.
      */
     protected $linkDB;
 
     /**
-     * @var \History instance.
+     * @var HistoryController instance.
      */
     protected $history;
 
@@ -59,10 +61,10 @@ class DeleteLinkTest extends \PHPUnit_Framework_TestCase
         $this->conf = new ConfigManager('tests/utils/config/configJson');
         $this->refDB = new \ReferenceLinkDB();
         $this->refDB->write(self::$testDatastore);
-        $this->linkDB = new \LinkDB(self::$testDatastore, true, false);
+        $this->linkDB = new LinkDB(self::$testDatastore, true, false);
         $refHistory = new \ReferenceHistory();
         $refHistory->write(self::$testHistory);
-        $this->history = new \History(self::$testHistory);
+        $this->history = new History(self::$testHistory);
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
         $this->container['db'] = $this->linkDB;
@@ -96,11 +98,11 @@ class DeleteLinkTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals(204, $response->getStatusCode());
         $this->assertEmpty((string) $response->getBody());
 
-        $this->linkDB = new \LinkDB(self::$testDatastore, true, false);
+        $this->linkDB = new LinkDB(self::$testDatastore, true, false);
         $this->assertFalse(isset($this->linkDB[$id]));
 
         $historyEntry = $this->history->getHistory()[0];
-        $this->assertEquals(\History::DELETED, $historyEntry['event']);
+        $this->assertEquals(History::DELETED, $historyEntry['event']);
         $this->assertTrue(
             (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
         );
@@ -110,7 +112,7 @@ class DeleteLinkTest extends \PHPUnit_Framework_TestCase
     /**
      * Test DELETE link endpoint: reach not existing ID.
      *
-     * @expectedException Shaarli\Api\Exceptions\ApiLinkNotFoundException
+     * @expectedException \Shaarli\Api\Exceptions\ApiLinkNotFoundException
      */
     public function testDeleteLink404()
     {
index 57528d5aee7c7372dee4dff3fd6f15abe0a6d8af..cb9b7f6a84afbc8cb87b0cc8cf3592474084fcc8 100644 (file)
@@ -3,7 +3,6 @@
 namespace Shaarli\Api\Controllers;
 
 use Shaarli\Config\ConfigManager;
-
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
@@ -18,7 +17,7 @@ use Slim\Http\Response;
  *
  * @package Shaarli\Api\Controllers
  */
-class GetLinkIdTest extends \PHPUnit_Framework_TestCase
+class GetLinkIdTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -61,7 +60,7 @@ class GetLinkIdTest extends \PHPUnit_Framework_TestCase
 
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
-        $this->container['db'] = new \LinkDB(self::$testDatastore, true, false);
+        $this->container['db'] = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false);
         $this->container['history'] = null;
 
         $this->controller = new Links($this->container);
@@ -108,7 +107,7 @@ class GetLinkIdTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals('sTuff', $data['tags'][0]);
         $this->assertEquals(false, $data['private']);
         $this->assertEquals(
-            \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20150310_114651')->format(\DateTime::ATOM),
+            \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20150310_114651')->format(\DateTime::ATOM),
             $data['created']
         );
         $this->assertEmpty($data['updated']);
index d22ed3bfe97fe8d98054f1eff9e9e3597573e5a9..711a315221b84d85d5829413866caa2411d5de1b 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 namespace Shaarli\Api\Controllers;
 
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigManager;
-
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
@@ -17,7 +17,7 @@ use Slim\Http\Response;
  *
  * @package Shaarli\Api\Controllers
  */
-class GetLinksTest extends \PHPUnit_Framework_TestCase
+class GetLinksTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -60,7 +60,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase
 
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
-        $this->container['db'] = new \LinkDB(self::$testDatastore, true, false);
+        $this->container['db'] = new LinkDB(self::$testDatastore, true, false);
         $this->container['history'] = null;
 
         $this->controller = new Links($this->container);
@@ -95,7 +95,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals($this->refDB->countLinks(), count($data));
 
         // Check order
-        $order = [41, 8, 6, 7, 0, 1, 9, 4, 42];
+        $order = [10, 11, 41, 8, 6, 7, 0, 1, 9, 4, 42];
         $cpt = 0;
         foreach ($data as $link) {
             $this->assertEquals(self::NB_FIELDS_LINK, count($link));
@@ -103,7 +103,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase
         }
 
         // Check first element fields
-        $first = $data[0];
+        $first = $data[2];
         $this->assertEquals('http://domain.tld/?WDWyig', $first['url']);
         $this->assertEquals('WDWyig', $first['shorturl']);
         $this->assertEquals('Link title: @website', $first['title']);
@@ -114,18 +114,18 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals('sTuff', $first['tags'][0]);
         $this->assertEquals(false, $first['private']);
         $this->assertEquals(
-            \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20150310_114651')->format(\DateTime::ATOM),
+            \DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651')->format(\DateTime::ATOM),
             $first['created']
         );
         $this->assertEmpty($first['updated']);
 
         // Multi tags
-        $link = $data[1];
+        $link = $data[3];
         $this->assertEquals(7, count($link['tags']));
 
         // Update date
         $this->assertEquals(
-            \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20160803_093033')->format(\DateTime::ATOM),
+            \DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20160803_093033')->format(\DateTime::ATOM),
             $link['updated']
         );
     }
@@ -138,7 +138,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase
     {
         $env = Environment::mock([
             'REQUEST_METHOD' => 'GET',
-            'QUERY_STRING' => 'offset=1&limit=1'
+            'QUERY_STRING' => 'offset=3&limit=1'
         ]);
         $request = Request::createFromEnvironment($env);
         $response = $this->controller->getLinks($request, new Response());
@@ -164,7 +164,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase
         $data = json_decode((string) $response->getBody(), true);
         $this->assertEquals($this->refDB->countLinks(), count($data));
         // Check order
-        $order = [41, 8, 6, 7, 0, 1, 9, 4, 42];
+        $order = [10, 11, 41, 8, 6, 7, 0, 1, 9, 4, 42];
         $cpt = 0;
         foreach ($data as $link) {
             $this->assertEquals(self::NB_FIELDS_LINK, count($link));
@@ -205,7 +205,8 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals(200, $response->getStatusCode());
         $data = json_decode((string)$response->getBody(), true);
         $this->assertEquals($this->refDB->countLinks(), count($data));
-        $this->assertEquals(41, $data[0]['id']);
+        $this->assertEquals(10, $data[0]['id']);
+        $this->assertEquals(41, $data[2]['id']);
         $this->assertEquals(self::NB_FIELDS_LINK, count($data[0]));
     }
 
@@ -243,7 +244,8 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals(200, $response->getStatusCode());
         $data = json_decode((string)$response->getBody(), true);
         $this->assertEquals($this->refDB->countPublicLinks(), count($data));
-        $this->assertEquals(41, $data[0]['id']);
+        $this->assertEquals(10, $data[0]['id']);
+        $this->assertEquals(41, $data[2]['id']);
         $this->assertEquals(self::NB_FIELDS_LINK, count($data[0]));
     }
 
@@ -413,8 +415,9 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase
         $response = $this->controller->getLinks($request, new Response());
         $this->assertEquals(200, $response->getStatusCode());
         $data = json_decode((string) $response->getBody(), true);
-        $this->assertEquals(9, count($data));
-        $this->assertEquals(41, $data[0]['id']);
+        $this->assertEquals(\ReferenceLinkDB::$NB_LINKS_TOTAL, count($data));
+        $this->assertEquals(10, $data[0]['id']);
+        $this->assertEquals(41, $data[2]['id']);
 
         // wildcard: optional ('*' does not need to expand)
         $env = Environment::mock([
index 100a91704f866e383430cf2e690522302ba20957..d683a98429c05a882d42998a287f9e98cf4c4ff7 100644 (file)
@@ -2,9 +2,9 @@
 
 namespace Shaarli\Api\Controllers;
 
-
 use PHPUnit\Framework\TestCase;
 use Shaarli\Config\ConfigManager;
+use Shaarli\History;
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
@@ -41,7 +41,7 @@ class PostLinkTest extends TestCase
     protected $refDB = null;
 
     /**
-     * @var \History instance.
+     * @var HistoryController instance.
      */
     protected $history;
 
@@ -71,12 +71,12 @@ class PostLinkTest extends TestCase
 
         $refHistory = new \ReferenceHistory();
         $refHistory->write(self::$testHistory);
-        $this->history = new \History(self::$testHistory);
+        $this->history = new History(self::$testHistory);
 
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
-        $this->container['db'] = new \LinkDB(self::$testDatastore, true, false);
-        $this->container['history'] = new \History(self::$testHistory);
+        $this->container['db'] = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false);
+        $this->container['history'] = new History(self::$testHistory);
 
         $this->controller = new Links($this->container);
 
@@ -122,17 +122,19 @@ class PostLinkTest extends TestCase
         $data = json_decode((string) $response->getBody(), true);
         $this->assertEquals(self::NB_FIELDS_LINK, count($data));
         $this->assertEquals(43, $data['id']);
-        $this->assertRegExp('/[\w-_]{6}/', $data['shorturl']);
+        $this->assertRegExp('/[\w_-]{6}/', $data['shorturl']);
         $this->assertEquals('http://domain.tld/?' . $data['shorturl'], $data['url']);
         $this->assertEquals('?' . $data['shorturl'], $data['title']);
         $this->assertEquals('', $data['description']);
         $this->assertEquals([], $data['tags']);
         $this->assertEquals(false, $data['private']);
-        $this->assertTrue(new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['created']));
+        $this->assertTrue(
+            new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
+        );
         $this->assertEquals('', $data['updated']);
 
         $historyEntry = $this->history->getHistory()[0];
-        $this->assertEquals(\History::CREATED, $historyEntry['event']);
+        $this->assertEquals(History::CREATED, $historyEntry['event']);
         $this->assertTrue(
             (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
         );
@@ -165,13 +167,15 @@ class PostLinkTest extends TestCase
         $data = json_decode((string) $response->getBody(), true);
         $this->assertEquals(self::NB_FIELDS_LINK, count($data));
         $this->assertEquals(43, $data['id']);
-        $this->assertRegExp('/[\w-_]{6}/', $data['shorturl']);
+        $this->assertRegExp('/[\w_-]{6}/', $data['shorturl']);
         $this->assertEquals('http://' . $link['url'], $data['url']);
         $this->assertEquals($link['title'], $data['title']);
         $this->assertEquals($link['description'], $data['description']);
         $this->assertEquals($link['tags'], $data['tags']);
         $this->assertEquals(true, $data['private']);
-        $this->assertTrue(new \DateTime('2 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['created']));
+        $this->assertTrue(
+            new \DateTime('2 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
+        );
         $this->assertEquals('', $data['updated']);
     }
 
@@ -207,11 +211,11 @@ class PostLinkTest extends TestCase
         $this->assertEquals(['gnu', 'media', 'web', '.hidden', 'hashtag'], $data['tags']);
         $this->assertEquals(false, $data['private']);
         $this->assertEquals(
-            \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20130614_184135'),
+            \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20130614_184135'),
             \DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
         );
         $this->assertEquals(
-            \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20130615_184230'),
+            \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20130615_184230'),
             \DateTime::createFromFormat(\DateTime::ATOM, $data['updated'])
         );
     }
index 8a5625710b5e924cda9d3c5146112b3d3851f353..cd815b667be954b99719e7a2c0e9b7fab1661a9c 100644 (file)
@@ -3,14 +3,14 @@
 
 namespace Shaarli\Api\Controllers;
 
-
 use Shaarli\Config\ConfigManager;
+use Shaarli\History;
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
 use Slim\Http\Response;
 
-class PutLinkTest extends \PHPUnit_Framework_TestCase
+class PutLinkTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -33,7 +33,7 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
     protected $refDB = null;
 
     /**
-     * @var \History instance.
+     * @var HistoryController instance.
      */
     protected $history;
 
@@ -63,12 +63,12 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
 
         $refHistory = new \ReferenceHistory();
         $refHistory->write(self::$testHistory);
-        $this->history = new \History(self::$testHistory);
+        $this->history = new History(self::$testHistory);
 
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
-        $this->container['db'] = new \LinkDB(self::$testDatastore, true, false);
-        $this->container['history'] = new \History(self::$testHistory);
+        $this->container['db'] = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false);
+        $this->container['history'] = new History(self::$testHistory);
 
         $this->controller = new Links($this->container);
 
@@ -115,10 +115,12 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
             \DateTime::createFromFormat('Ymd_His', '20150310_114651'),
             \DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
         );
-        $this->assertTrue(new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated']));
+        $this->assertTrue(
+            new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated'])
+        );
 
         $historyEntry = $this->history->getHistory()[0];
-        $this->assertEquals(\History::UPDATED, $historyEntry['event']);
+        $this->assertEquals(History::UPDATED, $historyEntry['event']);
         $this->assertTrue(
             (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
         );
@@ -160,7 +162,9 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
             \DateTime::createFromFormat('Ymd_His', '20150310_114651'),
             \DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
         );
-        $this->assertTrue(new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated']));
+        $this->assertTrue(
+            new \DateTime('5 seconds ago') < \DateTime::createFromFormat(\DateTime::ATOM, $data['updated'])
+        );
     }
 
     /**
@@ -195,11 +199,11 @@ class PutLinkTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals(['gnu', 'media', 'web', '.hidden', 'hashtag'], $data['tags']);
         $this->assertEquals(false, $data['private']);
         $this->assertEquals(
-            \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20130614_184135'),
+            \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20130614_184135'),
             \DateTime::createFromFormat(\DateTime::ATOM, $data['created'])
         );
         $this->assertEquals(
-            \DateTime::createFromFormat(\LinkDB::LINK_DATE_FORMAT, '20130615_184230'),
+            \DateTime::createFromFormat(\Shaarli\Bookmark\LinkDB::LINK_DATE_FORMAT, '20130615_184230'),
             \DateTime::createFromFormat(\DateTime::ATOM, $data['updated'])
         );
     }
index e0787ce2cfa213f356e6a770f1875fc24364e73f..84e1d56ecd279d4e45eb137f57e4777108480df8 100644 (file)
@@ -3,13 +3,15 @@
 
 namespace Shaarli\Api\Controllers;
 
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigManager;
+use Shaarli\History;
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
 use Slim\Http\Response;
 
-class DeleteTagTest extends \PHPUnit_Framework_TestCase
+class DeleteTagTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -32,12 +34,12 @@ class DeleteTagTest extends \PHPUnit_Framework_TestCase
     protected $refDB = null;
 
     /**
-     * @var \LinkDB instance.
+     * @var LinkDB instance.
      */
     protected $linkDB;
 
     /**
-     * @var \History instance.
+     * @var HistoryController instance.
      */
     protected $history;
 
@@ -59,10 +61,10 @@ class DeleteTagTest extends \PHPUnit_Framework_TestCase
         $this->conf = new ConfigManager('tests/utils/config/configJson');
         $this->refDB = new \ReferenceLinkDB();
         $this->refDB->write(self::$testDatastore);
-        $this->linkDB = new \LinkDB(self::$testDatastore, true, false);
+        $this->linkDB = new LinkDB(self::$testDatastore, true, false);
         $refHistory = new \ReferenceHistory();
         $refHistory->write(self::$testHistory);
-        $this->history = new \History(self::$testHistory);
+        $this->history = new History(self::$testHistory);
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
         $this->container['db'] = $this->linkDB;
@@ -97,18 +99,18 @@ class DeleteTagTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals(204, $response->getStatusCode());
         $this->assertEmpty((string) $response->getBody());
 
-        $this->linkDB = new \LinkDB(self::$testDatastore, true, false);
+        $this->linkDB = new LinkDB(self::$testDatastore, true, false);
         $tags = $this->linkDB->linksCountPerTag();
         $this->assertFalse(isset($tags[$tagName]));
 
         // 2 links affected
         $historyEntry = $this->history->getHistory()[0];
-        $this->assertEquals(\History::UPDATED, $historyEntry['event']);
+        $this->assertEquals(History::UPDATED, $historyEntry['event']);
         $this->assertTrue(
             (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
         );
         $historyEntry = $this->history->getHistory()[1];
-        $this->assertEquals(\History::UPDATED, $historyEntry['event']);
+        $this->assertEquals(History::UPDATED, $historyEntry['event']);
         $this->assertTrue(
             (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
         );
@@ -131,13 +133,13 @@ class DeleteTagTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals(204, $response->getStatusCode());
         $this->assertEmpty((string) $response->getBody());
 
-        $this->linkDB = new \LinkDB(self::$testDatastore, true, false);
+        $this->linkDB = new LinkDB(self::$testDatastore, true, false);
         $tags = $this->linkDB->linksCountPerTag();
         $this->assertFalse(isset($tags[$tagName]));
         $this->assertTrue($tags[strtolower($tagName)] > 0);
 
         $historyEntry = $this->history->getHistory()[0];
-        $this->assertEquals(\History::UPDATED, $historyEntry['event']);
+        $this->assertEquals(History::UPDATED, $historyEntry['event']);
         $this->assertTrue(
             (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
         );
index afac228e26b23e0ad74037c105e69a5a4b49a67c..a2525c177b63967aadb8c1b7b6255b4fcf585814 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Shaarli\Api\Controllers;
 
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigManager;
-
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
@@ -16,7 +16,7 @@ use Slim\Http\Response;
  *
  * @package Shaarli\Api\Controllers
  */
-class GetTagNameTest extends \PHPUnit_Framework_TestCase
+class GetTagNameTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -59,7 +59,7 @@ class GetTagNameTest extends \PHPUnit_Framework_TestCase
 
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
-        $this->container['db'] = new \LinkDB(self::$testDatastore, true, false);
+        $this->container['db'] = new LinkDB(self::$testDatastore, true, false);
         $this->container['history'] = null;
 
         $this->controller = new Tags($this->container);
index 3fab31b0f462a3ee335b9429240e65919a745e68..98628c984f0fa9e12f2da7f7865bb6eb70155d3f 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 namespace Shaarli\Api\Controllers;
 
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigManager;
-
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
@@ -15,7 +15,7 @@ use Slim\Http\Response;
  *
  * @package Shaarli\Api\Controllers
  */
-class GetTagsTest extends \PHPUnit_Framework_TestCase
+class GetTagsTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -38,7 +38,7 @@ class GetTagsTest extends \PHPUnit_Framework_TestCase
     protected $container;
 
     /**
-     * @var \LinkDB instance.
+     * @var LinkDB instance.
      */
     protected $linkDB;
 
@@ -63,7 +63,7 @@ class GetTagsTest extends \PHPUnit_Framework_TestCase
 
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
-        $this->linkDB = new \LinkDB(self::$testDatastore, true, false);
+        $this->linkDB = new LinkDB(self::$testDatastore, true, false);
         $this->container['db'] = $this->linkDB;
         $this->container['history'] = null;
 
index 6f7dec224071c7c764506a52e4b1e2680ad33cef..86106fc7eaec629b8739a14d87ee42dea8ca90ed 100644 (file)
@@ -1,17 +1,17 @@
 <?php
 
-
 namespace Shaarli\Api\Controllers;
 
-
 use Shaarli\Api\Exceptions\ApiBadParametersException;
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigManager;
+use Shaarli\History;
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
 use Slim\Http\Response;
 
-class PutTagTest extends \PHPUnit_Framework_TestCase
+class PutTagTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -34,7 +34,7 @@ class PutTagTest extends \PHPUnit_Framework_TestCase
     protected $refDB = null;
 
     /**
-     * @var \History instance.
+     * @var HistoryController instance.
      */
     protected $history;
 
@@ -44,7 +44,7 @@ class PutTagTest extends \PHPUnit_Framework_TestCase
     protected $container;
 
     /**
-     * @var \LinkDB instance.
+     * @var LinkDB instance.
      */
     protected $linkDB;
 
@@ -69,11 +69,11 @@ class PutTagTest extends \PHPUnit_Framework_TestCase
 
         $refHistory = new \ReferenceHistory();
         $refHistory->write(self::$testHistory);
-        $this->history = new \History(self::$testHistory);
+        $this->history = new History(self::$testHistory);
 
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
-        $this->linkDB = new \LinkDB(self::$testDatastore, true, false);
+        $this->linkDB = new LinkDB(self::$testDatastore, true, false);
         $this->container['db'] = $this->linkDB;
         $this->container['history'] = $this->history;
 
@@ -114,12 +114,12 @@ class PutTagTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals(2, $tags[$newName]);
 
         $historyEntry = $this->history->getHistory()[0];
-        $this->assertEquals(\History::UPDATED, $historyEntry['event']);
+        $this->assertEquals(History::UPDATED, $historyEntry['event']);
         $this->assertTrue(
             (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
         );
         $historyEntry = $this->history->getHistory()[1];
-        $this->assertEquals(\History::UPDATED, $historyEntry['event']);
+        $this->assertEquals(History::UPDATED, $historyEntry['event']);
         $this->assertTrue(
             (new \DateTime())->add(\DateInterval::createFromDateString('-5 seconds')) < $historyEntry['datetime']
         );
similarity index 92%
rename from tests/LinkDBTest.php
rename to tests/bookmark/LinkDBTest.php
index 3b9808782fba646c9ec1440b844d46310b05cbcd..ff5c0b970af1e8283d71e68606c3337e3d4c5936 100644 (file)
@@ -3,9 +3,14 @@
  * Link datastore tests
  */
 
-require_once 'application/Cache.php';
-require_once 'application/FileUtils.php';
-require_once 'application/LinkDB.php';
+namespace Shaarli\Bookmark;
+
+use DateTime;
+use ReferenceLinkDB;
+use ReflectionClass;
+use Shaarli;
+
+require_once 'application/feed/Cache.php';
 require_once 'application/Utils.php';
 require_once 'tests/utils/ReferenceLinkDB.php';
 
@@ -13,7 +18,7 @@ require_once 'tests/utils/ReferenceLinkDB.php';
 /**
  * Unitary tests for LinkDB
  */
-class LinkDBTest extends PHPUnit_Framework_TestCase
+class LinkDBTest extends \PHPUnit\Framework\TestCase
 {
     // datastore to test write operations
     protected static $testDatastore = 'sandbox/datastore.php';
@@ -73,7 +78,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
      */
     protected static function getMethod($name)
     {
-        $class = new ReflectionClass('LinkDB');
+        $class = new ReflectionClass('Shaarli\Bookmark\LinkDB');
         $method = $class->getMethod($name);
         $method->setAccessible(true);
         return $method;
@@ -100,7 +105,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
     /**
      * Attempt to instantiate a LinkDB whereas the datastore is not writable
      *
-     * @expectedException              IOException
+     * @expectedException              Shaarli\Exceptions\IOException
      * @expectedExceptionMessageRegExp /Error accessing "null"/
      */
     public function testConstructDatastoreNotWriteable()
@@ -187,12 +192,12 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
 
         $link = array(
             'id' => 42,
-            'title'=>'an additional link',
-            'url'=>'http://dum.my',
-            'description'=>'One more',
-            'private'=>0,
-            'created'=> DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150518_190000'),
-            'tags'=>'unit test'
+            'title' => 'an additional link',
+            'url' => 'http://dum.my',
+            'description' => 'One more',
+            'private' => 0,
+            'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150518_190000'),
+            'tags' => 'unit test'
         );
         $testDB[$link['id']] = $link;
         $testDB->save('tests');
@@ -239,12 +244,12 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
     public function testDays()
     {
         $this->assertEquals(
-            array('20100310', '20121206', '20130614', '20150310'),
+            array('20100309', '20100310', '20121206', '20121207', '20130614', '20150310'),
             self::$publicLinkDB->days()
         );
 
         $this->assertEquals(
-            array('20100310', '20121206', '20130614', '20141125', '20150310'),
+            array('20100309', '20100310', '20121206', '20121207', '20130614', '20141125', '20150310'),
             self::$privateLinkDB->days()
         );
     }
@@ -362,7 +367,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
     public function testLinkRealUrlWithoutRedirector()
     {
         $db = new LinkDB(self::$testDatastore, false, false);
-        foreach($db as $link) {
+        foreach ($db as $link) {
             $this->assertEquals($link['url'], $link['real_url']);
         }
     }
@@ -374,13 +379,13 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
     {
         $redirector = 'http://redirector.to?';
         $db = new LinkDB(self::$testDatastore, false, false, $redirector);
-        foreach($db as $link) {
+        foreach ($db as $link) {
             $this->assertStringStartsWith($redirector, $link['real_url']);
             $this->assertNotFalse(strpos($link['real_url'], urlencode('://')));
         }
 
         $db = new LinkDB(self::$testDatastore, false, false, $redirector, false);
-        foreach($db as $link) {
+        foreach ($db as $link) {
             $this->assertStringStartsWith($redirector, $link['real_url']);
             $this->assertFalse(strpos($link['real_url'], urlencode('://')));
         }
@@ -451,7 +456,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
     /**
      * Test filterHash() with an invalid smallhash.
      *
-     * @expectedException LinkNotFoundException
+     * @expectedException \Shaarli\Bookmark\Exception\LinkNotFoundException
      */
     public function testFilterHashInValid1()
     {
@@ -462,7 +467,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
     /**
      * Test filterHash() with an empty smallhash.
      *
-     * @expectedException LinkNotFoundException
+     * @expectedException \Shaarli\Bookmark\Exception\LinkNotFoundException
      */
     public function testFilterHashInValid()
     {
@@ -475,13 +480,15 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
     public function testReorderLinksDesc()
     {
         self::$privateLinkDB->reorder('ASC');
-        $linkIds = array(42, 4, 9, 1, 0, 7, 6, 8, 41);
+        $stickyIds = [11, 10];
+        $standardIds = [42, 4, 9, 1, 0, 7, 6, 8, 41];
+        $linkIds = array_merge($stickyIds, $standardIds);
         $cpt = 0;
         foreach (self::$privateLinkDB as $key => $value) {
             $this->assertEquals($linkIds[$cpt++], $key);
         }
         self::$privateLinkDB->reorder('DESC');
-        $linkIds = array_reverse($linkIds);
+        $linkIds = array_merge(array_reverse($stickyIds), array_reverse($standardIds));
         $cpt = 0;
         foreach (self::$privateLinkDB as $key => $value) {
             $this->assertEquals($linkIds[$cpt++], $key);
similarity index 95%
rename from tests/LinkFilterTest.php
rename to tests/bookmark/LinkFilterTest.php
index 9cd6dbd443b2a52b492cd165d12155c06aa14f49..808f81220b84e5d75d48ae3ca62983f262473a1f 100644 (file)
@@ -1,11 +1,14 @@
 <?php
 
-require_once 'application/LinkFilter.php';
+namespace Shaarli\Bookmark;
+
+use Exception;
+use ReferenceLinkDB;
 
 /**
  * Class LinkFilterTest.
  */
-class LinkFilterTest extends PHPUnit_Framework_TestCase
+class LinkFilterTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string Test datastore path.
@@ -27,7 +30,7 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
     protected static $linkDB;
 
     /**
-     * Instanciate linkFilter with ReferenceLinkDB data.
+     * Instantiate linkFilter with ReferenceLinkDB data.
      */
     public static function setUpBeforeClass()
     {
@@ -76,7 +79,19 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
 
         $this->assertEquals(
             self::$refDB->countUntaggedLinks(),
-            count(self::$linkFilter->filter(LinkFilter::$FILTER_TAG, /*$request=*/'', /*$casesensitive=*/false, /*$visibility=*/'all', /*$untaggedonly=*/true))
+            count(
+                self::$linkFilter->filter(
+                    LinkFilter::$FILTER_TAG,
+                    /*$request=*/
+                    '',
+                    /*$casesensitive=*/
+                    false,
+                    /*$visibility=*/
+                    'all',
+                    /*$untaggedonly=*/
+                    true
+                )
+            )
         );
 
         $this->assertEquals(
@@ -219,7 +234,7 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
     /**
      * No link for this hash
      *
-     * @expectedException LinkNotFoundException
+     * @expectedException \Shaarli\Bookmark\Exception\LinkNotFoundException
      */
     public function testFilterUnknownSmallHash()
     {
@@ -246,7 +261,7 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
             2,
             count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'ars.userfriendly.org'))
         );
-        
+
         $this->assertEquals(
             2,
             count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'ars org'))
@@ -288,16 +303,16 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
             1,
             count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'publishing media'))
         );
-        
+
         $this->assertEquals(
             1,
             count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'mercurial w3c'))
         );
-        
+
         $this->assertEquals(
             3,
             count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, '"free software"'))
-        );        
+        );
     }
 
     /**
similarity index 75%
rename from tests/LinkUtilsTest.php
rename to tests/bookmark/LinkUtilsTest.php
index 7fbd59b0b80489d7b9e3521664e8aeb7d204b19d..1b8688e6d398fc1381e6b2acc586ae2562c282f2 100644 (file)
@@ -1,11 +1,15 @@
 <?php
 
-require_once 'application/LinkUtils.php';
+namespace Shaarli\Bookmark;
+
+use ReferenceLinkDB;
+
+require_once 'tests/utils/CurlUtils.php';
 
 /**
-* Class LinkUtilsTest.
-*/
-class LinkUtilsTest extends PHPUnit_Framework_TestCase
+ * Class LinkUtilsTest.
+ */
+class LinkUtilsTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Test html_extract_title() when the title is found.
@@ -13,9 +17,9 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
     public function testHtmlExtractExistentTitle()
     {
         $title = 'Read me please.';
-        $html = '<html><meta>stuff</meta><title>'. $title .'</title></html>';
+        $html = '<html><meta>stuff</meta><title>' . $title . '</title></html>';
         $this->assertEquals($title, html_extract_title($html));
-        $html = '<html><title>'. $title .'</title>blabla<title>another</title></html>';
+        $html = '<html><title>' . $title . '</title>blabla<title>another</title></html>';
         $this->assertEquals($title, html_extract_title($html));
     }
 
@@ -34,7 +38,7 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
     public function testHeadersExtractExistentCharset()
     {
         $charset = 'x-MacCroatian';
-        $headers = 'text/html; charset='. $charset;
+        $headers = 'text/html; charset=' . $charset;
         $this->assertEquals(strtolower($charset), header_extract_charset($headers));
     }
 
@@ -56,7 +60,7 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
     public function testHtmlExtractExistentCharset()
     {
         $charset = 'x-MacCroatian';
-        $html = '<html><meta>stuff2</meta><meta charset="'. $charset .'"/></html>';
+        $html = '<html><meta>stuff2</meta><meta charset="' . $charset . '"/></html>';
         $this->assertEquals(strtolower($charset), html_extract_charset($html));
     }
 
@@ -83,7 +87,9 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
             'Date: Sat, 28 Oct 2017 12:01:33 GMT',
             'Content-Type: text/html; charset=utf-8',
             'Status: 200 OK',
-            'end' => 'th=device-width"><title>Refactoring · GitHub</title><link rel="search" type="application/opensea',
+            'end' => 'th=device-width">'
+                . '<title>Refactoring · GitHub</title>'
+                . '<link rel="search" type="application/opensea',
             '<title>ignored</title>',
         ];
         foreach ($data as $key => $line) {
@@ -106,7 +112,9 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
         $callback = get_curl_download_callback($charset, $title, 'ut_curl_getinfo_no_charset');
         $data = [
             'HTTP/1.1 200 OK',
-            'end' => 'th=device-width"><title>Refactoring · GitHub</title><link rel="search" type="application/opensea',
+            'end' => 'th=device-width">'
+                . '<title>Refactoring · GitHub</title>'
+                . '<link rel="search" type="application/opensea',
             '<title>ignored</title>',
         ];
         foreach ($data as $key => $line) {
@@ -126,7 +134,9 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
         $data = [
             'HTTP/1.1 200 OK',
             '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />',
-            'end' => 'th=device-width"><title>Refactoring · GitHub</title><link rel="search" type="application/opensea',
+            'end' => 'th=device-width">'
+                . '<title>Refactoring · GitHub</title>'
+                . '<link rel="search" type="application/opensea',
             '<title>ignored</title>',
         ];
         foreach ($data as $key => $line) {
@@ -211,29 +221,32 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
     public function testText2clickableWithoutRedirector()
     {
         $text = 'stuff http://hello.there/is=someone#here otherstuff';
-        $expectedText = 'stuff <a href="http://hello.there/is=someone#here">http://hello.there/is=someone#here</a> otherstuff';
+        $expectedText = 'stuff <a href="http://hello.there/is=someone#here">'
+            . 'http://hello.there/is=someone#here</a> otherstuff';
         $processedText = text2clickable($text, '');
         $this->assertEquals($expectedText, $processedText);
 
         $text = 'stuff http://hello.there/is=someone#here(please) otherstuff';
-        $expectedText = 'stuff <a href="http://hello.there/is=someone#here(please)">http://hello.there/is=someone#here(please)</a> otherstuff';
+        $expectedText = 'stuff <a href="http://hello.there/is=someone#here(please)">'
+            . 'http://hello.there/is=someone#here(please)</a> otherstuff';
         $processedText = text2clickable($text, '');
         $this->assertEquals($expectedText, $processedText);
 
         $text = 'stuff http://hello.there/is=someone#here(please)&no otherstuff';
-        $expectedText = 'stuff <a href="http://hello.there/is=someone#here(please)&no">http://hello.there/is=someone#here(please)&no</a> otherstuff';
+        $expectedText = 'stuff <a href="http://hello.there/is=someone#here(please)&no">'
+            . 'http://hello.there/is=someone#here(please)&no</a> otherstuff';
         $processedText = text2clickable($text, '');
         $this->assertEquals($expectedText, $processedText);
     }
 
     /**
-     * Test text2clickable a redirector set.
+     * Test text2clickable with a redirector set.
      */
     public function testText2clickableWithRedirector()
     {
         $text = 'stuff http://hello.there/is=someone#here otherstuff';
         $redirector = 'http://redirector.to';
-        $expectedText = 'stuff <a href="'.
+        $expectedText = 'stuff <a href="' .
             $redirector .
             urlencode('http://hello.there/is=someone#here') .
             '">http://hello.there/is=someone#here</a> otherstuff';
@@ -248,7 +261,7 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
     {
         $text = 'stuff http://hello.there/?is=someone&or=something#here otherstuff';
         $redirector = 'http://redirector.to';
-        $expectedText = 'stuff <a href="'.
+        $expectedText = 'stuff <a href="' .
             $redirector .
             'http://hello.there/?is=someone&or=something#here' .
             '">http://hello.there/?is=someone&or=something#here</a> otherstuff';
@@ -261,8 +274,8 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
      */
     public function testSpace2nbsp()
     {
-        $text = '  Are you   thrilled  by flags   ?'. PHP_EOL .' Really?';
-        $expectedText = '&nbsp; Are you &nbsp; thrilled &nbsp;by flags &nbsp; ?'. PHP_EOL .'&nbsp;Really?';
+        $text = '  Are you   thrilled  by flags   ?' . PHP_EOL . ' Really?';
+        $expectedText = '&nbsp; Are you &nbsp; thrilled &nbsp;by flags &nbsp; ?' . PHP_EOL . '&nbsp;Really?';
         $processedText = space2nbsp($text);
         $this->assertEquals($expectedText, $processedText);
     }
@@ -308,106 +321,13 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
      * Util function to build an hashtag link.
      *
      * @param string $hashtag Hashtag name.
-     * @param string $index   Index URL.
+     * @param string $index Index URL.
      *
      * @return string HTML hashtag link.
      */
     private function getHashtagLink($hashtag, $index = '')
     {
-        $hashtagLink = '<a href="'. $index .'?addtag=$1" title="Hashtag $1">#$1</a>';
+        $hashtagLink = '<a href="' . $index . '?addtag=$1" title="Hashtag $1">#$1</a>';
         return str_replace('$1', $hashtag, $hashtagLink);
     }
 }
-
-// old style mock: PHPUnit doesn't allow function mock
-
-/**
- * Returns code 200 or html content type.
- *
- * @param resource $ch   cURL resource
- * @param int      $type cURL info type
- *
- * @return int|string 200 or 'text/html'
- */
-function ut_curl_getinfo_ok($ch, $type)
-{
-    switch ($type) {
-        case CURLINFO_RESPONSE_CODE:
-            return 200;
-        case CURLINFO_CONTENT_TYPE:
-            return 'text/html; charset=utf-8';
-    }
-}
-
-/**
- * Returns code 200 or html content type without charset.
- *
- * @param resource $ch   cURL resource
- * @param int      $type cURL info type
- *
- * @return int|string 200 or 'text/html'
- */
-function ut_curl_getinfo_no_charset($ch, $type)
-{
-    switch ($type) {
-        case CURLINFO_RESPONSE_CODE:
-            return 200;
-        case CURLINFO_CONTENT_TYPE:
-            return 'text/html';
-    }
-}
-
-/**
- * Invalid response code.
- *
- * @param resource $ch   cURL resource
- * @param int      $type cURL info type
- *
- * @return int|string 404 or 'text/html'
- */
-function ut_curl_getinfo_rc_ko($ch, $type)
-{
-    switch ($type) {
-        case CURLINFO_RESPONSE_CODE:
-            return 404;
-        case CURLINFO_CONTENT_TYPE:
-            return 'text/html; charset=utf-8';
-    }
-}
-
-/**
- * Invalid content type.
- *
- * @param resource $ch   cURL resource
- * @param int      $type cURL info type
- *
- * @return int|string 200 or 'text/plain'
- */
-function ut_curl_getinfo_ct_ko($ch, $type)
-{
-    switch ($type) {
-        case CURLINFO_RESPONSE_CODE:
-            return 200;
-        case CURLINFO_CONTENT_TYPE:
-            return 'text/plain';
-    }
-}
-
-/**
- * Invalid response code and content type.
- *
- * @param resource $ch   cURL resource
- * @param int      $type cURL info type
- *
- * @return int|string 404 or 'text/plain'
- */
-function ut_curl_getinfo_rs_ct_ko($ch, $type)
-{
-    switch ($type) {
-        case CURLINFO_RESPONSE_CODE:
-            return 404;
-        case CURLINFO_CONTENT_TYPE:
-            return 'text/plain';
-    }
-}
-
index d237bc80cdacd1a7919399f68cad57ece869a470..95ad060b0537fed84ca2bd2cc43a6f92098ee1b4 100644 (file)
@@ -4,7 +4,7 @@ namespace Shaarli\Config;
 /**
  * Class ConfigJsonTest
  */
-class ConfigJsonTest extends \PHPUnit_Framework_TestCase
+class ConfigJsonTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var ConfigJson
@@ -111,7 +111,7 @@ class ConfigJsonTest extends \PHPUnit_Framework_TestCase
     /**
      * Write to invalid path.
      *
-     * @expectedException \IOException
+     * @expectedException \Shaarli\Exceptions\IOException
      */
     public function testWriteInvalidArray()
     {
@@ -122,7 +122,7 @@ class ConfigJsonTest extends \PHPUnit_Framework_TestCase
     /**
      * Write to invalid path.
      *
-     * @expectedException \IOException
+     * @expectedException \Shaarli\Exceptions\IOException
      */
     public function testWriteInvalidBlank()
     {
index 1ec447b23aeab9bfbe31b847e9731cfa780db617..33830bc94bcc3584380b1a18259e4cf9ec101980 100644 (file)
@@ -7,7 +7,7 @@ namespace Shaarli\Config;
  * Note: it only test the manager with ConfigJson,
  *  ConfigPhp is only a workaround to handle the transition to JSON type.
  */
-class ConfigManagerTest extends \PHPUnit_Framework_TestCase
+class ConfigManagerTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var ConfigManager
@@ -81,6 +81,18 @@ class ConfigManagerTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals('testSetWriteGetNested', $this->conf->get('foo.bar.key.stuff'));
     }
 
+    public function testSetDeleteNested()
+    {
+        $this->conf->set('foo.bar.key.stuff', 'testSetDeleteNested');
+        $this->assertTrue($this->conf->exists('foo.bar'));
+        $this->assertTrue($this->conf->exists('foo.bar.key.stuff'));
+        $this->assertEquals('testSetDeleteNested', $this->conf->get('foo.bar.key.stuff'));
+
+        $this->conf->remove('foo.bar');
+        $this->assertFalse($this->conf->exists('foo.bar.key.stuff'));
+        $this->assertFalse($this->conf->exists('foo.bar'));
+    }
+
     /**
      * Set with an empty key.
      *
@@ -103,6 +115,17 @@ class ConfigManagerTest extends \PHPUnit_Framework_TestCase
         $this->conf->set(array('foo' => 'bar'), 'stuff');
     }
 
+    /**
+     * Remove with an empty key.
+     *
+     * @expectedException \Exception
+     * @expectedExceptionMessageRegExp #^Invalid setting key parameter. String expected, got.*#
+     */
+    public function testRmoveEmptyKey()
+    {
+        $this->conf->remove('');
+    }
+
     /**
      * Try to write the config without mandatory parameter (e.g. 'login').
      *
index be23eea1563a909ecce1a981d1194040d8d9fe3a..67d878cee31cc88a61cf0cad4b92eb8d08e2b044 100644 (file)
@@ -4,7 +4,7 @@ namespace Shaarli\Config;
 /**
  * Class ConfigPhpTest
  */
-class ConfigPhpTest extends \PHPUnit_Framework_TestCase
+class ConfigPhpTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var ConfigPhp
index deb02c9e487f901519b07b66f545599aaed75692..d7a70e6886b54a889eed845560350eae05cefabe 100644 (file)
@@ -8,7 +8,7 @@ require_once 'application/config/ConfigPlugin.php';
 /**
  * Unitary tests for Shaarli config related functions
  */
-class ConfigPluginTest extends \PHPUnit_Framework_TestCase
+class ConfigPluginTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Test save_plugin_config with valid data.
similarity index 67%
rename from tests/CacheTest.php
rename to tests/feed/CacheTest.php
index 992e26a5502cea6afc15cc9756f85c7e507089d0..c0a9f26f2dc933d7adf8644a8b580d797efe01de 100644 (file)
@@ -2,16 +2,17 @@
 /**
  * Cache tests
  */
+namespace Shaarli\Feed;
 
 // required to access $_SESSION array
 session_start();
 
-require_once 'application/Cache.php';
+require_once 'application/feed/Cache.php';
 
 /**
  * Unitary tests for cached pages
  */
-class CacheTest extends PHPUnit_Framework_TestCase
+class CacheTest extends \PHPUnit\Framework\TestCase
 {
     // test cache directory
     protected static $testCacheDir = 'sandbox/dummycache';
@@ -25,16 +26,16 @@ class CacheTest extends PHPUnit_Framework_TestCase
      */
     public function setUp()
     {
-        if (! is_dir(self::$testCacheDir)) {
+        if (!is_dir(self::$testCacheDir)) {
             mkdir(self::$testCacheDir);
         } else {
-            array_map('unlink', glob(self::$testCacheDir.'/*'));
+            array_map('unlink', glob(self::$testCacheDir . '/*'));
         }
 
         foreach (self::$pages as $page) {
-            file_put_contents(self::$testCacheDir.'/'.$page.'.cache', $page);
+            file_put_contents(self::$testCacheDir . '/' . $page . '.cache', $page);
         }
-        file_put_contents(self::$testCacheDir.'/intru.der', 'ShouldNotBeThere');
+        file_put_contents(self::$testCacheDir . '/intru.der', 'ShouldNotBeThere');
     }
 
     /**
@@ -42,7 +43,7 @@ class CacheTest extends PHPUnit_Framework_TestCase
      */
     public function tearDown()
     {
-        array_map('unlink', glob(self::$testCacheDir.'/*'));
+        array_map('unlink', glob(self::$testCacheDir . '/*'));
         rmdir(self::$testCacheDir);
     }
 
@@ -53,10 +54,10 @@ class CacheTest extends PHPUnit_Framework_TestCase
     {
         purgeCachedPages(self::$testCacheDir);
         foreach (self::$pages as $page) {
-            $this->assertFileNotExists(self::$testCacheDir.'/'.$page.'.cache');
+            $this->assertFileNotExists(self::$testCacheDir . '/' . $page . '.cache');
         }
 
-        $this->assertFileExists(self::$testCacheDir.'/intru.der');
+        $this->assertFileExists(self::$testCacheDir . '/intru.der');
     }
 
     /**
@@ -68,7 +69,7 @@ class CacheTest extends PHPUnit_Framework_TestCase
         ini_set('error_log', '/dev/null');
         $this->assertEquals(
             'Cannot purge sandbox/dummycache_missing: no directory',
-            purgeCachedPages(self::$testCacheDir.'_missing')
+            purgeCachedPages(self::$testCacheDir . '_missing')
         );
         ini_set('error_log', $oldlog);
     }
@@ -83,8 +84,8 @@ class CacheTest extends PHPUnit_Framework_TestCase
 
         invalidateCaches(self::$testCacheDir);
         foreach (self::$pages as $page) {
-            $this->assertFileNotExists(self::$testCacheDir.'/'.$page.'.cache');
-        }        
+            $this->assertFileNotExists(self::$testCacheDir . '/' . $page . '.cache');
+        }
 
         $this->assertArrayNotHasKey('tags', $_SESSION);
     }
similarity index 92%
rename from tests/CachedPageTest.php
rename to tests/feed/CachedPageTest.php
index 51565cd63f591c5e69ff41a1eb29d1e616b52cba..0bcc1442c7133bbf41bba1348213a9143352d328 100644 (file)
@@ -2,13 +2,12 @@
 /**
  * PageCache tests
  */
-
-require_once 'application/CachedPage.php';
+namespace Shaarli\Feed;
 
 /**
  * Unitary tests for cached pages
  */
-class CachedPageTest extends PHPUnit_Framework_TestCase
+class CachedPageTest extends \PHPUnit\Framework\TestCase
 {
     // test cache directory
     protected static $testCacheDir = 'sandbox/pagecache';
@@ -20,10 +19,10 @@ class CachedPageTest extends PHPUnit_Framework_TestCase
      */
     public static function setUpBeforeClass()
     {
-        if (! is_dir(self::$testCacheDir)) {
+        if (!is_dir(self::$testCacheDir)) {
             mkdir(self::$testCacheDir);
         }
-        self::$filename = self::$testCacheDir.'/'.sha1(self::$url).'.cache';
+        self::$filename = self::$testCacheDir . '/' . sha1(self::$url) . '.cache';
     }
 
     /**
similarity index 92%
rename from tests/FeedBuilderTest.php
rename to tests/feed/FeedBuilderTest.php
index a590306db54524e8fc4a98a6d5a2d8e023c3d4ee..b496cb4c3499612fa2ec37c2df44a679eead3da1 100644 (file)
@@ -1,14 +1,17 @@
 <?php
 
-require_once 'application/FeedBuilder.php';
-require_once 'application/LinkDB.php';
+namespace Shaarli\Feed;
+
+use DateTime;
+use ReferenceLinkDB;
+use Shaarli\Bookmark\LinkDB;
 
 /**
  * FeedBuilderTest class.
  *
  * Unit tests for FeedBuilder.
  */
-class FeedBuilderTest extends PHPUnit_Framework_TestCase
+class FeedBuilderTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string locale Basque (Spain).
@@ -82,15 +85,15 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase
         $this->assertFalse($data['usepermalinks']);
         $this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links']));
 
-        // Test first link (note link)
-        $link = reset($data['links']);
+        // Test first not pinned link (note link)
+        $link = $data['links'][array_keys($data['links'])[2]];
         $this->assertEquals(41, $link['id']);
         $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']);
         $this->assertEquals('http://host.tld/?WDWyig', $link['guid']);
         $this->assertEquals('http://host.tld/?WDWyig', $link['url']);
         $this->assertRegExp('/Tue, 10 Mar 2015 11:46:51 \+\d{4}/', $link['pub_iso_date']);
         $pub = DateTime::createFromFormat(DateTime::RSS, $link['pub_iso_date']);
-        $up  = DateTime::createFromFormat(DateTime::ATOM, $link['up_iso_date']);
+        $up = DateTime::createFromFormat(DateTime::ATOM, $link['up_iso_date']);
         $this->assertEquals($pub, $up);
         $this->assertContains('Stallman has a beard', $link['description']);
         $this->assertContains('Permalink', $link['description']);
@@ -119,7 +122,7 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase
         $data = $feedBuilder->buildData();
         $this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links']));
         $this->assertRegExp('/2016-08-03T09:30:33\+\d{2}:\d{2}/', $data['last_update']);
-        $link = reset($data['links']);
+        $link = $data['links'][array_keys($data['links'])[2]];
         $this->assertRegExp('/2015-03-10T11:46:51\+\d{2}:\d{2}/', $link['pub_iso_date']);
         $this->assertRegExp('/2016-08-03T09:30:33\+\d{2}:\d{2}/', $data['links'][8]['up_iso_date']);
     }
@@ -148,13 +151,13 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase
     public function testBuildDataCount()
     {
         $criteria = array(
-            'nb' => '1',
+            'nb' => '3',
         );
         $feedBuilder = new FeedBuilder(self::$linkDB, FeedBuilder::$FEED_ATOM, self::$serverInfo, $criteria, false);
         $feedBuilder->setLocale(self::$LOCALE);
         $data = $feedBuilder->buildData();
-        $this->assertEquals(1, count($data['links']));
-        $link = array_shift($data['links']);
+        $this->assertEquals(3, count($data['links']));
+        $link = $data['links'][array_keys($data['links'])[2]];
         $this->assertEquals(41, $link['id']);
         $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']);
     }
@@ -171,7 +174,7 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase
         $this->assertEquals(ReferenceLinkDB::$NB_LINKS_TOTAL, count($data['links']));
         $this->assertTrue($data['usepermalinks']);
         // First link is a permalink
-        $link = array_shift($data['links']);
+        $link = $data['links'][array_keys($data['links'])[2]];
         $this->assertEquals(41, $link['id']);
         $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114651'), $link['created']);
         $this->assertEquals('http://host.tld/?WDWyig', $link['guid']);
@@ -179,7 +182,7 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase
         $this->assertContains('Direct link', $link['description']);
         $this->assertContains('http://host.tld/?WDWyig', $link['description']);
         // Second link is a direct link
-        $link = array_shift($data['links']);
+        $link = $data['links'][array_keys($data['links'])[3]];
         $this->assertEquals(8, $link['id']);
         $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20150310_114633'), $link['created']);
         $this->assertEquals('http://host.tld/?RttfEw', $link['guid']);
@@ -237,7 +240,7 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase
         );
 
         // Test first link (note link)
-        $link = array_shift($data['links']);
+        $link = $data['links'][array_keys($data['links'])[2]];
         $this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['guid']);
         $this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['url']);
         $this->assertContains('http://host.tld:8080/~user/shaarli/?addtag=hashtag', $link['description']);
similarity index 89%
rename from tests/HttpUtils/ClientIpIdTest.php
rename to tests/http/HttpUtils/ClientIpIdTest.php
index c15ac5cc0a4814733cd7bfdd79eccaccec29e0c4..982e57e0b6ff37ae8b42b1a5a11707ddf0bb08b9 100644 (file)
@@ -3,12 +3,14 @@
  * HttpUtils' tests
  */
 
-require_once 'application/HttpUtils.php';
+namespace Shaarli\Http;
+
+require_once 'application/http/HttpUtils.php';
 
 /**
  * Unitary tests for client_ip_id()
  */
-class ClientIpIdTest extends PHPUnit_Framework_TestCase
+class ClientIpIdTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Get a remote client ID based on its IP
similarity index 85%
rename from tests/HttpUtils/GetHttpUrlTest.php
rename to tests/http/HttpUtils/GetHttpUrlTest.php
index ea53de5f27feabec829489c442c728bf5b661cf4..3dc5bc9b03c38c9b0cad7763b2578b6e0ed017c5 100644 (file)
@@ -3,12 +3,14 @@
  * HttpUtils' tests
  */
 
-require_once 'application/HttpUtils.php';
+namespace Shaarli\Http;
+
+require_once 'application/http/HttpUtils.php';
 
 /**
  * Unitary tests for get_http_response()
  */
-class GetHttpUrlTest extends PHPUnit_Framework_TestCase
+class GetHttpUrlTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Get an invalid local URL
@@ -17,12 +19,12 @@ class GetHttpUrlTest extends PHPUnit_Framework_TestCase
     {
         // Local
         list($headers, $content) = get_http_response('/non/existent', 1);
-        $this->assertEquals('Invalid HTTP Url', $headers[0]);
+        $this->assertEquals('Invalid HTTP UrlUtils', $headers[0]);
         $this->assertFalse($content);
 
         // Non HTTP
         list($headers, $content) = get_http_response('ftp://save.tld/mysave', 1);
-        $this->assertEquals('Invalid HTTP Url', $headers[0]);
+        $this->assertEquals('Invalid HTTP UrlUtils', $headers[0]);
         $this->assertFalse($content);
     }
 
similarity index 91%
rename from tests/HttpUtils/GetIpAdressFromProxyTest.php
rename to tests/http/HttpUtils/GetIpAdressFromProxyTest.php
index 6a74a45aff696f66623d64b3072c0c0af62a2272..fe3a639e296ed3fe6512c7186f43f9d49fb7694c 100644 (file)
@@ -1,11 +1,14 @@
 <?php
 
-require_once 'application/HttpUtils.php';
+namespace Shaarli\Http;
+
+require_once 'application/http/HttpUtils.php';
 
 /**
  * Unitary tests for getIpAddressFromProxy()
  */
-class GetIpAdressFromProxyTest extends PHPUnit_Framework_TestCase {
+class GetIpAdressFromProxyTest extends \PHPUnit\Framework\TestCase
+{
 
     /**
      * Test without proxy
similarity index 92%
rename from tests/HttpUtils/IndexUrlTest.php
rename to tests/http/HttpUtils/IndexUrlTest.php
index 337dcab0b070fa9b6439eb11d9009815c6ee2450..bcbe59cbf6abe493a392f429fb96f1c54cb2d46c 100644 (file)
@@ -3,12 +3,14 @@
  * HttpUtils' tests
  */
 
-require_once 'application/HttpUtils.php';
+namespace Shaarli\Http;
+
+require_once 'application/http/HttpUtils.php';
 
 /**
  * Unitary tests for index_url()
  */
-class IndexUrlTest extends PHPUnit_Framework_TestCase
+class IndexUrlTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * If on the main page, remove "index.php" from the URL resource
similarity index 89%
rename from tests/HttpUtils/IsHttpsTest.php
rename to tests/http/HttpUtils/IsHttpsTest.php
index 097f2bcf0c56b5e2364548ffc360402ea3e05f38..348956c645e6c40891ab42655237e75d7b810403 100644 (file)
@@ -1,12 +1,15 @@
 <?php
 
+namespace Shaarli\Http;
+
+require_once 'application/http/HttpUtils.php';
 
 /**
  * Class IsHttpsTest
  *
  * Test class for is_https() function.
  */
-class IsHttpsTest extends PHPUnit_Framework_TestCase
+class IsHttpsTest extends \PHPUnit\Framework\TestCase
 {
 
     /**
similarity index 93%
rename from tests/HttpUtils/PageUrlTest.php
rename to tests/http/HttpUtils/PageUrlTest.php
index 4dbbe9cf40bb57d40fe0f862c80367b116acb780..f199171684bad9694e6d3545b13b2a55c14d14ef 100644 (file)
@@ -3,12 +3,14 @@
  * HttpUtils' tests
  */
 
-require_once 'application/HttpUtils.php';
+namespace Shaarli\Http;
+
+require_once 'application/http/HttpUtils.php';
 
 /**
  * Unitary tests for page_url()
  */
-class PageUrlTest extends PHPUnit_Framework_TestCase
+class PageUrlTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * If on the main page, remove "index.php" from the URL resource
similarity index 97%
rename from tests/HttpUtils/ServerUrlTest.php
rename to tests/http/HttpUtils/ServerUrlTest.php
index 324b827acc11e9612c933fa89893dfd318f523a3..9caf104983ffd75427cb6a9a9c35cb1a29f042d0 100644 (file)
@@ -3,12 +3,14 @@
  * HttpUtils' tests
  */
 
-require_once 'application/HttpUtils.php';
+namespace Shaarli\Http;
+
+require_once 'application/http/HttpUtils.php';
 
 /**
  * Unitary tests for server_url()
  */
-class ServerUrlTest extends PHPUnit_Framework_TestCase
+class ServerUrlTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Detect if the server uses SSL
similarity index 85%
rename from tests/Url/UrlTest.php
rename to tests/http/UrlTest.php
index aa2f2234529b4878cdb3e926918a13d004f7d9bc..ae92f73a4d4a2a62a851b9d99d5b523bc9b303e7 100644 (file)
@@ -1,14 +1,14 @@
 <?php
 /**
- * Url's tests
+ * UrlUtils's tests
  */
 
-require_once 'application/Url.php';
+namespace Shaarli\Http;
 
 /**
  * Unitary tests for URL utilities
  */
-class UrlTest extends PHPUnit_Framework_TestCase
+class UrlTest extends \PHPUnit\Framework\TestCase
 {
     // base URL for tests
     protected static $baseUrl = 'http://domain.tld:3000';
@@ -16,9 +16,9 @@ class UrlTest extends PHPUnit_Framework_TestCase
     /**
      * Helper method
      */
-    private function assertUrlIsCleaned($query='', $fragment='')
+    private function assertUrlIsCleaned($query = '', $fragment = '')
     {
-        $url = new Url(self::$baseUrl.$query.$fragment);
+        $url = new Url(self::$baseUrl . $query . $fragment);
         $url->cleanup();
         $this->assertEquals(self::$baseUrl, $url->toString());
     }
@@ -38,7 +38,7 @@ class UrlTest extends PHPUnit_Framework_TestCase
     public function testConstruct()
     {
         $ref = 'http://username:password@hostname:9090/path'
-              .'?arg1=value1&arg2=value2#anchor';
+            '?arg1=value1&arg2=value2#anchor';
         $url = new Url($ref);
         $this->assertEquals($ref, $url->toString());
     }
@@ -52,7 +52,7 @@ class UrlTest extends PHPUnit_Framework_TestCase
         $this->assertUrlIsCleaned();
 
         // URL with no annoying elements
-        $ref = self::$baseUrl.'?p1=val1&p2=1234#edit';
+        $ref = self::$baseUrl . '?p1=val1&p2=1234#edit';
         $url = new Url($ref);
         $this->assertEquals($ref, $url->cleanup());
     }
@@ -115,33 +115,33 @@ class UrlTest extends PHPUnit_Framework_TestCase
         // ditch annoying query params and fragment, keep useful params
         $url = new Url(
             self::$baseUrl
-            .'?fb=zomg&my=stuff&utm_medium=numnum&is=kept#tk.rss_all'
+            . '?fb=zomg&my=stuff&utm_medium=numnum&is=kept#tk.rss_all'
         );
-        $this->assertEquals(self::$baseUrl.'?my=stuff&is=kept', $url->cleanup());
+        $this->assertEquals(self::$baseUrl . '?my=stuff&is=kept', $url->cleanup());
 
 
         // ditch annoying query params, keep useful params and fragment
         $url = new Url(
             self::$baseUrl
-            .'?fb=zomg&my=stuff&utm_medium=numnum&is=kept#again'
+            . '?fb=zomg&my=stuff&utm_medium=numnum&is=kept#again'
         );
         $this->assertEquals(
-            self::$baseUrl.'?my=stuff&is=kept#again',
+            self::$baseUrl . '?my=stuff&is=kept#again',
             $url->cleanup()
         );
 
         // test firefox reader url
         $url = new Url(
-            'about://reader?url=' . urlencode(self::$baseUrl .'?my=stuff&is=kept')
+            'about://reader?url=' . urlencode(self::$baseUrl . '?my=stuff&is=kept')
         );
-        $this->assertEquals(self::$baseUrl.'?my=stuff&is=kept', $url->cleanup());
-
+        $this->assertEquals(self::$baseUrl . '?my=stuff&is=kept', $url->cleanup());
     }
 
     /**
      * Test default http scheme.
      */
-    public function testDefaultScheme() {
+    public function testDefaultScheme()
+    {
         $url = new Url(self::$baseUrl);
         $this->assertEquals('http', $url->getScheme());
         $url = new Url('domain.tld');
similarity index 96%
rename from tests/Url/CleanupUrlTest.php
rename to tests/http/UrlUtils/CleanupUrlTest.php
index 1407d7d2581689bddaba990c5435ec9506781db3..6c4d124bed845f4d5205dda31df2f61b0a0d99d0 100644 (file)
@@ -3,9 +3,11 @@
  * Unitary tests for cleanup_url()
  */
 
-require_once 'application/Url.php';
+namespace Shaarli\Http;
 
-class CleanupUrlTest extends PHPUnit_Framework_TestCase
+require_once 'application/http/UrlUtils.php';
+
+class CleanupUrlTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string reference URL
@@ -107,4 +109,3 @@ class CleanupUrlTest extends PHPUnit_Framework_TestCase
         );
     }
 }
-
similarity index 76%
rename from tests/Url/GetUrlSchemeTest.php
rename to tests/http/UrlUtils/GetUrlSchemeTest.php
index 72d80b30825ee452a1028e4b962ee0c477229160..2b97f7be649a4c120fb31c24f13ab19f70b7c3a1 100644 (file)
@@ -3,12 +3,14 @@
  * Unitary tests for get_url_scheme()
  */
 
-require_once 'application/Url.php';
+namespace Shaarli\Http;
 
-class GetUrlSchemeTest extends PHPUnit_Framework_TestCase
+require_once 'application/http/UrlUtils.php';
+
+class GetUrlSchemeTest extends \PHPUnit\Framework\TestCase
 {
     /**
-     * Get empty scheme string for empty Url
+     * Get empty scheme string for empty UrlUtils
      */
     public function testGetUrlSchemeEmpty()
     {
@@ -16,7 +18,7 @@ class GetUrlSchemeTest extends PHPUnit_Framework_TestCase
     }
 
     /**
-     * Get normal scheme of Url
+     * Get normal scheme of UrlUtils
      */
     public function testGetUrlScheme()
     {
@@ -28,4 +30,3 @@ class GetUrlSchemeTest extends PHPUnit_Framework_TestCase
         $this->assertEquals('git', get_url_scheme('git://domain.tld/push?pull=clone#checkout'));
     }
 }
-
similarity index 76%
rename from tests/Url/UnparseUrlTest.php
rename to tests/http/UrlUtils/UnparseUrlTest.php
index edde73e408580fe0f7e40884645b2bdf302d9b15..040d8c54ed5a1fca14490ec36ebdb2994005252f 100644 (file)
@@ -1,14 +1,16 @@
 <?php
 /**
- * Unpares Url's tests
+ * Unpares UrlUtils's tests
  */
 
-require_once 'application/Url.php';
+namespace Shaarli\Http;
+
+require_once 'application/http/UrlUtils.php';
 
 /**
  * Unitary tests for unparse_url()
  */
-class UnparseUrlTest extends PHPUnit_Framework_TestCase
+class UnparseUrlTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Thanks for building nothing
@@ -28,4 +30,3 @@ class UnparseUrlTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($ref, unparse_url(parse_url($ref)));
     }
 }
-
similarity index 91%
rename from tests/Url/WhitelistProtocolsTest.php
rename to tests/http/UrlUtils/WhitelistProtocolsTest.php
index a315680483259e4e340a6323f4c12069d00075c5..69512dbd18787a2129b83c97662cf31fbba91f9a 100644 (file)
@@ -1,15 +1,15 @@
 <?php
 
-require_once 'application/Url.php';
+namespace Shaarli\Http;
 
-use Shaarli\Config\ConfigManager;
+require_once 'application/http/UrlUtils.php';
 
 /**
  * Class WhitelistProtocolsTest
  *
- * Test whitelist_protocols() function of Url.
+ * Test whitelist_protocols() function of UrlUtils.
  */
-class WhitelistProtocolsTest extends PHPUnit_Framework_TestCase
+class WhitelistProtocolsTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Test whitelist_protocols() on a note (relative URL).
index 4569c923b3171609d8a755cd32aa4cdf06c755a2..588c9fd6e4749e59517bbbedd248c04698331616 100644 (file)
@@ -20,7 +20,7 @@ class UtilsDeTest extends UtilsTest
     public function testDateFormatNoTime()
     {
         $date = DateTime::createFromFormat('Ymd_His', '20170101_101112');
-        $this->assertRegExp('/1\. Januar 2017/', format_date($date, false,true));
+        $this->assertRegExp('/1\. Januar 2017/', format_date($date, false, true));
     }
 
     /**
index 0cf74891b7ab937403c2b6f6184975edeb5a2671..b8b7ca3a548358e98946e5d8833b748a40ecf27c 100644 (file)
@@ -3,7 +3,6 @@
 
 namespace Shaarli;
 
-
 use Shaarli\Config\ConfigManager;
 
 /**
@@ -13,7 +12,7 @@ use Shaarli\Config\ConfigManager;
  *
  * @package Shaarli
  */
-class LanguagesFrTest extends \PHPUnit_Framework_TestCase
+class LanguagesFrTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string Config file path (without extension).
similarity index 91%
rename from tests/NetscapeBookmarkUtils/BookmarkExportTest.php
rename to tests/netscape/BookmarkExportTest.php
index 6a47bbb97acac26996766c7cf9c30f8738fc069c..6de9876d419701cd76bcf7078b3c57a718e13510 100644 (file)
@@ -1,11 +1,14 @@
 <?php
+namespace Shaarli\Netscape;
 
-require_once 'application/NetscapeBookmarkUtils.php';
+use Shaarli\Bookmark\LinkDB;
+
+require_once 'tests/utils/ReferenceLinkDB.php';
 
 /**
  * Netscape bookmark export
  */
-class BookmarkExportTest extends PHPUnit_Framework_TestCase
+class BookmarkExportTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -13,7 +16,7 @@ class BookmarkExportTest extends PHPUnit_Framework_TestCase
     protected static $testDatastore = 'sandbox/datastore.php';
 
     /**
-     * @var ReferenceLinkDB instance.
+     * @var \ReferenceLinkDB instance.
      */
     protected static $refDb = null;
 
@@ -27,7 +30,7 @@ class BookmarkExportTest extends PHPUnit_Framework_TestCase
      */
     public static function setUpBeforeClass()
     {
-        self::$refDb = new ReferenceLinkDB();
+        self::$refDb = new \ReferenceLinkDB();
         self::$refDb->write(self::$testDatastore);
         self::$linkDb = new LinkDB(self::$testDatastore, true, false);
     }
@@ -110,7 +113,7 @@ class BookmarkExportTest extends PHPUnit_Framework_TestCase
         $links = NetscapeBookmarkUtils::filterAndFormat(self::$linkDb, 'public', false, '');
         $this->assertEquals(
             '?WDWyig',
-            $links[0]['url']
+            $links[2]['url']
         );
     }
 
@@ -128,7 +131,7 @@ class BookmarkExportTest extends PHPUnit_Framework_TestCase
         );
         $this->assertEquals(
             $indexUrl . '?WDWyig',
-            $links[0]['url']
+            $links[2]['url']
         );
     }
 }
similarity index 99%
rename from tests/NetscapeBookmarkUtils/BookmarkImportTest.php
rename to tests/netscape/BookmarkImportTest.php
index f0a958cb2e71fed3cd747ef10f906b38b82efc1b..ccafc1619cf48d988fef4e4a62d44f5f81789a88 100644 (file)
@@ -1,8 +1,10 @@
 <?php
+namespace Shaarli\Netscape;
 
-require_once 'application/NetscapeBookmarkUtils.php';
-
+use DateTime;
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigManager;
+use Shaarli\History;
 
 /**
  * Utility function to load a file's metadata in a $_FILES-like array
@@ -26,7 +28,7 @@ function file2array($filename)
 /**
  * Netscape bookmark import
  */
-class BookmarkImportTest extends PHPUnit_Framework_TestCase
+class BookmarkImportTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
index b6239e7f2f09851e94caf0b3933e4c511c0157ca..d052f8b9f24766911d4c295a4015b24456959f07 100644 (file)
@@ -1,17 +1,15 @@
 <?php
+namespace Shaarli\Plugin\Addlink;
 
-/**
- * PluginPlayvideosTest.php
- */
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Router;
 
 require_once 'plugins/addlink_toolbar/addlink_toolbar.php';
-require_once 'application/Router.php';
 
 /**
- * Class PluginAddlinkTest
  * Unit test for the Addlink toolbar plugin
  */
-class PluginAddlinkTest extends PHPUnit_Framework_TestCase
+class PluginAddlinkTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Reset plugin path.
index fecd5f2c21488b3cf35390b663879766c0a1a0e8..510288bbadc2e31557142896d89034bf10a40148 100644 (file)
@@ -1,16 +1,19 @@
 <?php
+namespace Shaarli\Plugin\Archiveorg;
 
 /**
  * PluginArchiveorgTest.php
  */
 
+use Shaarli\Plugin\PluginManager;
+
 require_once 'plugins/archiveorg/archiveorg.php';
 
 /**
  * Class PluginArchiveorgTest
  * Unit test for the archiveorg plugin
  */
-class PluginArchiveorgTest extends PHPUnit_Framework_TestCase
+class PluginArchiveorgTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Reset plugin path
index 0ae73183808666ec74bf7ef7ea64e50f63b73c94..bdfab439cd60d0a42b22193dd1f4b7ddd60d0076 100644 (file)
@@ -1,5 +1,10 @@
 <?php
+namespace Shaarli\Plugin\Isso;
+
+use DateTime;
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigManager;
+use Shaarli\Plugin\PluginManager;
 
 require_once 'plugins/isso/isso.php';
 
@@ -8,7 +13,7 @@ require_once 'plugins/isso/isso.php';
  *
  * Test the Isso plugin (comment system).
  */
-class PluginIssoTest extends PHPUnit_Framework_TestCase
+class PluginIssoTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Reset plugin path
@@ -21,7 +26,7 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase
     /**
      * Test Isso init without errors.
      */
-    public function testWallabagInitNoError()
+    public function testIssoInitNoError()
     {
         $conf = new ConfigManager('');
         $conf->set('plugins.ISSO_SERVER', 'value');
@@ -32,7 +37,7 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase
     /**
      * Test Isso init with errors.
      */
-    public function testWallabagInitError()
+    public function testIssoInitError()
     {
         $conf = new ConfigManager('');
         $errors = isso_init($conf);
@@ -96,19 +101,22 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase
                 array(
                     'id' => 12,
                     'url' => $str,
+                    'shorturl' => $short1 = 'abcd',
                     'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date1),
                 ),
                 array(
                     'id' => 13,
                     'url' => $str . '2',
+                    'shorturl' => $short2 = 'efgh',
                     'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date2),
                 ),
             )
         );
 
         $processed = hook_isso_render_linklist($data, $conf);
-        // data shouldn't be altered
-        $this->assertEquals($data, $processed);
+        // link_plugin should be added for the icon
+        $this->assertContains('<a href="?'. $short1 .'#isso-thread">', $processed['links'][0]['link_plugin'][0]);
+        $this->assertContains('<a href="?'. $short2 .'#isso-thread">', $processed['links'][1]['link_plugin'][0]);
     }
 
     /**
@@ -127,6 +135,7 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase
                 array(
                     'id' => 12,
                     'url' => $str,
+                    'shorturl' => $short1 = 'abcd',
                     'created' => DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $date),
                 )
             ),
@@ -135,8 +144,8 @@ class PluginIssoTest extends PHPUnit_Framework_TestCase
 
         $processed = hook_isso_render_linklist($data, $conf);
 
-        // data shouldn't be altered
-        $this->assertEquals($data, $processed);
+        // link_plugin should be added for the icon
+        $this->assertContains('<a href="?'. $short1 .'#isso-thread">', $processed['links'][0]['link_plugin'][0]);
     }
 
     /**
index b31e817fe6093c85e7a5dbb57813a1d6f2ec0ad0..5e7c02b0c8f5b95407733d73cf01f95b26ccf3e8 100644 (file)
@@ -1,10 +1,14 @@
 <?php
+namespace Shaarli\Plugin\Markdown;
+
 use Shaarli\Config\ConfigManager;
+use Shaarli\Plugin\PluginManager;
 
 /**
  * PluginMarkdownTest.php
  */
 
+require_once 'application/bookmark/LinkUtils.php';
 require_once 'application/Utils.php';
 require_once 'plugins/markdown/markdown.php';
 
@@ -12,7 +16,7 @@ require_once 'plugins/markdown/markdown.php';
  * Class PluginMarkdownTest
  * Unit test for the Markdown plugin
  */
-class PluginMarkdownTest extends PHPUnit_Framework_TestCase
+class PluginMarkdownTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var ConfigManager instance.
@@ -47,6 +51,8 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase
         $data = hook_markdown_render_linklist($data, $this->conf);
         $this->assertNotFalse(strpos($data['links'][0]['description'], '<h1>'));
         $this->assertNotFalse(strpos($data['links'][0]['description'], '<p>'));
+
+        $this->assertEquals($markdown, $data['links'][0]['description_src']);
     }
 
     /**
@@ -106,6 +112,18 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($text, $reversedText);
     }
 
+    /**
+     * Test reverse_text2clickable().
+     */
+    public function testReverseText2clickableHashtags()
+    {
+        $text = file_get_contents('tests/plugins/resources/hashtags.raw');
+        $md = file_get_contents('tests/plugins/resources/hashtags.md');
+        $clickableText = hashtag_autolink($text);
+        $reversedText = reverse_text2clickable($clickableText);
+        $this->assertEquals($md, $reversedText);
+    }
+
     /**
      * Test reverse_nl2br().
      */
@@ -246,7 +264,7 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase
             $this->conf->get('security.markdown_escape', true),
             $this->conf->get('security.allowed_protocols')
         );
-        $this->assertEquals($html, $data);
+        $this->assertEquals($html, $data . PHP_EOL);
     }
 
     /**
index 29ad047f4a10ae608dd1d1b59bd057f40429ff9a..51472617ad47cf21cd5fbc418ca2fd5d0982652c 100644 (file)
@@ -1,17 +1,20 @@
 <?php
+namespace Shaarli\Plugin\Playvideos;
 
 /**
  * PluginPlayvideosTest.php
  */
 
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Router;
+
 require_once 'plugins/playvideos/playvideos.php';
-require_once 'application/Router.php';
 
 /**
  * Class PluginPlayvideosTest
  * Unit test for the PlayVideos plugin
  */
-class PluginPlayvideosTest extends PHPUnit_Framework_TestCase
+class PluginPlayvideosTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Reset plugin path
index 69d00936f13db7a9f8d38e20753a8973dbad77c6..a7bd8fc93d79980633fd7edc71a66eb248df0b3e 100644 (file)
@@ -1,14 +1,17 @@
 <?php
+namespace Shaarli\Plugin\Pubsubhubbub;
+
 use Shaarli\Config\ConfigManager;
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Router;
 
 require_once 'plugins/pubsubhubbub/pubsubhubbub.php';
-require_once 'application/Router.php';
 
 /**
  * Class PluginPubsubhubbubTest
  * Unit test for the pubsubhubbub plugin
  */
-class PluginPubsubhubbubTest extends PHPUnit_Framework_TestCase
+class PluginPubsubhubbubTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string Config file path (without extension).
index ebfadddf39b0bd6241b13273d8734d633c74cebe..0c61e14a75bc841f1be4d5362bcb4b55c8b4662d 100644 (file)
@@ -1,21 +1,26 @@
 <?php
+namespace Shaarli\Plugin\Qrcode;
+
 /**
  * PluginQrcodeTest.php
  */
 
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Router;
+
 require_once 'plugins/qrcode/qrcode.php';
-require_once 'application/Router.php';
 
 /**
  * Class PluginQrcodeTest
  * Unit test for the QR-Code plugin
  */
-class PluginQrcodeTest extends PHPUnit_Framework_TestCase
+class PluginQrcodeTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Reset plugin path
      */
-    public function setUp() {
+    public function setUp()
+    {
         PluginManager::$PLUGINS_PATH = 'plugins';
     }
 
index 76b7887e53e1443272527518d50a72f5eb4b420e..797519210c63c5827da633d870e90de1b152d6c3 100644 (file)
@@ -1,9 +1,8 @@
 <?php
-use Shaarli\Config\ConfigManager;
+namespace Shaarli\Plugin\Wallabag;
 
-/**
- * PluginWallabagTest.php.php
- */
+use Shaarli\Config\ConfigManager;
+use Shaarli\Plugin\PluginManager;
 
 require_once 'plugins/wallabag/wallabag.php';
 
@@ -11,7 +10,7 @@ require_once 'plugins/wallabag/wallabag.php';
  * Class PluginWallabagTest
  * Unit test for the Wallabag plugin
  */
-class PluginWallabagTest extends PHPUnit_Framework_TestCase
+class PluginWallabagTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Reset plugin path
index 2c46687100c13495408e80ac68dc31523283fd78..a3cd90765676c36920a9a58d2b0140133950a54d 100644 (file)
@@ -1,11 +1,10 @@
 <?php
-
-require_once 'plugins/wallabag/WallabagInstance.php';
+namespace Shaarli\Plugin\Wallabag;
 
 /**
  * Class WallabagInstanceTest
  */
-class WallabagInstanceTest extends PHPUnit_Framework_TestCase
+class WallabagInstanceTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string wallabag url.
diff --git a/tests/plugins/resources/hashtags.md b/tests/plugins/resources/hashtags.md
new file mode 100644 (file)
index 0000000..46326de
--- /dev/null
@@ -0,0 +1,10 @@
+[#lol](?addtag=lol)
+
+    #test
+
+`#test2`
+
+```
+bla #bli blo
+#bla
+```
diff --git a/tests/plugins/resources/hashtags.raw b/tests/plugins/resources/hashtags.raw
new file mode 100644 (file)
index 0000000..9d2dc98
--- /dev/null
@@ -0,0 +1,10 @@
+#lol
+
+    #test
+
+`#test2`
+
+```
+bla #bli blo
+#bla
+```
index f1df4e7ee96fa1aba001e0b6ee067b8958d1c61e..c3460bf7880c58c4184bc862e115029c7364b574 100644 (file)
 <li><a href="http://link.tld">two</a></li>
 <li><a href="http://link.tld">three</a></li>
 <li><a href="http://link.tld">four</a></li>
-<li>foo &lt;a href=&quot;?addtag=foobar&quot; title=&quot;Hashtag foobar&quot;&gt;#foobar&lt;/a&gt;</li>
+<li>foo <a href="?addtag=foobar">#foobar</a></li>
 </ol></li>
 </ol>
-<p>&lt;a href=&quot;?addtag=foobar&quot; title=&quot;Hashtag foobar&quot;&gt;#foobar&lt;/a&gt; foo <code>lol #foo</code> &lt;a href=&quot;?addtag=bar&quot; title=&quot;Hashtag bar&quot;&gt;#bar&lt;/a&gt;</p>
-<p>fsdfs <a href="http://link.tld">http://link.tld</a> &lt;a href=&quot;?addtag=foobar&quot; title=&quot;Hashtag foobar&quot;&gt;#foobar&lt;/a&gt; <code>http://link.tld</code></p>
+<p><a href="?addtag=foobar">#foobar</a> foo <code>lol #foo</code> <a href="?addtag=bar">#bar</a></p>
+<p>fsdfs <a href="http://link.tld">http://link.tld</a> <a href="?addtag=foobar">#foobar</a> <code>http://link.tld</code></p>
 <pre><code>http://link.tld #foobar
 next #foo</code></pre>
 <p>Block:</p>
@@ -30,4 +30,4 @@ next #foo</code></pre>
 <a href="ftp://test.tld/path/?query=value#hash">link</a><br />
 <a href="magnet:test.tld/path/?query=value#hash">link</a><br />
 <a href="http://alert(&#039;xss&#039;)">link</a><br />
-<a href="http://test.tld/path/?query=value#hash">link</a></p></div>
\ No newline at end of file
+<a href="http://test.tld/path/?query=value#hash">link</a></p></div>
index b8ebd9340870e338a8a125d1522f8fe96970cc15..9350a8c7dd9f4c7011d85f64dc6abba92eca3401 100644 (file)
@@ -31,4 +31,4 @@ lorem ipsum #foobar http://link.tld
 [link](ftp://test.tld/path/?query=value#hash)
 [link](magnet:test.tld/path/?query=value#hash)
 [link](javascript:alert('xss'))
-[link](other://test.tld/path/?query=value#hash)
\ No newline at end of file
+[link](other://test.tld/path/?query=value#hash)
similarity index 93%
rename from tests/ThemeUtilsTest.php
rename to tests/render/ThemeUtilsTest.php
index e44564be3e398bc2e265a5f8cf7cbc089e31652e..58e3426b2de3670ab40a2c12bc385c2b308652d8 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 
-namespace Shaarli;
+namespace Shaarli\Render;
 
 /**
  * Class ThemeUtilsTest
  *
  * @package Shaarli
  */
-class ThemeUtilsTest extends \PHPUnit_Framework_TestCase
+class ThemeUtilsTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * Test getThemes() with existing theme directories.
index b9ab5ec45929025d0de81040c8c9521f2785b4b0..7b0262b32c128871841cf9d98aaf83e129ffacca 100644 (file)
@@ -2,7 +2,8 @@
 namespace Shaarli\Security;
 
 require_once 'tests/utils/FakeConfigManager.php';
-use \PHPUnit\Framework\TestCase;
+
+use PHPUnit\Framework\TestCase;
 
 /**
  * Test coverage for LoginManager
index 9bd868f809687273bf680f8a551ac41d876d8684..f264505eaefa81159e7cf1af14fb01b22b60f027 100644 (file)
@@ -5,9 +5,8 @@ require_once 'tests/utils/FakeConfigManager.php';
 require_once 'tests/utils/ReferenceSessionIdHashes.php';
 ReferenceSessionIdHashes::genAllHashes();
 
-use \Shaarli\Security\SessionManager;
-use \PHPUnit\Framework\TestCase;
-
+use PHPUnit\Framework\TestCase;
+use Shaarli\Security\SessionManager;
 
 /**
  * Test coverage for SessionManager
similarity index 75%
rename from tests/Updater/DummyUpdater.php
rename to tests/updater/DummyUpdater.php
index a0be4413e1e2e8f39c8e55eec78e6bddd49f3aa1..9e866f1f1c60fab1f7551885378d91ffadcdc4a4 100644 (file)
@@ -1,10 +1,15 @@
 <?php
+namespace Shaarli\Updater;
 
-require_once 'application/Updater.php';
+use Exception;
+use ReflectionClass;
+use ReflectionMethod;
+use Shaarli\Bookmark\LinkDB;
+use Shaarli\Config\ConfigManager;
 
 /**
  * Class DummyUpdater.
- * Extends Updater to add update method designed for unit tests.
+ * Extends updater to add update method designed for unit tests.
  */
 class DummyUpdater extends Updater
 {
@@ -31,7 +36,7 @@ class DummyUpdater extends Updater
      *
      * @return bool true.
      */
-    private final function updateMethodDummy1()
+    final private function updateMethodDummy1()
     {
         return true;
     }
@@ -41,7 +46,7 @@ class DummyUpdater extends Updater
      *
      * @return bool true.
      */
-    private final function updateMethodDummy2()
+    final private function updateMethodDummy2()
     {
         return true;
     }
@@ -51,7 +56,7 @@ class DummyUpdater extends Updater
      *
      * @return bool true.
      */
-    private final function updateMethodDummy3()
+    final private function updateMethodDummy3()
     {
         return true;
     }
@@ -61,7 +66,7 @@ class DummyUpdater extends Updater
      *
      * @throws Exception error.
      */
-    private final function updateMethodException()
+    final private function updateMethodException()
     {
         throw new Exception('whatever');
     }
similarity index 82%
rename from tests/Updater/UpdaterTest.php
rename to tests/updater/UpdaterTest.php
index 94e3c7d307c4bb46f1e45d8cf523852ee3b7ba88..d7df59637395ddf9a7d4760eecefa5db4a32a97e 100644 (file)
@@ -1,16 +1,24 @@
 <?php
+namespace Shaarli\Updater;
+
+use DateTime;
+use Exception;
+use Shaarli\Bookmark\LinkDB;
 use Shaarli\Config\ConfigJson;
 use Shaarli\Config\ConfigManager;
 use Shaarli\Config\ConfigPhp;
+use Shaarli\Thumbnailer;
 
-require_once 'tests/Updater/DummyUpdater.php';
+require_once 'application/updater/UpdaterUtils.php';
+require_once 'tests/updater/DummyUpdater.php';
+require_once 'tests/utils/ReferenceLinkDB.php';
 require_once 'inc/rain.tpl.class.php';
 
 /**
  * Class UpdaterTest.
- * Runs unit tests against the Updater class.
+ * Runs unit tests against the updater class.
  */
-class UpdaterTest extends PHPUnit_Framework_TestCase
+class UpdaterTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string Path to test datastore.
@@ -20,7 +28,7 @@ class UpdaterTest extends PHPUnit_Framework_TestCase
     /**
      * @var string Config file path (without extension).
      */
-    protected static $configFile = 'tests/utils/config/configJson';
+    protected static $configFile = 'sandbox/config';
 
     /**
      * @var ConfigManager
@@ -32,6 +40,7 @@ class UpdaterTest extends PHPUnit_Framework_TestCase
      */
     public function setUp()
     {
+        copy('tests/utils/config/configJson.json.php', self::$configFile .'.json.php');
         $this->conf = new ConfigManager(self::$configFile);
     }
 
@@ -151,7 +160,7 @@ class UpdaterTest extends PHPUnit_Framework_TestCase
     /**
      * Test Update failed.
      *
-     * @expectedException UpdaterException
+     * @expectedException \Exception
      */
     public function testUpdateFailed()
     {
@@ -177,17 +186,17 @@ class UpdaterTest extends PHPUnit_Framework_TestCase
         $this->conf->setConfigFile('tests/utils/config/configPhp');
         $this->conf->reset();
 
-        $optionsFile = 'tests/Updater/options.php';
+        $optionsFile = 'tests/updater/options.php';
         $options = '<?php
 $GLOBALS[\'privateLinkByDefault\'] = true;';
         file_put_contents($optionsFile, $options);
 
         // tmp config file.
-        $this->conf->setConfigFile('tests/Updater/config');
+        $this->conf->setConfigFile('tests/updater/config');
 
         // merge configs
         $updater = new Updater(array(), array(), $this->conf, true);
-        // This writes a new config file in tests/Updater/config.php
+        // This writes a new config file in tests/updater/config.php
         $updater->updateMethodMergeDeprecatedConfigFile();
 
         // make sure updated field is changed
@@ -214,7 +223,7 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
      */
     public function testRenameDashTags()
     {
-        $refDB = new ReferenceLinkDB();
+        $refDB = new \ReferenceLinkDB();
         $refDB->write(self::$testDatastore);
         $linkDB = new LinkDB(self::$testDatastore, true, false);
 
@@ -360,7 +369,7 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
                 'private' => true,
             ),
         );
-        $refDB = new ReferenceLinkDB();
+        $refDB = new \ReferenceLinkDB();
         $refDB->setLinks($links);
         $refDB->write(self::$testDatastore);
         $linkDB = new LinkDB(self::$testDatastore, true, false);
@@ -391,20 +400,32 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
         $this->assertEquals('Naming conventions... #private', $linkDB[0]['description']);
         $this->assertEquals('samba cartoon web', $linkDB[0]['tags']);
         $this->assertTrue($linkDB[0]['private']);
-        $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_142300'), $linkDB[0]['created']);
+        $this->assertEquals(
+            DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_142300'),
+            $linkDB[0]['created']
+        );
 
         $this->assertTrue(isset($linkDB[1]));
         $this->assertFalse(isset($linkDB[1]['linkdate']));
         $this->assertEquals(1, $linkDB[1]['id']);
         $this->assertEquals('UserFriendly - Samba', $linkDB[1]['title']);
-        $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_172539'), $linkDB[1]['created']);
+        $this->assertEquals(
+            DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_172539'),
+            $linkDB[1]['created']
+        );
 
         $this->assertTrue(isset($linkDB[2]));
         $this->assertFalse(isset($linkDB[2]['linkdate']));
         $this->assertEquals(2, $linkDB[2]['id']);
         $this->assertEquals('Geek and Poke', $linkDB[2]['title']);
-        $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_182539'), $linkDB[2]['created']);
-        $this->assertEquals(DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_190301'), $linkDB[2]['updated']);
+        $this->assertEquals(
+            DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_182539'),
+            $linkDB[2]['created']
+        );
+        $this->assertEquals(
+            DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121206_190301'),
+            $linkDB[2]['updated']
+        );
     }
 
     /**
@@ -412,7 +433,7 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
      */
     public function testDatastoreIdsNothingToDo()
     {
-        $refDB = new ReferenceLinkDB();
+        $refDB = new \ReferenceLinkDB();
         $refDB->write(self::$testDatastore);
         $linkDB = new LinkDB(self::$testDatastore, true, false);
 
@@ -684,4 +705,111 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
         $this->assertEquals(4194304, $this->conf->get('general.download_max_size'));
         $this->assertEquals(3, $this->conf->get('general.download_timeout'));
     }
+
+    /**
+<<<<<<< HEAD
+     * Test updateMethodWebThumbnailer with thumbnails enabled.
+     */
+    public function testUpdateMethodWebThumbnailerEnabled()
+    {
+        $this->conf->remove('thumbnails');
+        $this->conf->set('thumbnail.enable_thumbnails', true);
+        $updater = new Updater([], [], $this->conf, true, $_SESSION);
+        $this->assertTrue($updater->updateMethodWebThumbnailer());
+        $this->assertFalse($this->conf->exists('thumbnail'));
+        $this->assertEquals(\Shaarli\Thumbnailer::MODE_ALL, $this->conf->get('thumbnails.mode'));
+        $this->assertEquals(125, $this->conf->get('thumbnails.width'));
+        $this->assertEquals(90, $this->conf->get('thumbnails.height'));
+        $this->assertContains('You have enabled or changed thumbnails', $_SESSION['warnings'][0]);
+    }
+
+    /**
+     * Test updateMethodWebThumbnailer with thumbnails disabled.
+     */
+    public function testUpdateMethodWebThumbnailerDisabled()
+    {
+        $this->conf->remove('thumbnails');
+        $this->conf->set('thumbnail.enable_thumbnails', false);
+        $updater = new Updater([], [], $this->conf, true, $_SESSION);
+        $this->assertTrue($updater->updateMethodWebThumbnailer());
+        $this->assertFalse($this->conf->exists('thumbnail'));
+        $this->assertEquals(Thumbnailer::MODE_NONE, $this->conf->get('thumbnails.mode'));
+        $this->assertEquals(125, $this->conf->get('thumbnails.width'));
+        $this->assertEquals(90, $this->conf->get('thumbnails.height'));
+        $this->assertTrue(empty($_SESSION['warnings']));
+    }
+
+    /**
+     * Test updateMethodWebThumbnailer with thumbnails disabled.
+     */
+    public function testUpdateMethodWebThumbnailerNothingToDo()
+    {
+        $updater = new Updater([], [], $this->conf, true, $_SESSION);
+        $this->assertTrue($updater->updateMethodWebThumbnailer());
+        $this->assertFalse($this->conf->exists('thumbnail'));
+        $this->assertEquals(Thumbnailer::MODE_COMMON, $this->conf->get('thumbnails.mode'));
+        $this->assertEquals(90, $this->conf->get('thumbnails.width'));
+        $this->assertEquals(53, $this->conf->get('thumbnails.height'));
+        $this->assertTrue(empty($_SESSION['warnings']));
+    }
+
+    /**
+     * Test updateMethodSetSticky().
+     */
+    public function testUpdateStickyValid()
+    {
+        $blank = [
+            'id' => 1,
+            'url' => 'z',
+            'title' => '',
+            'description' => '',
+            'tags' => '',
+            'created' => new DateTime(),
+        ];
+        $links = [
+            1 => ['id' => 1] + $blank,
+            2 => ['id' => 2] + $blank,
+        ];
+        $refDB = new \ReferenceLinkDB();
+        $refDB->setLinks($links);
+        $refDB->write(self::$testDatastore);
+        $linkDB = new LinkDB(self::$testDatastore, true, false);
+
+        $updater = new Updater(array(), $linkDB, $this->conf, true);
+        $this->assertTrue($updater->updateMethodSetSticky());
+
+        $linkDB = new LinkDB(self::$testDatastore, true, false);
+        foreach ($linkDB as $link) {
+            $this->assertFalse($link['sticky']);
+        }
+    }
+
+    /**
+     * Test updateMethodSetSticky().
+     */
+    public function testUpdateStickyNothingToDo()
+    {
+        $blank = [
+            'id' => 1,
+            'url' => 'z',
+            'title' => '',
+            'description' => '',
+            'tags' => '',
+            'created' => new DateTime(),
+        ];
+        $links = [
+            1 => ['id' => 1, 'sticky' => true] + $blank,
+            2 => ['id' => 2] + $blank,
+        ];
+        $refDB = new \ReferenceLinkDB();
+        $refDB->setLinks($links);
+        $refDB->write(self::$testDatastore);
+        $linkDB = new LinkDB(self::$testDatastore, true, false);
+
+        $updater = new Updater(array(), $linkDB, $this->conf, true);
+        $this->assertTrue($updater->updateMethodSetSticky());
+
+        $linkDB = new LinkDB(self::$testDatastore, true, false);
+        $this->assertTrue($linkDB[1]['sticky']);
+    }
 }
diff --git a/tests/utils/CurlUtils.php b/tests/utils/CurlUtils.php
new file mode 100644 (file)
index 0000000..1cc4907
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Old-style mock for cURL, as PHPUnit doesn't allow to mock global functions
+ */
+
+/**
+ * Returns code 200 or html content type.
+ *
+ * @param resource $ch   cURL resource
+ * @param int      $type cURL info type
+ *
+ * @return int|string 200 or 'text/html'
+ */
+function ut_curl_getinfo_ok($ch, $type)
+{
+    switch ($type) {
+        case CURLINFO_RESPONSE_CODE:
+            return 200;
+        case CURLINFO_CONTENT_TYPE:
+            return 'text/html; charset=utf-8';
+    }
+}
+
+/**
+ * Returns code 200 or html content type without charset.
+ *
+ * @param resource $ch   cURL resource
+ * @param int      $type cURL info type
+ *
+ * @return int|string 200 or 'text/html'
+ */
+function ut_curl_getinfo_no_charset($ch, $type)
+{
+    switch ($type) {
+        case CURLINFO_RESPONSE_CODE:
+            return 200;
+        case CURLINFO_CONTENT_TYPE:
+            return 'text/html';
+    }
+}
+
+/**
+ * Invalid response code.
+ *
+ * @param resource $ch   cURL resource
+ * @param int      $type cURL info type
+ *
+ * @return int|string 404 or 'text/html'
+ */
+function ut_curl_getinfo_rc_ko($ch, $type)
+{
+    switch ($type) {
+        case CURLINFO_RESPONSE_CODE:
+            return 404;
+        case CURLINFO_CONTENT_TYPE:
+            return 'text/html; charset=utf-8';
+    }
+}
+
+/**
+ * Invalid content type.
+ *
+ * @param resource $ch   cURL resource
+ * @param int      $type cURL info type
+ *
+ * @return int|string 200 or 'text/plain'
+ */
+function ut_curl_getinfo_ct_ko($ch, $type)
+{
+    switch ($type) {
+        case CURLINFO_RESPONSE_CODE:
+            return 200;
+        case CURLINFO_CONTENT_TYPE:
+            return 'text/plain';
+    }
+}
+
+/**
+ * Invalid response code and content type.
+ *
+ * @param resource $ch   cURL resource
+ * @param int      $type cURL info type
+ *
+ * @return int|string 404 or 'text/plain'
+ */
+function ut_curl_getinfo_rs_ct_ko($ch, $type)
+{
+    switch ($type) {
+        case CURLINFO_RESPONSE_CODE:
+            return 404;
+        case CURLINFO_CONTENT_TYPE:
+            return 'text/plain';
+    }
+}
diff --git a/tests/utils/FakeApplicationUtils.php b/tests/utils/FakeApplicationUtils.php
new file mode 100644 (file)
index 0000000..de83d59
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+namespace Shaarli;
+
+/**
+ * Fake ApplicationUtils class to avoid HTTP requests
+ */
+class FakeApplicationUtils extends ApplicationUtils
+{
+    public static $VERSION_CODE = '';
+
+    /**
+     * Toggle HTTP requests, allow overriding the version code
+     */
+    public static function getVersion($url, $timeout = 0)
+    {
+        return self::$VERSION_CODE;
+    }
+}
index 75cbb32629a3668fcde141619afde6514a360210..e411c417e7e6ed96ccaf24becd51541dab347f52 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 
+use Shaarli\FileUtils;
+use Shaarli\History;
+
 /**
  * Populates a reference history
  */
index e887aa78c2251747c46cf37fab4359c782b32b36..c12bcb678e42bf8de317e5308bd5a9251613ec59 100644 (file)
@@ -1,10 +1,13 @@
 <?php
+
+use Shaarli\Bookmark\LinkDB;
+
 /**
  * Populates a reference datastore to test LinkDB
  */
 class ReferenceLinkDB
 {
-    public static $NB_LINKS_TOTAL = 9;
+    public static $NB_LINKS_TOTAL = 11;
 
     private $_links = array();
     private $_publicCount = 0;
@@ -15,6 +18,32 @@ class ReferenceLinkDB
      */
     public function __construct()
     {
+        $this->addLink(
+            11,
+            'Pined older',
+            '?PCRizQ',
+            'This is an older pinned link',
+            0,
+            DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20100309_101010'),
+            '',
+            null,
+            'PCRizQ',
+            true
+        );
+
+        $this->addLink(
+            10,
+            'Pined',
+            '?0gCTjQ',
+            'This is a pinned link',
+            0,
+            DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, '20121207_152312'),
+            '',
+            null,
+            '0gCTjQ',
+            true
+        );
+
         $this->addLink(
             41,
             'Link title: @website',
@@ -114,8 +143,18 @@ class ReferenceLinkDB
     /**
      * Adds a new link
      */
-    protected function addLink($id, $title, $url, $description, $private, $date, $tags, $updated = '', $shorturl = '')
-    {
+    protected function addLink(
+        $id,
+        $title,
+        $url,
+        $description,
+        $private,
+        $date,
+        $tags,
+        $updated = '',
+        $shorturl = '',
+        $pinned = false
+    ) {
         $link = array(
             'id' => $id,
             'title' => $title,
@@ -126,6 +165,7 @@ class ReferenceLinkDB
             'created' => $date,
             'updated' => $updated,
             'shorturl' => $shorturl ? $shorturl : smallHash($date->format(LinkDB::LINK_DATE_FORMAT) . $id),
+            'sticky' => $pinned
         );
         $this->_links[$id] = $link;
 
@@ -164,7 +204,11 @@ class ReferenceLinkDB
 
         $order = $order === 'ASC' ? -1 : 1;
         // Reorder array by dates.
-        usort($this->_links, function($a, $b) use ($order) {
+        usort($this->_links, function ($a, $b) use ($order) {
+            if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) {
+                return $a['sticky'] ? -1 : 1;
+            }
+
             return $a['created'] < $b['created'] ? 1 * $order : -1 * $order;
         });
     }
index 9c9288f30cc696c38115dd1562a1770b3dfe8cb3..1549ddfc500acf72602d2f351cde4c5a69af9ef0 100644 (file)
@@ -1,35 +1,84 @@
 <?php /*
 {
     "credentials": {
-        "login":"root",
-        "hash":"hash",
-        "salt":"salt"
+        "login": "root",
+        "hash": "hash",
+        "salt": "salt"
     },
     "security": {
-        "session_protection_disabled":false
+        "session_protection_disabled": false,
+        "ban_after": 4,
+        "ban_duration": 1800,
+        "open_shaarli": false,
+        "allowed_protocols": [
+            "ftp",
+            "ftps",
+            "magnet"
+        ]
     },
     "general": {
-        "timezone":"Europe\/Paris",
+        "timezone": "Europe\/Paris",
         "title": "Shaarli",
-        "header_link": "?"
+        "header_link": "?",
+        "links_per_page": 20,
+        "enabled_plugins": [
+            "qrcode"
+        ],
+        "default_note_title": "Note: "
     },
     "privacy": {
-        "default_private_links":true
+        "default_private_links": true,
+        "hide_public_links": false,
+        "force_login": false,
+        "hide_timestamps": false,
+        "remember_user_default": true
     },
     "redirector": {
-        "url":"lala"
+        "url": "lala",
+        "encode_url": true
     },
     "config": {
         "foo": "bar"
     },
     "resource": {
         "datastore": "tests\/utils\/config\/datastore.php",
-        "data_dir": "sandbox/",
-        "raintpl_tpl": "tpl/"
+        "data_dir": "sandbox\/",
+        "raintpl_tpl": "tpl\/",
+        "config": "data\/config.php",
+        "ban_file": "data\/ipbans.php",
+        "updates": "data\/updates.txt",
+        "log": "data\/log.txt",
+        "update_check": "data\/lastupdatecheck.txt",
+        "history": "data\/history.php",
+        "theme": "default",
+        "raintpl_tmp": "tmp\/",
+        "thumbnails_cache": "cache",
+        "page_cache": "pagecache"
     },
     "plugins": {
         "WALLABAG_VERSION": 1
+    },
+    "dev": {
+        "debug": true
+    },
+    "updates": {
+        "check_updates": false,
+        "check_updates_branch": "stable",
+        "check_updates_interval": 86400
+    },
+    "feed": {
+        "rss_permalinks": true,
+        "show_atom": true
+    },
+    "translation": {
+        "language": "auto",
+        "mode": "php",
+        "extensions": []
+    },
+    "thumbnails": {
+        "mode": "common",
+        "width": 90,
+        "height": 53
     }
 }
 */ ?>
-
index 0e034175757d7ccc1f076606d70b181bc05b8f88..7dc81e2289504286fa69abeeea9d20d5c538a448 100644 (file)
@@ -1,4 +1,4 @@
-<?php 
+<?php
 $GLOBALS['login'] = 'root';
 $GLOBALS['hash'] = 'hash';
 $GLOBALS['salt'] = 'salt';
@@ -8,7 +8,7 @@ $GLOBALS['titleLink'] = 'titleLink';
 $GLOBALS['redirector'] = 'lala';
 $GLOBALS['disablesessionprotection'] = false;
 $GLOBALS['privateLinkByDefault'] = false;
-$GLOBALS['config']['DATADIR'] = 'tests/Updater';
+$GLOBALS['config']['DATADIR'] = 'tests/updater';
 $GLOBALS['config']['PAGECACHE'] = 'sandbox/pagecache';
 $GLOBALS['config']['DATASTORE'] = 'data/datastore.php';
 $GLOBALS['plugins']['WALLABAG_VERSION'] = '1';
diff --git a/tests/utils/config/wt.json b/tests/utils/config/wt.json
new file mode 100644 (file)
index 0000000..69ce49a
--- /dev/null
@@ -0,0 +1,12 @@
+{
+  "settings": {
+    "default": {
+      "_comment": "infinite cache",
+      "cache_duration": -1,
+      "timeout": 10
+    },
+    "path": {
+      "cache": "sandbox/"
+    }
+  }
+}
\ No newline at end of file
index 2f956e061bc30534a1f15cbaa2087e2a51da9c3d..55864a023947c201ad09fd32754452f45bb02c6d 100644 (file)
@@ -11,7 +11,8 @@
     <h2 class="window-title">{"Shaare a new link"|t}</h2>
     <form method="GET" action="#" name="addform" class="addform">
       <div>
-        <input type="text" name="post" placeholder="{'URL or leave empty to post a note'|t}" class="autofocus">
+        <label for="shaare">{'URL or leave empty to post a note'|t}</label>
+        <input type="text" name="post" id="shaare" class="autofocus">
       </div>
       <div>
         <input type="submit" value="{'Add link'|t}">
index a63c7ad33a6d8402423aebe90d51b5357c11de17..42e32230b7bacb88cad86354e06072bac72078c0 100644 (file)
           </div>
         </div>
       </div>
+      <div class="pure-g">
+        <div class="pure-u-lg-{$ratioLabel} pure-u-{$ratioLabelMobile}">
+          <div class="form-label">
+            <label for="enableThumbnails">
+              <span class="label-name">{'Enable thumbnails'|t}</span><br>
+              <span class="label-desc">
+                {if="! $gd_enabled"}
+                  {'You need to enable the extension <code>php-gd</code> to use thumbnails.'|t}
+                {elseif="$thumbnails_enabled"}
+                  <a href="?do=thumbs_update">{'Synchronize thumbnails'|t}</a>
+                {/if}
+              </span>
+            </label>
+          </div>
+        </div>
+        <div class="pure-u-lg-{$ratioInput} pure-u-{$ratioInputMobile}">
+          <div class="form-input">
+            <select name="enableThumbnails" id="enableThumbnails" class="align">
+              <option value="all"    {if="$thumbnails_mode=='all'"}selected{/if}>
+                {'All'|t}
+              </option>
+              <option value="common" {if="$thumbnails_mode=='common'"}selected{/if}>
+                {'Only common media hosts'|t}
+              </option>
+              <option value="none"   {if="$thumbnails_mode=='none'"}selected{/if}>
+                {'None'|t}
+              </option>
+            </select>
+          </div>
+        </div>
+      </div>
       <div class="center">
         <input type="submit" value="{'Save'|t}" name="save">
       </div>
index 29d845d5307231d1337e3964837d8931a89736e0..2c409478bed424edd51700855ed2f352c70dd9df 100644 (file)
                     </a>
                     <a href="{$link.real_url}">{$link.title}</a>
                   </div>
-                  {$thumb=thumbnail($value.url)}
-                  {if="$thumb!=false"}
-                    <div class="daily-entry-thumbnail">{$thumb}</div>
+                  {if="$thumbnails_enabled && !empty($link.thumbnail)"}
+                    <div class="daily-entry-thumbnail">
+                      <img data-src="{$link.thumbnail}#" class="b-lazy"
+                           src=""
+                           alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
+                    </div>
                   {/if}
                   <div class="daily-entry-description">{$link.formatedDescription}</div>
                   {if="$link.tags"}
@@ -83,7 +86,7 @@
                       {/loop}
                     </div>
                   {/if}
-                  <div class="dailyEntryFooter">
+                  <div class="dailyEntryFooter clear">
                     {loop="$link.link_plugin"}
                       {$value}
                     {/loop}
   </div>
 </div>
 {include="page.footer"}
+<script src="js/thumbnails.min.js?v={$version_hash}"></script>
 </body>
 </html>
 
index b14a38595c6038620317cea2d0d8157e1261658e..f589b06ead8b0f675c67f347c6b9360437d1bdb9 100644 (file)
@@ -8,7 +8,7 @@
                <h3><a href="{$value.url}">{$value.title}</a></h3>
                <small>{if="!$hide_timestamps"}{function="strftime('%c', $value.timestamp)"} - {/if}{if="$value.tags"}{$value.tags}{/if}<br>
                {$value.url}</small><br>
-               {if="$value.thumbnail"}{$value.thumbnail}{/if}<br>
+               {if="$value.thumbnail"}<img src="{$index_url}{$value.thumbnail}#" alt="thumbnail" />{/if}<br>
                {if="$value.description"}{$value.formatedDescription}{/if}
                <br><br><hr>
         {/loop}
index 5ccacaafb82d1dada9c27a1ea7fac317e267e2b4..6c30d1bf8a432052df87b14709249e62e786ef51 100644 (file)
   <link type="text/css" rel="stylesheet" href="data/user.css#" />
 {/if}
 <link rel="search" type="application/opensearchdescription+xml" href="?do=opensearch#" title="Shaarli search - {$shaarlititle}"/>
+{if="! empty($links) && count($links) === 1"}
+  {$link=reset($links)}
+  <meta property="og:title" content="{$link.title}" />
+  <meta property="og:type" content="article" />
+  <meta property="og:url" content="{$index_url}?{$link.shorturl}" />
+  {$ogDescription=isset($link.description_src) ? $link.description_src : $link.description}
+  <meta property="og:description" content="{function="substr(strip_tags($ogDescription), 0, 300)"}" />
+  {if="$link.thumbnail"}
+    <meta property="og:image" content="{$index_url}{$link.thumbnail}" />
+  {/if}
+  {if="!$hide_timestamps || $is_logged_in"}
+    <meta property="article:published_time" content="{$link.created->format(DateTime::ATOM)}" />
+    {if="$link.updated"}
+      <meta property="article:modified_time" content="{$link.updated->format(DateTime::ATOM)}" />
+    {/if}
+  {/if}
+  {loop="link.taglist"}
+    <meta property="article:tag" content="{$value}" />
+  {/loop}
+{/if}
index 322cddd5341ec417cbfc9597bf199a629b7d6f9b..ed78f40a7502f625e60659a92738ef91fc669226 100644 (file)
       {$strPermalink=t('Permalink')}
       {$strPermalinkLc=t('permalink')}
       {$strAddTag=t('Add tag')}
+      {$strToggleSticky=t('Toggle sticky')}
+      {$strSticky=t('Sticky')}
       {ignore}End of translations{/ignore}
       {loop="links"}
         <div class="anchor" id="{$value.shorturl}"></div>
 
         <div class="linklist-item linklist-item{if="$value.class"} {$value.class}{/if}" data-id="{$value.id}">
           <div class="linklist-item-title">
-            {$thumb=thumbnail($value.url)}
-            {if="$thumb!=false"}
-              <div class="linklist-item-thumbnail">{$thumb}</div>
+            {if="$thumbnails_enabled && !empty($value.thumbnail)"}
+              <div class="linklist-item-thumbnail" style="width:{$thumbnails_width}px;height:{$thumbnails_height}px;">
+                <div class="thumbnail">
+                  <a href="{$value.real_url}">
+                  {ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
+                  <img data-src="{$value.thumbnail}#" class="b-lazy"
+                    src=""
+                    alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
+                  </a>
+                </div>
+              </div>
             {/if}
 
             {if="$is_logged_in"}
                 {if="$is_logged_in"}
                   <div class="linklist-item-infos-controls-group pure-u-0 pure-u-lg-visible">
                     <span class="linklist-item-infos-controls-item ctrl-checkbox">
-                      <input type="checkbox" class="delete-checkbox" value="{$value.id}">
+                      <input type="checkbox" class="link-checkbox" value="{$value.id}">
                     </span>
                     <span class="linklist-item-infos-controls-item ctrl-edit">
                       <a href="?edit_link={$value.id}" title="{$strEdit}"><i class="fa fa-pencil-square-o edit-link"></i></a>
                         <i class="fa fa-trash"></i>
                       </a>
                     </span>
+                    <span class="linklist-item-infos-controls-item ctrl-pin">
+                      <a href="?do=pin&amp;id={$value.id}&amp;token={$token}"
+                         title="{$strToggleSticky}" class="pin-link {if="$value.sticky"}pinned-link{/if} pure-u-0 pure-u-lg-visible">
+                        <i class="fa fa-thumb-tack"></i>
+                      </a>
+                    </span>
                   </div>
+                {else}
+                  {if="$value.sticky"}
+                    <div class="linklist-item-infos-controls-group pure-u-0 pure-u-lg-visible">
+                      <span class="linklist-item-infos-controls-item ctrl-pin">
+                        <span title="{$strSticky}" class="pin-link pinned-link pure-u-0 pure-u-lg-visible">
+                          <i class="fa fa-thumb-tack"></i>
+                        </span>
+                      </span>
+                    </div>
+                  {/if}
                 {/if}
                 <a href="?{$value.shorturl}" title="{$strPermalink}">
                   {if="!$hide_timestamps || $is_logged_in"}
 </div>
 
 {include="page.footer"}
+<script src="js/thumbnails.min.js?v={$version_hash}"></script>
 </body>
 </html>
index 5309e348a8c38ba236be2ee13be916279c84fa67..fe665a840293fa2396ff4b0ea9470ce6a091cc4a 100644 (file)
@@ -16,6 +16,9 @@
         <a href="?untaggedonly" title="{'Filter untagged links'|t}"
            class={if="$untaggedonly"}"filter-on"{else}"filter-off"{/if}
         ><i class="fa fa-tag"></i></a>
+        <a href="#" title="{'Select all'|t}"
+           class="filter-off select-all-button"
+        ><i class="fa fa-check-square-o"></i></a>
         <a href="#" class="filter-off fold-all pure-u-lg-0" title="{'Fold all'|t}">
           <i class="fa fa-chevron-up"></i>
         </a>
index 82568d635ca0db797b2daf609b7d1852d1142bf0..4f6dd4d8f87afa536db31854f99a3f9083c6080f 100644 (file)
@@ -2,7 +2,7 @@
   <div class="pure-u-lg-0 pure-u-1">
     <div class="pure-menu">
       <a href="{$titleLink}" class="pure-menu-link shaarli-title" id="shaarli-title-mobile">
-        <img src="img/icon.png" width="16" height="16" class="head-logo" alt="logo" />
+        <img src="img/icon.png" width="16" height="16" class="head-logo" alt="" />
         {$shaarlititle}
       </a>
       <a href="#" class="menu-toggle" id="menu-toggle"><s class="bar"></s><s class="bar"></s></a>
@@ -13,7 +13,7 @@
       <ul class="pure-menu-list pure-u-lg-5-6 pure-u-1">
         <li class="pure-menu-item pure-u-0 pure-u-lg-visible">
           <a href="{$titleLink}" class="pure-menu-link shaarli-title" id="shaarli-title-desktop">
-            <img src="img/icon.png" width="16" height="16" class="head-logo" alt="logo" />
+            <img src="img/icon.png" width="16" height="16" class="head-logo" alt="" />
             {$shaarlititle}
           </a>
         </li>
         <li class="pure-menu-item" id="shaarli-menu-tags">
           <a href="?do=tagcloud" class="pure-menu-link">{'Tag cloud'|t}</a>
         </li>
-        <li class="pure-menu-item" id="shaarli-menu-picwall">
-          <a href="?do=picwall{$searchcrits}" class="pure-menu-link">{'Picture wall'|t}</a>
-        </li>
+        {if="$thumbnails_enabled"}
+          <li class="pure-menu-item" id="shaarli-menu-picwall">
+            <a href="?do=picwall{$searchcrits}" class="pure-menu-link">{'Picture wall'|t}</a>
+          </li>
+        {/if}
         <li class="pure-menu-item" id="shaarli-menu-daily">
           <a href="?do=daily" class="pure-menu-link">{'Daily'|t}</a>
         </li>
   <div id="actions" class="subheader-form">
     <div class="pure-g">
       <div class="pure-u-1">
-        <a href="" id="actions-delete" class="button">Delete</a>
+        <a href="" id="actions-delete" class="button">{'Delete'|t}</a>
       </div>
     </div>
   </div>
   </div>
 {/if}
 
+{if="!empty($global_warnings) && $is_logged_in"}
+  <div class="pure-g pure-alert pure-alert-warning pure-alert-closable" id="shaarli-warnings-alert">
+    <div class="pure-u-2-24"></div>
+    <div class="pure-u-20-24">
+      {loop="global_warnings"}
+        <p>{$value}</p>
+      {/loop}
+    </div>
+    <div class="pure-u-2-24">
+      <i class="fa fa-times pure-alert-close"></i>
+    </div>
+  </div>
+{/if}
+
   <div class="clear"></div>
index 2f7e03dc3bc0b127e254acb7f3acb82f86d9d986..4c325487ac0dbfe10328f79205a4f4e9a4d1f242 100644 (file)
@@ -5,41 +5,61 @@
 </head>
 <body>
 {include="page.header"}
+{if="!$thumbnails_enabled"}
+<div class="pure-g pure-alert pure-alert-warning page-single-alert">
+  <div class="pure-u-1 center">
+    {'Picture wall unavailable (thumbnails are disabled).'|t}
+  </div>
+</div>
+{else}
+  {if="count($linksToDisplay)===0 && $is_logged_in"}
+    <div class="pure-g pure-alert pure-alert-warning page-single-alert">
+      <div class="pure-u-1 center">
+        {'There is no cached thumbnail. Try to <a href="?do=thumbs_update">synchronize them</a>.'|t}
+      </div>
+    </div>
+  {/if}
 
-<div class="pure-g">
-  <div class="pure-u-lg-1-6 pure-u-1-24"></div>
-  <div class="pure-u-lg-2-3 pure-u-22-24 page-form page-visitor">
-    {$countPics=count($linksToDisplay)}
-    <h2 class="window-title">{'Picture Wall'|t} - {$countPics} {'pics'|t}</h2>
+  <div class="pure-g">
+    <div class="pure-u-lg-1-6 pure-u-1-24"></div>
+    <div class="pure-u-lg-2-3 pure-u-22-24 page-form page-visitor">
+      {$countPics=count($linksToDisplay)}
+      <h2 class="window-title">{'Picture Wall'|t} - {$countPics} {'pics'|t}</h2>
 
-    <div id="plugin_zone_start_picwall" class="plugin_zone">
-      {loop="$plugin_start_zone"}
-        {$value}
-      {/loop}
-    </div>
+      <div id="plugin_zone_start_picwall" class="plugin_zone">
+        {loop="$plugin_start_zone"}
+          {$value}
+        {/loop}
+      </div>
 
-    <div id="picwall_container" class="picwall-container">
-      {loop="$linksToDisplay"}
-        <div class="picwall-pictureframe">
-          {$value.thumbnail}<a href="{$value.real_url}"><span class="info">{$value.title}</span></a>
-          {loop="$value.picwall_plugin"}
-            {$value}
-          {/loop}
-        </div>
-      {/loop}
-      <div class="clear"></div>
-    </div>
+      <div id="picwall-container" class="picwall-container">
+        {loop="$linksToDisplay"}
+          <div class="picwall-pictureframe">
+            {ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
+            <img data-src="{$value.thumbnail}#" class="b-lazy"
+                 src=""
+                 alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
+            <a href="{$value.real_url}"><span class="info">{$value.title}</span></a>
+            {loop="$value.picwall_plugin"}
+              {$value}
+            {/loop}
+          </div>
+        {/loop}
+        <div class="clear"></div>
+      </div>
 
-    <div id="plugin_zone_end_picwall" class="plugin_zone">
-      {loop="$plugin_end_zone"}
-        {$value}
-      {/loop}
+      <div id="plugin_zone_end_picwall" class="plugin_zone">
+        {loop="$plugin_end_zone"}
+          {$value}
+        {/loop}
+      </div>
     </div>
+    <div class="pure-u-lg-1-6 pure-u-1-24"></div>
   </div>
-</div>
+{/if}
 
 {include="page.footer"}
-<script src="js/picwall.min.js?v={$version_hash}"></script>
+<script src="js/thumbnails.min.js?v={$version_hash}"></script>
 </body>
 </html>
 
diff --git a/tpl/default/thumbnails.html b/tpl/default/thumbnails.html
new file mode 100644 (file)
index 0000000..a8cf904
--- /dev/null
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+  {include="includes"}
+</head>
+<body>
+{include="page.header"}
+
+<div class="pure-g thumbnails-page-container">
+  <div class="pure-u-lg-1-3 pure-u-1-24"></div>
+  <div class="pure-u-lg-1-3 pure-u-22-24 page-form page-form-light">
+    <h2 class="window-title">{'Thumbnails update'|t}</h2>
+
+    <div class="pure-g">
+      <div class="pure-u-lg-1-3 pure-u-1-24"></div>
+      <div class="pure-u-lg-1-3 pure-u-22-24">
+        <div class="thumbnail-placeholder" style="width: {$thumbnails_width}px; height: {$thumbnails_height}px;"></div>
+      </div>
+    </div>
+
+    <div class="pure-g">
+      <div class="pure-u-1-12"></div>
+      <div class="pure-u-5-6">
+        <div class="thumbnail-link-title"></div>
+
+        <div class="progressbar">
+          <div></div>
+        </div>
+      </div>
+    </div>
+
+    <div class="pure-g">
+      <div class="pure-u-lg-1-3 pure-u-1-24"></div>
+      <div class="pure-u-lg-1-3 pure-u-22-24">
+        <div class="progress-counter">
+          <span class="progress-current">0</span> / <span class="progress-total">{$ids|count}</span>
+        </div>
+      </div>
+    </div>
+
+    <input type="hidden" name="ids" value="{function="implode($ids, ',')"}" />
+  </div>
+</div>
+
+{include="page.footer"}
+<script src="js/thumbnails_update.min.js?v={$version_hash}"></script>
+</body>
+</html>
index ece66884c3438cb9f524131b73f810db877bc4c4..c9ce1eaf4970b61ecc40f0e0e96ce47b56f666e9 100644 (file)
       </a>
     </div>
 
+    {if="$thumbnails_enabled"}
+      <div class="tools-item">
+        <a href="?do=thumbs_update" title="{'Synchronize all link thumbnails'|t}">
+          <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Synchronize thumbnails'|t}</span>
+        </a>
+      </div>
+    {/if}
+
     {loop="$tools_plugin"}
       <div class="tools-item">
         {$value}
   </div>
 </div>
 
-{if="$sslenabled"}
-  <div class="pure-g">
-    <div class="pure-u-lg-1-3 pure-u-1-24"></div>
-    <div class="pure-u-lg-1-3 pure-u-22-24 page-form page-form-light">
-      <h2 class="window-title">Firefox Social API</h2>
-      <p>{'You need to browse your Shaarli over <strong>HTTPS</strong> to use this functionality.'|t}</p>
-
-      <div class="tools-item">
-        <a title="{'Click on this button to add Shaarli to the 'Share this page' button in Firefox"
-           id="ff-social-button">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ {'Add to'|t} Firefox Social</span>
-        </a>
-      </div>
-    </div>
-  </div>
-{/if}
-
 <div class="pure-g">
   <div class="pure-u-lg-1-3 pure-u-1-24"></div>
   <div class="pure-u-lg-1-3 pure-u-22-24 page-form page-form-light">
     <h2 class="window-title">{'3rd party'|t}</h2>
     <div class="tools-item">
-      <a href="https://addons.mozilla.org/fr/firefox/addon/shaarli/" title="Firefox {'Plugin'|t}">
+      <a href="https://addons.mozilla.org/fr/firefox/addon/shaarli/">
         <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Firefox {'plugin'|t}</span>
       </a>
     </div>
     <div class="tools-item">
-      <a href="https://chrome.google.com/webstore/detail/shiny-shaarli/hajdfkmbdmadjmmpkkbbcnllepomekin"
-         title="Chrome {'Plugin'|t}">
+      <a href="https://chrome.google.com/webstore/detail/shiny-shaarli/hajdfkmbdmadjmmpkkbbcnllepomekin">
         <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Chrome {'plugin'|t}</span>
       </a>
     </div>
     <div class="tools-item">
-      <a href="https://play.google.com/store/apps/details?id=com.dimtion.shaarlier&hl=fr"
-         title="Android Shaarlier">
+      <a href="https://play.google.com/store/apps/details?id=com.dimtion.shaarlier&hl=fr">
         <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Android Shaarlier</span>
       </a>
     </div>
     <div class="tools-item">
-      <a href="https://stakali.toneiv.eu/"
-         title="Android Stakali">
+      <a href="https://stakali.toneiv.eu/">
         <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Android Stakali</span>
       </a>
     </div>
index 479284eb1aa2ec993ceb02caf5281093871cb0a4..f1892fa1a1de1954249b54a1c8d06215f51f5ec3 100644 (file)
         </td>
       </tr>
 
-      <tr>
-        <td><b>Redirector</b></td>
-        <td>
-          <input type="text" name="redirector" id="redirector" size="50" value="{$redirector}"><br>
-          (e.g. <i>http://anonym.to/?</i> will mask the HTTP_REFERER)
-        </td>
-      </tr>
-
       <tr>
         <td><b>Security:</b></td>
         <td>
           <input type="text" name="apiSecret" id="apiSecret" size="50" value="{$api_secret}" />
         </td>
       </tr>
+      <tr>
+        <td valign="top"><b>Enable thumbnails</b></td>
+        <td>
+          <select name="enableThumbnails" id="enableThumbnails" class="align">
+            <option value="all"    {if="$thumbnails_mode=='all'"}selected{/if}>
+            {'All'|t}
+            </option>
+            <option value="common" {if="$thumbnails_mode=='common'"}selected{/if}>
+            {'Only common media hosts'|t}
+            </option>
+            <option value="none"   {if="$thumbnails_mode=='none'"}selected{/if}>
+            {'None'|t}
+            </option>
+          </select>
+          <label for="enableThumbnails">
+            {if="! $gd_enabled"}
+              {'You need to enable the extension <code>php-gd</code> to use thumbnails.'|t}
+            {elseif="$thumbnails_enabled"}
+              <a href="?do=thumbs_update">{'Synchonize thumbnails'|t}</a>
+            {/if}
+          </label>
+        </td>
+      </tr>
 
       <tr>
         <td></td>
index ede359106d30e107422c884b59bf494ae316092c..71d84475df2a2b1f42a20eb43159070438750495 100644 (file)
                         <div class="dailyEntryTitle">
                             <a href="{$link.real_url}">{$link.title}</a>
                         </div>
-                        {if="$link.thumbnail"}
-                            <div class="dailyEntryThumbnail">{$link.thumbnail}</div>
+                        {if="$thumbnails_enabled && !empty($link.thumbnail)"}
+                            <div class="dailyEntryThumbnail">
+                              <img data-src="{$link.thumbnail}#" class="b-lazy"
+                                   src=""
+                                   alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
+                            </div>
                         {/if}
                         <div class="dailyEntryDescription">{$link.formatedDescription}</div>
 
     <div id="closing"><img src="img/squiggle_closing.png" width="66" height="61" alt="-"></div>
 </div>
 {include="page.footer"}
+<script src="js/thumbnails.min.js?v={$version_hash}"></script>
 </body>
 </html>
index ddbd6c5ea49ba5a0d3b68238471a7c06d3f42e41..f589b06ead8b0f675c67f347c6b9360437d1bdb9 100644 (file)
@@ -4,11 +4,11 @@
     <link>{$absurl}</link>
     <pubDate>{$rssdate}</pubDate>
     <description><![CDATA[
-        {loop="$links"}
+        {loop="links"}
                <h3><a href="{$value.url}">{$value.title}</a></h3>
                <small>{if="!$hide_timestamps"}{function="strftime('%c', $value.timestamp)"} - {/if}{if="$value.tags"}{$value.tags}{/if}<br>
                {$value.url}</small><br>
-               {if="$value.thumbnail"}{$value.thumbnail}{/if}<br>
+               {if="$value.thumbnail"}<img src="{$index_url}{$value.thumbnail}#" alt="thumbnail" />{/if}<br>
                {if="$value.description"}{$value.formatedDescription}{/if}
                <br><br><hr>
         {/loop}
index 410b466b1b5d8f1954c90b4bdfdbec5f1fd0115b..2efb6b1063b632a23aef1cf383d941b57916b550 100644 (file)
 {/loop}
 {if="is_file('data/user.css')"}<link type="text/css" rel="stylesheet" href="data/user.css#" />{/if}
 <link rel="search" type="application/opensearchdescription+xml" href="?do=opensearch#" title="Shaarli search - {$shaarlititle|htmlspecialchars}"/>
+{if="! empty($links) && count($links) === 1"}
+  {$link=reset($links)}
+  <meta property="og:title" content="{$link.title}" />
+  <meta property="og:type" content="article" />
+  <meta property="og:url" content="{$index_url}?{$link.shorturl}" />
+  {$ogDescription=isset($link.description_src) ? $link.description_src : $link.description}
+  <meta property="og:description" content="{function="mb_substr(strip_tags($ogDescription), 0, 300)"}" />
+  {if="$link.thumbnail"}
+    <meta property="og:image" content="{$index_url}{$link.thumbnail}" />
+  {/if}
+  {if="!$hide_timestamps || $is_logged_in"}
+    <meta property="article:published_time" content="{$link.created->format(DateTime::ATOM)}" />
+    {if="$link.updated"}
+      <meta property="article:modified_time" content="{$link.updated->format(DateTime::ATOM)}" />
+    {/if}
+  {/if}
+  {loop="link.taglist"}
+    <meta property="article:tag" content="{$value}" />
+  {/loop}
+{/if}
index 1ca51be3b962f4ac1d3965fa94b5ba231623924f..dcb14e908042f6a6088ca118f820f19551cac47a 100644 (file)
         {loop="$links"}
         <li{if="$value.class"} class="{$value.class}"{/if}>
             <a id="{$value.shorturl}"></a>
-            <div class="thumbnail">{$value.url|thumbnail}</div>
+            {if="$thumbnails_enabled && !empty($value.thumbnail)"}
+                <div class="thumbnail">
+                    <a href="{$value.real_url}">
+                        {ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
+                        <img data-src="{$value.thumbnail}#" class="b-lazy"
+                             src=""
+                             alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
+                    </a>
+                </div>
+            {/if}
             <div class="linkcontainer">
                 {if="$is_logged_in"}
                     <div class="linkeditbuttons">
 </div>
 
     {include="page.footer"}
+<script src="js/thumbnails.min.js"></script>
 
 </body>
 </html>
index 29688914165ed19f870b75d29087b29fab80a88d..b3a16791b679a06dc8cadea773d299f3cf0e701f 100644 (file)
         <div id="picwall_container">
             {loop="$linksToDisplay"}
             <div class="picwall_pictureframe">
-                   {$value.thumbnail}<a href="{$value.real_url}"><span class="info">{$value.title}</span></a>
+                {ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
+                <img data-src="{$value.thumbnail}#" class="b-lazy"
+                     src=""
+                     alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
+                <a href="{$value.real_url}"><span class="info">{$value.title}</span></a>
                 {loop="$value.picwall_plugin"}
                     {$value}
                 {/loop}
@@ -34,6 +38,6 @@
 
 {include="page.footer"}
 
-<script src="js/picwall.min.js"></script>
+<script src="js/thumbnails.min.js"></script>
 </body>
 </html>
diff --git a/tpl/vintage/thumbnails.html b/tpl/vintage/thumbnails.html
new file mode 100644 (file)
index 0000000..79aebf8
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>{include="includes"}</head>
+<body>
+<div id="pageheader">
+{include="page.header"}
+</div>
+
+<div class="center thumbnails-update-container">
+  <div class="thumbnail-placeholder" style="width: {$thumbnails_width}px; height: {$thumbnails_height}px;"></div>
+
+  <div class="thumbnail-link-title"></div>
+
+  <div class="progressbar">
+    <div></div>
+  </div>
+
+  <div class="progress-counter">
+    <span class="progress-current">0</span> / <span class="progress-total">{$ids|count}</span>
+  </div>
+</div>
+
+<input type="hidden" name="ids" value="{function="implode($ids, ',')"}" />
+
+{include="page.footer"}
+<script src="js/thumbnails_update.min.js?v={$version_hash}"></script>
+</body>
+</html>
index 3194844adfb6a49379b95b559691c9ed204c0f7e..1cef726eef357aedd4a27779dcb85990b2effe55 100644 (file)
                        </span>
                </a><br><br>
 
-               {if="$sslenabled"}
-               <a class="smallbutton" onclick="activateFirefoxSocial(this)"><b>✚Add to Firefox social</b></a>
-               <a href="#">
-                       <span>&#x21D0; Click on this button to add Shaarli to the "Share this page" button in Firefox.</span>
-               </a><br><br>
-               {/if}
-
                {loop="$tools_plugin"}
             {$value}
         {/loop}
                <div class="clear"></div>
 
                <script>
-                       {if="$sslenabled"}
-                       function activateFirefoxSocial(node) {
-                               var loc = location.href;
-                               var baseURL = loc.substring(0, loc.lastIndexOf("/"));
-
-                               // Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable.
-                               var data = {
-                                       name: "{$shaarlititle}",
-                                       description: "The personal, minimalist, super-fast, no-database delicious clone.",
-                                       author: "Shaarli",
-                                       version: "1.0.0",
-
-                                       iconURL: baseURL + "/img/favicon.ico",
-                                       icon32URL: baseURL + "/img/favicon.ico",
-                                       icon64URL: baseURL + "/img/favicon.ico",
-
-                                       shareURL: baseURL + "{noparse}?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi{/noparse}",
-                                       homepageURL: baseURL
-                               };
-                               node.setAttribute("data-service", JSON.stringify(data));
-
-                               var activate = new CustomEvent("ActivateSocialFeature");
-                               node.dispatchEvent(activate);
-                       }
-                       {/if}
                        function alertBookmarklet() {
                                alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');
                                return false;
index 94b7aa701b270a57f068a05800bac9d6e9964773..ed548c735ad08444ba7adf204e93a2c14012e4ab 100644 (file)
@@ -23,7 +23,8 @@ const extractCssVintage = new ExtractTextPlugin({
 module.exports = [
   {
     entry: {
-      picwall: './assets/common/js/picwall.js',
+      thumbnails: './assets/common/js/thumbnails.js',
+      thumbnails_update: './assets/common/js/thumbnails-update.js',
       pluginsadmin: './assets/default/js/plugins-admin.js',
       shaarli: [
         './assets/default/js/base.js',
@@ -96,7 +97,8 @@ module.exports = [
         './assets/vintage/css/reset.css',
         './assets/vintage/css/shaarli.css',
       ].concat(glob.sync('./assets/vintage/img/*')),
-      picwall: './assets/common/js/picwall.js',
+      thumbnails: './assets/common/js/thumbnails.js',
+      thumbnails_update: './assets/common/js/thumbnails-update.js',
     },
     output: {
       filename: '[name].min.js',