diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 8f1068312..0a9a88278 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -148,3 +148,57 @@ jobs: - name: "Run PHPUnit" run: "php bin/phpunit -v" + + phpunit-without-rmq-redis: + name: "PHP ${{ matrix.php }} using ${{ matrix.database }} without Rabbit & Redis" + runs-on: "ubuntu-20.04" + + strategy: + fail-fast: false + matrix: + php: + - "8.3" + database: + - "sqlite" + - "mysql" + - "pgsql" + + steps: + - name: "Checkout" + uses: "actions/checkout@v4" + with: + fetch-depth: 2 + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php }}" + coverage: none + tools: pecl + extensions: json, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, curl, imagick, pgsql, gd, tidy + ini-values: "date.timezone=Europe/Paris" + + - name: "Setup MySQL" + if: "${{ matrix.database == 'mysql' }}" + run: | + sudo systemctl start mysql.service + sudo mysql -u root -proot -h 127.0.0.1 -e "CREATE DATABASE wallabag_test" + + - name: "Setup PostgreSQL" + if: "${{ matrix.database == 'pgsql' }}" + run: | + sudo systemctl start postgresql + sudo -u postgres psql -d template1 -c "CREATE USER wallabag WITH PASSWORD 'wallabagrocks' CREATEDB" + createdb -h localhost -p 5432 -U wallabag wallabag_test + pg_isready -d wallabag_test -h localhost -p 5432 -U wallabag + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v3" + with: + composer-options: "--optimize-autoloader --prefer-dist" + + - name: "Prepare database configuration" + run: cp app/config/tests/parameters_test.${{ matrix.database }}.yml app/config/parameters_test.yml + + - name: "Run PHPUnit" + run: "php bin/phpunit -v" diff --git a/app/config/services_rabbit.yml b/app/config/services_rabbit.yml index 978624aa7..ff00fc8df 100644 --- a/app/config/services_rabbit.yml +++ b/app/config/services_rabbit.yml @@ -6,6 +6,7 @@ services: public: true Wallabag\Consumer\RabbitMQConsumerTotalProxy: + lazy: true arguments: $pocketConsumer: '@old_sound_rabbit_mq.import_pocket_consumer' $readabilityConsumer: '@old_sound_rabbit_mq.import_readability_consumer' diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml index 13abc5250..3cc1b15c1 100644 --- a/app/config/wallabag.yml +++ b/app/config/wallabag.yml @@ -114,6 +114,10 @@ parameters: name: export_xml value: 1 section: export + - + name: export_md + value: 1 + section: export - name: import_with_redis value: 0 @@ -140,7 +144,7 @@ parameters: section: misc - name: wallabag_support_url - value: https://www.wallabag.org/pages/support.html + value: https://github.com/wallabag/wallabag/issues/new/choose section: misc - name: api_user_registration diff --git a/composer.json b/composer.json index c6ca1557b..a365bf705 100644 --- a/composer.json +++ b/composer.json @@ -87,6 +87,7 @@ "jms/serializer-bundle": "^5.4", "laminas/laminas-code": "^4.7.1", "lcobucci/jwt": "^4.3", + "league/html-to-markdown": "^5.1", "mgargano/simplehtmldom": "^1.5", "mnapoli/piwik-twig-extension": "^3.0", "monolog/monolog": "^2.9", diff --git a/composer.lock b/composer.lock index 7201b144b..4a2483a6d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6407ed5fbd4b0973ed565c2a136d3a81", + "content-hash": "a45ce1bad60f024c66e17b6aca7ad88d", "packages": [ { "name": "babdev/pagerfanta-bundle", @@ -145,16 +145,16 @@ }, { "name": "beberlei/assert", - "version": "v3.3.3", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "b5fd8eacd8915a1b627b8bfc027803f1939734dd" + "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/b5fd8eacd8915a1b627b8bfc027803f1939734dd", - "reference": "b5fd8eacd8915a1b627b8bfc027803f1939734dd", + "url": "https://api.github.com/repos/beberlei/assert/zipball/cb70015c04be1baee6f5f5c953703347c0ac1655", + "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655", "shasum": "" }, "require": { @@ -162,7 +162,7 @@ "ext-json": "*", "ext-mbstring": "*", "ext-simplexml": "*", - "php": "^7.1 || ^8.0" + "php": "^7.0 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", @@ -206,9 +206,9 @@ ], "support": { "issues": "https://github.com/beberlei/assert/issues", - "source": "https://github.com/beberlei/assert/tree/v3.3.3" + "source": "https://github.com/beberlei/assert/tree/v3.3.2" }, - "time": "2024-07-15T13:18:35+00:00" + "time": "2021-12-16T21:41:27+00:00" }, { "name": "behat/transliterator", @@ -413,23 +413,23 @@ }, { "name": "dasprid/enum", - "version": "1.0.6", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/DASPRiD/Enum.git", - "reference": "8dfd07c6d2cf31c8da90c53b83c026c7696dda90" + "reference": "6faf451159fb8ba4126b925ed2d78acfce0dc016" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/8dfd07c6d2cf31c8da90c53b83c026c7696dda90", - "reference": "8dfd07c6d2cf31c8da90c53b83c026c7696dda90", + "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/6faf451159fb8ba4126b925ed2d78acfce0dc016", + "reference": "6faf451159fb8ba4126b925ed2d78acfce0dc016", "shasum": "" }, "require": { "php": ">=7.1 <9.0" }, "require-dev": { - "phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11", + "phpunit/phpunit": "^7 | ^8 | ^9", "squizlabs/php_codesniffer": "*" }, "type": "library", @@ -457,9 +457,9 @@ ], "support": { "issues": "https://github.com/DASPRiD/Enum/issues", - "source": "https://github.com/DASPRiD/Enum/tree/1.0.6" + "source": "https://github.com/DASPRiD/Enum/tree/1.0.5" }, - "time": "2024-08-09T14:30:48+00:00" + "time": "2023-08-25T16:18:39+00:00" }, { "name": "defuse/php-encryption", @@ -2657,16 +2657,16 @@ }, { "name": "gedmo/doctrine-extensions", - "version": "v3.17.1", + "version": "v3.16.1", "source": { "type": "git", "url": "https://github.com/doctrine-extensions/DoctrineExtensions.git", - "reference": "eabb45018c5a4362b46c5beae3881261da89f900" + "reference": "e85560ed96f977b8c29428a99222cb2ef2f0e80d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine-extensions/DoctrineExtensions/zipball/eabb45018c5a4362b46c5beae3881261da89f900", - "reference": "eabb45018c5a4362b46c5beae3881261da89f900", + "url": "https://api.github.com/repos/doctrine-extensions/DoctrineExtensions/zipball/e85560ed96f977b8c29428a99222cb2ef2f0e80d", + "reference": "e85560ed96f977b8c29428a99222cb2ef2f0e80d", "shasum": "" }, "require": { @@ -2683,14 +2683,14 @@ }, "conflict": { "doctrine/annotations": "<1.13 || >=3.0", - "doctrine/dbal": "<3.7 || >=5.0", + "doctrine/dbal": "<3.2 || >=4.0", "doctrine/mongodb-odm": "<2.3 || >=3.0", "doctrine/orm": "<2.14.0 || 2.16.0 || 2.16.1 || >=4.0" }, "require-dev": { "doctrine/annotations": "^1.13 || ^2.0", "doctrine/cache": "^1.11 || ^2.0", - "doctrine/dbal": "^3.7 || ^4.0", + "doctrine/dbal": "^3.2", "doctrine/doctrine-bundle": "^2.3", "doctrine/mongodb-odm": "^2.3", "doctrine/orm": "^2.14.0 || ^3.0", @@ -2762,7 +2762,7 @@ "support": { "email": "gediminas.morkevicius@gmail.com", "issues": "https://github.com/doctrine-extensions/DoctrineExtensions/issues", - "source": "https://github.com/doctrine-extensions/DoctrineExtensions/tree/v3.17.1", + "source": "https://github.com/doctrine-extensions/DoctrineExtensions/tree/v3.16.1", "wiki": "https://github.com/Atlantic18/DoctrineExtensions/tree/main/doc" }, "funding": [ @@ -2783,7 +2783,7 @@ "type": "github" } ], - "time": "2024-10-07T22:30:27+00:00" + "time": "2024-06-25T16:22:14+00:00" }, { "name": "grandt/binstring", @@ -5305,6 +5305,95 @@ ], "time": "2023-01-02T13:28:00+00:00" }, + { + "name": "league/html-to-markdown", + "version": "5.1.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/html-to-markdown.git", + "reference": "0b4066eede55c48f38bcee4fb8f0aa85654390fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/0b4066eede55c48f38bcee4fb8f0aa85654390fd", + "reference": "0b4066eede55c48f38bcee4fb8f0aa85654390fd", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xml": "*", + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "mikehaertl/php-shellcommand": "^1.1.0", + "phpstan/phpstan": "^1.8.8", + "phpunit/phpunit": "^8.5 || ^9.2", + "scrutinizer/ocular": "^1.6", + "unleashedtech/php-coding-standard": "^2.7 || ^3.0", + "vimeo/psalm": "^4.22 || ^5.0" + }, + "bin": [ + "bin/html-to-markdown" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\HTMLToMarkdown\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + }, + { + "name": "Nick Cernis", + "email": "nick@cern.is", + "homepage": "http://modernnerd.net", + "role": "Original Author" + } + ], + "description": "An HTML-to-markdown conversion helper for PHP", + "homepage": "https://github.com/thephpleague/html-to-markdown", + "keywords": [ + "html", + "markdown" + ], + "support": { + "issues": "https://github.com/thephpleague/html-to-markdown/issues", + "source": "https://github.com/thephpleague/html-to-markdown/tree/5.1.1" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/html-to-markdown", + "type": "tidelift" + } + ], + "time": "2023-07-12T21:21:09+00:00" + }, { "name": "masterminds/html5", "version": "2.9.0", @@ -8593,16 +8682,16 @@ }, { "name": "sentry/sentry", - "version": "4.10.0", + "version": "4.9.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "2af937d47d8aadb8dab0b1d7b9557e495dd12856" + "reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/2af937d47d8aadb8dab0b1d7b9557e495dd12856", - "reference": "2af937d47d8aadb8dab0b1d7b9557e495dd12856", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/788ec170f51ebb22f2809a1e3f78b19ccd39b70d", + "reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d", "shasum": "" }, "require": { @@ -8620,12 +8709,12 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.4", - "guzzlehttp/promises": "^2.0.3", + "guzzlehttp/promises": "^1.0|^2.0", "guzzlehttp/psr7": "^1.8.4|^2.1.1", "monolog/monolog": "^1.6|^2.0|^3.0", "phpbench/phpbench": "^1.0", "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^8.5|^9.6", + "phpunit/phpunit": "^8.5.14|^9.4", "symfony/phpunit-bridge": "^5.2|^6.0|^7.0", "vimeo/psalm": "^4.17" }, @@ -8666,7 +8755,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/4.10.0" + "source": "https://github.com/getsentry/sentry-php/tree/4.9.0" }, "funding": [ { @@ -8678,7 +8767,7 @@ "type": "custom" } ], - "time": "2024-11-06T07:44:19+00:00" + "time": "2024-08-08T14:40:50+00:00" }, { "name": "sentry/sentry-symfony", @@ -8910,16 +8999,16 @@ }, { "name": "spiriitlabs/form-filter-bundle", - "version": "v10.0.2", + "version": "v10.0.0", "source": { "type": "git", "url": "https://github.com/SpiriitLabs/form-filter-bundle.git", - "reference": "78a8aaaf4f0e51d1ba6ffd59e371e137f9517123" + "reference": "7a1ab5c7f8d1890562f8a3e57796bbb8f84e5be8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SpiriitLabs/form-filter-bundle/zipball/78a8aaaf4f0e51d1ba6ffd59e371e137f9517123", - "reference": "78a8aaaf4f0e51d1ba6ffd59e371e137f9517123", + "url": "https://api.github.com/repos/SpiriitLabs/form-filter-bundle/zipball/7a1ab5c7f8d1890562f8a3e57796bbb8f84e5be8", + "reference": "7a1ab5c7f8d1890562f8a3e57796bbb8f84e5be8", "shasum": "" }, "require": { @@ -8956,9 +9045,9 @@ "symfony" ], "support": { - "source": "https://github.com/SpiriitLabs/form-filter-bundle/tree/v10.0.2" + "source": "https://github.com/SpiriitLabs/form-filter-bundle/tree/v10.0.0" }, - "time": "2024-08-23T08:46:41+00:00" + "time": "2024-01-15T14:09:58+00:00" }, { "name": "spomky-labs/otphp", @@ -9446,16 +9535,16 @@ }, { "name": "symfony/console", - "version": "v5.4.46", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "fb0d4760e7147d81ab4d9e2d57d56268261b4e4e" + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fb0d4760e7147d81ab4d9e2d57d56268261b4e4e", - "reference": "fb0d4760e7147d81ab4d9e2d57d56268261b4e4e", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", "shasum": "" }, "require": { @@ -9525,7 +9614,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.46" + "source": "https://github.com/symfony/console/tree/v5.4.47" }, "funding": [ { @@ -9541,7 +9630,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T14:17:06+00:00" + "time": "2024-11-06T11:30:55+00:00" }, { "name": "symfony/dependency-injection", @@ -10639,16 +10728,16 @@ }, { "name": "symfony/http-client", - "version": "v5.4.46", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "ebcaeeafc48b69f497f82b9700ddf54bfe975f71" + "reference": "3b643b83f87e1765d2e9b1e946bb56ee0b4b7bde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/ebcaeeafc48b69f497f82b9700ddf54bfe975f71", - "reference": "ebcaeeafc48b69f497f82b9700ddf54bfe975f71", + "url": "https://api.github.com/repos/symfony/http-client/zipball/3b643b83f87e1765d2e9b1e946bb56ee0b4b7bde", + "reference": "3b643b83f87e1765d2e9b1e946bb56ee0b4b7bde", "shasum": "" }, "require": { @@ -10710,7 +10799,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v5.4.46" + "source": "https://github.com/symfony/http-client/tree/v5.4.47" }, "funding": [ { @@ -10726,7 +10815,7 @@ "type": "tidelift" } ], - "time": "2024-10-25T11:45:42+00:00" + "time": "2024-11-13T12:18:12+00:00" }, { "name": "symfony/http-client-contracts", @@ -10884,16 +10973,16 @@ }, { "name": "symfony/http-kernel", - "version": "v5.4.46", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "492ce57430d44e28b30b2c76724bef31dcb73b3e" + "reference": "0ac42d5e16317f15dc5f8ea83742c51d2ed2350f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/492ce57430d44e28b30b2c76724bef31dcb73b3e", - "reference": "492ce57430d44e28b30b2c76724bef31dcb73b3e", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/0ac42d5e16317f15dc5f8ea83742c51d2ed2350f", + "reference": "0ac42d5e16317f15dc5f8ea83742c51d2ed2350f", "shasum": "" }, "require": { @@ -10977,7 +11066,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.4.46" + "source": "https://github.com/symfony/http-kernel/tree/v5.4.47" }, "funding": [ { @@ -10993,20 +11082,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:26:57+00:00" + "time": "2024-11-13T13:47:53+00:00" }, { "name": "symfony/intl", - "version": "v5.4.46", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/intl.git", - "reference": "d74763310045ccf2bf485549f8ba942184e31087" + "reference": "5258476a3ab680cd633a1d23130fcc9e8027e3ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/d74763310045ccf2bf485549f8ba942184e31087", - "reference": "d74763310045ccf2bf485549f8ba942184e31087", + "url": "https://api.github.com/repos/symfony/intl/zipball/5258476a3ab680cd633a1d23130fcc9e8027e3ff", + "reference": "5258476a3ab680cd633a1d23130fcc9e8027e3ff", "shasum": "" }, "require": { @@ -11067,7 +11156,7 @@ "localization" ], "support": { - "source": "https://github.com/symfony/intl/tree/v5.4.46" + "source": "https://github.com/symfony/intl/tree/v5.4.47" }, "funding": [ { @@ -11083,7 +11172,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T14:12:18+00:00" + "time": "2024-11-08T08:12:23+00:00" }, { "name": "symfony/mailer", @@ -12419,16 +12508,16 @@ }, { "name": "symfony/property-info", - "version": "v5.4.45", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "cec75362b20263758c9c7af4c2f9af82614195ae" + "reference": "4d77ab22c57ef56a943e3f5769b5fe66be546094" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/cec75362b20263758c9c7af4c2f9af82614195ae", - "reference": "cec75362b20263758c9c7af4c2f9af82614195ae", + "url": "https://api.github.com/repos/symfony/property-info/zipball/4d77ab22c57ef56a943e3f5769b5fe66be546094", + "reference": "4d77ab22c57ef56a943e3f5769b5fe66be546094", "shasum": "" }, "require": { @@ -12445,7 +12534,7 @@ "require-dev": { "doctrine/annotations": "^1.10.4|^2", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "phpstan/phpdoc-parser": "^1.0", + "phpstan/phpdoc-parser": "^1.0|^2.0", "symfony/cache": "^4.4|^5.0|^6.0", "symfony/dependency-injection": "^4.4|^5.0|^6.0", "symfony/serializer": "^4.4|^5.0|^6.0" @@ -12490,7 +12579,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v5.4.45" + "source": "https://github.com/symfony/property-info/tree/v5.4.47" }, "funding": [ { @@ -12506,7 +12595,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2024-11-07T14:13:13+00:00" }, { "name": "symfony/proxy-manager-bridge", @@ -13094,16 +13183,16 @@ }, { "name": "symfony/security-http", - "version": "v5.4.46", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/security-http.git", - "reference": "7152f0e4e292719cdeb8306076448036e025569b" + "reference": "cde02b002e0447075430e6a84482e38f2fd9268d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-http/zipball/7152f0e4e292719cdeb8306076448036e025569b", - "reference": "7152f0e4e292719cdeb8306076448036e025569b", + "url": "https://api.github.com/repos/symfony/security-http/zipball/cde02b002e0447075430e6a84482e38f2fd9268d", + "reference": "cde02b002e0447075430e6a84482e38f2fd9268d", "shasum": "" }, "require": { @@ -13160,7 +13249,7 @@ "description": "Symfony Security Component - HTTP Integration", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-http/tree/v5.4.46" + "source": "https://github.com/symfony/security-http/tree/v5.4.47" }, "funding": [ { @@ -13176,7 +13265,7 @@ "type": "tidelift" } ], - "time": "2024-11-04T12:18:48+00:00" + "time": "2024-11-07T14:12:41+00:00" }, { "name": "symfony/serializer", @@ -13428,16 +13517,16 @@ }, { "name": "symfony/string", - "version": "v5.4.45", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "7f6807add88b1e2635f3c6de5e1ace631ed7cad2" + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/7f6807add88b1e2635f3c6de5e1ace631ed7cad2", - "reference": "7f6807add88b1e2635f3c6de5e1ace631ed7cad2", + "url": "https://api.github.com/repos/symfony/string/zipball/136ca7d72f72b599f2631aca474a4f8e26719799", + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799", "shasum": "" }, "require": { @@ -13494,7 +13583,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.45" + "source": "https://github.com/symfony/string/tree/v5.4.47" }, "funding": [ { @@ -13510,7 +13599,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2024-11-10T20:33:58+00:00" }, { "name": "symfony/templating", @@ -13968,16 +14057,16 @@ }, { "name": "symfony/validator", - "version": "v5.4.46", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "9849c2cae17964a42a77df6823ac90414e2b451d" + "reference": "7caeb2a5f5d5a8a82f243e4dd0b1e7b89e54dc33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/9849c2cae17964a42a77df6823ac90414e2b451d", - "reference": "9849c2cae17964a42a77df6823ac90414e2b451d", + "url": "https://api.github.com/repos/symfony/validator/zipball/7caeb2a5f5d5a8a82f243e4dd0b1e7b89e54dc33", + "reference": "7caeb2a5f5d5a8a82f243e4dd0b1e7b89e54dc33", "shasum": "" }, "require": { @@ -14061,7 +14150,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v5.4.46" + "source": "https://github.com/symfony/validator/tree/v5.4.47" }, "funding": [ { @@ -14077,20 +14166,20 @@ "type": "tidelift" } ], - "time": "2024-11-04T11:03:12+00:00" + "time": "2024-11-08T08:12:23+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.4.46", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "f51f11e4fc5ca24fa0defcdf4df027078950b9e0" + "reference": "e13e8dfa8eaab2b0536ef365beddc2af723a9ac0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f51f11e4fc5ca24fa0defcdf4df027078950b9e0", - "reference": "f51f11e4fc5ca24fa0defcdf4df027078950b9e0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e13e8dfa8eaab2b0536ef365beddc2af723a9ac0", + "reference": "e13e8dfa8eaab2b0536ef365beddc2af723a9ac0", "shasum": "" }, "require": { @@ -14150,7 +14239,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.46" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.47" }, "funding": [ { @@ -14166,7 +14255,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T14:17:06+00:00" + "time": "2024-11-08T15:21:10+00:00" }, { "name": "symfony/var-exporter", @@ -14721,16 +14810,16 @@ }, { "name": "twig/twig", - "version": "v3.11.3", + "version": "v3.11.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3b06600ff3abefaf8ff55d5c336cd1c4253f8c7e" + "reference": "5b580ec1882b54c98cbd8c0f8a3ca5d1904db6b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3b06600ff3abefaf8ff55d5c336cd1c4253f8c7e", - "reference": "3b06600ff3abefaf8ff55d5c336cd1c4253f8c7e", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/5b580ec1882b54c98cbd8c0f8a3ca5d1904db6b1", + "reference": "5b580ec1882b54c98cbd8c0f8a3ca5d1904db6b1", "shasum": "" }, "require": { @@ -14785,7 +14874,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.11.3" + "source": "https://github.com/twigphp/Twig/tree/v3.11.2" }, "funding": [ { @@ -14797,7 +14886,7 @@ "type": "tidelift" } ], - "time": "2024-11-07T12:34:41+00:00" + "time": "2024-11-06T18:50:16+00:00" }, { "name": "wallabag/phpepub", @@ -15596,24 +15685,24 @@ }, { "name": "composer/semver", - "version": "3.4.3", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.11", - "symfony/phpunit-bridge": "^3 || ^7" + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { @@ -15657,7 +15746,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.3" + "source": "https://github.com/composer/semver/tree/3.4.2" }, "funding": [ { @@ -15673,7 +15762,7 @@ "type": "tidelift" } ], - "time": "2024-09-19T14:15:21+00:00" + "time": "2024-07-12T11:35:52+00:00" }, { "name": "composer/xdebug-handler", @@ -15896,16 +15985,16 @@ }, { "name": "doctrine/doctrine-fixtures-bundle", - "version": "3.6.1", + "version": "3.6.2", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineFixturesBundle.git", - "reference": "d13a08ebf244f74c8adb8ff15aa55d01c404e534" + "reference": "f44a224e27573b79140197a44e68484c45fb24da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/d13a08ebf244f74c8adb8ff15aa55d01c404e534", - "reference": "d13a08ebf244f74c8adb8ff15aa55d01c404e534", + "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/f44a224e27573b79140197a44e68484c45fb24da", + "reference": "f44a224e27573b79140197a44e68484c45fb24da", "shasum": "" }, "require": { @@ -15963,7 +16052,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineFixturesBundle/issues", - "source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/3.6.1" + "source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/3.6.2" }, "funding": [ { @@ -15979,7 +16068,7 @@ "type": "tidelift" } ], - "time": "2024-05-07T07:16:35+00:00" + "time": "2024-11-13T07:41:29+00:00" }, { "name": "ergebnis/composer-normalize", @@ -16836,16 +16925,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.1", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -16884,7 +16973,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -16892,20 +16981,20 @@ "type": "tidelift" } ], - "time": "2024-11-08T17:47:46+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "nikic/php-parser", - "version": "v4.19.4", + "version": "v4.19.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", "shasum": "" }, "require": { @@ -16914,7 +17003,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -16946,9 +17035,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" }, - "time": "2024-09-29T15:01:53+00:00" + "time": "2024-03-17T08:10:35+00:00" }, { "name": "phar-io/manifest", @@ -17434,35 +17523,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.32", + "version": "9.2.31", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.19.1 || ^5.1.0", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-text-template": "^2.0.4", - "sebastian/code-unit-reverse-lookup": "^2.0.3", - "sebastian/complexity": "^2.0.3", - "sebastian/environment": "^5.1.5", - "sebastian/lines-of-code": "^1.0.4", - "sebastian/version": "^3.0.2", - "theseer/tokenizer": "^1.2.3" + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -17471,7 +17560,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "9.2.x-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -17500,7 +17589,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" }, "funding": [ { @@ -17508,7 +17597,7 @@ "type": "github" } ], - "time": "2024-08-22T04:23:01+00:00" + "time": "2024-03-02T06:37:42+00:00" }, { "name": "phpunit/php-file-iterator", @@ -17753,16 +17842,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.21", + "version": "9.6.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" + "reference": "49d7820565836236411f5dc002d16dd689cde42f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f", + "reference": "49d7820565836236411f5dc002d16dd689cde42f", "shasum": "" }, "require": { @@ -17777,7 +17866,7 @@ "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-code-coverage": "^9.2.31", "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.4", @@ -17836,7 +17925,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20" }, "funding": [ { @@ -17852,7 +17941,7 @@ "type": "tidelift" } ], - "time": "2024-09-19T10:50:18+00:00" + "time": "2024-07-10T11:45:39+00:00" }, { "name": "react/cache", @@ -19732,16 +19821,16 @@ }, { "name": "symfony/process", - "version": "v5.4.46", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "01906871cb9b5e3cf872863b91aba4ec9767daf4" + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/01906871cb9b5e3cf872863b91aba4ec9767daf4", - "reference": "01906871cb9b5e3cf872863b91aba4ec9767daf4", + "url": "https://api.github.com/repos/symfony/process/zipball/5d1662fb32ebc94f17ddb8d635454a776066733d", + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d", "shasum": "" }, "require": { @@ -19774,7 +19863,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.46" + "source": "https://github.com/symfony/process/tree/v5.4.47" }, "funding": [ { @@ -19790,7 +19879,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:18:28+00:00" + "time": "2024-11-06T11:36:42+00:00" }, { "name": "symfony/web-profiler-bundle", diff --git a/migrations/Version20241112193044.php b/migrations/Version20241112193044.php new file mode 100644 index 000000000..7a3705bc5 --- /dev/null +++ b/migrations/Version20241112193044.php @@ -0,0 +1,24 @@ +addSql('INSERT INTO ' . $this->getTable('internal_setting') . " (name, value, section) VALUES ('export_md', '1', 'export');"); + } + + public function down(Schema $schema): void + { + $this->addSql('DELETE FROM' . $this->getTable('internal_setting') . " WHERE name = 'export_md';"); + } +} diff --git a/package.json b/package.json index 03e6ce6ab..955305fb7 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "file-loader": "^6.2.0", "lato-font": "^3.0.0", "mini-css-extract-plugin": "^2.9.2", - "postcss": "^8.4.47", + "postcss": "^8.4.48", "postcss-loader": "^8.1.1", "postcss-scss": "^4.0.9", "sass-embedded": "^1.80.6", diff --git a/src/Controller/ExportController.php b/src/Controller/ExportController.php index e4ddbb1f5..c49a3d2c1 100644 --- a/src/Controller/ExportController.php +++ b/src/Controller/ExportController.php @@ -20,7 +20,7 @@ class ExportController extends AbstractController * Gets one entry content. * * @Route("/export/{id}.{format}", name="export_entry", requirements={ - * "format": "epub|pdf|json|xml|txt|csv", + * "format": "epub|pdf|json|xml|txt|csv|md", * "id": "\d+" * }) * @@ -54,7 +54,7 @@ class ExportController extends AbstractController * Export all entries for current user. * * @Route("/export/{category}.{format}", name="export_entries", requirements={ - * "format": "epub|pdf|json|xml|txt|csv", + * "format": "epub|pdf|json|xml|txt|csv|md", * "category": "all|unread|starred|archive|tag_entries|untagged|search|annotated|same_domain" * }) * diff --git a/src/Helper/EntriesExport.php b/src/Helper/EntriesExport.php index 9b4712632..e05f3af84 100644 --- a/src/Helper/EntriesExport.php +++ b/src/Helper/EntriesExport.php @@ -5,6 +5,7 @@ namespace Wallabag\Helper; use Html2Text\Html2Text; use JMS\Serializer\SerializationContext; use JMS\Serializer\SerializerBuilder; +use League\HTMLToMarkdown\HtmlConverter; use PHPePub\Core\EPub; use PHPePub\Core\Structure\OPF\DublinCore; use Symfony\Component\HttpFoundation\Response; @@ -129,10 +130,8 @@ class EntriesExport /** * Use PHPePub to dump a .epub file. - * - * @return Response */ - private function produceEpub() + private function produceEpub(): Response { $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; \assert($user instanceof User); @@ -249,10 +248,8 @@ class EntriesExport /** * Use TCPDF to dump a .pdf file. - * - * @return Response */ - private function producePdf() + private function producePdf(): Response { $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; \assert($user instanceof User); @@ -326,10 +323,8 @@ class EntriesExport /** * Inspired from CsvFileDumper. - * - * @return Response */ - private function produceCsv() + private function produceCsv(): Response { $delimiter = ';'; $enclosure = '"'; @@ -372,10 +367,8 @@ class EntriesExport /** * Dump a JSON file. - * - * @return Response */ - private function produceJson() + private function produceJson(): Response { return Response::create( $this->prepareSerializingContent('json'), @@ -390,10 +383,8 @@ class EntriesExport /** * Dump a XML file. - * - * @return Response */ - private function produceXml() + private function produceXml(): Response { return Response::create( $this->prepareSerializingContent('xml'), @@ -408,10 +399,8 @@ class EntriesExport /** * Dump a TXT file. - * - * @return Response */ - private function produceTxt() + private function produceTxt(): Response { $content = ''; $bar = str_repeat('=', 100); @@ -432,6 +421,29 @@ class EntriesExport ); } + /** + * Dump a Markdown file. + */ + private function produceMd(): Response + { + $content = ''; + $converter = new HtmlConverter(); + $converter->getConfig()->setOption('strip_tags', true); + foreach ($this->entries as $entry) { + $content .= $converter->convert('
{{ import.description|trans|raw }}- -