mirror of
https://github.com/wallabag/wallabag.git
synced 2025-12-29 14:37:35 +01:00
Compare commits
1 Commits
2.6.13
...
remove-dup
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e3ad401e9 |
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,5 +1,5 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Want to ask something?
|
- name: Want to ask something?
|
||||||
url: https://matrix.to/#/#wallabag:matrix.org
|
url: https://gitter.im/wallabag/wallabag
|
||||||
about: Use Matrix to ask questions.
|
about: Use Gitter to ask questions.
|
||||||
|
|||||||
10
.github/workflows/assets.yml
vendored
10
.github/workflows/assets.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- "2.**"
|
- 2.*
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -13,16 +13,16 @@ permissions:
|
|||||||
jobs:
|
jobs:
|
||||||
js:
|
js:
|
||||||
name: "Building assets"
|
name: "Building assets"
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-20.04"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v4"
|
uses: "actions/checkout@v3"
|
||||||
|
|
||||||
- name: "Install Node"
|
- name: "Install Node"
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version: "16"
|
||||||
|
|
||||||
- name: "Install dependencies with Yarn"
|
- name: "Install dependencies with Yarn"
|
||||||
run: "yarn install"
|
run: "yarn install"
|
||||||
|
|||||||
6
.github/workflows/coding-standards.yml
vendored
6
.github/workflows/coding-standards.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- "2.**"
|
- 2.*
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -13,11 +13,11 @@ permissions:
|
|||||||
jobs:
|
jobs:
|
||||||
coding-standards:
|
coding-standards:
|
||||||
name: "CS Fixer, PHPStan & TwigCS"
|
name: "CS Fixer, PHPStan & TwigCS"
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-20.04"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v4"
|
uses: "actions/checkout@v3"
|
||||||
|
|
||||||
- name: "Install PHP"
|
- name: "Install PHP"
|
||||||
uses: "shivammathur/setup-php@v2"
|
uses: "shivammathur/setup-php@v2"
|
||||||
|
|||||||
10
.github/workflows/continuous-integration.yml
vendored
10
.github/workflows/continuous-integration.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- "2.**"
|
- 2.*
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PGPASSWORD: wallabagrocks
|
PGPASSWORD: wallabagrocks
|
||||||
@ -14,7 +14,7 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
phpunit:
|
phpunit:
|
||||||
name: "PHP ${{ matrix.php }} using ${{ matrix.database }}"
|
name: "PHP ${{ matrix.php }} using ${{ matrix.database }}"
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-20.04"
|
||||||
services:
|
services:
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
image: rabbitmq:3-alpine
|
image: rabbitmq:3-alpine
|
||||||
@ -40,7 +40,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v4"
|
uses: "actions/checkout@v3"
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ jobs:
|
|||||||
|
|
||||||
phpunit_no_prefix:
|
phpunit_no_prefix:
|
||||||
name: "PHP ${{ matrix.php }} using ${{ matrix.database }} without prefix"
|
name: "PHP ${{ matrix.php }} using ${{ matrix.database }} without prefix"
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-20.04"
|
||||||
services:
|
services:
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
image: rabbitmq:3-alpine
|
image: rabbitmq:3-alpine
|
||||||
@ -106,7 +106,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v4"
|
uses: "actions/checkout@v3"
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
|
|||||||
6
.github/workflows/translations.yml
vendored
6
.github/workflows/translations.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- "2.**"
|
- 2.*
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -13,7 +13,7 @@ permissions:
|
|||||||
jobs:
|
jobs:
|
||||||
translations:
|
translations:
|
||||||
name: "Translations"
|
name: "Translations"
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-20.04"
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v4"
|
uses: "actions/checkout@v3"
|
||||||
|
|
||||||
- name: "Install PHP"
|
- name: "Install PHP"
|
||||||
uses: "shivammathur/setup-php@v2"
|
uses: "shivammathur/setup-php@v2"
|
||||||
|
|||||||
2
.github/workflows/upload-release-package.yml
vendored
2
.github/workflows/upload-release-package.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v4"
|
uses: "actions/checkout@v3"
|
||||||
|
|
||||||
- name: "Install PHP"
|
- name: "Install PHP"
|
||||||
uses: "shivammathur/setup-php@v2"
|
uses: "shivammathur/setup-php@v2"
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -15,7 +15,6 @@
|
|||||||
.php-cs-fixer.cache
|
.php-cs-fixer.cache
|
||||||
.phpunit.result.cache
|
.phpunit.result.cache
|
||||||
phpunit.xml
|
phpunit.xml
|
||||||
docker-compose.override.yml
|
|
||||||
|
|
||||||
# Parameters
|
# Parameters
|
||||||
/app/config/parameters.yml
|
/app/config/parameters.yml
|
||||||
|
|||||||
145
CHANGELOG.md
145
CHANGELOG.md
@ -1,150 +1,5 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [2.6.13](https://github.com/wallabag/wallabag/tree/2.6.13)
|
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.12...2.6.13)
|
|
||||||
|
|
||||||
### Improvements
|
|
||||||
|
|
||||||
* Add support of Pocket CSV import by @kdecherf and @nicosomb in [https://github.com/wallabag/wallabag/pull/8240](https://github.com/wallabag/wallabag/pull/8240)
|
|
||||||
* Backport Pocket and Shaarli HTML imports from master by @nicosomb in [https://github.com/wallabag/wallabag/pull/8193](https://github.com/wallabag/wallabag/pull/8193)
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
* Avoid non-validated OTP to be enabled #8139 by @j0k3r in [https://github.com/wallabag/wallabag/pull/8139](https://github.com/wallabag/wallabag/pull/8139)
|
|
||||||
|
|
||||||
### Technical stuff
|
|
||||||
|
|
||||||
* Update j0k3r/php-readability:1.2.13 to fix regression (about latin1 instead of UTF-8 used for entries) by @nicosomb [https://github.com/wallabag/wallabag/pull/8194](https://github.com/wallabag/wallabag/pull/8194)
|
|
||||||
|
|
||||||
## [2.6.12](https://github.com/wallabag/wallabag/tree/2.6.12)
|
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.11...2.6.12)
|
|
||||||
|
|
||||||
### Technical stuff
|
|
||||||
|
|
||||||
* Fix changelog by @yguedidi in [https://github.com/wallabag/wallabag/pull/8135](https://github.com/wallabag/wallabag/pull/8135)
|
|
||||||
* Update dependencies by @yguedidi in [https://github.com/wallabag/wallabag/pull/8136](https://github.com/wallabag/wallabag/pull/8136)
|
|
||||||
|
|
||||||
## [2.6.11](https://github.com/wallabag/wallabag/tree/2.6.11)
|
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.10...2.6.11)
|
|
||||||
|
|
||||||
### Security fix
|
|
||||||
* Protect actions with a CSRF token by @yguedidi in https://github.com/wallabag/wallabag/commit/99c8a06594d6ee7480ce4d041ccff3025b353656
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
* Fix redirection after action in search results by @nicosomb in [https://github.com/wallabag/wallabag/pull/7827](https://github.com/wallabag/wallabag/pull/7827)
|
|
||||||
* Fix title tag filter by @nicosomb in [https://github.com/wallabag/wallabag/pull/7846](https://github.com/wallabag/wallabag/pull/7846)
|
|
||||||
* Change NB_ELEMENTS in pocket importer to 30 by @j0k3r in [https://github.com/wallabag/wallabag/pull/7993](https://github.com/wallabag/wallabag/pull/7993)
|
|
||||||
* Fix entries counter for annotated entries in the menu by @j0k3r in [https://github.com/wallabag/wallabag/pull/7999](https://github.com/wallabag/wallabag/pull/7999)
|
|
||||||
|
|
||||||
### Technical stuff
|
|
||||||
|
|
||||||
* Prepare 2.6.11 release by @yguedidi in [https://github.com/wallabag/wallabag/pull/8133](https://github.com/wallabag/wallabag/pull/8133)
|
|
||||||
|
|
||||||
## [2.6.10](https://github.com/wallabag/wallabag/tree/2.6.10)
|
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.9...2.6.10)
|
|
||||||
|
|
||||||
### Improvement
|
|
||||||
|
|
||||||
* Add Omnivore import by @nicosomb in https://github.com/wallabag/wallabag/pull/7754
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
* Update site config & tests by @j0k3r in https://github.com/wallabag/wallabag/pull/7582 (fixes "Key provided is shorter
|
|
||||||
than 256 bits, only 240 bits provided" https://github.com/wallabag/wallabag/issues/7531)
|
|
||||||
* Update site config by @yguedidi in https://github.com/wallabag/wallabag/pull/7623
|
|
||||||
* Replace gitter with matrix by @nicosomb in https://github.com/wallabag/wallabag/pull/7753
|
|
||||||
|
|
||||||
## [2.6.9](https://github.com/wallabag/wallabag/tree/2.6.9)
|
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.8...2.6.9)
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
* Fix same domain pagination by @yguedidi in https://github.com/wallabag/wallabag/pull/7266
|
|
||||||
* Upgrade PHP dependencies by @yguedidi in https://github.com/wallabag/wallabag/pull/7272
|
|
||||||
* Use a proper "how to" for elCurator by @j0k3r in https://github.com/wallabag/wallabag/pull/7323
|
|
||||||
|
|
||||||
## [2.6.8](https://github.com/wallabag/wallabag/tree/2.6.8)
|
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.7...2.6.8)
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
* Update deps & Node 20 by @j0k3r in https://github.com/wallabag/wallabag/pull/7134
|
|
||||||
* Fix dark mode disabled url 2.6 by @Simounet in https://github.com/wallabag/wallabag/pull/7133
|
|
||||||
* Make database dependent commands lazy by @yguedidi in https://github.com/wallabag/wallabag/pull/7142
|
|
||||||
* Fix docker setup by @yguedidi in https://github.com/wallabag/wallabag/pull/7141
|
|
||||||
* Remove session-based redirection by @yguedidi in https://github.com/wallabag/wallabag/pull/7140
|
|
||||||
|
|
||||||
## [2.6.7](https://github.com/wallabag/wallabag/tree/2.6.7)
|
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.6...2.6.7)
|
|
||||||
|
|
||||||
### Security fix
|
|
||||||
* A user can disable her 2FA unintentionally by @kdecherf in https://github.com/wallabag/wallabag/commit/0cfdddc2eb0aee5ffb69bf499d377d75655ba157
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
* Fix deprecated null tag parameter by @Simounet in https://github.com/wallabag/wallabag/pull/6985
|
|
||||||
* Full clickable card on mass action by @Simounet in https://github.com/wallabag/wallabag/pull/6991
|
|
||||||
* Add tag form submit button always displayed by @Simounet in https://github.com/wallabag/wallabag/pull/6986
|
|
||||||
|
|
||||||
## [2.6.6](https://github.com/wallabag/wallabag/tree/2.6.6)
|
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.5...2.6.6)
|
|
||||||
|
|
||||||
### Security fix
|
|
||||||
* Force secure cookie on HTTPS connection by @j0k3r in https://github.com/wallabag/wallabag/pull/6924
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
* Fix checkboxes pointer events issue by @Simounet in https://github.com/wallabag/wallabag/pull/6897
|
|
||||||
* Add Google mailer by @j0k3r in https://github.com/wallabag/wallabag/pull/6899
|
|
||||||
* Improve performance on homepage by @Simounet in https://github.com/wallabag/wallabag/pull/6909
|
|
||||||
* Mass action layout improved by @Simounet in https://github.com/wallabag/wallabag/pull/6912
|
|
||||||
|
|
||||||
## [2.6.5](https://github.com/wallabag/wallabag/tree/2.6.5)
|
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.4...2.6.5)
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
* "Fix checkboxes pointer-events disabled" by @Simounet https://github.com/wallabag/wallabag/pull/6874
|
|
||||||
* "Fix nav input styles" by @Simounet https://github.com/wallabag/wallabag/pull/6877
|
|
||||||
* "Change domain status filters html types" by @Simounet https://github.com/wallabag/wallabag/pull/6888
|
|
||||||
|
|
||||||
## [2.6.4](https://github.com/wallabag/wallabag/tree/2.6.4)
|
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.3...2.6.4)
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
* Fix API token generation by @nicosomb https://github.com/wallabag/wallabag/pull/6869
|
|
||||||
* Fix checkboxes which were broken by @nicosomb https://github.com/wallabag/wallabag/pull/6864
|
|
||||||
|
|
||||||
## [2.6.3](https://github.com/wallabag/wallabag/tree/2.6.3)
|
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.2...2.6.3)
|
|
||||||
|
|
||||||
### Security fixes
|
|
||||||
* Replace GET way to POST way to reset data user by @nicosomb https://github.com/wallabag/wallabag/commit/78b0b55c40511e1f22d5bbb4897aa10fca68441c
|
|
||||||
* Replace GET way to POST way to delete API client by @nicosomb https://github.com/wallabag/wallabag/commit/ffcc5c9062fcc8cd922d7d6d65edbe5efae96806
|
|
||||||
|
|
||||||
### Improvement
|
|
||||||
* Add confirmation before reload entry by @nicosomb https://github.com/wallabag/wallabag/pull/6778
|
|
||||||
* Remove external dependencies on howto page by @viktoriussuwandi https://github.com/wallabag/wallabag/pull/6775
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
* Use Session instead of Referrer for Redirection by @Spoons https://github.com/wallabag/wallabag/pull/6119
|
|
||||||
* Reduce risk of collision for #content by @kdecherf https://github.com/wallabag/wallabag/pull/6829
|
|
||||||
* Update dependencies to fix vulnerabilities by @nicosomb https://github.com/wallabag/wallabag/pull/6783
|
|
||||||
* Fix failing randomly test by @nicosomb https://github.com/wallabag/wallabag/pull/6763
|
|
||||||
|
|
||||||
### Technical stuff
|
|
||||||
* Add check if git is installed by @nicosomb https://github.com/wallabag/wallabag/pull/6788
|
|
||||||
* Replace kernel.root_dir by kernel.project_dir by @yguedidi https://github.com/wallabag/wallabag/pull/6809
|
|
||||||
* Split symfony/symfony by @yguedidi https://github.com/wallabag/wallabag/pull/6817
|
|
||||||
* Make Crawler::extract get an array by @yguedidi https://github.com/wallabag/wallabag/pull/6812
|
|
||||||
* Use PSR-17 and PSR-18 by @yguedidi https://github.com/wallabag/wallabag/pull/6816
|
|
||||||
* Replace Client by KernelBrowser by @yguedidi https://github.com/wallabag/wallabag/pull/6813
|
|
||||||
* Replace Debug component by ErrorHandler component by @yguedidi https://github.com/wallabag/wallabag/pull/6810
|
|
||||||
* Make ImportController extends AbstractController by @yguedidi https://github.com/wallabag/wallabag/pull/6808
|
|
||||||
* Use Twig instead of templating by @yguedidi https://github.com/wallabag/wallabag/pull/6797
|
|
||||||
* Identify platforms by their class by @yguedidi https://github.com/wallabag/wallabag/pull/6799
|
|
||||||
* Move from transchoice to trans by @yguedidi https://github.com/wallabag/wallabag/pull/6800
|
|
||||||
* Replace GetResponseEvent by RequestEvent by @yguedidi https://github.com/wallabag/wallabag/pull/6811
|
|
||||||
* Ensure the kernel is shut down before calling createClient by @yguedidi https://github.com/wallabag/wallabag/pull/6803
|
|
||||||
* Ignore docker-compose.override.yml by @yguedidi https://github.com/wallabag/wallabag/pull/6814
|
|
||||||
* Add composer normalizer by @nicosomb https://github.com/wallabag/wallabag/pull/6762
|
|
||||||
|
|
||||||
## [2.6.2](https://github.com/wallabag/wallabag/tree/2.6.2)
|
## [2.6.2](https://github.com/wallabag/wallabag/tree/2.6.2)
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.1...2.6.2)
|
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.1...2.6.2)
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# wallabag
|
# wallabag
|
||||||
|
|
||||||

|

|
||||||
[](https://matrix.to/#/#wallabag:matrix.org)
|
[](https://gitter.im/wallabag/wallabag)
|
||||||
[](https://liberapay.com/wallabag/donate)
|
[](https://liberapay.com/wallabag/donate)
|
||||||
[](https://hosted.weblate.org/engage/wallabag/?utm_source=widget)
|
[](https://hosted.weblate.org/engage/wallabag/?utm_source=widget)
|
||||||

|

|
||||||
|
|||||||
@ -62,6 +62,11 @@ class AppKernel extends Kernel
|
|||||||
return $bundles;
|
return $bundles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getRootDir()
|
||||||
|
{
|
||||||
|
return __DIR__;
|
||||||
|
}
|
||||||
|
|
||||||
public function getCacheDir()
|
public function getCacheDir()
|
||||||
{
|
{
|
||||||
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
|
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
|
||||||
@ -74,7 +79,7 @@ class AppKernel extends Kernel
|
|||||||
|
|
||||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||||
{
|
{
|
||||||
$loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml');
|
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
|
||||||
|
|
||||||
$loader->load(function ($container) {
|
$loader->load(function ($container) {
|
||||||
if ($container->getParameter('use_webpack_dev_server')) {
|
if ($container->getParameter('use_webpack_dev_server')) {
|
||||||
|
|||||||
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -17,10 +14,8 @@ class Version20160401000000 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
$this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
|
$this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
|
||||||
|
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
||||||
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
||||||
@ -63,7 +58,7 @@ SQL
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||||
CREATE TABLE {$this->getTable('entry')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
CREATE TABLE {$this->getTable('entry')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||||
@ -96,7 +91,7 @@ SQL
|
|||||||
$this->addSql($query);
|
$this->addSql($query);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
||||||
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -16,7 +15,7 @@ class Version20160812120952 extends WallabagMigration
|
|||||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||||
$this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.');
|
$this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.');
|
||||||
|
|
||||||
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
|
||||||
// Can't use $clientsTable->addColumn('name', 'blob');
|
// Can't use $clientsTable->addColumn('name', 'blob');
|
||||||
// because of the error:
|
// because of the error:
|
||||||
// SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL
|
// SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL
|
||||||
@ -36,7 +35,7 @@ class Version20160812120952 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||||
|
|
||||||
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
|
||||||
$databaseTablePrefix = $this->container->getParameter('database_table_prefix');
|
$databaseTablePrefix = $this->container->getParameter('database_table_prefix');
|
||||||
$this->addSql('DROP INDEX IDX_635D765EA76ED395');
|
$this->addSql('DROP INDEX IDX_635D765EA76ED395');
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients');
|
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients');
|
||||||
|
|||||||
@ -3,9 +3,6 @@
|
|||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -16,13 +13,11 @@ class Version20161001072726 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||||
|
|
||||||
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
|
||||||
|
|
||||||
// remove all FK from entry_tag
|
// remove all FK from entry_tag
|
||||||
switch (true) {
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$query = $this->connection->query("
|
$query = $this->connection->query("
|
||||||
SELECT CONSTRAINT_NAME
|
SELECT CONSTRAINT_NAME
|
||||||
FROM information_schema.key_column_usage
|
FROM information_schema.key_column_usage
|
||||||
@ -34,7 +29,7 @@ class Version20161001072726 extends WallabagMigration
|
|||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry_tag') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry_tag') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
||||||
$query = $this->connection->query("
|
$query = $this->connection->query("
|
||||||
SELECT conrelid::regclass AS table_from
|
SELECT conrelid::regclass AS table_from
|
||||||
@ -58,8 +53,8 @@ class Version20161001072726 extends WallabagMigration
|
|||||||
|
|
||||||
// remove entry FK from annotation
|
// remove entry FK from annotation
|
||||||
|
|
||||||
switch (true) {
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$query = $this->connection->query("
|
$query = $this->connection->query("
|
||||||
SELECT CONSTRAINT_NAME
|
SELECT CONSTRAINT_NAME
|
||||||
FROM information_schema.key_column_usage
|
FROM information_schema.key_column_usage
|
||||||
@ -73,7 +68,7 @@ class Version20161001072726 extends WallabagMigration
|
|||||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
||||||
$query = $this->connection->query("
|
$query = $this->connection->query("
|
||||||
SELECT conrelid::regclass AS table_from
|
SELECT conrelid::regclass AS table_from
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ class Version20161022134138 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||||
|
|
||||||
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;');
|
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;');
|
||||||
|
|
||||||
@ -41,7 +40,7 @@ class Version20161022134138 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||||
|
|
||||||
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;');
|
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;');
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -38,7 +37,7 @@ class Version20161024212538 extends WallabagMigration
|
|||||||
|
|
||||||
$clientsTable->dropColumn('user_id', 'integer');
|
$clientsTable->dropColumn('user_id', 'integer');
|
||||||
|
|
||||||
if (!$this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
if ('sqlite' !== $this->connection->getDatabasePlatform()->getName()) {
|
||||||
$clientsTable->removeForeignKey($this->constraintName);
|
$clientsTable->removeForeignKey($this->constraintName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -19,20 +16,18 @@ class Version20161214094402 extends WallabagMigration
|
|||||||
|
|
||||||
$this->skipIf($entryTable->hasColumn('uid'), 'It seems that you already played this migration.');
|
$this->skipIf($entryTable->hasColumn('uid'), 'It seems that you already played this migration.');
|
||||||
|
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM ' . $this->getTable('entry'));
|
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM ' . $this->getTable('entry'));
|
||||||
$this->addSql('DROP TABLE ' . $this->getTable('entry'));
|
$this->addSql('DROP TABLE ' . $this->getTable('entry'));
|
||||||
$this->addSql('CREATE TABLE ' . $this->getTable('entry') . ' (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB DEFAULT NULL COLLATE BINARY, title CLOB DEFAULT NULL COLLATE BINARY, url CLOB DEFAULT NULL COLLATE BINARY, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL COLLATE BINARY, language CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL COLLATE BINARY, preview_picture CLOB DEFAULT NULL COLLATE BINARY, is_public BOOLEAN DEFAULT "0", PRIMARY KEY(id));');
|
$this->addSql('CREATE TABLE ' . $this->getTable('entry') . ' (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB DEFAULT NULL COLLATE BINARY, title CLOB DEFAULT NULL COLLATE BINARY, url CLOB DEFAULT NULL COLLATE BINARY, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL COLLATE BINARY, language CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL COLLATE BINARY, preview_picture CLOB DEFAULT NULL COLLATE BINARY, is_public BOOLEAN DEFAULT "0", PRIMARY KEY(id));');
|
||||||
$this->addSql('INSERT INTO ' . $this->getTable('entry') . ' (id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public) SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM __temp__wallabag_entry;');
|
$this->addSql('INSERT INTO ' . $this->getTable('entry') . ' (id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public) SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM __temp__wallabag_entry;');
|
||||||
$this->addSql('DROP TABLE __temp__wallabag_entry');
|
$this->addSql('DROP TABLE __temp__wallabag_entry');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uuid uid VARCHAR(23)');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uuid uid VARCHAR(23)');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uuid TO uid');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uuid TO uid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -43,16 +38,14 @@ class Version20161214094402 extends WallabagMigration
|
|||||||
|
|
||||||
$this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.');
|
$this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.');
|
||||||
|
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
throw new SkipMigrationException('Too complex ...');
|
throw new SkipMigrationException('Too complex ...');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uid uuid VARCHAR(23)');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uid uuid VARCHAR(23)');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -26,7 +25,7 @@ class Version20170501115751 extends WallabagMigration
|
|||||||
$table->setPrimaryKey(['id']);
|
$table->setPrimaryKey(['id']);
|
||||||
$table->addForeignKeyConstraint($this->getTable('user'), ['user_id'], ['id'], [], 'fk_user');
|
$table->addForeignKeyConstraint($this->getTable('user'), ['user_id'], ['id'], [], 'fk_user');
|
||||||
|
|
||||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||||
$schema->dropSequence('site_credential_id_seq');
|
$schema->dropSequence('site_credential_id_seq');
|
||||||
$schema->createSequence('site_credential_id_seq');
|
$schema->createSequence('site_credential_id_seq');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -20,7 +19,7 @@ class Version20170510082609 extends WallabagMigration
|
|||||||
|
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||||
|
|
||||||
foreach ($this->fields as $field) {
|
foreach ($this->fields as $field) {
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(180) NOT NULL;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(180) NOT NULL;');
|
||||||
@ -29,7 +28,7 @@ class Version20170510082609 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||||
|
|
||||||
foreach ($this->fields as $field) {
|
foreach ($this->fields as $field) {
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;');
|
||||||
|
|||||||
@ -3,9 +3,6 @@
|
|||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -16,10 +13,8 @@ class Version20170511211659 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$annotationTableName = $this->getTable('annotation', true);
|
$annotationTableName = $this->getTable('annotation', true);
|
||||||
$userTableName = $this->getTable('user', true);
|
$userTableName = $this->getTable('user', true);
|
||||||
$entryTableName = $this->getTable('entry', true);
|
$entryTableName = $this->getTable('entry', true);
|
||||||
@ -58,10 +53,10 @@ EOD
|
|||||||
);
|
);
|
||||||
$this->addSql('DROP TABLE __temp__wallabag_annotation');
|
$this->addSql('DROP TABLE __temp__wallabag_annotation');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' MODIFY quote TEXT NOT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' MODIFY quote TEXT NOT NULL');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' ALTER COLUMN quote TYPE TEXT');
|
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' ALTER COLUMN quote TYPE TEXT');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -71,16 +66,14 @@ EOD
|
|||||||
{
|
{
|
||||||
$tableName = $this->getTable('annotation');
|
$tableName = $this->getTable('annotation');
|
||||||
|
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
throw new SkipMigrationException('Too complex ...');
|
throw new SkipMigrationException('Too complex ...');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $tableName . ' MODIFY quote VARCHAR(255) NOT NULL');
|
$this->addSql('ALTER TABLE ' . $tableName . ' MODIFY quote VARCHAR(255) NOT NULL');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $tableName . ' ALTER COLUMN quote TYPE VARCHAR(255)');
|
$this->addSql('ALTER TABLE ' . $tableName . ' ALTER COLUMN quote TYPE VARCHAR(255)');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ class Version20170719231144 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf($this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||||
|
|
||||||
// Find tags which need to be merged
|
// Find tags which need to be merged
|
||||||
$dupTags = $this->connection->query('
|
$dupTags = $this->connection->query('
|
||||||
|
|||||||
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -15,16 +12,14 @@ class Version20171008195606 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||||
|
|
||||||
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'mysql':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof MySQLPlatform:
|
|
||||||
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time SET NOT NULL;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time SET NOT NULL;');
|
||||||
break;
|
break;
|
||||||
@ -33,15 +28,13 @@ class Version20171008195606 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||||
|
|
||||||
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'mysql':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof MySQLPlatform:
|
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11);');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11);');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time DROP NOT NULL;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time DROP NOT NULL;');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ class Version20181128203230 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration can only be applied on \'mysql\'.');
|
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(191) NOT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(191) NOT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(191)');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(191)');
|
||||||
@ -28,7 +27,7 @@ class Version20181128203230 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration can only be applied on \'mysql\'.');
|
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(255) NOT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(255) NOT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(255)');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(255)');
|
||||||
|
|||||||
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -15,10 +12,8 @@ final class Version20181202073750 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
||||||
@ -33,13 +28,13 @@ final class Version20181202073750 extends WallabagMigration
|
|||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $this->getTable('user', true) . ' (email_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $this->getTable('user', true) . ' (email_canonical)');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $this->getTable('user', true) . ' (username_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $this->getTable('user', true) . ' (username_canonical)');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD backupCodes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD backupCodes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN twofactorauthentication TO emailTwoFactor');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN twofactorauthentication TO emailTwoFactor');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
||||||
@ -50,10 +45,8 @@ final class Version20181202073750 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
||||||
@ -66,13 +59,13 @@ final class Version20181202073750 extends WallabagMigration
|
|||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "' . $this->getTable('user', true) . '" (email_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "' . $this->getTable('user', true) . '" (email_canonical)');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "' . $this->getTable('user', true) . '" (confirmation_token)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "' . $this->getTable('user', true) . '" (confirmation_token)');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret');
|
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret');
|
||||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL');
|
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL');
|
||||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` ADD trusted TEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` ADD trusted TEXT DEFAULT NULL');
|
||||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP backupCodes');
|
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP backupCodes');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP googleAuthenticatorSecret');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP googleAuthenticatorSecret');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN emailTwoFactor TO twofactorauthentication');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN emailTwoFactor TO twofactorauthentication');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD trusted TEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD trusted TEXT DEFAULT NULL');
|
||||||
|
|||||||
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -15,10 +12,8 @@ final class Version20190425115043 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM ' . $this->getTable('config', true));
|
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM ' . $this->getTable('config', true));
|
||||||
$this->addSql('DROP TABLE ' . $this->getTable('config', true));
|
$this->addSql('DROP TABLE ' . $this->getTable('config', true));
|
||||||
@ -27,11 +22,11 @@ final class Version20190425115043 extends WallabagMigration
|
|||||||
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON ' . $this->getTable('config', true) . ' (user_id)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON ' . $this->getTable('config', true) . ' (user_id)');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_token feed_token VARCHAR(255) DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_token feed_token VARCHAR(255) DEFAULT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_limit feed_limit INT DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_limit feed_limit INT DEFAULT NULL');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_token TO feed_token');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_token TO feed_token');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_limit TO feed_limit');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_limit TO feed_limit');
|
||||||
break;
|
break;
|
||||||
@ -40,10 +35,8 @@ final class Version20190425115043 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, feed_token, feed_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM "' . $this->getTable('config', true) . '"');
|
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, feed_token, feed_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM "' . $this->getTable('config', true) . '"');
|
||||||
$this->addSql('DROP TABLE "' . $this->getTable('config', true) . '"');
|
$this->addSql('DROP TABLE "' . $this->getTable('config', true) . '"');
|
||||||
@ -52,11 +45,11 @@ final class Version20190425115043 extends WallabagMigration
|
|||||||
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "' . $this->getTable('config', true) . '" (user_id)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "' . $this->getTable('config', true) . '" (user_id)');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_token rss_token');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_token rss_token');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_limit rss_limit');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_limit rss_limit');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_token TO rss_token');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_token TO rss_token');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_limit TO rss_limit');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_limit TO rss_limit');
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -3,9 +3,6 @@
|
|||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -20,10 +17,8 @@ final class Version20190510141130 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('DROP INDEX IDX_368A4209A76ED395');
|
$this->addSql('DROP INDEX IDX_368A4209A76ED395');
|
||||||
$this->addSql('DROP INDEX IDX_368A420919EB6921');
|
$this->addSql('DROP INDEX IDX_368A420919EB6921');
|
||||||
$this->addSql('DROP INDEX UNIQ_368A42095F37A13B');
|
$this->addSql('DROP INDEX UNIQ_368A42095F37A13B');
|
||||||
@ -65,7 +60,7 @@ final class Version20190510141130 extends WallabagMigration
|
|||||||
$this->addSql('CREATE INDEX IDX_EE52E3FAA76ED395 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (user_id)');
|
$this->addSql('CREATE INDEX IDX_EE52E3FAA76ED395 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (user_id)');
|
||||||
$this->addSql('CREATE INDEX IDX_EE52E3FA19EB6921 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (client_id)');
|
$this->addSql('CREATE INDEX IDX_EE52E3FA19EB6921 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (client_id)');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP FOREIGN KEY FK_368A4209A76ED395');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP FOREIGN KEY FK_368A4209A76ED395');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
||||||
|
|
||||||
@ -80,7 +75,7 @@ final class Version20190510141130 extends WallabagMigration
|
|||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' DROP FOREIGN KEY FK_EE52E3FAA76ED395');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' DROP FOREIGN KEY FK_EE52E3FAA76ED395');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP CONSTRAINT FK_368A4209A76ED395');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP CONSTRAINT FK_368A4209A76ED395');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -15,7 +14,7 @@ final class Version20190511165128 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
||||||
@ -23,7 +22,7 @@ final class Version20190511165128 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -15,7 +14,7 @@ final class Version20190619093534 extends WallabagMigration
|
|||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'sqlite\'.');
|
$this->skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.');
|
||||||
|
|
||||||
$this->addSql('UPDATE ' . $this->getTable('entry', true) . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
$this->addSql('UPDATE ' . $this->getTable('entry', true) . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||||
|
|
||||||
@ -43,7 +42,7 @@ final class Version20190619093534 extends WallabagMigration
|
|||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'sqlite\'.');
|
$this->skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.');
|
||||||
|
|
||||||
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
||||||
$this->addSql('DROP INDEX created_at');
|
$this->addSql('DROP INDEX created_at');
|
||||||
|
|||||||
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -21,10 +18,8 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('DROP INDEX uid');
|
$this->addSql('DROP INDEX uid');
|
||||||
$this->addSql('DROP INDEX created_at');
|
$this->addSql('DROP INDEX created_at');
|
||||||
$this->addSql('DROP INDEX hashed_url_user_id');
|
$this->addSql('DROP INDEX hashed_url_user_id');
|
||||||
@ -49,7 +44,7 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag', true) . ' (label)');
|
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag', true) . ' (label)');
|
||||||
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config', true) . ' (feed_token)');
|
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config', true) . ' (feed_token)');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL');
|
||||||
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
||||||
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
||||||
@ -58,7 +53,7 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag') . ' (label (255))');
|
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag') . ' (label (255))');
|
||||||
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config') . ' (feed_token (255))');
|
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config') . ' (feed_token (255))');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)');
|
||||||
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
||||||
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
||||||
@ -72,10 +67,8 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
||||||
$this->addSql('DROP INDEX created_at');
|
$this->addSql('DROP INDEX created_at');
|
||||||
$this->addSql('DROP INDEX uid');
|
$this->addSql('DROP INDEX uid');
|
||||||
@ -100,7 +93,7 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
$this->addSql('CREATE INDEX hashed_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_url)');
|
$this->addSql('CREATE INDEX hashed_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_url)');
|
||||||
$this->addSql('CREATE INDEX hashed_given_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_given_url)');
|
$this->addSql('CREATE INDEX hashed_given_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_given_url)');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL');
|
||||||
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
||||||
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
||||||
@ -109,7 +102,7 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
$this->addSql('DROP INDEX tag_label ON ' . $this->getTable('tag'));
|
$this->addSql('DROP INDEX tag_label ON ' . $this->getTable('tag'));
|
||||||
$this->addSql('DROP INDEX config_feed_token ON ' . $this->getTable('config'));
|
$this->addSql('DROP INDEX config_feed_token ON ' . $this->getTable('config'));
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT');
|
||||||
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
||||||
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
||||||
|
|||||||
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -15,16 +12,14 @@ final class Version20190808124957 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting', true) . ' RENAME TO ' . $this->getTable('internal_setting', true));
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting', true) . ' RENAME TO ' . $this->getTable('internal_setting', true));
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME ' . $this->getTable('internal_setting'));
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME ' . $this->getTable('internal_setting'));
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME TO ' . $this->getTable('internal_setting'));
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME TO ' . $this->getTable('internal_setting'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -32,16 +27,14 @@ final class Version20190808124957 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting', true) . ' RENAME TO ' . $this->getTable('craue_config_setting', true));
|
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting', true) . ' RENAME TO ' . $this->getTable('craue_config_setting', true));
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME ' . $this->getTable('craue_config_setting'));
|
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME ' . $this->getTable('craue_config_setting'));
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME TO ' . $this->getTable('craue_config_setting'));
|
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME TO ' . $this->getTable('craue_config_setting'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -24,7 +23,7 @@ final class Version20190826204730 extends WallabagMigration
|
|||||||
$userTable->setPrimaryKey(['id']);
|
$userTable->setPrimaryKey(['id']);
|
||||||
$userTable->addForeignKeyConstraint($this->getTable('config'), ['config_id'], ['id'], [], 'fk_config');
|
$userTable->addForeignKeyConstraint($this->getTable('config'), ['config_id'], ['id'], [], 'fk_config');
|
||||||
|
|
||||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||||
$schema->dropSequence('ignore_origin_user_rule_id_seq');
|
$schema->dropSequence('ignore_origin_user_rule_id_seq');
|
||||||
$schema->createSequence('ignore_origin_user_rule_id_seq');
|
$schema->createSequence('ignore_origin_user_rule_id_seq');
|
||||||
}
|
}
|
||||||
@ -36,7 +35,7 @@ final class Version20190826204730 extends WallabagMigration
|
|||||||
$instanceTable->addColumn('rule', 'string', ['length' => 255]);
|
$instanceTable->addColumn('rule', 'string', ['length' => 255]);
|
||||||
$instanceTable->setPrimaryKey(['id']);
|
$instanceTable->setPrimaryKey(['id']);
|
||||||
|
|
||||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||||
$schema->dropSequence('ignore_origin_instance_rule_id_seq');
|
$schema->dropSequence('ignore_origin_instance_rule_id_seq');
|
||||||
$schema->createSequence('ignore_origin_instance_rule_id_seq');
|
$schema->createSequence('ignore_origin_instance_rule_id_seq');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -16,10 +13,8 @@ final class Version20221221092957 extends WallabagMigration
|
|||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$userTable = $this->getTable('user');
|
$userTable = $this->getTable('user');
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM ' . $userTable);
|
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM ' . $userTable);
|
||||||
$this->addSql('DROP TABLE ' . $userTable);
|
$this->addSql('DROP TABLE ' . $userTable);
|
||||||
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
||||||
@ -31,10 +26,10 @@ final class Version20221221092957 extends WallabagMigration
|
|||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupcodes TYPE JSON USING backupcodes::json');
|
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupcodes TYPE JSON USING backupcodes::json');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -43,10 +38,8 @@ final class Version20221221092957 extends WallabagMigration
|
|||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$userTable = $this->getTable('user');
|
$userTable = $this->getTable('user');
|
||||||
$platform = $this->connection->getDatabasePlatform();
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
|
case 'sqlite':
|
||||||
switch (true) {
|
|
||||||
case $platform instanceof SqlitePlatform:
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM ' . $userTable);
|
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM ' . $userTable);
|
||||||
$this->addSql('DROP TABLE ' . $userTable);
|
$this->addSql('DROP TABLE ' . $userTable);
|
||||||
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
||||||
@ -58,10 +51,10 @@ final class Version20221221092957 extends WallabagMigration
|
|||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof MySQLPlatform:
|
case 'mysql':
|
||||||
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
||||||
break;
|
break;
|
||||||
case $platform instanceof PostgreSQLPlatform:
|
case 'postgresql':
|
||||||
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupCodes TYPE TEXT');
|
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupCodes TYPE TEXT');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -235,12 +235,6 @@
|
|||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tags-add-form {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 640px) {
|
@media only screen and (max-width: 640px) {
|
||||||
.entry-info {
|
.entry-info {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
@ -264,12 +258,4 @@
|
|||||||
#article .entry-info .chip-action {
|
#article .entry-info .chip-action {
|
||||||
min-width: 40px;
|
min-width: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tags-add-form {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tags-add-form-submit {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
========================================================================== */
|
========================================================================== */
|
||||||
|
|
||||||
main {
|
main {
|
||||||
div#content {
|
#content {
|
||||||
padding: 0 0.5rem;
|
padding: 0 0.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -177,7 +177,6 @@ a.original:not(.waves-effect) {
|
|||||||
.card-entry-tags a,
|
.card-entry-tags a,
|
||||||
.card-entry-labels a,
|
.card-entry-labels a,
|
||||||
.card-tag-labels a,
|
.card-tag-labels a,
|
||||||
.card-tag-labels button,
|
|
||||||
.card-entry-labels-hidden a,
|
.card-entry-labels-hidden a,
|
||||||
#list .chip a {
|
#list .chip a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|||||||
@ -62,9 +62,7 @@
|
|||||||
.nav-panels .input-field input:focus,
|
.nav-panels .input-field input:focus,
|
||||||
.results-item,
|
.results-item,
|
||||||
.side-nav li > a,
|
.side-nav li > a,
|
||||||
.side-nav li > a > i.material-icons,
|
.side-nav li > a > i.material-icons {
|
||||||
.side-nav li button,
|
|
||||||
.side-nav li button > i.material-icons {
|
|
||||||
color: #dfdfdf;
|
color: #dfdfdf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,9 +85,7 @@
|
|||||||
background-color: #2f2f2f;
|
background-color: #2f2f2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mass-action-tags .mass-action-tags-input.mass-action-tags-input,
|
|
||||||
.side-nav li:not(.logo) > a:hover,
|
.side-nav li:not(.logo) > a:hover,
|
||||||
.side-nav li:not(.logo) button:hover,
|
|
||||||
.side-nav .collapsible-header:hover,
|
.side-nav .collapsible-header:hover,
|
||||||
.side-nav.fixed .collapsible-header:hover {
|
.side-nav.fixed .collapsible-header:hover {
|
||||||
background-color: #1d1d1d;
|
background-color: #1d1d1d;
|
||||||
@ -135,10 +131,6 @@
|
|||||||
color: #abb2bf;
|
color: #abb2bf;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="url"]:not(.browser-default):disabled {
|
|
||||||
color: #9e9e9e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-field.nav-panel-add.disabled,
|
.input-field.nav-panel-add.disabled,
|
||||||
.input-field.nav-panel-add.disabled input {
|
.input-field.nav-panel-add.disabled input {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
|||||||
@ -14,53 +14,44 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mass-action {
|
.mass-action {
|
||||||
margin: 20px 5px 10px 20px;
|
margin: 10px 5px 10px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mass-action-group {
|
.mass-action-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
align-items: center;
|
gap: 10px;
|
||||||
gap: 30px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mass-action-button {
|
.mass-action-button {
|
||||||
height: 36px;
|
height: 24px;
|
||||||
line-height: 36px;
|
line-height: 24px;
|
||||||
padding: 0 0.7rem;
|
padding: 0 0.5rem;
|
||||||
|
|
||||||
i {
|
i {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mass-action-button--tags {
|
.entry-checkbox {
|
||||||
border-radius: 2px 0 0 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-stacked .entry-checkbox {
|
|
||||||
margin: 10px 15px 10px 5px;
|
margin: 10px 15px 10px 5px;
|
||||||
}
|
|
||||||
|
|
||||||
.card .entry-checkbox {
|
.card & {
|
||||||
position: absolute;
|
float: right;
|
||||||
display: flex;
|
margin-right: 0;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
inset: 0;
|
}
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: start;
|
|
||||||
background-color: rgb(0 172 193 / 20%);
|
|
||||||
cursor: pointer;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.entries .entry-checkbox-input,
|
.entries .entry-checkbox-input,
|
||||||
.mass-action .entry-checkbox-input {
|
.mass-action .entry-checkbox-input {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
left: 0;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
min-height: 25px;
|
min-height: 25px;
|
||||||
|
height: 100%;
|
||||||
|
vertical-align: middle;
|
||||||
opacity: initial;
|
opacity: initial;
|
||||||
cursor: pointer;
|
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,19 +64,11 @@
|
|||||||
|
|
||||||
.mass-action-tags {
|
.mass-action-tags {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 10px;
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
|
||||||
.mass-action-tags-input.mass-action-tags-input {
|
.mass-action-tags-input {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0 5px;
|
|
||||||
height: 34px;
|
|
||||||
background: white;
|
|
||||||
border-bottom: 3px solid #c5ebef;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mass-action-tags-input.mass-action-tags-input.mass-action-tags-input:focus {
|
|
||||||
border-bottom: 3px solid $blue-accent-color;
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,16 +88,13 @@
|
|||||||
|
|
||||||
.results {
|
.results {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: 10px;
|
|
||||||
padding: 1rem 1rem 0;
|
padding: 1rem 1rem 0;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
|
||||||
|
|
||||||
.nb-results {
|
.nb-results {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
margin-bottom: 20px;
|
}
|
||||||
gap: 30px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.results-item {
|
.results-item {
|
||||||
@ -193,38 +173,9 @@ footer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 993px) {
|
@media screen and (min-width: 993px) {
|
||||||
.results {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nb-results {
|
|
||||||
margin-bottom: 0;
|
|
||||||
gap: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mass-action-button {
|
|
||||||
height: 24px;
|
|
||||||
line-height: 24px;
|
|
||||||
padding: 0 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mass-action-group {
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mass-action-tags {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-left: 7px;
|
|
||||||
flex-wrap: initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mass-action {
|
.mass-action {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 10px;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
gap: 30px;
|
||||||
.mass-action-tags-input.mass-action-tags-input {
|
|
||||||
height: 21px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 993px) {
|
@media screen and (min-width: 993px) {
|
||||||
.entry main div#content {
|
.entry #content {
|
||||||
padding-left: 70px;
|
padding-left: 70px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,32 +6,11 @@ nav {
|
|||||||
line-height: initial;
|
line-height: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
// adapted from anchor styles from node_modules/materialize-css/sass/components/_navbar.scss
|
|
||||||
nav ul button {
|
|
||||||
transition: background-color .3s;
|
|
||||||
font-size: 1rem;
|
|
||||||
color: #fff;
|
|
||||||
display: block;
|
|
||||||
padding: 0 15px;
|
|
||||||
cursor: pointer;
|
|
||||||
background: none;
|
|
||||||
border: 0;
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: rgba(0 0 0 / 10%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nav {
|
nav {
|
||||||
input {
|
input {
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul button:hover,
|
|
||||||
ul a:hover {
|
ul a:hover {
|
||||||
background-color: initial;
|
background-color: initial;
|
||||||
}
|
}
|
||||||
@ -55,7 +34,6 @@ nav {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
button,
|
|
||||||
a {
|
a {
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
}
|
}
|
||||||
@ -92,7 +70,6 @@ nav {
|
|||||||
|
|
||||||
.input-field input {
|
.input-field input {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 1.2rem;
|
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
height: 3rem;
|
height: 3rem;
|
||||||
}
|
}
|
||||||
@ -102,17 +79,6 @@ nav {
|
|||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
color: #444;
|
color: #444;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* materializecss override */
|
|
||||||
.input-field.input-field input {
|
|
||||||
margin-bottom: 0;
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-field.input-field input:focus {
|
|
||||||
border-bottom: none;
|
|
||||||
box-shadow: initial;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-panel-top {
|
.nav-panel-top {
|
||||||
|
|||||||
@ -12,7 +12,6 @@
|
|||||||
background: initial;
|
background: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
& button > i.material-icons.theme-toggle-icon,
|
|
||||||
& > a > i.material-icons.theme-toggle-icon {
|
& > a > i.material-icons.theme-toggle-icon {
|
||||||
float: none;
|
float: none;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
@ -23,7 +22,6 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.fixed button,
|
|
||||||
&.fixed a {
|
&.fixed a {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 44px;
|
line-height: 44px;
|
||||||
@ -43,35 +41,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// adapted from anchor styles from node_modules/materialize-css/sass/components/_sideNav.scss
|
.bold > a {
|
||||||
.side-nav li button {
|
|
||||||
color: rgba(0 0 0 / 87%);
|
|
||||||
display: block;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
height: 48px;
|
|
||||||
line-height: 48px;
|
|
||||||
padding: 0 (16px * 2);
|
|
||||||
width: 100%;
|
|
||||||
text-align: left;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: rgba(0 0 0 / 5%);
|
|
||||||
}
|
|
||||||
|
|
||||||
& > i,
|
|
||||||
& > i.material-icons {
|
|
||||||
float: left;
|
|
||||||
height: 48px;
|
|
||||||
line-height: 48px;
|
|
||||||
margin: 0 (16px * 2) 0 0;
|
|
||||||
width: 24px;
|
|
||||||
color: rgba(0 0 0 / 54%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.bold > a,
|
|
||||||
.bold > button {
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,13 +15,6 @@ div.settings div.file-field {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* override materializecss pointer-event disabled on checkboxes */
|
|
||||||
[type="checkbox"]:not(:checked),
|
|
||||||
[type="checkbox"]:checked,
|
|
||||||
.input-field label {
|
|
||||||
pointer-events: initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-field label.active {
|
.input-field label.active {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
@ -38,18 +31,3 @@ nav .input-field input {
|
|||||||
.tab {
|
.tab {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-link {
|
|
||||||
background: none;
|
|
||||||
border: 0;
|
|
||||||
padding: 0;
|
|
||||||
color: $blue-accent-color;
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.inline-block {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -228,10 +228,10 @@ $(document).ready(() => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$('input[name="tags"][form="form_mass_action"]').on('keydown', (e) => {
|
$('form[name="form_mass_action"] input[name="tags"]').on('keydown', (e) => {
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$('button[name="tag"][form="form_mass_action"]').trigger('click');
|
$('form[name="form_mass_action"] button[name="tag"]').trigger('click');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -10,17 +10,17 @@ $(document).ready(() => {
|
|||||||
|
|
||||||
/* mark as favorite */
|
/* mark as favorite */
|
||||||
Mousetrap.bind('f', () => {
|
Mousetrap.bind('f', () => {
|
||||||
$('ul.side-nav button.favorite i')[0].click();
|
$('ul.side-nav a.favorite i')[0].click();
|
||||||
});
|
});
|
||||||
|
|
||||||
/* mark as read */
|
/* mark as read */
|
||||||
Mousetrap.bind('a', () => {
|
Mousetrap.bind('a', () => {
|
||||||
$('ul.side-nav button.markasread i')[0].click();
|
$('ul.side-nav a.markasread i')[0].click();
|
||||||
});
|
});
|
||||||
|
|
||||||
/* delete */
|
/* delete */
|
||||||
Mousetrap.bind('del', () => {
|
Mousetrap.bind('del', () => {
|
||||||
$('ul.side-nav button.delete i')[0].click();
|
$('ul.side-nav a.delete i')[0].click();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -23,14 +23,14 @@ framework:
|
|||||||
csrf_protection: ~
|
csrf_protection: ~
|
||||||
validation:
|
validation:
|
||||||
enable_annotations: true
|
enable_annotations: true
|
||||||
|
templating:
|
||||||
|
engines: ['twig']
|
||||||
default_locale: "%locale%"
|
default_locale: "%locale%"
|
||||||
trusted_hosts: ~
|
trusted_hosts: ~
|
||||||
session:
|
session:
|
||||||
# handler_id set to null will use default session handler from php.ini
|
# handler_id set to null will use default session handler from php.ini
|
||||||
handler_id: session.handler.native_file
|
handler_id: session.handler.native_file
|
||||||
save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%"
|
save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%"
|
||||||
cookie_secure: auto
|
|
||||||
cookie_samesite: lax
|
|
||||||
fragments: ~
|
fragments: ~
|
||||||
http_method_override: true
|
http_method_override: true
|
||||||
assets: ~
|
assets: ~
|
||||||
@ -43,6 +43,7 @@ twig:
|
|||||||
strict_variables: "%kernel.debug%"
|
strict_variables: "%kernel.debug%"
|
||||||
form_themes:
|
form_themes:
|
||||||
- "@LexikFormFilter/Form/form_div_layout.html.twig"
|
- "@LexikFormFilter/Form/form_div_layout.html.twig"
|
||||||
|
exception_controller: Wallabag\CoreBundle\Controller\ExceptionController:showAction
|
||||||
globals:
|
globals:
|
||||||
registration_enabled: '%fosuser_registration%'
|
registration_enabled: '%fosuser_registration%'
|
||||||
|
|
||||||
@ -268,11 +269,6 @@ old_sound_rabbit_mq:
|
|||||||
exchange_options:
|
exchange_options:
|
||||||
name: 'wallabag.import.elcurator'
|
name: 'wallabag.import.elcurator'
|
||||||
type: topic
|
type: topic
|
||||||
import_omnivore:
|
|
||||||
connection: default
|
|
||||||
exchange_options:
|
|
||||||
name: 'wallabag.import.omnivore'
|
|
||||||
type: topic
|
|
||||||
import_firefox:
|
import_firefox:
|
||||||
connection: default
|
connection: default
|
||||||
exchange_options:
|
exchange_options:
|
||||||
@ -283,21 +279,6 @@ old_sound_rabbit_mq:
|
|||||||
exchange_options:
|
exchange_options:
|
||||||
name: 'wallabag.import.chrome'
|
name: 'wallabag.import.chrome'
|
||||||
type: topic
|
type: topic
|
||||||
import_shaarli:
|
|
||||||
connection: default
|
|
||||||
exchange_options:
|
|
||||||
name: 'wallabag.import.shaarli'
|
|
||||||
type: topic
|
|
||||||
import_pocket_html:
|
|
||||||
connection: default
|
|
||||||
exchange_options:
|
|
||||||
name: 'wallabag.import.pocket_html'
|
|
||||||
type: topic
|
|
||||||
import_pocket_csv:
|
|
||||||
connection: default
|
|
||||||
exchange_options:
|
|
||||||
name: 'wallabag.import.pocket_csv'
|
|
||||||
type: topic
|
|
||||||
consumers:
|
consumers:
|
||||||
import_pocket:
|
import_pocket:
|
||||||
connection: default
|
connection: default
|
||||||
@ -371,15 +352,6 @@ old_sound_rabbit_mq:
|
|||||||
name: 'wallabag.import.elcurator'
|
name: 'wallabag.import.elcurator'
|
||||||
callback: wallabag_import.consumer.amqp.elcurator
|
callback: wallabag_import.consumer.amqp.elcurator
|
||||||
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
||||||
import_omnivore:
|
|
||||||
connection: default
|
|
||||||
exchange_options:
|
|
||||||
name: 'wallabag.import.omnivore'
|
|
||||||
type: topic
|
|
||||||
queue_options:
|
|
||||||
name: 'wallabag.import.omnivore'
|
|
||||||
callback: wallabag_import.consumer.amqp.omnivore
|
|
||||||
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
|
||||||
import_firefox:
|
import_firefox:
|
||||||
connection: default
|
connection: default
|
||||||
exchange_options:
|
exchange_options:
|
||||||
@ -398,33 +370,6 @@ old_sound_rabbit_mq:
|
|||||||
name: 'wallabag.import.chrome'
|
name: 'wallabag.import.chrome'
|
||||||
callback: wallabag_import.consumer.amqp.chrome
|
callback: wallabag_import.consumer.amqp.chrome
|
||||||
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
||||||
import_shaarli:
|
|
||||||
connection: default
|
|
||||||
exchange_options:
|
|
||||||
name: 'wallabag.import.shaarli'
|
|
||||||
type: topic
|
|
||||||
queue_options:
|
|
||||||
name: 'wallabag.import.shaarli'
|
|
||||||
callback: wallabag_import.consumer.amqp.shaarli
|
|
||||||
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
|
||||||
import_pocket_html:
|
|
||||||
connection: default
|
|
||||||
exchange_options:
|
|
||||||
name: 'wallabag.import.pocket_html'
|
|
||||||
type: topic
|
|
||||||
queue_options:
|
|
||||||
name: 'wallabag.import.pocket_html'
|
|
||||||
callback: wallabag_import.consumer.amqp.pocket_html
|
|
||||||
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
|
||||||
import_pocket_csv:
|
|
||||||
connection: default
|
|
||||||
exchange_options:
|
|
||||||
name: 'wallabag.import.pocket_csv'
|
|
||||||
type: topic
|
|
||||||
queue_options:
|
|
||||||
name: 'wallabag.import.pocket_csv'
|
|
||||||
callback: wallabag_import.consumer.amqp.pocket_csv
|
|
||||||
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
|
||||||
|
|
||||||
fos_js_routing:
|
fos_js_routing:
|
||||||
routes_to_expose:
|
routes_to_expose:
|
||||||
|
|||||||
@ -12,7 +12,7 @@ services:
|
|||||||
autoconfigure: true
|
autoconfigure: true
|
||||||
public: true
|
public: true
|
||||||
bind:
|
bind:
|
||||||
$projectDir: '%kernel.project_dir%'
|
$rootDir: '%kernel.root_dir%'
|
||||||
$debug: '%kernel.debug%'
|
$debug: '%kernel.debug%'
|
||||||
$defaultLocale: '%kernel.default_locale%'
|
$defaultLocale: '%kernel.default_locale%'
|
||||||
$wallabagUrl: '%domain_name%'
|
$wallabagUrl: '%domain_name%'
|
||||||
@ -81,11 +81,6 @@ services:
|
|||||||
$rabbitMqProducer: '@old_sound_rabbit_mq.import_elcurator_producer'
|
$rabbitMqProducer: '@old_sound_rabbit_mq.import_elcurator_producer'
|
||||||
$redisProducer: '@wallabag_import.producer.redis.elcurator'
|
$redisProducer: '@wallabag_import.producer.redis.elcurator'
|
||||||
|
|
||||||
Wallabag\ImportBundle\Controller\OmnivoreController:
|
|
||||||
arguments:
|
|
||||||
$rabbitMqProducer: '@old_sound_rabbit_mq.import_omnivore_producer'
|
|
||||||
$redisProducer: '@wallabag_import.producer.redis.omnivore'
|
|
||||||
|
|
||||||
Wallabag\ImportBundle\Controller\FirefoxController:
|
Wallabag\ImportBundle\Controller\FirefoxController:
|
||||||
arguments:
|
arguments:
|
||||||
$rabbitMqProducer: '@old_sound_rabbit_mq.import_firefox_producer'
|
$rabbitMqProducer: '@old_sound_rabbit_mq.import_firefox_producer'
|
||||||
@ -121,21 +116,6 @@ services:
|
|||||||
$rabbitMqProducer: '@old_sound_rabbit_mq.import_wallabag_v2_producer'
|
$rabbitMqProducer: '@old_sound_rabbit_mq.import_wallabag_v2_producer'
|
||||||
$redisProducer: '@wallabag_import.producer.redis.wallabag_v2'
|
$redisProducer: '@wallabag_import.producer.redis.wallabag_v2'
|
||||||
|
|
||||||
Wallabag\ImportBundle\Controller\ShaarliController:
|
|
||||||
arguments:
|
|
||||||
$rabbitMqProducer: '@old_sound_rabbit_mq.import_shaarli_producer'
|
|
||||||
$redisProducer: '@wallabag_import.producer.redis.shaarli'
|
|
||||||
|
|
||||||
Wallabag\ImportBundle\Controller\PocketHtmlController:
|
|
||||||
arguments:
|
|
||||||
$rabbitMqProducer: '@old_sound_rabbit_mq.import_pocket_html_producer'
|
|
||||||
$redisProducer: '@wallabag_import.producer.redis.pocket_html'
|
|
||||||
|
|
||||||
Wallabag\ImportBundle\Controller\PocketCsvController:
|
|
||||||
arguments:
|
|
||||||
$rabbitMqProducer: '@old_sound_rabbit_mq.import_pocket_csv_producer'
|
|
||||||
$redisProducer: '@wallabag_import.producer.redis.pocket_csv'
|
|
||||||
|
|
||||||
Wallabag\ImportBundle\:
|
Wallabag\ImportBundle\:
|
||||||
resource: '../../src/Wallabag/ImportBundle/*'
|
resource: '../../src/Wallabag/ImportBundle/*'
|
||||||
exclude: '../../src/Wallabag/ImportBundle/{Consumer,Controller,Redis}'
|
exclude: '../../src/Wallabag/ImportBundle/{Consumer,Controller,Redis}'
|
||||||
@ -288,23 +268,9 @@ services:
|
|||||||
arguments:
|
arguments:
|
||||||
$baseFolder: "%kernel.project_dir%/web/assets/images"
|
$baseFolder: "%kernel.project_dir%/web/assets/images"
|
||||||
|
|
||||||
Wallabag\CoreBundle\Command\CleanDownloadedImagesCommand:
|
|
||||||
tags:
|
|
||||||
- { name: console.command, command: 'wallabag:clean-downloaded-images' }
|
|
||||||
|
|
||||||
Wallabag\CoreBundle\Command\CleanDuplicatesCommand:
|
|
||||||
tags:
|
|
||||||
- { name: console.command, command: 'wallabag:clean-duplicates' }
|
|
||||||
|
|
||||||
Wallabag\CoreBundle\Command\ExportCommand:
|
Wallabag\CoreBundle\Command\ExportCommand:
|
||||||
arguments:
|
arguments:
|
||||||
$projectDir: '%kernel.project_dir%'
|
$projectDir: '%kernel.project_dir%'
|
||||||
tags:
|
|
||||||
- { name: console.command, command: 'wallabag:export' }
|
|
||||||
|
|
||||||
Wallabag\CoreBundle\Command\GenerateUrlHashesCommand:
|
|
||||||
tags:
|
|
||||||
- { name: console.command, command: 'wallabag:generate-hashed-urls' }
|
|
||||||
|
|
||||||
Wallabag\CoreBundle\Command\InstallCommand:
|
Wallabag\CoreBundle\Command\InstallCommand:
|
||||||
arguments:
|
arguments:
|
||||||
@ -313,26 +279,6 @@ services:
|
|||||||
$defaultSettings: '%wallabag_core.default_internal_settings%'
|
$defaultSettings: '%wallabag_core.default_internal_settings%'
|
||||||
$defaultIgnoreOriginInstanceRules: '%wallabag_core.default_ignore_origin_instance_rules%'
|
$defaultIgnoreOriginInstanceRules: '%wallabag_core.default_ignore_origin_instance_rules%'
|
||||||
|
|
||||||
Wallabag\CoreBundle\Command\ListUserCommand:
|
|
||||||
tags:
|
|
||||||
- { name: console.command, command: 'wallabag:user:list' }
|
|
||||||
|
|
||||||
Wallabag\CoreBundle\Command\ReloadEntryCommand:
|
|
||||||
tags:
|
|
||||||
- { name: console.command, command: 'wallabag:entry:reload' }
|
|
||||||
|
|
||||||
Wallabag\CoreBundle\Command\ShowUserCommand:
|
|
||||||
tags:
|
|
||||||
- { name: console.command, command: 'wallabag:user:show' }
|
|
||||||
|
|
||||||
Wallabag\CoreBundle\Command\TagAllCommand:
|
|
||||||
tags:
|
|
||||||
- { name: console.command, command: 'wallabag:tag:all' }
|
|
||||||
|
|
||||||
Wallabag\ImportBundle\Command\ImportCommand:
|
|
||||||
tags:
|
|
||||||
- { name: console.command, command: 'wallabag:import' }
|
|
||||||
|
|
||||||
wallabag_core.entry.download_images.client:
|
wallabag_core.entry.download_images.client:
|
||||||
alias: 'httplug.client.wallabag_core.entry.download_images'
|
alias: 'httplug.client.wallabag_core.entry.download_images'
|
||||||
|
|
||||||
@ -397,10 +343,6 @@ services:
|
|||||||
tags:
|
tags:
|
||||||
- { name: wallabag_import.import, alias: delicious }
|
- { name: wallabag_import.import, alias: delicious }
|
||||||
|
|
||||||
Wallabag\ImportBundle\Import\OmnivoreImport:
|
|
||||||
tags:
|
|
||||||
- { name: wallabag_import.import, alias: omnivore }
|
|
||||||
|
|
||||||
Wallabag\ImportBundle\Import\FirefoxImport:
|
Wallabag\ImportBundle\Import\FirefoxImport:
|
||||||
tags:
|
tags:
|
||||||
- { name: wallabag_import.import, alias: firefox }
|
- { name: wallabag_import.import, alias: firefox }
|
||||||
@ -409,18 +351,6 @@ services:
|
|||||||
tags:
|
tags:
|
||||||
- { name: wallabag_import.import, alias: chrome }
|
- { name: wallabag_import.import, alias: chrome }
|
||||||
|
|
||||||
Wallabag\ImportBundle\Import\ShaarliImport:
|
|
||||||
tags:
|
|
||||||
- { name: wallabag_import.import, alias: shaarli }
|
|
||||||
|
|
||||||
Wallabag\ImportBundle\Import\PocketHtmlImport:
|
|
||||||
tags:
|
|
||||||
- { name: wallabag_import.import, alias: pocket_html }
|
|
||||||
|
|
||||||
Wallabag\ImportBundle\Import\PocketCsvImport:
|
|
||||||
tags:
|
|
||||||
- { name: wallabag_import.import, alias: pocket_csv }
|
|
||||||
|
|
||||||
# to factorize the proximity and bypass translation for prev & next
|
# to factorize the proximity and bypass translation for prev & next
|
||||||
pagerfanta.view.default_wallabag:
|
pagerfanta.view.default_wallabag:
|
||||||
class: Pagerfanta\View\OptionableView
|
class: Pagerfanta\View\OptionableView
|
||||||
|
|||||||
@ -18,10 +18,6 @@ services:
|
|||||||
$pinboardConsumer: '@old_sound_rabbit_mq.import_pinboard_consumer'
|
$pinboardConsumer: '@old_sound_rabbit_mq.import_pinboard_consumer'
|
||||||
$deliciousConsumer: '@old_sound_rabbit_mq.import_delicious_consumer'
|
$deliciousConsumer: '@old_sound_rabbit_mq.import_delicious_consumer'
|
||||||
$elcuratorConsumer: '@old_sound_rabbit_mq.import_elcurator_consumer'
|
$elcuratorConsumer: '@old_sound_rabbit_mq.import_elcurator_consumer'
|
||||||
$omnivoreConsumer: '@old_sound_rabbit_mq.import_omnivore_consumer'
|
|
||||||
$shaarliConsumer: '@old_sound_rabbit_mq.import_shaarli_consumer'
|
|
||||||
$pocketHtmlConsumer: '@old_sound_rabbit_mq.import_pocket_html_consumer'
|
|
||||||
$pocketCsvConsumer: '@old_sound_rabbit_mq.import_pocket_csv_consumer'
|
|
||||||
|
|
||||||
wallabag_import.consumer.amqp.pocket:
|
wallabag_import.consumer.amqp.pocket:
|
||||||
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
@ -48,11 +44,6 @@ services:
|
|||||||
arguments:
|
arguments:
|
||||||
$import: '@Wallabag\ImportBundle\Import\DeliciousImport'
|
$import: '@Wallabag\ImportBundle\Import\DeliciousImport'
|
||||||
|
|
||||||
wallabag_import.consumer.amqp.omnivore:
|
|
||||||
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
|
||||||
arguments:
|
|
||||||
$import: '@Wallabag\ImportBundle\Import\OmnivoreImport'
|
|
||||||
|
|
||||||
wallabag_import.consumer.amqp.wallabag_v1:
|
wallabag_import.consumer.amqp.wallabag_v1:
|
||||||
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
arguments:
|
arguments:
|
||||||
@ -77,18 +68,3 @@ services:
|
|||||||
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
arguments:
|
arguments:
|
||||||
$import: '@Wallabag\ImportBundle\Import\ChromeImport'
|
$import: '@Wallabag\ImportBundle\Import\ChromeImport'
|
||||||
|
|
||||||
wallabag_import.consumer.amqp.shaarli:
|
|
||||||
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
|
||||||
arguments:
|
|
||||||
$import: '@Wallabag\ImportBundle\Import\ShaarliImport'
|
|
||||||
|
|
||||||
wallabag_import.consumer.amqp.pocket_html:
|
|
||||||
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
|
||||||
arguments:
|
|
||||||
$import: '@Wallabag\ImportBundle\Import\PocketHtmlImport'
|
|
||||||
|
|
||||||
wallabag_import.consumer.amqp.pocket_csv:
|
|
||||||
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
|
||||||
arguments:
|
|
||||||
$import: '@Wallabag\ImportBundle\Import\PocketCsvImport'
|
|
||||||
|
|||||||
@ -69,22 +69,6 @@ services:
|
|||||||
arguments:
|
arguments:
|
||||||
$import: '@Wallabag\ImportBundle\Import\DeliciousImport'
|
$import: '@Wallabag\ImportBundle\Import\DeliciousImport'
|
||||||
|
|
||||||
# Omnivore
|
|
||||||
wallabag_import.queue.redis.omnivore:
|
|
||||||
class: Simpleue\Queue\RedisQueue
|
|
||||||
arguments:
|
|
||||||
$queueName: "wallabag.import.omnivore"
|
|
||||||
|
|
||||||
wallabag_import.producer.redis.omnivore:
|
|
||||||
class: Wallabag\ImportBundle\Redis\Producer
|
|
||||||
arguments:
|
|
||||||
- "@wallabag_import.queue.redis.omnivore"
|
|
||||||
|
|
||||||
wallabag_import.consumer.redis.omnivore:
|
|
||||||
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
|
|
||||||
arguments:
|
|
||||||
$import: '@Wallabag\ImportBundle\Import\OmnivoreImport'
|
|
||||||
|
|
||||||
# pocket
|
# pocket
|
||||||
wallabag_import.queue.redis.pocket:
|
wallabag_import.queue.redis.pocket:
|
||||||
class: Simpleue\Queue\RedisQueue
|
class: Simpleue\Queue\RedisQueue
|
||||||
@ -180,51 +164,3 @@ services:
|
|||||||
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
|
||||||
arguments:
|
arguments:
|
||||||
$import: '@Wallabag\ImportBundle\Import\ChromeImport'
|
$import: '@Wallabag\ImportBundle\Import\ChromeImport'
|
||||||
|
|
||||||
# shaarli
|
|
||||||
wallabag_import.queue.redis.shaarli:
|
|
||||||
class: Simpleue\Queue\RedisQueue
|
|
||||||
arguments:
|
|
||||||
$queueName: "wallabag.import.shaarli"
|
|
||||||
|
|
||||||
wallabag_import.producer.redis.shaarli:
|
|
||||||
class: Wallabag\ImportBundle\Redis\Producer
|
|
||||||
arguments:
|
|
||||||
- "@wallabag_import.queue.redis.shaarli"
|
|
||||||
|
|
||||||
wallabag_import.consumer.redis.shaarli:
|
|
||||||
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
|
|
||||||
arguments:
|
|
||||||
$import: '@Wallabag\ImportBundle\Import\ShaarliImport'
|
|
||||||
|
|
||||||
# pocket html
|
|
||||||
wallabag_import.queue.redis.pocket_html:
|
|
||||||
class: Simpleue\Queue\RedisQueue
|
|
||||||
arguments:
|
|
||||||
$queueName: "wallabag.import.pocket_html"
|
|
||||||
|
|
||||||
wallabag_import.producer.redis.pocket_html:
|
|
||||||
class: Wallabag\ImportBundle\Redis\Producer
|
|
||||||
arguments:
|
|
||||||
- "@wallabag_import.queue.redis.pocket_html"
|
|
||||||
|
|
||||||
wallabag_import.consumer.redis.pocket_html:
|
|
||||||
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
|
|
||||||
arguments:
|
|
||||||
$import: '@Wallabag\ImportBundle\Import\PocketHtmlImport'
|
|
||||||
|
|
||||||
# pocket csv
|
|
||||||
wallabag_import.queue.redis.pocket_csv:
|
|
||||||
class: Simpleue\Queue\RedisQueue
|
|
||||||
arguments:
|
|
||||||
$queueName: "wallabag.import.pocket_csv"
|
|
||||||
|
|
||||||
wallabag_import.producer.redis.pocket_csv:
|
|
||||||
class: Wallabag\ImportBundle\Redis\Producer
|
|
||||||
arguments:
|
|
||||||
- "@wallabag_import.queue.redis.pocket_csv"
|
|
||||||
|
|
||||||
wallabag_import.consumer.redis.pocket_csv:
|
|
||||||
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
|
|
||||||
arguments:
|
|
||||||
$import: '@Wallabag\ImportBundle\Import\PocketCsvImport'
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
wallabag_core:
|
wallabag_core:
|
||||||
version: 2.6.13
|
version: 2.6.2
|
||||||
paypal_url: "https://liberapay.com/wallabag/donate"
|
paypal_url: "https://liberapay.com/wallabag/donate"
|
||||||
languages:
|
languages:
|
||||||
en: 'English'
|
en: 'English'
|
||||||
@ -167,11 +167,5 @@ wallabag_core:
|
|||||||
rule: _all ~ "https?://www\.lemonde\.fr/tiny.*"
|
rule: _all ~ "https?://www\.lemonde\.fr/tiny.*"
|
||||||
|
|
||||||
wallabag_import:
|
wallabag_import:
|
||||||
allow_mimetypes:
|
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv']
|
||||||
- 'application/octet-stream'
|
|
||||||
- 'application/json'
|
|
||||||
- 'text/plain'
|
|
||||||
- 'text/csv'
|
|
||||||
- 'text/html'
|
|
||||||
- 'application/vnd.ms-excel'
|
|
||||||
resource_dir: "%kernel.project_dir%/web/uploads/import"
|
resource_dir: "%kernel.project_dir%/web/uploads/import"
|
||||||
|
|||||||
@ -2,16 +2,16 @@ const path = require('path');
|
|||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const StyleLintPlugin = require('stylelint-webpack-plugin');
|
const StyleLintPlugin = require('stylelint-webpack-plugin');
|
||||||
|
|
||||||
const projectDir = path.resolve(__dirname, '../../../');
|
const rootDir = path.resolve(__dirname, '../../../');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: {
|
entry: {
|
||||||
material: path.join(projectDir, './app/Resources/static/themes/material/index.js'),
|
material: path.join(rootDir, './app/Resources/static/themes/material/index.js'),
|
||||||
public: path.join(projectDir, './app/Resources/static/themes/_global/share.js'),
|
public: path.join(rootDir, './app/Resources/static/themes/_global/share.js'),
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
path: path.resolve(projectDir, 'web/wallassets'),
|
path: path.resolve(rootDir, 'web/wallassets'),
|
||||||
publicPath: '',
|
publicPath: '',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
@ -31,7 +31,7 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
jquery: path.join(projectDir, 'node_modules/jquery/dist/jquery.js'),
|
jquery: path.join(rootDir, 'node_modules/jquery/dist/jquery.js'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||||
use Symfony\Component\Console\Input\ArgvInput;
|
use Symfony\Component\Console\Input\ArgvInput;
|
||||||
use Symfony\Component\ErrorHandler\Debug;
|
use Symfony\Component\Debug\Debug;
|
||||||
|
|
||||||
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
|
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
|
||||||
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
|
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
|
||||||
|
|||||||
208
composer.json
208
composer.json
@ -56,125 +56,96 @@
|
|||||||
"ext-tidy": "*",
|
"ext-tidy": "*",
|
||||||
"ext-tokenizer": "*",
|
"ext-tokenizer": "*",
|
||||||
"ext-xml": "*",
|
"ext-xml": "*",
|
||||||
"babdev/pagerfanta-bundle": "^3.8",
|
"babdev/pagerfanta-bundle": "^3.7",
|
||||||
"bdunogier/guzzle-site-authenticator": "^1.1.0",
|
"bdunogier/guzzle-site-authenticator": "^1.0.0",
|
||||||
"craue/config-bundle": "^2.7.0",
|
"craue/config-bundle": "^2.3.0",
|
||||||
"defuse/php-encryption": "^2.4",
|
"defuse/php-encryption": "^2.1",
|
||||||
"doctrine/collections": "^1.8",
|
"doctrine/collections": "^1.6",
|
||||||
"doctrine/common": "^3.4.3",
|
"doctrine/common": "^3.0",
|
||||||
"doctrine/dbal": "^3.8.2",
|
"doctrine/dbal": "^3.3",
|
||||||
"doctrine/doctrine-bundle": "^2.7.2",
|
"doctrine/doctrine-bundle": "^2.0",
|
||||||
"doctrine/doctrine-migrations-bundle": "^3.2.5",
|
"doctrine/doctrine-migrations-bundle": "^3.2",
|
||||||
"doctrine/event-manager": "^1.2",
|
"doctrine/event-manager": "^1.1",
|
||||||
"doctrine/migrations": "^3.5.5",
|
"doctrine/migrations": "^3.2",
|
||||||
"doctrine/orm": "^2.18",
|
"doctrine/orm": "^2.6",
|
||||||
"doctrine/persistence": "^3.2",
|
"doctrine/persistence": "^3.0",
|
||||||
"egulias/email-validator": "^3.2.6",
|
"egulias/email-validator": "^3.2",
|
||||||
"enshrined/svg-sanitize": "^0.15.4",
|
"enshrined/svg-sanitize": "^0.15.4",
|
||||||
"friendsofsymfony/jsrouting-bundle": "^2.8",
|
"friendsofsymfony/jsrouting-bundle": "^2.2",
|
||||||
"friendsofsymfony/oauth-server-bundle": "dev-master#dc8ff343363cf794d30eb1a123610d186a43f162",
|
"friendsofsymfony/oauth-server-bundle": "dev-master#dc8ff343363cf794d30eb1a123610d186a43f162",
|
||||||
"friendsofsymfony/rest-bundle": "^3.5",
|
"friendsofsymfony/rest-bundle": "~3.4",
|
||||||
"friendsofsymfony/user-bundle": "^3.2.1",
|
"friendsofsymfony/user-bundle": "^3.1",
|
||||||
"guzzlehttp/guzzle": "^5.3.4",
|
"guzzlehttp/guzzle": "^5.3.1",
|
||||||
"guzzlehttp/psr7": "^2.6.2",
|
"guzzlehttp/psr7": "^2.5",
|
||||||
"html2text/html2text": "^4.3.1",
|
"html2text/html2text": "^4.1",
|
||||||
"incenteev/composer-parameter-handler": "^2.1.5",
|
"incenteev/composer-parameter-handler": "^2.1",
|
||||||
"j0k3r/graby": "^2.4.5",
|
"j0k3r/graby": "^2.0",
|
||||||
"j0k3r/php-readability": "^1.2.13",
|
"javibravo/simpleue": "^2.0",
|
||||||
"javibravo/simpleue": "^2.1",
|
"jms/serializer": "^3.17",
|
||||||
"jms/serializer": "^3.29.1",
|
"jms/serializer-bundle": "~5.0",
|
||||||
"jms/serializer-bundle": "^5.3.1",
|
"kphoen/rulerz": "^0.21",
|
||||||
"kphoen/rulerz": "^0.21.1",
|
"kphoen/rulerz-bundle": "~0.13",
|
||||||
"kphoen/rulerz-bundle": "^0.15",
|
"laminas/laminas-code": "^4.7",
|
||||||
"laminas/laminas-code": "^4.7.1",
|
"lcobucci/jwt": "~4.1.5",
|
||||||
"lcobucci/jwt": "4.1.5",
|
"lexik/form-filter-bundle": "^7.0",
|
||||||
"lexik/form-filter-bundle": "^7.0.3",
|
"mgargano/simplehtmldom": "~1.5",
|
||||||
"mgargano/simplehtmldom": "^1.5",
|
|
||||||
"mnapoli/piwik-twig-extension": "^3.0",
|
"mnapoli/piwik-twig-extension": "^3.0",
|
||||||
"nelmio/api-doc-bundle": "^4.11.1",
|
"nelmio/api-doc-bundle": "^4.10",
|
||||||
"nelmio/cors-bundle": "^2.3.1",
|
"nelmio/cors-bundle": "~2.2",
|
||||||
"ocramius/proxy-manager": "^2.1.1",
|
"ocramius/proxy-manager": "^2.1.1",
|
||||||
"pagerfanta/doctrine-orm-adapter": "^3.8",
|
"pagerfanta/doctrine-orm-adapter": "^3.7",
|
||||||
"pagerfanta/twig": "^3.8",
|
"pagerfanta/twig": "^3.7",
|
||||||
"php-amqplib/php-amqplib": "^3.6.1",
|
"php-amqplib/php-amqplib": "^3.4",
|
||||||
"php-amqplib/rabbitmq-bundle": "^2.14",
|
"php-amqplib/rabbitmq-bundle": "^2.11",
|
||||||
"php-http/client-common": "^2.7.1",
|
"php-http/client-common": "^2.4",
|
||||||
"php-http/discovery": "^1.19.2",
|
"php-http/discovery": "^1.14",
|
||||||
"php-http/guzzle5-adapter": "^2.0",
|
"php-http/guzzle5-adapter": "^2.0",
|
||||||
"php-http/httplug": "^2.4",
|
"php-http/httplug": "^2.3",
|
||||||
"php-http/httplug-bundle": "^1.32",
|
"php-http/httplug-bundle": "^1.14",
|
||||||
"php-http/message": "^1.16",
|
"php-http/message": "^1.13",
|
||||||
"php-http/message-factory": "^1.1",
|
"php-http/message-factory": "^1.0",
|
||||||
"pragmarx/recovery": "^0.2.1",
|
"pragmarx/recovery": "^0.2.0",
|
||||||
"predis/predis": "^2.2.2",
|
"predis/predis": "^2.0.3",
|
||||||
"psr/http-message": "^1.1",
|
"psr/http-message": "^1.0",
|
||||||
"psr/log": "^1.1.4",
|
"psr/log": "^1.1",
|
||||||
"scheb/2fa-backup-code": "^5.13.2",
|
"scheb/2fa-backup-code": "^5.13",
|
||||||
"scheb/2fa-bundle": "^5.13.2",
|
"scheb/2fa-bundle": "^5.13",
|
||||||
"scheb/2fa-email": "^5.13.2",
|
"scheb/2fa-email": "^5.13",
|
||||||
"scheb/2fa-google-authenticator": "^5.13.2",
|
"scheb/2fa-google-authenticator": "^5.13",
|
||||||
"scheb/2fa-qr-code": "^5.13.2",
|
"scheb/2fa-qr-code": "^5.13",
|
||||||
"scheb/2fa-trusted-device": "^5.13.2",
|
"scheb/2fa-trusted-device": "^5.13",
|
||||||
"sensio/framework-extra-bundle": "^6.2.10",
|
"sensio/framework-extra-bundle": "^6.2",
|
||||||
"sentry/sentry-symfony": "^4.13.2",
|
"sentry/sentry-symfony": "4.10.0",
|
||||||
"stof/doctrine-extensions-bundle": "^1.7.2",
|
"stof/doctrine-extensions-bundle": "^1.2",
|
||||||
"symfony/asset": "^4.4.46",
|
"symfony/dom-crawler": "^4.0",
|
||||||
"symfony/config": "^4.4.44",
|
"symfony/mailer": "^4.0",
|
||||||
"symfony/console": "^4.4.49",
|
"symfony/monolog-bundle": "^3.1",
|
||||||
"symfony/debug": "^4.4.44",
|
"symfony/proxy-manager-bridge": "^4.4",
|
||||||
"symfony/dependency-injection": "^4.4.49",
|
"symfony/symfony": "^4.0",
|
||||||
"symfony/doctrine-bridge": "^4.4.48",
|
"tecnickcom/tcpdf": "^6.3.0",
|
||||||
"symfony/dom-crawler": "^4.4.45",
|
"twig/extra-bundle": "^3.4",
|
||||||
"symfony/error-handler": "^4.4.44",
|
"twig/string-extra": "^3.4",
|
||||||
"symfony/event-dispatcher": "^4.4.44",
|
"twig/twig": "^3.4.3",
|
||||||
"symfony/finder": "^4.4.44",
|
"wallabag/php-mobi": "~1.0",
|
||||||
"symfony/form": "^4.4.48",
|
|
||||||
"symfony/framework-bundle": "^4.4.51",
|
|
||||||
"symfony/google-mailer": "^4.4.41",
|
|
||||||
"symfony/http-foundation": "^4.4.49",
|
|
||||||
"symfony/http-kernel": "^4.4.51",
|
|
||||||
"symfony/mailer": "^4.4.49",
|
|
||||||
"symfony/mime": "^4.4.47",
|
|
||||||
"symfony/monolog-bundle": "^3.8",
|
|
||||||
"symfony/options-resolver": "^4.4.44",
|
|
||||||
"symfony/proxy-manager-bridge": "^4.4.39",
|
|
||||||
"symfony/routing": "^4.4.44",
|
|
||||||
"symfony/security-bundle": "^4.4.50",
|
|
||||||
"symfony/security-core": "^4.4.48",
|
|
||||||
"symfony/security-http": "^4.4.50",
|
|
||||||
"symfony/templating": "^4.4.44",
|
|
||||||
"symfony/twig-bundle": "^4.4.41",
|
|
||||||
"symfony/validator": "^4.4.48",
|
|
||||||
"tecnickcom/tcpdf": "^6.6.5",
|
|
||||||
"twig/extra-bundle": "^3.7",
|
|
||||||
"twig/string-extra": "^3.8",
|
|
||||||
"twig/twig": "^3.8.0",
|
|
||||||
"wallabag/php-mobi": "^1.1.1",
|
|
||||||
"wallabag/phpepub": "^4.0.10",
|
"wallabag/phpepub": "^4.0.10",
|
||||||
"willdurand/hateoas": "^3.10",
|
"willdurand/hateoas": "^3.8",
|
||||||
"willdurand/hateoas-bundle": "^2.6"
|
"willdurand/hateoas-bundle": "~2.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"dama/doctrine-test-bundle": "^7.1.1",
|
"dama/doctrine-test-bundle": "^7.1",
|
||||||
"doctrine/doctrine-fixtures-bundle": "^3.4.5",
|
"doctrine/doctrine-fixtures-bundle": "~3.0",
|
||||||
"ergebnis/composer-normalize": "^2.42",
|
"ergebnis/composer-normalize": "^2.28",
|
||||||
"friendsofphp/php-cs-fixer": "^3.4",
|
"friendsofphp/php-cs-fixer": "~3.4",
|
||||||
"friendsoftwig/twigcs": "^6.1",
|
"friendsoftwig/twigcs": "^6.0",
|
||||||
"m6web/redis-mock": "^5.6",
|
"m6web/redis-mock": "^5.0",
|
||||||
"php-http/mock-client": "^1.6",
|
"php-http/mock-client": "^1.0",
|
||||||
"phpstan/extension-installer": "^1.3.1",
|
"phpstan/extension-installer": "^1.0",
|
||||||
"phpstan/phpstan": "^1.10.58",
|
"phpstan/phpstan": "^1.8",
|
||||||
"phpstan/phpstan-doctrine": "^1.3.62",
|
"phpstan/phpstan-doctrine": "^1.3",
|
||||||
"phpstan/phpstan-phpunit": "^1.3.15",
|
"phpstan/phpstan-phpunit": "^1.1",
|
||||||
"phpstan/phpstan-symfony": "^1.3.7",
|
"phpstan/phpstan-symfony": "^1.2",
|
||||||
"symfony/browser-kit": "^4.4.44",
|
"symfony/maker-bundle": "^1.18",
|
||||||
"symfony/css-selector": "^4.4.44",
|
"symfony/phpunit-bridge": "~6.0"
|
||||||
"symfony/debug-bundle": "^4.4.37",
|
|
||||||
"symfony/maker-bundle": "^1.39.1",
|
|
||||||
"symfony/phpunit-bridge": "^6.4.3",
|
|
||||||
"symfony/var-dumper": "^4.4.47",
|
|
||||||
"symfony/web-profiler-bundle": "^4.4.47",
|
|
||||||
"symfony/web-server-bundle": "^4.4.44"
|
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-imagick": "To keep GIF animation when downloading image is enabled"
|
"ext-imagick": "To keep GIF animation when downloading image is enabled"
|
||||||
@ -193,13 +164,16 @@
|
|||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Tests\\": "tests/"
|
"Tests\\": "tests/"
|
||||||
}
|
},
|
||||||
|
"files": [
|
||||||
|
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"allow-plugins": {
|
"allow-plugins": {
|
||||||
"ergebnis/composer-normalize": true,
|
"phpstan/extension-installer": true,
|
||||||
"php-http/discovery": true,
|
"php-http/discovery": true,
|
||||||
"phpstan/extension-installer": true
|
"ergebnis/composer-normalize": true
|
||||||
},
|
},
|
||||||
"bin-dir": "bin",
|
"bin-dir": "bin",
|
||||||
"platform": {
|
"platform": {
|
||||||
@ -211,11 +185,7 @@
|
|||||||
"incenteev-parameters": {
|
"incenteev-parameters": {
|
||||||
"file": "app/config/parameters.yml"
|
"file": "app/config/parameters.yml"
|
||||||
},
|
},
|
||||||
"public-dir": "web",
|
"public-dir": "web"
|
||||||
"symfony": {
|
|
||||||
"allow-contrib": true,
|
|
||||||
"require": "4.4.*"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"post-install-cmd": [
|
"post-install-cmd": [
|
||||||
|
|||||||
7068
composer.lock
generated
7068
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
FROM php:8.1-fpm AS rootless
|
FROM php:8.1-fpm AS rootless
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
ARG NODE_VERSION=20
|
ARG NODE_VERSION=16
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y \
|
&& apt-get install -y \
|
||||||
@ -33,7 +33,8 @@ RUN apt-get update && apt-get install -y \
|
|||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
git \
|
git \
|
||||||
build-essential \
|
build-essential \
|
||||||
nodejs
|
nodejs \
|
||||||
|
npm
|
||||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
|
||||||
RUN docker-php-ext-install -j "$(nproc)" \
|
RUN docker-php-ext-install -j "$(nproc)" \
|
||||||
bcmath \
|
bcmath \
|
||||||
|
|||||||
@ -6,7 +6,7 @@ parameters:
|
|||||||
database_name: ${DATABASE_NAME:-symfony}
|
database_name: ${DATABASE_NAME:-symfony}
|
||||||
database_user: ${DATABASE_USER:-root}
|
database_user: ${DATABASE_USER:-root}
|
||||||
database_password: ${DATABASE_PASSWORD:-~}
|
database_password: ${DATABASE_PASSWORD:-~}
|
||||||
database_path: '${DATABASE_PATH:-"%kernel.project_dir%/data/db/wallabag.sqlite"}'
|
database_path: '${DATABASE_PATH:-"%kernel.root_dir%/data/db/wallabag.sqlite"}'
|
||||||
database_table_prefix: ${DATABASE_TABLE_PREFIX:-wallabag_}
|
database_table_prefix: ${DATABASE_TABLE_PREFIX:-wallabag_}
|
||||||
database_socket: null
|
database_socket: null
|
||||||
database_charset: ${DATABASE_CHARSET:-utf8}
|
database_charset: ${DATABASE_CHARSET:-utf8}
|
||||||
|
|||||||
24
package.json
24
package.json
@ -7,7 +7,7 @@
|
|||||||
"doc": "docs"
|
"doc": "docs"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=16"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -41,30 +41,30 @@
|
|||||||
"url": "https://github.com/wallabag/wallabag/issues"
|
"url": "https://github.com/wallabag/wallabag/issues"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.22.10",
|
"@babel/core": "^7.22.9",
|
||||||
"@babel/eslint-parser": "^7.22.10",
|
"@babel/eslint-parser": "^7.22.9",
|
||||||
"@babel/preset-env": "^7.22.10",
|
"@babel/preset-env": "^7.22.9",
|
||||||
"autoprefixer": "^10.4.15",
|
"autoprefixer": "^10.4.14",
|
||||||
"babel-loader": "^9.1.3",
|
"babel-loader": "^9.1.3",
|
||||||
"css-loader": "^6.8.1",
|
"css-loader": "^6.8.1",
|
||||||
"eslint": "^8.47.0",
|
"eslint": "^8.46.0",
|
||||||
"eslint-config-airbnb-base": "^15.0.0",
|
"eslint-config-airbnb-base": "^15.0.0",
|
||||||
"eslint-plugin-import": "^2.28.1",
|
"eslint-plugin-import": "^2.28.0",
|
||||||
"eslint-webpack-plugin": "^4.0.1",
|
"eslint-webpack-plugin": "^4.0.1",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"lato-font": "^3.0.0",
|
"lato-font": "^3.0.0",
|
||||||
"mini-css-extract-plugin": "^2.7.6",
|
"mini-css-extract-plugin": "^2.7.6",
|
||||||
"node-sass": "^9.0.0",
|
"node-sass": "^9.0.0",
|
||||||
"postcss": "^8.4.28",
|
"postcss": "^8.4.27",
|
||||||
"postcss-loader": "^7.3.3",
|
"postcss-loader": "^7.3.3",
|
||||||
"postcss-scss": "^4.0.7",
|
"postcss-scss": "^4.0.6",
|
||||||
"sass": "^1.66.1",
|
"sass": "^1.64.1",
|
||||||
"sass-loader": "^13.3.2",
|
"sass-loader": "^13.3.2",
|
||||||
"style-loader": "^3.3.3",
|
"style-loader": "^3.3.3",
|
||||||
"stylelint": "^15.10.3",
|
"stylelint": "^15.10.2",
|
||||||
"stylelint-config-standard": "^34.0.0",
|
"stylelint-config-standard": "^34.0.0",
|
||||||
"stylelint-config-standard-scss": "^10.0.0",
|
"stylelint-config-standard-scss": "^10.0.0",
|
||||||
"stylelint-scss": "^5.1.0",
|
"stylelint-scss": "^5.0.1",
|
||||||
"stylelint-webpack-plugin": "^4.1.1",
|
"stylelint-webpack-plugin": "^4.1.1",
|
||||||
"terser-webpack-plugin": "^5.3.9",
|
"terser-webpack-plugin": "^5.3.9",
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
|
|||||||
@ -45,6 +45,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php
|
path: tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method generate\\(\\) on an unknown class PHPUnit_Framework_MockObject_MockObject\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: tests/Wallabag/CoreBundle/Helper/RedirectTest.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Property Tests\\\\Wallabag\\\\CoreBundle\\\\Helper\\\\RedirectTest\\:\\:\\$routerMock has unknown class PHPUnit_Framework_MockObject_MockObject as its type\\.$#"
|
message: "#^Property Tests\\\\Wallabag\\\\CoreBundle\\\\Helper\\\\RedirectTest\\:\\:\\$routerMock has unknown class PHPUnit_Framework_MockObject_MockObject as its type\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -59,13 +64,3 @@ parameters:
|
|||||||
message: "#^Method FOS\\\\UserBundle\\\\Model\\\\UserManagerInterface\\:\\:updateUser()#"
|
message: "#^Method FOS\\\\UserBundle\\\\Model\\\\UserManagerInterface\\:\\:updateUser()#"
|
||||||
count: 7
|
count: 7
|
||||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Wallabag/ImportBundle/Controller/HtmlController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Wallabag/ImportBundle/Controller/HtmlController.php
|
|
||||||
|
|||||||
@ -7,9 +7,3 @@ if [ ! -f composer.phar ]; then
|
|||||||
else
|
else
|
||||||
COMPOSER_COMMAND='./composer.phar'
|
COMPOSER_COMMAND='./composer.phar'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for git
|
|
||||||
command -v git >/dev/null 2>&1 ||
|
|
||||||
{ echo >&2 "git is not installed. We can't install wallabag";
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|||||||
@ -7,9 +7,7 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
|||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||||
use Wallabag\CoreBundle\DataFixtures\EntryFixtures;
|
use Wallabag\CoreBundle\DataFixtures\EntryFixtures;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
|
||||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
|
||||||
|
|
||||||
class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
||||||
{
|
{
|
||||||
@ -18,8 +16,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
$annotation1 = new Annotation($this->getReference('admin-user', User::class));
|
$annotation1 = new Annotation($this->getReference('admin-user'));
|
||||||
$annotation1->setEntry($this->getReference('entry1', Entry::class));
|
$annotation1->setEntry($this->getReference('entry1'));
|
||||||
$annotation1->setText('This is my annotation /o/');
|
$annotation1->setText('This is my annotation /o/');
|
||||||
$annotation1->setQuote('content');
|
$annotation1->setQuote('content');
|
||||||
|
|
||||||
@ -27,8 +25,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
$this->addReference('annotation1', $annotation1);
|
$this->addReference('annotation1', $annotation1);
|
||||||
|
|
||||||
$annotation2 = new Annotation($this->getReference('admin-user', User::class));
|
$annotation2 = new Annotation($this->getReference('admin-user'));
|
||||||
$annotation2->setEntry($this->getReference('entry2', Entry::class));
|
$annotation2->setEntry($this->getReference('entry2'));
|
||||||
$annotation2->setText('This is my 2nd annotation /o/');
|
$annotation2->setText('This is my 2nd annotation /o/');
|
||||||
$annotation2->setQuote('content');
|
$annotation2->setQuote('content');
|
||||||
|
|
||||||
@ -36,8 +34,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
$this->addReference('annotation2', $annotation2);
|
$this->addReference('annotation2', $annotation2);
|
||||||
|
|
||||||
$annotation3 = new Annotation($this->getReference('bob-user', User::class));
|
$annotation3 = new Annotation($this->getReference('bob-user'));
|
||||||
$annotation3->setEntry($this->getReference('entry3', Entry::class));
|
$annotation3->setEntry($this->getReference('entry3'));
|
||||||
$annotation3->setText('This is my first annotation !');
|
$annotation3->setText('This is my first annotation !');
|
||||||
$annotation3->setQuote('content');
|
$annotation3->setQuote('content');
|
||||||
|
|
||||||
|
|||||||
@ -152,12 +152,6 @@ class AnnotationRepository extends ServiceEntityRepository
|
|||||||
->getResult();
|
->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCountBuilderByUser($userId = null)
|
|
||||||
{
|
|
||||||
return $this->createQueryBuilder('e')
|
|
||||||
->andWhere('e.user = :userId')->setParameter('userId', $userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a query builder to used by other getBuilderFor* method.
|
* Return a query builder to used by other getBuilderFor* method.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -7,7 +7,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
use Wallabag\ApiBundle\Entity\Client;
|
use Wallabag\ApiBundle\Entity\Client;
|
||||||
@ -70,16 +69,12 @@ class DeveloperController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Remove a client.
|
* Remove a client.
|
||||||
*
|
*
|
||||||
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client", methods={"POST"})
|
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteClientAction(Request $request, Client $client, EntityManagerInterface $entityManager, TranslatorInterface $translator)
|
public function deleteClientAction(Client $client, EntityManagerInterface $entityManager, TranslatorInterface $translator)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('delete-client', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === $this->getUser() || $client->getUser()->getId() !== $this->getUser()->getId()) {
|
if (null === $this->getUser() || $client->getUser()->getId() !== $this->getUser()->getId()) {
|
||||||
throw $this->createAccessDeniedException('You can not access this client.');
|
throw $this->createAccessDeniedException('You can not access this client.');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,9 +4,6 @@ namespace Wallabag\CoreBundle\Command;
|
|||||||
|
|
||||||
use Doctrine\DBAL\Connection;
|
use Doctrine\DBAL\Connection;
|
||||||
use Doctrine\DBAL\Exception\DriverException;
|
use Doctrine\DBAL\Exception\DriverException;
|
||||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use FOS\UserBundle\Event\UserEvent;
|
use FOS\UserBundle\Event\UserEvent;
|
||||||
use FOS\UserBundle\FOSUserEvents;
|
use FOS\UserBundle\FOSUserEvents;
|
||||||
@ -141,7 +138,7 @@ class InstallCommand extends Command
|
|||||||
$help = '';
|
$help = '';
|
||||||
|
|
||||||
// now check if MySQL isn't too old to handle utf8mb4
|
// now check if MySQL isn't too old to handle utf8mb4
|
||||||
if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof MySQLPlatform) {
|
if ($conn->isConnected() && 'mysql' === $conn->getDatabasePlatform()->getName()) {
|
||||||
$version = $conn->query('select version()')->fetchOne();
|
$version = $conn->query('select version()')->fetchOne();
|
||||||
$minimalVersion = '5.5.4';
|
$minimalVersion = '5.5.4';
|
||||||
|
|
||||||
@ -153,7 +150,7 @@ class InstallCommand extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
// testing if PostgreSQL > 9.1
|
// testing if PostgreSQL > 9.1
|
||||||
if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
if ($conn->isConnected() && 'postgresql' === $conn->getDatabasePlatform()->getName()) {
|
||||||
// return version should be like "PostgreSQL 9.5.4 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 8.0.0 (clang-800.0.38), 64-bit"
|
// return version should be like "PostgreSQL 9.5.4 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 8.0.0 (clang-800.0.38), 64-bit"
|
||||||
$version = $conn->query('SELECT version();')->fetchOne();
|
$version = $conn->query('SELECT version();')->fetchOne();
|
||||||
|
|
||||||
@ -394,7 +391,7 @@ class InstallCommand extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
// custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite
|
// custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite
|
||||||
if ($connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
if ('sqlite' === $schemaManager->getDatabasePlatform()->getName()) {
|
||||||
$params = $connection->getParams();
|
$params = $connection->getParams();
|
||||||
|
|
||||||
if (isset($params['path']) && file_exists($params['path'])) {
|
if (isset($params['path']) && file_exists($params['path'])) {
|
||||||
|
|||||||
@ -16,7 +16,6 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
|
use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
|
||||||
@ -33,7 +32,6 @@ use Wallabag\CoreBundle\Form\Type\IgnoreOriginUserRuleType;
|
|||||||
use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType;
|
use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType;
|
||||||
use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
|
use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
|
||||||
use Wallabag\CoreBundle\Form\Type\UserInformationType;
|
use Wallabag\CoreBundle\Form\Type\UserInformationType;
|
||||||
use Wallabag\CoreBundle\Helper\Redirect;
|
|
||||||
use Wallabag\CoreBundle\Repository\ConfigRepository;
|
use Wallabag\CoreBundle\Repository\ConfigRepository;
|
||||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||||
use Wallabag\CoreBundle\Repository\IgnoreOriginUserRuleRepository;
|
use Wallabag\CoreBundle\Repository\IgnoreOriginUserRuleRepository;
|
||||||
@ -50,9 +48,8 @@ class ConfigController extends AbstractController
|
|||||||
private TagRepository $tagRepository;
|
private TagRepository $tagRepository;
|
||||||
private AnnotationRepository $annotationRepository;
|
private AnnotationRepository $annotationRepository;
|
||||||
private ConfigRepository $configRepository;
|
private ConfigRepository $configRepository;
|
||||||
private Redirect $redirectHelper;
|
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $entityManager, UserManagerInterface $userManager, EntryRepository $entryRepository, TagRepository $tagRepository, AnnotationRepository $annotationRepository, ConfigRepository $configRepository, Redirect $redirectHelper)
|
public function __construct(EntityManagerInterface $entityManager, UserManagerInterface $userManager, EntryRepository $entryRepository, TagRepository $tagRepository, AnnotationRepository $annotationRepository, ConfigRepository $configRepository)
|
||||||
{
|
{
|
||||||
$this->entityManager = $entityManager;
|
$this->entityManager = $entityManager;
|
||||||
$this->userManager = $userManager;
|
$this->userManager = $userManager;
|
||||||
@ -60,7 +57,6 @@ class ConfigController extends AbstractController
|
|||||||
$this->tagRepository = $tagRepository;
|
$this->tagRepository = $tagRepository;
|
||||||
$this->annotationRepository = $annotationRepository;
|
$this->annotationRepository = $annotationRepository;
|
||||||
$this->configRepository = $configRepository;
|
$this->configRepository = $configRepository;
|
||||||
$this->redirectHelper = $redirectHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -258,14 +254,10 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Disable 2FA using email.
|
* Disable 2FA using email.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/email/disable", name="disable_otp_email", methods={"POST"})
|
* @Route("/config/otp/email/disable", name="disable_otp_email")
|
||||||
*/
|
*/
|
||||||
public function disableOtpEmailAction(Request $request)
|
public function disableOtpEmailAction()
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$user->setEmailTwoFactor(false);
|
$user->setEmailTwoFactor(false);
|
||||||
|
|
||||||
@ -282,14 +274,10 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Enable 2FA using email.
|
* Enable 2FA using email.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/email", name="config_otp_email", methods={"POST"})
|
* @Route("/config/otp/email", name="config_otp_email")
|
||||||
*/
|
*/
|
||||||
public function otpEmailAction(Request $request)
|
public function otpEmailAction()
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
|
||||||
$user->setGoogleAuthenticatorSecret(null);
|
$user->setGoogleAuthenticatorSecret(null);
|
||||||
@ -309,14 +297,10 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Disable 2FA using OTP app.
|
* Disable 2FA using OTP app.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/app/disable", name="disable_otp_app", methods={"POST"})
|
* @Route("/config/otp/app/disable", name="disable_otp_app")
|
||||||
*/
|
*/
|
||||||
public function disableOtpAppAction(Request $request)
|
public function disableOtpAppAction()
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
|
||||||
$user->setGoogleAuthenticatorSecret('');
|
$user->setGoogleAuthenticatorSecret('');
|
||||||
@ -335,14 +319,10 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Enable 2FA using OTP app, user will need to confirm the generated code from the app.
|
* Enable 2FA using OTP app, user will need to confirm the generated code from the app.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/app", name="config_otp_app", methods={"POST"})
|
* @Route("/config/otp/app", name="config_otp_app")
|
||||||
*/
|
*/
|
||||||
public function otpAppAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
|
public function otpAppAction(GoogleAuthenticatorInterface $googleAuthenticator)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$secret = $googleAuthenticator->generateSecret();
|
$secret = $googleAuthenticator->generateSecret();
|
||||||
|
|
||||||
@ -377,10 +357,8 @@ class ConfigController extends AbstractController
|
|||||||
* Cancelling 2FA using OTP app.
|
* Cancelling 2FA using OTP app.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/app/cancel", name="config_otp_app_cancel")
|
* @Route("/config/otp/app/cancel", name="config_otp_app_cancel")
|
||||||
*
|
|
||||||
* XXX: commented until we rewrite 2fa with a real two-steps activation
|
|
||||||
*/
|
*/
|
||||||
/*public function otpAppCancelAction()
|
public function otpAppCancelAction()
|
||||||
{
|
{
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$user->setGoogleAuthenticatorSecret(null);
|
$user->setGoogleAuthenticatorSecret(null);
|
||||||
@ -388,66 +366,55 @@ class ConfigController extends AbstractController
|
|||||||
|
|
||||||
$this->userManager->updateUser($user, true);
|
$this->userManager->updateUser($user, true);
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('config') . '#set3');
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate OTP code.
|
|
||||||
*
|
|
||||||
* @Route("/config/otp/app/check", name="config_otp_app_check", methods={"POST"})
|
|
||||||
*/
|
|
||||||
public function otpAppCheckAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
|
|
||||||
{
|
|
||||||
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->getUser();
|
|
||||||
|
|
||||||
$isValid = $googleAuthenticator->checkCode(
|
|
||||||
$user,
|
|
||||||
$request->get('_auth_code')
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($isValid) {
|
|
||||||
$this->addFlash(
|
|
||||||
'notice',
|
|
||||||
'flashes.config.notice.otp_enabled'
|
|
||||||
);
|
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('config') . '#set3');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->addFlash(
|
|
||||||
'notice',
|
|
||||||
'flashes.config.notice.otp_code_invalid'
|
|
||||||
);
|
|
||||||
|
|
||||||
$user->setGoogleAuthenticatorSecret(null);
|
|
||||||
$user->setBackupCodes(null);
|
|
||||||
|
|
||||||
$this->userManager->updateUser($user, true);
|
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('config') . '#set3');
|
return $this->redirect($this->generateUrl('config') . '#set3');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/generate-token", name="generate_token", methods={"POST"})
|
* Validate OTP code.
|
||||||
|
*
|
||||||
|
* @Route("/config/otp/app/check", name="config_otp_app_check")
|
||||||
|
*/
|
||||||
|
public function otpAppCheckAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
|
||||||
|
{
|
||||||
|
$isValid = $googleAuthenticator->checkCode(
|
||||||
|
$this->getUser(),
|
||||||
|
$request->get('_auth_code')
|
||||||
|
);
|
||||||
|
|
||||||
|
if (true === $isValid) {
|
||||||
|
$this->addFlash(
|
||||||
|
'notice',
|
||||||
|
'flashes.config.notice.otp_enabled'
|
||||||
|
);
|
||||||
|
|
||||||
|
return $this->redirect($this->generateUrl('config') . '#set3');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->addFlash(
|
||||||
|
'two_factor',
|
||||||
|
'scheb_two_factor.code_invalid'
|
||||||
|
);
|
||||||
|
|
||||||
|
return $this->redirect($this->generateUrl('config_otp_app'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Route("/generate-token", name="generate_token")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse|JsonResponse
|
* @return RedirectResponse|JsonResponse
|
||||||
*/
|
*/
|
||||||
public function generateTokenAction(Request $request)
|
public function generateTokenAction(Request $request)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('generate-token', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$config = $this->getConfig();
|
$config = $this->getConfig();
|
||||||
$config->setFeedToken(Utils::generateToken());
|
$config->setFeedToken(Utils::generateToken());
|
||||||
|
|
||||||
$this->entityManager->persist($config);
|
$this->entityManager->persist($config);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
|
if ($request->isXmlHttpRequest()) {
|
||||||
|
return new JsonResponse(['token' => $config->getFeedToken()]);
|
||||||
|
}
|
||||||
|
|
||||||
$this->addFlash(
|
$this->addFlash(
|
||||||
'notice',
|
'notice',
|
||||||
'flashes.config.notice.feed_token_updated'
|
'flashes.config.notice.feed_token_updated'
|
||||||
@ -457,22 +424,22 @@ class ConfigController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/revoke-token", name="revoke_token", methods={"POST"})
|
* @Route("/revoke-token", name="revoke_token")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse|JsonResponse
|
* @return RedirectResponse|JsonResponse
|
||||||
*/
|
*/
|
||||||
public function revokeTokenAction(Request $request)
|
public function revokeTokenAction(Request $request)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('revoke-token', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$config = $this->getConfig();
|
$config = $this->getConfig();
|
||||||
$config->setFeedToken(null);
|
$config->setFeedToken(null);
|
||||||
|
|
||||||
$this->entityManager->persist($config);
|
$this->entityManager->persist($config);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
|
if ($request->isXmlHttpRequest()) {
|
||||||
|
return new JsonResponse();
|
||||||
|
}
|
||||||
|
|
||||||
$this->addFlash(
|
$this->addFlash(
|
||||||
'notice',
|
'notice',
|
||||||
'flashes.config.notice.feed_token_revoked'
|
'flashes.config.notice.feed_token_revoked'
|
||||||
@ -484,16 +451,12 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Deletes a tagging rule and redirect to the config homepage.
|
* Deletes a tagging rule and redirect to the config homepage.
|
||||||
*
|
*
|
||||||
* @Route("/tagging-rule/delete/{id}", name="delete_tagging_rule", methods={"POST"}, requirements={"id" = "\d+"})
|
* @Route("/tagging-rule/delete/{id}", requirements={"id" = "\d+"}, name="delete_tagging_rule")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteTaggingRuleAction(Request $request, TaggingRule $rule)
|
public function deleteTaggingRuleAction(TaggingRule $rule)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('delete-tagging-rule', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->validateRuleAction($rule);
|
$this->validateRuleAction($rule);
|
||||||
|
|
||||||
$this->entityManager->remove($rule);
|
$this->entityManager->remove($rule);
|
||||||
@ -524,16 +487,12 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Deletes an ignore origin rule and redirect to the config homepage.
|
* Deletes an ignore origin rule and redirect to the config homepage.
|
||||||
*
|
*
|
||||||
* @Route("/ignore-origin-user-rule/delete/{id}", name="delete_ignore_origin_rule", methods={"POST"}, requirements={"id" = "\d+"})
|
* @Route("/ignore-origin-user-rule/delete/{id}", requirements={"id" = "\d+"}, name="delete_ignore_origin_rule")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteIgnoreOriginRuleAction(Request $request, IgnoreOriginUserRule $rule)
|
public function deleteIgnoreOriginRuleAction(IgnoreOriginUserRule $rule)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('delete-ignore-origin-rule', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->validateRuleAction($rule);
|
$this->validateRuleAction($rule);
|
||||||
|
|
||||||
$this->entityManager->remove($rule);
|
$this->entityManager->remove($rule);
|
||||||
@ -564,16 +523,12 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Remove all annotations OR tags OR entries for the current user.
|
* Remove all annotations OR tags OR entries for the current user.
|
||||||
*
|
*
|
||||||
* @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset", methods={"POST"})
|
* @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function resetAction(Request $request, string $type, AnnotationRepository $annotationRepository, EntryRepository $entryRepository)
|
public function resetAction(string $type, AnnotationRepository $annotationRepository, EntryRepository $entryRepository)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('reset-area', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'annotations':
|
case 'annotations':
|
||||||
$annotationRepository->removeAllByUserId($this->getUser()->getId());
|
$annotationRepository->removeAllByUserId($this->getUser()->getId());
|
||||||
@ -625,7 +580,7 @@ class ConfigController extends AbstractController
|
|||||||
public function deleteAccountAction(Request $request, UserRepository $userRepository, TokenStorageInterface $tokenStorage)
|
public function deleteAccountAction(Request $request, UserRepository $userRepository, TokenStorageInterface $tokenStorage)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('delete-account', $request->request->get('token'))) {
|
if (!$this->isCsrfTokenValid('delete-account', $request->request->get('token'))) {
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$enabledUsers = $userRepository->getSumEnabledUsers();
|
$enabledUsers = $userRepository->getSumEnabledUsers();
|
||||||
@ -648,25 +603,19 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Switch view mode for current user.
|
* Switch view mode for current user.
|
||||||
*
|
*
|
||||||
* @Route("/config/view-mode", name="switch_view_mode", methods={"POST"})
|
* @Route("/config/view-mode", name="switch_view_mode")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function changeViewModeAction(Request $request)
|
public function changeViewModeAction(Request $request)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('switch-view-mode', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$user->getConfig()->setListMode(!$user->getConfig()->getListMode());
|
$user->getConfig()->setListMode(!$user->getConfig()->getListMode());
|
||||||
|
|
||||||
$this->entityManager->persist($user);
|
$this->entityManager->persist($user);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
|
return $this->redirect($request->headers->get('referer'));
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -674,16 +623,12 @@ class ConfigController extends AbstractController
|
|||||||
*
|
*
|
||||||
* @param string $language
|
* @param string $language
|
||||||
*
|
*
|
||||||
* @Route("/locale/{language}", name="changeLocale", methods={"POST"})
|
* @Route("/locale/{language}", name="changeLocale")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function setLocaleAction(Request $request, ValidatorInterface $validator, $language = null)
|
public function setLocaleAction(Request $request, ValidatorInterface $validator, $language = null)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('change-locale', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$errors = $validator->validate($language, (new LocaleConstraint()));
|
$errors = $validator->validate($language, (new LocaleConstraint()));
|
||||||
|
|
||||||
if (0 === \count($errors)) {
|
if (0 === \count($errors)) {
|
||||||
|
|||||||
@ -14,8 +14,8 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
|||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\CoreBundle\Entity\Tag;
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
@ -53,16 +53,12 @@ class EntryController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/mass", name="mass_action", methods={"POST"})
|
* @Route("/mass", name="mass_action")
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function massAction(Request $request, TagRepository $tagRepository)
|
public function massAction(Request $request, TagRepository $tagRepository)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('mass-action', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$values = $request->request->all();
|
$values = $request->request->all();
|
||||||
|
|
||||||
$tagsToAdd = [];
|
$tagsToAdd = [];
|
||||||
@ -132,7 +128,7 @@ class EntryController extends AbstractController
|
|||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
|
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -405,16 +401,12 @@ class EntryController extends AbstractController
|
|||||||
* Reload an entry.
|
* Reload an entry.
|
||||||
* Refetch content from the website and make it readable again.
|
* Refetch content from the website and make it readable again.
|
||||||
*
|
*
|
||||||
* @Route("/reload/{id}", name="reload_entry", methods={"POST"}, requirements={"id" = "\d+"})
|
* @Route("/reload/{id}", requirements={"id" = "\d+"}, name="reload_entry")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function reloadAction(Request $request, Entry $entry)
|
public function reloadAction(Entry $entry)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('reload-entry', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->checkUserAction($entry);
|
$this->checkUserAction($entry);
|
||||||
|
|
||||||
$this->updateEntry($entry, 'entry_reloaded');
|
$this->updateEntry($entry, 'entry_reloaded');
|
||||||
@ -438,16 +430,12 @@ class EntryController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Changes read status for an entry.
|
* Changes read status for an entry.
|
||||||
*
|
*
|
||||||
* @Route("/archive/{id}", name="archive_entry", methods={"POST"}, requirements={"id" = "\d+"})
|
* @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function toggleArchiveAction(Request $request, Entry $entry)
|
public function toggleArchiveAction(Request $request, Entry $entry)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('archive-entry', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->checkUserAction($entry);
|
$this->checkUserAction($entry);
|
||||||
|
|
||||||
$entry->toggleArchive();
|
$entry->toggleArchive();
|
||||||
@ -463,7 +451,7 @@ class EntryController extends AbstractController
|
|||||||
$message
|
$message
|
||||||
);
|
);
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
|
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -471,16 +459,12 @@ class EntryController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Changes starred status for an entry.
|
* Changes starred status for an entry.
|
||||||
*
|
*
|
||||||
* @Route("/star/{id}", name="star_entry", methods={"POST"}, requirements={"id" = "\d+"})
|
* @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function toggleStarAction(Request $request, Entry $entry)
|
public function toggleStarAction(Request $request, Entry $entry)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('star-entry', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->checkUserAction($entry);
|
$this->checkUserAction($entry);
|
||||||
|
|
||||||
$entry->toggleStar();
|
$entry->toggleStar();
|
||||||
@ -497,7 +481,7 @@ class EntryController extends AbstractController
|
|||||||
$message
|
$message
|
||||||
);
|
);
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
|
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -505,23 +489,20 @@ class EntryController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Deletes entry and redirect to the homepage or the last viewed page.
|
* Deletes entry and redirect to the homepage or the last viewed page.
|
||||||
*
|
*
|
||||||
* @Route("/delete/{id}", name="delete_entry", methods={"POST"}, requirements={"id" = "\d+"})
|
* @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry")
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteEntryAction(Request $request, Entry $entry)
|
public function deleteEntryAction(Request $request, Entry $entry)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('delete-entry', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->checkUserAction($entry);
|
$this->checkUserAction($entry);
|
||||||
|
|
||||||
// generates the view url for this entry to check for redirection later
|
// generates the view url for this entry to check for redirection later
|
||||||
// to avoid redirecting to the deleted entry. Ugh.
|
// to avoid redirecting to the deleted entry. Ugh.
|
||||||
$url = $this->generateUrl(
|
$url = $this->generateUrl(
|
||||||
'view',
|
'view',
|
||||||
['id' => $entry->getId()]
|
['id' => $entry->getId()],
|
||||||
|
UrlGeneratorInterface::ABSOLUTE_PATH
|
||||||
);
|
);
|
||||||
|
|
||||||
// entry deleted, dispatch event about it!
|
// entry deleted, dispatch event about it!
|
||||||
@ -536,8 +517,8 @@ class EntryController extends AbstractController
|
|||||||
);
|
);
|
||||||
|
|
||||||
// don't redirect user to the deleted entry (check that the referer doesn't end with the same url)
|
// don't redirect user to the deleted entry (check that the referer doesn't end with the same url)
|
||||||
$prev = $request->query->get('redirect', '');
|
$referer = $request->headers->get('referer');
|
||||||
$to = (1 !== preg_match('#' . $url . '$#i', $prev) ? $prev : null);
|
$to = (1 !== preg_match('#' . $url . '$#i', $referer) ? $referer : null);
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($to);
|
$redirectUrl = $this->redirectHelper->to($to);
|
||||||
|
|
||||||
@ -547,16 +528,12 @@ class EntryController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Get public URL for entry (and generate it if necessary).
|
* Get public URL for entry (and generate it if necessary).
|
||||||
*
|
*
|
||||||
* @Route("/share/{id}", name="share", methods={"POST"}, requirements={"id" = "\d+"})
|
* @Route("/share/{id}", requirements={"id" = "\d+"}, name="share")
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function shareAction(Request $request, Entry $entry)
|
public function shareAction(Entry $entry)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('share-entry', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->checkUserAction($entry);
|
$this->checkUserAction($entry);
|
||||||
|
|
||||||
if (null === $entry->getUid()) {
|
if (null === $entry->getUid()) {
|
||||||
@ -574,16 +551,12 @@ class EntryController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Disable public sharing for an entry.
|
* Disable public sharing for an entry.
|
||||||
*
|
*
|
||||||
* @Route("/share/delete/{id}", name="delete_share", methods={"POST"}, requirements={"id" = "\d+"})
|
* @Route("/share/delete/{id}", requirements={"id" = "\d+"}, name="delete_share")
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function deleteShareAction(Request $request, Entry $entry)
|
public function deleteShareAction(Entry $entry)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('delete-share', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->checkUserAction($entry);
|
$this->checkUserAction($entry);
|
||||||
|
|
||||||
$entry->cleanUid();
|
$entry->cleanUid();
|
||||||
@ -599,7 +572,7 @@ class EntryController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Ability to view a content publicly.
|
* Ability to view a content publicly.
|
||||||
*
|
*
|
||||||
* @Route("/share/{uid}", name="share_entry", methods={"GET"}, requirements={"uid" = ".+"})
|
* @Route("/share/{uid}", requirements={"uid" = ".+"}, name="share_entry")
|
||||||
* @Cache(maxage="25200", smaxage="25200", public=true)
|
* @Cache(maxage="25200", smaxage="25200", public=true)
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
@ -621,7 +594,7 @@ class EntryController extends AbstractController
|
|||||||
*
|
*
|
||||||
* @param int $page
|
* @param int $page
|
||||||
*
|
*
|
||||||
* @Route("/domain/{id}/{page}", requirements={"id" = "\d+"}, defaults={"page" = 1}, name="same_domain")
|
* @Route("/domain/{id}/{page}", requirements={"id" = ".+"}, defaults={"page" = 1}, name="same_domain")
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
@ -700,6 +673,9 @@ class EntryController extends AbstractController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$nbEntriesUntagged = $this->entryRepository
|
||||||
|
->countUntaggedEntriesByUser($this->getUser()->getId());
|
||||||
|
|
||||||
return $this->render(
|
return $this->render(
|
||||||
'@WallabagCore/Entry/entries.html.twig', [
|
'@WallabagCore/Entry/entries.html.twig', [
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
@ -707,6 +683,7 @@ class EntryController extends AbstractController
|
|||||||
'currentPage' => $page,
|
'currentPage' => $page,
|
||||||
'searchTerm' => $searchTerm,
|
'searchTerm' => $searchTerm,
|
||||||
'isFiltered' => $form->isSubmitted(),
|
'isFiltered' => $form->isSubmitted(),
|
||||||
|
'nbEntriesUntagged' => $nbEntriesUntagged,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
40
src/Wallabag/CoreBundle/Controller/ExceptionController.php
Normal file
40
src/Wallabag/CoreBundle/Controller/ExceptionController.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Wallabag\CoreBundle\Controller;
|
||||||
|
|
||||||
|
use Symfony\Bundle\TwigBundle\Controller\ExceptionController as BaseExceptionController;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This controller allow us to customize the error template.
|
||||||
|
* The only modified line from the parent template is for "WallabagCoreBundle".
|
||||||
|
*/
|
||||||
|
class ExceptionController extends BaseExceptionController
|
||||||
|
{
|
||||||
|
protected function findTemplate(Request $request, $format, $code, $showException)
|
||||||
|
{
|
||||||
|
$name = $showException ? 'exception' : 'error';
|
||||||
|
if ($showException && 'html' === $format) {
|
||||||
|
$name = 'exception_full';
|
||||||
|
}
|
||||||
|
|
||||||
|
// For error pages, try to find a template for the specific HTTP status code and format
|
||||||
|
if (!$showException) {
|
||||||
|
$template = sprintf('@WallabagCore/Exception/%s.%s.twig', $name, $format);
|
||||||
|
if ($this->templateExists($template)) {
|
||||||
|
return $template;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// try to find a template for the given format
|
||||||
|
$template = sprintf('@Twig/Exception/%s.%s.twig', $name, $format);
|
||||||
|
if ($this->templateExists($template)) {
|
||||||
|
return $template;
|
||||||
|
}
|
||||||
|
|
||||||
|
// default to a generic HTML exception
|
||||||
|
$request->setRequestFormat('html');
|
||||||
|
|
||||||
|
return sprintf('@Twig/Exception/%s.html.twig', $showException ? 'exception_full' : $name);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -10,7 +10,6 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
|||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
@ -46,7 +45,7 @@ class TagController extends AbstractController
|
|||||||
$form = $this->createForm(NewTagType::class, new Tag());
|
$form = $this->createForm(NewTagType::class, new Tag());
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
$tags = $form->get('label')->getData() ?? '';
|
$tags = $form->get('label')->getData();
|
||||||
$tagsExploded = explode(',', $tags);
|
$tagsExploded = explode(',', $tags);
|
||||||
|
|
||||||
// avoid too much tag to be added
|
// avoid too much tag to be added
|
||||||
@ -88,16 +87,12 @@ class TagController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Removes tag from entry.
|
* Removes tag from entry.
|
||||||
*
|
*
|
||||||
* @Route("/remove-tag/{entry}/{tag}", name="remove_tag", methods={"POST"}, requirements={"entry" = "\d+", "tag" = "\d+"})
|
* @Route("/remove-tag/{entry}/{tag}", requirements={"entry" = "\d+", "tag" = "\d+"}, name="remove_tag")
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function removeTagFromEntry(Request $request, Entry $entry, Tag $tag)
|
public function removeTagFromEntry(Request $request, Entry $entry, Tag $tag)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('remove-tag', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->checkUserAction($entry);
|
$this->checkUserAction($entry);
|
||||||
|
|
||||||
$entry->removeTag($tag);
|
$entry->removeTag($tag);
|
||||||
@ -109,7 +104,7 @@ class TagController extends AbstractController
|
|||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'), true);
|
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -190,7 +185,7 @@ class TagController extends AbstractController
|
|||||||
$form = $this->createForm(RenameTagType::class, new Tag());
|
$form = $this->createForm(RenameTagType::class, new Tag());
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'), true);
|
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$newTag = new Tag();
|
$newTag = new Tag();
|
||||||
@ -233,16 +228,12 @@ class TagController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Tag search results with the current search term.
|
* Tag search results with the current search term.
|
||||||
*
|
*
|
||||||
* @Route("/tag/search/{filter}", name="tag_this_search", methods={"POST"})
|
* @Route("/tag/search/{filter}", name="tag_this_search")
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function tagThisSearchAction($filter, Request $request, EntryRepository $entryRepository)
|
public function tagThisSearchAction($filter, Request $request, EntryRepository $entryRepository)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('tag-this-search', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$currentRoute = $request->query->has('currentRoute') ? $request->query->get('currentRoute') : '';
|
$currentRoute = $request->query->has('currentRoute') ? $request->query->get('currentRoute') : '';
|
||||||
|
|
||||||
/** @var QueryBuilder $qb */
|
/** @var QueryBuilder $qb */
|
||||||
@ -266,23 +257,19 @@ class TagController extends AbstractController
|
|||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirect($this->redirectHelper->to($request->query->get('redirect'), true));
|
return $this->redirect($this->redirectHelper->to($request->headers->get('referer'), '', true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a given tag for the current user.
|
* Delete a given tag for the current user.
|
||||||
*
|
*
|
||||||
* @Route("/tag/delete/{slug}", name="tag_delete", methods={"POST"})
|
* @Route("/tag/delete/{slug}", name="tag_delete")
|
||||||
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
|
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function removeTagAction(Tag $tag, Request $request, EntryRepository $entryRepository)
|
public function removeTagAction(Tag $tag, Request $request, EntryRepository $entryRepository)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('tag-delete', $request->request->get('token'))) {
|
|
||||||
throw new BadRequestHttpException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($tag->getEntriesByUserId($this->getUser()->getId()) as $entry) {
|
foreach ($tag->getEntriesByUserId($this->getUser()->getId()) as $entry) {
|
||||||
$entryRepository->removeTag($this->getUser()->getId(), $tag);
|
$entryRepository->removeTag($this->getUser()->getId(), $tag);
|
||||||
}
|
}
|
||||||
@ -292,7 +279,8 @@ class TagController extends AbstractController
|
|||||||
$this->entityManager->remove($tag);
|
$this->entityManager->remove($tag);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'), true);
|
|
||||||
|
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,6 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
|||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Wallabag\CoreBundle\Entity\Config;
|
use Wallabag\CoreBundle\Entity\Config;
|
||||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
|
||||||
|
|
||||||
class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
||||||
{
|
{
|
||||||
@ -16,7 +15,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager): void
|
public function load(ObjectManager $manager): void
|
||||||
{
|
{
|
||||||
$adminConfig = new Config($this->getReference('admin-user', User::class));
|
$adminConfig = new Config($this->getReference('admin-user'));
|
||||||
|
|
||||||
$adminConfig->setItemsPerPage(30);
|
$adminConfig->setItemsPerPage(30);
|
||||||
$adminConfig->setReadingSpeed(200);
|
$adminConfig->setReadingSpeed(200);
|
||||||
@ -30,7 +29,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
$this->addReference('admin-config', $adminConfig);
|
$this->addReference('admin-config', $adminConfig);
|
||||||
|
|
||||||
$bobConfig = new Config($this->getReference('bob-user', User::class));
|
$bobConfig = new Config($this->getReference('bob-user'));
|
||||||
$bobConfig->setItemsPerPage(10);
|
$bobConfig->setItemsPerPage(10);
|
||||||
$bobConfig->setReadingSpeed(200);
|
$bobConfig->setReadingSpeed(200);
|
||||||
$bobConfig->setLanguage('fr');
|
$bobConfig->setLanguage('fr');
|
||||||
@ -43,7 +42,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
$this->addReference('bob-config', $bobConfig);
|
$this->addReference('bob-config', $bobConfig);
|
||||||
|
|
||||||
$emptyConfig = new Config($this->getReference('empty-user', User::class));
|
$emptyConfig = new Config($this->getReference('empty-user'));
|
||||||
$emptyConfig->setItemsPerPage(10);
|
$emptyConfig->setItemsPerPage(10);
|
||||||
$emptyConfig->setReadingSpeed(100);
|
$emptyConfig->setReadingSpeed(100);
|
||||||
$emptyConfig->setLanguage('en');
|
$emptyConfig->setLanguage('en');
|
||||||
|
|||||||
@ -6,9 +6,7 @@ use Doctrine\Bundle\FixturesBundle\Fixture;
|
|||||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\CoreBundle\Entity\Tag;
|
|
||||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
|
||||||
|
|
||||||
class EntryFixtures extends Fixture implements DependentFixtureInterface
|
class EntryFixtures extends Fixture implements DependentFixtureInterface
|
||||||
{
|
{
|
||||||
@ -89,7 +87,7 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
];
|
];
|
||||||
|
|
||||||
foreach ($entries as $reference => $item) {
|
foreach ($entries as $reference => $item) {
|
||||||
$entry = new Entry($this->getReference($item['user'], User::class));
|
$entry = new Entry($this->getReference($item['user']));
|
||||||
$entry->setUrl($item['url']);
|
$entry->setUrl($item['url']);
|
||||||
$entry->setReadingTime($item['reading_time']);
|
$entry->setReadingTime($item['reading_time']);
|
||||||
$entry->setDomainName($item['domain']);
|
$entry->setDomainName($item['domain']);
|
||||||
@ -100,7 +98,7 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
if (isset($item['tags'])) {
|
if (isset($item['tags'])) {
|
||||||
foreach ($item['tags'] as $tag) {
|
foreach ($item['tags'] as $tag) {
|
||||||
$entry->addTag($this->getReference($tag, Tag::class));
|
$entry->addTag($this->getReference($tag));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,6 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
|||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
||||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
|
||||||
|
|
||||||
class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
|
class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
|
||||||
{
|
{
|
||||||
@ -18,7 +17,7 @@ class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureIn
|
|||||||
{
|
{
|
||||||
$rule = new IgnoreOriginUserRule();
|
$rule = new IgnoreOriginUserRule();
|
||||||
$rule->setRule('host = "example.fr"');
|
$rule->setRule('host = "example.fr"');
|
||||||
$rule->setConfig($this->getReference('admin-user', User::class)->getConfig());
|
$rule->setConfig($this->getReference('admin-user')->getConfig());
|
||||||
|
|
||||||
$manager->persist($rule);
|
$manager->persist($rule);
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|||||||
use Wallabag\CoreBundle\Entity\SiteCredential;
|
use Wallabag\CoreBundle\Entity\SiteCredential;
|
||||||
use Wallabag\CoreBundle\Helper\CryptoProxy;
|
use Wallabag\CoreBundle\Helper\CryptoProxy;
|
||||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
|
||||||
|
|
||||||
class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface, ContainerAwareInterface
|
class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface, ContainerAwareInterface
|
||||||
{
|
{
|
||||||
@ -29,14 +28,14 @@ class SiteCredentialFixtures extends Fixture implements DependentFixtureInterfac
|
|||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager): void
|
public function load(ObjectManager $manager): void
|
||||||
{
|
{
|
||||||
$credential = new SiteCredential($this->getReference('admin-user', User::class));
|
$credential = new SiteCredential($this->getReference('admin-user'));
|
||||||
$credential->setHost('.super.com');
|
$credential->setHost('.super.com');
|
||||||
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('.super'));
|
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('.super'));
|
||||||
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
|
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
|
||||||
|
|
||||||
$manager->persist($credential);
|
$manager->persist($credential);
|
||||||
|
|
||||||
$credential = new SiteCredential($this->getReference('admin-user', User::class));
|
$credential = new SiteCredential($this->getReference('admin-user'));
|
||||||
$credential->setHost('paywall.example.com');
|
$credential->setHost('paywall.example.com');
|
||||||
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('paywall.example'));
|
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('paywall.example'));
|
||||||
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
|
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
|
||||||
|
|||||||
@ -5,7 +5,6 @@ namespace Wallabag\CoreBundle\DataFixtures;
|
|||||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Wallabag\CoreBundle\Entity\Config;
|
|
||||||
use Wallabag\CoreBundle\Entity\TaggingRule;
|
use Wallabag\CoreBundle\Entity\TaggingRule;
|
||||||
|
|
||||||
class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
||||||
@ -18,14 +17,14 @@ class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
$tr1 = new TaggingRule();
|
$tr1 = new TaggingRule();
|
||||||
$tr1->setRule('content matches "spurs"');
|
$tr1->setRule('content matches "spurs"');
|
||||||
$tr1->setTags(['sport']);
|
$tr1->setTags(['sport']);
|
||||||
$tr1->setConfig($this->getReference('admin-config', Config::class));
|
$tr1->setConfig($this->getReference('admin-config'));
|
||||||
|
|
||||||
$manager->persist($tr1);
|
$manager->persist($tr1);
|
||||||
|
|
||||||
$tr2 = new TaggingRule();
|
$tr2 = new TaggingRule();
|
||||||
$tr2->setRule('content matches "basket"');
|
$tr2->setRule('content matches "basket"');
|
||||||
$tr2->setTags(['sport']);
|
$tr2->setTags(['sport']);
|
||||||
$tr2->setConfig($this->getReference('admin-config', Config::class));
|
$tr2->setConfig($this->getReference('admin-config'));
|
||||||
|
|
||||||
$manager->persist($tr2);
|
$manager->persist($tr2);
|
||||||
|
|
||||||
@ -33,28 +32,28 @@ class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
$tr3->setRule('title matches "wallabag"');
|
$tr3->setRule('title matches "wallabag"');
|
||||||
$tr3->setTags(['wallabag']);
|
$tr3->setTags(['wallabag']);
|
||||||
$tr3->setConfig($this->getReference('admin-config', Config::class));
|
$tr3->setConfig($this->getReference('admin-config'));
|
||||||
|
|
||||||
$manager->persist($tr3);
|
$manager->persist($tr3);
|
||||||
|
|
||||||
$tr4 = new TaggingRule();
|
$tr4 = new TaggingRule();
|
||||||
$tr4->setRule('content notmatches "basket"');
|
$tr4->setRule('content notmatches "basket"');
|
||||||
$tr4->setTags(['foot']);
|
$tr4->setTags(['foot']);
|
||||||
$tr4->setConfig($this->getReference('admin-config', Config::class));
|
$tr4->setConfig($this->getReference('admin-config'));
|
||||||
|
|
||||||
$manager->persist($tr4);
|
$manager->persist($tr4);
|
||||||
|
|
||||||
$tr5 = new TaggingRule();
|
$tr5 = new TaggingRule();
|
||||||
$tr5->setRule('readingTime <= 5');
|
$tr5->setRule('readingTime <= 5');
|
||||||
$tr5->setTags(['shortread']);
|
$tr5->setTags(['shortread']);
|
||||||
$tr5->setConfig($this->getReference('empty-config', Config::class));
|
$tr5->setConfig($this->getReference('empty-config'));
|
||||||
|
|
||||||
$manager->persist($tr5);
|
$manager->persist($tr5);
|
||||||
|
|
||||||
$tr6 = new TaggingRule();
|
$tr6 = new TaggingRule();
|
||||||
$tr6->setRule('readingTime > 5');
|
$tr6->setRule('readingTime > 5');
|
||||||
$tr6->setTags(['longread']);
|
$tr6->setTags(['longread']);
|
||||||
$tr6->setConfig($this->getReference('empty-config', Config::class));
|
$tr6->setConfig($this->getReference('empty-config'));
|
||||||
|
|
||||||
$manager->persist($tr6);
|
$manager->persist($tr6);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Wallabag\CoreBundle\Doctrine;
|
namespace Wallabag\CoreBundle\Doctrine;
|
||||||
|
|
||||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||||
@ -50,7 +49,7 @@ abstract class WallabagMigration extends AbstractMigration implements ContainerA
|
|||||||
}
|
}
|
||||||
|
|
||||||
// escape table name is handled using " on postgresql
|
// escape table name is handled using " on postgresql
|
||||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||||
return '"' . $table . '"';
|
return '"' . $table . '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
namespace Wallabag\CoreBundle\Event\Listener;
|
namespace Wallabag\CoreBundle\Event\Listener;
|
||||||
|
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
use Symfony\Component\HttpKernel\Event\RequestEvent;
|
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,7 +18,7 @@ class LocaleListener implements EventSubscriberInterface
|
|||||||
$this->defaultLocale = $defaultLocale;
|
$this->defaultLocale = $defaultLocale;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onKernelRequest(RequestEvent $event)
|
public function onKernelRequest(GetResponseEvent $event)
|
||||||
{
|
{
|
||||||
$request = $event->getRequest();
|
$request = $event->getRequest();
|
||||||
if (!$request->hasPreviousSession()) {
|
if (!$request->hasPreviousSession()) {
|
||||||
|
|||||||
@ -6,7 +6,6 @@ use Lexik\Bundle\FormFilterBundle\Filter\FilterOperands;
|
|||||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType;
|
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType;
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType;
|
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType;
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType;
|
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType;
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberFilterType;
|
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType;
|
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType;
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;
|
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
|
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
|
||||||
@ -103,13 +102,10 @@ class EntryFilterType extends AbstractType
|
|||||||
return $filterQuery->createCondition($expression);
|
return $filterQuery->createCondition($expression);
|
||||||
},
|
},
|
||||||
'label' => 'entry.filters.domain_label',
|
'label' => 'entry.filters.domain_label',
|
||||||
'attr' => [
|
|
||||||
'autocapitalize' => 'off',
|
|
||||||
],
|
|
||||||
])
|
])
|
||||||
->add('httpStatus', NumberFilterType::class, [
|
->add('httpStatus', TextFilterType::class, [
|
||||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||||
$value = (int) $values['value'];
|
$value = $values['value'];
|
||||||
if (false === \array_key_exists($value, Response::$statusTexts)) {
|
if (false === \array_key_exists($value, Response::$statusTexts)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -121,11 +117,6 @@ class EntryFilterType extends AbstractType
|
|||||||
return $filterQuery->createCondition($expression, $parameters);
|
return $filterQuery->createCondition($expression, $parameters);
|
||||||
},
|
},
|
||||||
'label' => 'entry.filters.http_status_label',
|
'label' => 'entry.filters.http_status_label',
|
||||||
'html5' => true,
|
|
||||||
'attr' => [
|
|
||||||
'min' => 100,
|
|
||||||
'max' => 527,
|
|
||||||
],
|
|
||||||
])
|
])
|
||||||
->add('isArchived', CheckboxFilterType::class, [
|
->add('isArchived', CheckboxFilterType::class, [
|
||||||
'label' => 'entry.filters.archived_label',
|
'label' => 'entry.filters.archived_label',
|
||||||
|
|||||||
@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Form\Type;
|
|||||||
|
|
||||||
use FOS\UserBundle\Form\Type\RegistrationFormType;
|
use FOS\UserBundle\Form\Type\RegistrationFormType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
@ -22,6 +23,15 @@ class UserInformationType extends AbstractType
|
|||||||
->add('email', EmailType::class, [
|
->add('email', EmailType::class, [
|
||||||
'label' => 'config.form_user.email_label',
|
'label' => 'config.form_user.email_label',
|
||||||
])
|
])
|
||||||
|
->add('emailTwoFactor', CheckboxType::class, [
|
||||||
|
'required' => false,
|
||||||
|
'label' => 'config.form_user.emailTwoFactor_label',
|
||||||
|
])
|
||||||
|
->add('googleTwoFactor', CheckboxType::class, [
|
||||||
|
'required' => false,
|
||||||
|
'label' => 'config.form_user.googleTwoFactor_label',
|
||||||
|
'mapped' => false,
|
||||||
|
])
|
||||||
->add('save', SubmitType::class, [
|
->add('save', SubmitType::class, [
|
||||||
'label' => 'config.form.save',
|
'label' => 'config.form.save',
|
||||||
])
|
])
|
||||||
|
|||||||
@ -9,11 +9,10 @@ use Http\Client\Common\HttpMethodsClient;
|
|||||||
use Http\Client\Common\Plugin\ErrorPlugin;
|
use Http\Client\Common\Plugin\ErrorPlugin;
|
||||||
use Http\Client\Common\Plugin\RedirectPlugin;
|
use Http\Client\Common\Plugin\RedirectPlugin;
|
||||||
use Http\Client\Common\PluginClient;
|
use Http\Client\Common\PluginClient;
|
||||||
use Http\Discovery\Psr17FactoryDiscovery;
|
use Http\Client\HttpClient;
|
||||||
use Psr\Http\Client\ClientInterface;
|
use Http\Discovery\MessageFactoryDiscovery;
|
||||||
use Psr\Http\Message\RequestFactoryInterface;
|
use Http\Message\MessageFactory;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\StreamFactoryInterface;
|
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\DomCrawler\Crawler;
|
use Symfony\Component\DomCrawler\Crawler;
|
||||||
use Symfony\Component\Finder\Finder;
|
use Symfony\Component\Finder\Finder;
|
||||||
@ -29,9 +28,9 @@ class DownloadImages
|
|||||||
private $mimeTypes;
|
private $mimeTypes;
|
||||||
private $wallabagUrl;
|
private $wallabagUrl;
|
||||||
|
|
||||||
public function __construct(ClientInterface $client, $baseFolder, $wallabagUrl, LoggerInterface $logger, RequestFactoryInterface $requestFactory = null, StreamFactoryInterface $streamFactory = null)
|
public function __construct(HttpClient $client, $baseFolder, $wallabagUrl, LoggerInterface $logger, MessageFactory $messageFactory = null)
|
||||||
{
|
{
|
||||||
$this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin(), new RedirectPlugin()]), $requestFactory ?: Psr17FactoryDiscovery::findRequestFactory(), $streamFactory ?: Psr17FactoryDiscovery::findStreamFactory());
|
$this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin(), new RedirectPlugin()]), $messageFactory ?: MessageFactoryDiscovery::find());
|
||||||
$this->baseFolder = $baseFolder;
|
$this->baseFolder = $baseFolder;
|
||||||
$this->wallabagUrl = rtrim($wallabagUrl, '/');
|
$this->wallabagUrl = rtrim($wallabagUrl, '/');
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace Wallabag\CoreBundle\Helper;
|
namespace Wallabag\CoreBundle\Helper;
|
||||||
|
|
||||||
use GuzzleHttp\Psr7\Uri;
|
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Wallabag\CoreBundle\Entity\Config;
|
use Wallabag\CoreBundle\Entity\Config;
|
||||||
@ -24,23 +23,16 @@ class Redirect
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $url URL to redirect
|
* @param string $url URL to redirect
|
||||||
|
* @param string $fallback Fallback URL if $url is null
|
||||||
* @param bool $ignoreActionMarkAsRead Ignore configured action when mark as read
|
* @param bool $ignoreActionMarkAsRead Ignore configured action when mark as read
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function to($url, $ignoreActionMarkAsRead = false)
|
public function to($url, $fallback = '', $ignoreActionMarkAsRead = false)
|
||||||
{
|
{
|
||||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||||
|
|
||||||
if (!$user instanceof User) {
|
if (!$user instanceof User) {
|
||||||
if (null === $url) {
|
|
||||||
return $this->router->generate('homepage');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Uri::isAbsolutePathReference(new Uri($url))) {
|
|
||||||
return $this->router->generate('homepage');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,14 +41,14 @@ class Redirect
|
|||||||
return $this->router->generate('homepage');
|
return $this->router->generate('homepage');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $url) {
|
if (null !== $url) {
|
||||||
|
return $url;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('' === $fallback) {
|
||||||
return $this->router->generate('homepage');
|
return $this->router->generate('homepage');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Uri::isAbsolutePathReference(new Uri($url))) {
|
return $fallback;
|
||||||
return $this->router->generate('homepage');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $url;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,20 +37,6 @@ class EntryRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves all entries count for a user.
|
|
||||||
*
|
|
||||||
* @param int $userId
|
|
||||||
*
|
|
||||||
* @return QueryBuilder
|
|
||||||
*/
|
|
||||||
public function getCountBuilderForAllByUser($userId)
|
|
||||||
{
|
|
||||||
return $this
|
|
||||||
->getQueryBuilderByUser($userId)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves unread entries for a user.
|
* Retrieves unread entries for a user.
|
||||||
*
|
*
|
||||||
@ -66,21 +52,6 @@ class EntryRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves unread entries count for a user.
|
|
||||||
*
|
|
||||||
* @param int $userId
|
|
||||||
*
|
|
||||||
* @return QueryBuilder
|
|
||||||
*/
|
|
||||||
public function getCountBuilderForUnreadByUser($userId)
|
|
||||||
{
|
|
||||||
return $this
|
|
||||||
->getQueryBuilderByUser($userId)
|
|
||||||
->andWhere('e.isArchived = false')
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves entries with the same domain.
|
* Retrieves entries with the same domain.
|
||||||
*
|
*
|
||||||
@ -123,21 +94,6 @@ class EntryRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves read entries count for a user.
|
|
||||||
*
|
|
||||||
* @param int $userId
|
|
||||||
*
|
|
||||||
* @return QueryBuilder
|
|
||||||
*/
|
|
||||||
public function getCountBuilderForArchiveByUser($userId)
|
|
||||||
{
|
|
||||||
return $this
|
|
||||||
->getQueryBuilderByUser($userId)
|
|
||||||
->andWhere('e.isArchived = true')
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves starred entries for a user.
|
* Retrieves starred entries for a user.
|
||||||
*
|
*
|
||||||
@ -153,21 +109,6 @@ class EntryRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves starred entries count for a user.
|
|
||||||
*
|
|
||||||
* @param int $userId
|
|
||||||
*
|
|
||||||
* @return QueryBuilder
|
|
||||||
*/
|
|
||||||
public function getCountBuilderForStarredByUser($userId)
|
|
||||||
{
|
|
||||||
return $this
|
|
||||||
->getQueryBuilderByUser($userId)
|
|
||||||
->andWhere('e.isStarred = true')
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves entries filtered with a search term for a user.
|
* Retrieves entries filtered with a search term for a user.
|
||||||
*
|
*
|
||||||
@ -622,23 +563,6 @@ class EntryRepository extends ServiceEntityRepository
|
|||||||
return $qb->getQuery()->getArrayResult();
|
return $qb->getQuery()->getArrayResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param int $userId
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function findEmptyEntriesIdByUserId($userId = null)
|
|
||||||
{
|
|
||||||
$qb = $this->createQueryBuilder('e')
|
|
||||||
->select('e.id');
|
|
||||||
|
|
||||||
if (null !== $userId) {
|
|
||||||
$qb->where('e.user = :userid AND e.content IS NULL')->setParameter(':userid', $userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $qb->getQuery()->getArrayResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find all entries by url and owner.
|
* Find all entries by url and owner.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -123,63 +123,48 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="set2" class="col s12">
|
<div id="set2" class="col s12">
|
||||||
<div class="row">
|
|
||||||
<div class="input-field col s12">
|
|
||||||
{{ 'config.form_feed.description'|trans }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col s12">
|
|
||||||
<h6 class="grey-text">{{ 'config.form_feed.token_label'|trans }}</h6>
|
|
||||||
<div>
|
|
||||||
{% if feed.token %}
|
|
||||||
{{ feed.token }}
|
|
||||||
{% else %}
|
|
||||||
<em>{{ 'config.form_feed.no_token'|trans }}</em>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if feed.token %}
|
|
||||||
–
|
|
||||||
<form action="{{ path('generate_token') }}" method="post" class="inline-block">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('generate-token') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-link">{{ 'config.form_feed.token_reset'|trans }}</button>
|
|
||||||
</form>
|
|
||||||
–
|
|
||||||
<form action="{{ path('revoke_token') }}" method="post" class="inline-block">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('revoke-token') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-link">{{ 'config.form_feed.token_revoke'|trans }}</button>
|
|
||||||
</form>
|
|
||||||
{% else %}
|
|
||||||
–
|
|
||||||
<form action="{{ path('generate_token') }}" method="post" class="inline-block">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('generate-token') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-link">{{ 'config.form_feed.token_create'|trans }}</button>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% if feed.token %}
|
|
||||||
<div class="row">
|
|
||||||
<div class="col s12">
|
|
||||||
<h6 class="grey-text">{{ 'config.form_feed.feed_links'|trans }}</h6>
|
|
||||||
<ul>
|
|
||||||
<li><a href="{{ path('unread_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.unread'|trans }}</a></li>
|
|
||||||
<li><a href="{{ path('starred_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.starred'|trans }}</a></li>
|
|
||||||
<li><a href="{{ path('archive_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.archive'|trans }}</a></li>
|
|
||||||
<li><a href="{{ path('all_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.all'|trans }}</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{{ form_start(form.feed) }}
|
{{ form_start(form.feed) }}
|
||||||
{{ form_errors(form.feed) }}
|
{{ form_errors(form.feed) }}
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="input-field col s12">
|
||||||
|
{{ 'config.form_feed.description'|trans }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col s12">
|
||||||
|
<h6 class="grey-text">{{ 'config.form_feed.token_label'|trans }}</h6>
|
||||||
|
<div>
|
||||||
|
{% if feed.token %}
|
||||||
|
{{ feed.token }}
|
||||||
|
{% else %}
|
||||||
|
<em>{{ 'config.form_feed.no_token'|trans }}</em>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if feed.token %}
|
||||||
|
– <a href="{{ path('generate_token') }}">{{ 'config.form_feed.token_reset'|trans }}</a>
|
||||||
|
– <a href="{{ path('revoke_token') }}">{{ 'config.form_feed.token_revoke'|trans }}</a>
|
||||||
|
{% else %}
|
||||||
|
– <a href="{{ path('generate_token') }}">{{ 'config.form_feed.token_create'|trans }}</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% if feed.token %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col s12">
|
||||||
|
<h6 class="grey-text">{{ 'config.form_feed.feed_links'|trans }}</h6>
|
||||||
|
<ul>
|
||||||
|
<li><a href="{{ path('unread_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.unread'|trans }}</a></li>
|
||||||
|
<li><a href="{{ path('starred_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.starred'|trans }}</a></li>
|
||||||
|
<li><a href="{{ path('archive_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.archive'|trans }}</a></li>
|
||||||
|
<li><a href="{{ path('all_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.all'|trans }}</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="input-field col s12">
|
<div class="input-field col s12">
|
||||||
{{ form_label(form.feed.feed_limit) }}
|
{{ form_label(form.feed.feed_limit) }}
|
||||||
@ -224,66 +209,38 @@
|
|||||||
|
|
||||||
{{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
|
{{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
<div class="row">
|
||||||
|
<h5>{{ 'config.otp.page_title'|trans }}</h5>
|
||||||
|
|
||||||
|
<p>{{ 'config.form_user.two_factor_description'|trans }}</p>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ 'config.form_user.two_factor.table_method'|trans }}</th>
|
||||||
|
<th>{{ 'config.form_user.two_factor.table_state'|trans }}</th>
|
||||||
|
<th>{{ 'config.form_user.two_factor.table_action'|trans }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>{{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}</td>
|
||||||
|
<td>{% if app.user.isEmailTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
|
||||||
|
<td><a href="{{ path('config_otp_email') }}" class="waves-effect waves-light btn{% if app.user.isEmailTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_email'|trans }}</a> {% if app.user.isEmailTwoFactor %}<a href="{{ path('disable_otp_email') }}" class="waves-effect waves-light btn red">Disable</a>{% endif %}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}</td>
|
||||||
|
<td>{% if app.user.isGoogleTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
|
||||||
|
<td><a href="{{ path('config_otp_app') }}" class="waves-effect waves-light btn{% if app.user.isGoogleTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_app'|trans }}</a> {% if app.user.isGoogleTwoFactor %}<a href="{{ path('disable_otp_app') }}" class="waves-effect waves-light btn red">Disable</a>{% endif %}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
{{ form_widget(form.user._token) }}
|
{{ form_widget(form.user._token) }}
|
||||||
|
</form>
|
||||||
{{ form_end(form.user) }}
|
|
||||||
|
|
||||||
<br/>
|
|
||||||
<br/>
|
|
||||||
<div class="row">
|
|
||||||
<h5>{{ 'config.otp.page_title'|trans }}</h5>
|
|
||||||
|
|
||||||
<p>{{ 'config.form_user.two_factor_description'|trans }}</p>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>{{ 'config.form_user.two_factor.table_method'|trans }}</th>
|
|
||||||
<th>{{ 'config.form_user.two_factor.table_state'|trans }}</th>
|
|
||||||
<th>{{ 'config.form_user.two_factor.table_action'|trans }}</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td>{{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}</td>
|
|
||||||
<td>{% if app.user.isEmailTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
|
|
||||||
<td>
|
|
||||||
<form action="{{ path('config_otp_email') }}" method="post" name="config_otp_email">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('otp') }}" />
|
|
||||||
|
|
||||||
<button class="waves-effect waves-light btn{% if app.user.isEmailTwoFactor %} disabled{% endif %}" type="submit">{{ 'config.form_user.two_factor.action_email'|trans }}</button>
|
|
||||||
</form>
|
|
||||||
{% if app.user.isEmailTwoFactor %}
|
|
||||||
<form action="{{ path('disable_otp_email') }}" method="post" name="disable_otp_email">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('otp') }}" />
|
|
||||||
|
|
||||||
<button class="waves-effect waves-light btn red" type="submit">Disable</button>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>{{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}</td>
|
|
||||||
<td>{% if app.user.isGoogleTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
|
|
||||||
<td>
|
|
||||||
<form action="{{ path('config_otp_app') }}" method="post" name="config_otp_app">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('otp') }}" />
|
|
||||||
|
|
||||||
<button class="waves-effect waves-light btn{% if app.user.isGoogleTwoFactor %} disabled{% endif %}" type="submit">{{ 'config.form_user.two_factor.action_app'|trans }}</button>
|
|
||||||
</form>
|
|
||||||
{% if app.user.isGoogleTwoFactor %}
|
|
||||||
<form action="{{ path('disable_otp_app') }}" method="post" name="disable_otp_app">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('otp') }}" />
|
|
||||||
|
|
||||||
<button class="waves-effect waves-light btn red" type="submit">Disable</button>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="set4" class="col s12">
|
<div id="set4" class="col s12">
|
||||||
@ -340,13 +297,9 @@
|
|||||||
<a href="{{ path('edit_tagging_rule', {id: tagging_rule.id}) }}" title="{{ 'config.form_rules.edit_rule_label'|trans }}" class="mode_edit_tagging_rule">
|
<a href="{{ path('edit_tagging_rule', {id: tagging_rule.id}) }}" title="{{ 'config.form_rules.edit_rule_label'|trans }}" class="mode_edit_tagging_rule">
|
||||||
<i class="tool grey-text material-icons">mode_edit</i>
|
<i class="tool grey-text material-icons">mode_edit</i>
|
||||||
</a>
|
</a>
|
||||||
<form action="{{ path('delete_tagging_rule', {id: tagging_rule.id}) }}" method="post" class="inline-block">
|
<a href="{{ path('delete_tagging_rule', {id: tagging_rule.id}) }}" title="{{ 'config.form_rules.delete_rule_label'|trans }}" class="delete_tagging_rule">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('delete-tagging-rule') }}"/>
|
<i class="tool grey-text material-icons">delete</i>
|
||||||
|
</a>
|
||||||
<button type="submit" title="{{ 'config.form_rules.delete_rule_label'|trans }}" class="btn-link">
|
|
||||||
<i class="tool grey-text material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
@ -524,13 +477,9 @@
|
|||||||
<a href="{{ path('edit_ignore_origin_rule', {id: ignore_origin_rule.id}) }}" title="{{ 'config.form_rules.edit_rule_label'|trans }}" class="mode_edit">
|
<a href="{{ path('edit_ignore_origin_rule', {id: ignore_origin_rule.id}) }}" title="{{ 'config.form_rules.edit_rule_label'|trans }}" class="mode_edit">
|
||||||
<i class="tool grey-text material-icons">mode_edit</i>
|
<i class="tool grey-text material-icons">mode_edit</i>
|
||||||
</a>
|
</a>
|
||||||
<form action="{{ path('delete_ignore_origin_rule', {id: ignore_origin_rule.id}) }}" method="post" class="inline-block">
|
<a href="{{ path('delete_ignore_origin_rule', {id: ignore_origin_rule.id}) }}" title="{{ 'config.form_rules.delete_rule_label'|trans }}" class="delete">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('delete-ignore-origin-rule') }}"/>
|
<i class="tool grey-text material-icons">delete</i>
|
||||||
|
</a>
|
||||||
<button type="submit" title="{{ 'config.form_rules.delete_rule_label'|trans }}" class="btn-link">
|
|
||||||
<i class="tool grey-text material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
@ -603,34 +552,18 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<h5>{{ 'config.reset.title'|trans }}</h5>
|
<h5>{{ 'config.reset.title'|trans }}</h5>
|
||||||
<p>{{ 'config.reset.description'|trans }}</p>
|
<p>{{ 'config.reset.description'|trans }}</p>
|
||||||
<p>
|
<a href="{{ path('config_reset', {type: 'annotations'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
|
||||||
<form action="{{ path('config_reset', {type: 'annotations'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-annotations">
|
{{ 'config.reset.annotations'|trans }}
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
|
</a>
|
||||||
|
<a href="{{ path('config_reset', {type: 'tags'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
|
||||||
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.annotations'|trans }}</button>
|
{{ 'config.reset.tags'|trans }}
|
||||||
</form>
|
</a>
|
||||||
</p>
|
<a href="{{ path('config_reset', {type: 'archived'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
|
||||||
<p>
|
{{ 'config.reset.archived'|trans }}
|
||||||
<form action="{{ path('config_reset', {type: 'tags'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-tags">
|
</a>
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
|
<a href="{{ path('config_reset', {type: 'entries'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
|
||||||
|
{{ 'config.reset.entries'|trans }}
|
||||||
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.tags'|trans }}</button>
|
</a>
|
||||||
</form>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<form action="{{ path('config_reset', {type: 'archived'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-archived">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
|
|
||||||
|
|
||||||
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.archived'|trans }}</button>
|
|
||||||
</form>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<form action="{{ path('config_reset', {type: 'entries'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-entries">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
|
|
||||||
|
|
||||||
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.entries'|trans }}</button>
|
|
||||||
</form>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if enabled_users > 1 %}
|
{% if enabled_users > 1 %}
|
||||||
|
|||||||
@ -40,16 +40,18 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<form class="form" action="{{ path("config_otp_app_check") }}" method="post">
|
<form class="form" action="{{ path("config_otp_app_check") }}" method="post">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('otp') }}" />
|
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="input-field col s12">
|
<div class="input-field col s12">
|
||||||
<label for="_auth_code">{{ "auth_code"|trans({}, 'SchebTwoFactorBundle') }}</label>
|
<label for="_auth_code">{{ "auth_code"|trans({}, 'SchebTwoFactorBundle') }}</label>
|
||||||
<input id="_auth_code" type="text" autocomplete="off" name="_auth_code" required="required" />
|
<input id="_auth_code" type="text" autocomplete="off" name="_auth_code" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-action">
|
<div class="card-action">
|
||||||
|
<a href="{{ path('config_otp_app_cancel') }}" class="waves-effect waves-light grey btn">
|
||||||
|
{{ 'config.otp.app.cancel'|trans }}
|
||||||
|
</a>
|
||||||
<button class="btn waves-effect waves-light" type="submit" name="send">
|
<button class="btn waves-effect waves-light" type="submit" name="send">
|
||||||
{{ 'config.otp.app.enable'|trans }}
|
{{ 'config.otp.app.enable'|trans }}
|
||||||
<i class="material-icons right">send</i>
|
<i class="material-icons right">send</i>
|
||||||
|
|||||||
@ -57,11 +57,9 @@
|
|||||||
|
|
||||||
<p>{{ 'developer.remove.warn_message_1'|trans({'%name%': client.name}) }}</p>
|
<p>{{ 'developer.remove.warn_message_1'|trans({'%name%': client.name}) }}</p>
|
||||||
<p>{{ 'developer.remove.warn_message_2'|trans({'%name%': client.name}) }}</p>
|
<p>{{ 'developer.remove.warn_message_2'|trans({'%name%': client.name}) }}</p>
|
||||||
<form action="{{ path('developer_delete_client', {id: client.id}) }}" method="post" name="delete-client">
|
<p>
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('delete-client') }}" />
|
<a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{{ 'developer.remove.action'|trans({'%name%': client.name}) }}</a>
|
||||||
|
</p>
|
||||||
<button class="waves-effect waves-light btn red" type="submit">{{ 'developer.remove.action'|trans({'%name%': client.name}) }}</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
<label class="entry-checkbox">
|
<div class="entry-checkbox">
|
||||||
<input type="checkbox" form="form_mass_action" class="entry-checkbox-input" data-js="entry-checkbox" name="entry-checkbox[]" value="{{ entry.id }}" />
|
<input type="checkbox" class="entry-checkbox-input" data-js="entry-checkbox" name="entry-checkbox[]" value="{{ entry.id }}" />
|
||||||
</label>
|
</div>
|
||||||
|
|||||||
@ -7,38 +7,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% set current_path = app.request.requesturi %}
|
|
||||||
|
|
||||||
<ul class="tools right">
|
<ul class="tools right">
|
||||||
<li>
|
<li>
|
||||||
<a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id, redirect: current_path}) }}" data-action="same_domain" data-entry-id="{{ entry.id }}"><i class="material-icons">language</i></a>
|
<a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id}) }}" data-action="same_domain" data-entry-id="{{ entry.id }}"><i class="material-icons">language</i></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<form action="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
|
<a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', {'id': entry.id}) }}" data-action="archived" data-entry-id="{{ entry.id }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a>
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('archive-entry') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.toogle_as_read'|trans }}">
|
|
||||||
<i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<form action="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
|
<a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', {'id': entry.id}) }}" data-action="star" data-entry-id="{{ entry.id }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a>
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('star-entry') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.toogle_as_star'|trans }}">
|
|
||||||
<i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<form action="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
|
<a title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" data-action-confirm="{{ 'entry.confirm.delete'|trans }}" class="tool grey-text delete" href="{{ path('delete_entry', {'id': entry.id}) }}" data-action="delete" data-entry-id="{{ entry.id }}"><i class="material-icons">delete</i></a>
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('delete-entry') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')">
|
|
||||||
<i class="material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -9,33 +9,12 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% include "@WallabagCore/Entry/Card/_content.html.twig" with {'entry': entry, 'withMetadata': true, 'subClass': 'metadata'} only %}
|
{% include "@WallabagCore/Entry/Card/_content.html.twig" with {'entry': entry, 'withMetadata': true, 'subClass': 'metadata'} only %}
|
||||||
|
|
||||||
{% set current_path = app.request.requesturi %}
|
|
||||||
|
|
||||||
<ul class="tools-list hide-on-small-only">
|
<ul class="tools-list hide-on-small-only">
|
||||||
<li>
|
<li>
|
||||||
<a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id, redirect: current_path}) }}"><i class="material-icons">language</i></a>
|
<a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id}) }}"><i class="material-icons">language</i></a>
|
||||||
<form action="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
|
<a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a>
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('archive-entry') }}"/>
|
<a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a>
|
||||||
|
<a title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" class="tool grey-text delete" href="{{ path('delete_entry', {'id': entry.id}) }}"><i class="material-icons">delete</i></a>
|
||||||
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.toogle_as_read'|trans }}">
|
|
||||||
<i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
<form action="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('star-entry') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.toogle_as_star'|trans }}">
|
|
||||||
<i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
<form action="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('delete-entry') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')">
|
|
||||||
<i class="material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<div class="card entry-card{% if currentRoute in routes and entry.isArchived %} archived{% endif %}">
|
<div class="card entry-card{% if currentRoute in routes and entry.isArchived %} archived{% endif %}">
|
||||||
{% include "@WallabagCore/Entry/Card/_mass_checkbox.html.twig" with {'entry': entry} only %}
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="{% if app.user.config.displayThumbnails %}card-image{% endif %} waves-effect waves-block waves-light">
|
<div class="{% if app.user.config.displayThumbnails %}card-image{% endif %} waves-effect waves-block waves-light">
|
||||||
|
{% include "@WallabagCore/Entry/Card/_mass_checkbox.html.twig" with {'entry': entry} only %}
|
||||||
<ul class="card-entry-labels">
|
<ul class="card-entry-labels">
|
||||||
{% for tag in entry.tags|slice(0, 3) %}
|
{% for tag in entry.tags|slice(0, 3) %}
|
||||||
<li title="{{ tag.label }}"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li>
|
<li title="{{ tag.label }}"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li>
|
||||||
|
|||||||
@ -4,14 +4,9 @@
|
|||||||
<li class="chip">
|
<li class="chip">
|
||||||
<a class="chip-label" href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a>
|
<a class="chip-label" href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a>
|
||||||
{% if withRemove is defined and withRemove == true %}
|
{% if withRemove is defined and withRemove == true %}
|
||||||
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
|
<a class="chip-action" href="{{ path('remove_tag', {'entry': entryId, 'tag': tag.id}) }}" onclick="return confirm('{{ 'entry.confirm.delete_tag'|trans|escape('js') }}')">
|
||||||
<form action="{{ path('remove_tag', {'entry': entryId, 'tag': tag.id, redirect: current_path}) }}" method="post">
|
<i class="material-icons vertical-align-middle">delete</i>
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('remove-tag') }}"/>
|
</a>
|
||||||
|
|
||||||
<button type="submit" class="btn-link chip-action" onclick="return confirm('{{ 'entry.confirm.delete_tag'|trans|escape('js') }}')">
|
|
||||||
<i class="material-icons vertical-align-middle">delete</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
{% elseif current_route == 'search' %}
|
{% elseif current_route == 'search' %}
|
||||||
{{ 'entry.page_titles.filtered_search'|trans }} {{ filter }}
|
{{ 'entry.page_titles.filtered_search'|trans }} {{ filter }}
|
||||||
{% elseif current_route == 'tag_entries' %}
|
{% elseif current_route == 'tag_entries' %}
|
||||||
{{ 'entry.page_titles.filtered_tags'|trans }} {{ tag.label }}
|
{{ 'entry.page_titles.filtered_tags'|trans }} {{ filter }}
|
||||||
{% elseif current_route == 'untagged' %}
|
{% elseif current_route == 'untagged' %}
|
||||||
{{ 'entry.page_titles.untagged'|trans }}
|
{{ 'entry.page_titles.untagged'|trans }}
|
||||||
{% elseif current_route == 'same_domain' %}
|
{% elseif current_route == 'same_domain' %}
|
||||||
|
|||||||
@ -19,27 +19,18 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% set current_path = app.request.requesturi %}
|
|
||||||
{% set list_mode = app.user.config.listMode %}
|
{% set list_mode = app.user.config.listMode %}
|
||||||
{% set entries_with_archived_class_routes = ['tag_entries', 'search', 'all'] %}
|
{% set entries_with_archived_class_routes = ['tag_entries', 'search', 'all'] %}
|
||||||
{% set current_route = app.request.attributes.get('_route') %}
|
{% set current_route = app.request.attributes.get('_route') %}
|
||||||
{% if current_route == 'homepage' %}
|
{% if current_route == 'homepage' %}
|
||||||
{% set current_route = 'unread' %}
|
{% set current_route = 'unread' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<form id="form_mass_action" name="form_mass_action" action="{{ path('mass_action', {redirect: current_path}) }}" method="post">
|
<form name="form_mass_action" action="{{ path('mass_action') }}" method="post">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('mass-action') }}"/>
|
|
||||||
</form>
|
|
||||||
<div class="results">
|
<div class="results">
|
||||||
<div class="nb-results">
|
<div class="nb-results">
|
||||||
{{ 'entry.list.number_on_the_page'|trans({'%count%': entries.count}) }}
|
{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
|
||||||
{% if entries.count > 0 %}
|
{% if entries.count > 0 %}
|
||||||
<form action="{{ path('switch_view_mode', {redirect: current_path}) }}" method="post" class="inline-block">
|
<a class="results-item" href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if list_mode == 0 %}view_list{% else %}view_module{% endif %}</i></a>
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('switch-view-mode') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-link results-item">
|
|
||||||
<i class="material-icons">{% if list_mode == 0 %}view_list{% else %}view_module{% endif %}</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if entries.count > 0 %}
|
{% if entries.count > 0 %}
|
||||||
<label for="mass-action-inputs-displayed" class="mass-action-toggle results-item tooltipped" data-position="right" data-delay="50" data-tooltip="{{ 'entry.list.toggle_mass_action'|trans }}"><i class="material-icons">library_add_check</i></label>
|
<label for="mass-action-inputs-displayed" class="mass-action-toggle results-item tooltipped" data-position="right" data-delay="50" data-tooltip="{{ 'entry.list.toggle_mass_action'|trans }}"><i class="material-icons">library_add_check</i></label>
|
||||||
@ -48,13 +39,7 @@
|
|||||||
{% include "@WallabagCore/Entry/_feed_link.html.twig" %}
|
{% include "@WallabagCore/Entry/_feed_link.html.twig" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% if current_route == 'search' %}
|
{% if current_route == 'search' %}<div><a href="{{ path('tag_this_search', {'filter': searchTerm, 'currentRoute': app.request.get('currentRoute')}) }}" title="{{ 'entry.list.assign_search_tag'|trans }}">{{ 'entry.list.assign_search_tag'|trans }}</a></div>{% endif %}
|
||||||
<form action="{{ path('tag_this_search', {'filter': searchTerm, 'currentRoute': app.request.get('currentRoute'), redirect: current_path}) }}" method="post">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('tag-this-search') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-link" title="{{ 'entry.list.assign_search_tag'|trans }}">{{ 'entry.list.assign_search_tag'|trans }}</button>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
{% if entries.getNbPages > 1 %}
|
{% if entries.getNbPages > 1 %}
|
||||||
{{ pagerfanta(entries, 'default_wallabag') }}
|
{{ pagerfanta(entries, 'default_wallabag') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -64,15 +49,17 @@
|
|||||||
<input id="mass-action-inputs-displayed" class="toggle-checkbox" type="checkbox" />
|
<input id="mass-action-inputs-displayed" class="toggle-checkbox" type="checkbox" />
|
||||||
<div class="mass-action">
|
<div class="mass-action">
|
||||||
<div class="mass-action-group">
|
<div class="mass-action-group">
|
||||||
<input type="checkbox" form="form_mass_action" class="entry-checkbox-input" data-toggle="[data-js='entry-checkbox']" data-js="checkboxes-toggle" />
|
<input type="checkbox" class="entry-checkbox-input" data-toggle="[data-js='entry-checkbox']" data-js="checkboxes-toggle" />
|
||||||
<button class="mass-action-button btn cyan darken-1" type="submit" form="form_mass_action" name="toggle-read" title="{{ 'entry.list.toogle_as_read'|trans }}"><i class="material-icons">done</i></button>
|
<button class="mass-action-button btn cyan darken-1" type="submit" name="toggle-read" title="{{ 'entry.list.toogle_as_read'|trans }}"><i class="material-icons">done</i></button>
|
||||||
<button class="mass-action-button btn cyan darken-1" type="submit" form="form_mass_action" name="toggle-star" title="{{ 'entry.list.toogle_as_star'|trans }}" ><i class="material-icons">star</i></button>
|
<button class="mass-action-button btn cyan darken-1" type="submit" name="toggle-star" title="{{ 'entry.list.toogle_as_star'|trans }}" ><i class="material-icons">star</i></button>
|
||||||
<button class="mass-action-button btn cyan darken-1" type="submit" form="form_mass_action" name="delete" onclick="return confirm('{{ 'entry.confirm.delete_entries'|trans|escape('js') }}')" title="{{ 'entry.list.delete'|trans }}"><i class="material-icons">delete</i></button>
|
<button class="mass-action-button btn cyan darken-1" type="submit" name="delete" onclick="return confirm('{{ 'entry.confirm.delete_entries'|trans|escape('js') }}')" title="{{ 'entry.list.delete'|trans }}"><i class="material-icons">delete</i></button>
|
||||||
|
<label for="mass-action-tags-displayed" class="mass-action-button btn cyan darken-1" type="button" title="{{ 'entry.list.add_tags'|trans }}"><i class="material-icons">label</i></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<input id="mass-action-tags-displayed" class="toggle-checkbox" type="checkbox" />
|
||||||
<div class="mass-action-tags">
|
<div class="mass-action-tags">
|
||||||
<button class="btn cyan darken-1 mass-action-button mass-action-button--tags" type="submit" form="form_mass_action" name="tag" title="{{ 'entry.list.add_tags'|trans }}"><i class="material-icons">label</i></button>
|
<input type="text" class="mass-action-tags-input" name="tags" placeholder="{{ 'entry.list.mass_action_tags_input_placeholder'|trans }}" />
|
||||||
<input type="text" form="form_mass_action" class="mass-action-tags-input" name="tags" placeholder="{{ 'entry.list.mass_action_tags_input_placeholder'|trans }}" />
|
<button class="btn cyan darken-1" type="submit" name="tag">{{ 'entry.list.add_tags'|trans }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -91,6 +78,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ol>
|
</ol>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</form>
|
||||||
|
|
||||||
{% if entries.getNbPages > 1 %}
|
{% if entries.getNbPages > 1 %}
|
||||||
<div class="results">
|
<div class="results">
|
||||||
@ -130,9 +118,9 @@
|
|||||||
<h4 class="center">{{ 'entry.filters.title'|trans }}</h4>
|
<h4 class="center">{{ 'entry.filters.title'|trans }}</h4>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% if current_route != 'untagged' %}
|
{% if current_route != 'untagged' and nbEntriesUntagged != 0 %}
|
||||||
<div class="col s12 center-align">
|
<div class="col s12 center-align">
|
||||||
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a>
|
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }} ({{ nbEntriesUntagged }})</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
{% block body_class %}entry{% endblock %}
|
{% block body_class %}entry{% endblock %}
|
||||||
|
|
||||||
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
|
|
||||||
|
|
||||||
{% block menu %}
|
{% block menu %}
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
<div class="determinate"></div>
|
<div class="determinate"></div>
|
||||||
@ -26,22 +24,14 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<ul class="right">
|
<ul class="right">
|
||||||
<li>
|
<li>
|
||||||
<form action="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
|
<a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_read'|trans }}" href="{{ path('archive_entry', {'id': entry.id}) }}" id="markAsRead">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('archive-entry') }}"/>
|
<i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
|
||||||
|
</a>
|
||||||
<button type="submit" class="waves-effect" title="{{ 'entry.view.left_menu.set_as_read'|trans }}">
|
|
||||||
<i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<form action="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
|
<a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', {'id': entry.id}) }}" id="setFav">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('star-entry') }}"/>
|
<i class="material-icons small">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
|
||||||
|
</a>
|
||||||
<button type="submit" class="waves-effect" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}">
|
|
||||||
<i class="material-icons small">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -64,14 +54,10 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="bold">
|
<li class="bold">
|
||||||
<form action="{{ path('reload_entry', {'id': entry.id}) }}" method="post">
|
<a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.re_fetch_content'|trans }}" href="{{ path('reload_entry', {'id': entry.id}) }}" id="reload">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('reload-entry') }}"/>
|
<i class="material-icons small">refresh</i>
|
||||||
|
<span>{{ 'entry.view.left_menu.re_fetch_content'|trans }}</span>
|
||||||
<button type="submit" class="waves-effect collapsible-header" onclick="return confirm('{{ 'entry.confirm.reload'|trans|escape('js') }}')" title="{{ 'entry.view.left_menu.re_fetch_content'|trans }}">
|
</a>
|
||||||
<i class="material-icons small">refresh</i>
|
|
||||||
<span>{{ 'entry.view.left_menu.re_fetch_content'|trans }}</span>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
<div class="collapsible-body"></div>
|
<div class="collapsible-body"></div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -81,37 +67,25 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<li class="bold hide-on-med-and-down">
|
<li class="bold hide-on-med-and-down">
|
||||||
<form action="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" method="post">
|
<a class="waves-effect collapsible-header markasread" title="{{ mark_as_read_label|trans }}" href="{{ path('archive_entry', {'id': entry.id}) }}" id="markAsRead">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('archive-entry') }}"/>
|
<i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
|
||||||
|
<span>{{ mark_as_read_label|trans }}</span>
|
||||||
<button type="submit" class="waves-effect collapsible-header markasread" title="{{ mark_as_read_label|trans }}">
|
</a>
|
||||||
<i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
|
|
||||||
<span>{{ mark_as_read_label|trans }}</span>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
<div class="collapsible-body"></div>
|
<div class="collapsible-body"></div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="bold hide-on-med-and-down">
|
<li class="bold hide-on-med-and-down">
|
||||||
<form action="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" method="post">
|
<a class="waves-effect collapsible-header favorite" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', {'id': entry.id}) }}" id="setFav">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('star-entry') }}"/>
|
<i class="material-icons spall">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
|
||||||
|
<span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span>
|
||||||
<button type="submit" class="waves-effect collapsible-header favorite" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}">
|
</a>
|
||||||
<i class="material-icons spall">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
|
|
||||||
<span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
<div class="collapsible-body"></div>
|
<div class="collapsible-body"></div>
|
||||||
</li>
|
</li>
|
||||||
<li class="bold border-bottom">
|
<li class="bold border-bottom">
|
||||||
<form action="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}" method="post">
|
<a class="waves-effect collapsible-header delete" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" title="{{ 'entry.view.left_menu.delete'|trans }}" href="{{ path('delete_entry', {'id': entry.id}) }}">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('delete-entry') }}"/>
|
<i class="material-icons small">delete</i>
|
||||||
|
<span>{{ 'entry.view.left_menu.delete'|trans }}</span>
|
||||||
<button type="submit" class="waves-effect collapsible-header delete" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" title="{{ 'entry.view.left_menu.delete'|trans }}">
|
</a>
|
||||||
<i class="material-icons small">delete</i>
|
|
||||||
<span>{{ 'entry.view.left_menu.delete'|trans }}</span>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
<div class="collapsible-body"></div>
|
<div class="collapsible-body"></div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -159,22 +133,14 @@
|
|||||||
<ul>
|
<ul>
|
||||||
{% if craue_setting('share_public') %}
|
{% if craue_setting('share_public') %}
|
||||||
<li>
|
<li>
|
||||||
<form action="{{ path('share', {'id': entry.id}) }}" method="post">
|
<a href="{{ path('share', {'id': entry.id}) }}" target="_blank" title="{{ 'entry.view.left_menu.public_link'|trans }}" class="tool icon-eye">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('share-entry') }}"/>
|
<span>{{ 'entry.view.left_menu.public_link'|trans }}</span>
|
||||||
|
</a>
|
||||||
<button type="submit" formtarget="_blank" class="btn-link tool icon-eye" title="{{ 'entry.view.left_menu.public_link'|trans }}">
|
|
||||||
<span>{{ 'entry.view.left_menu.public_link'|trans }}</span>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<form action="{{ path('delete_share', {'id': entry.id}) }}" method="post">
|
<a href="{{ path('delete_share', {'id': entry.id}) }}" title="{{ 'entry.view.left_menu.delete_public_link'|trans }}" class="tool icon-no-eye">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('delete-share') }}"/>
|
<span>{{ 'entry.view.left_menu.delete_public_link'|trans }}</span>
|
||||||
|
</a>
|
||||||
<button type="submit" class="btn-link tool icon-no-eye" title="{{ 'entry.view.left_menu.delete_public_link'|trans }}">
|
|
||||||
<span>{{ 'entry.view.left_menu.delete_public_link'|trans }}</span>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if craue_setting('share_twitter') %}
|
{% if craue_setting('share_twitter') %}
|
||||||
@ -303,7 +269,7 @@
|
|||||||
{% if entry.annotations|length %}
|
{% if entry.annotations|length %}
|
||||||
<li>
|
<li>
|
||||||
<i class="material-icons grey-text">comment</i>
|
<i class="material-icons grey-text">comment</i>
|
||||||
{{ 'entry.view.annotations_on_the_entry'|trans({'%count%': entry.annotations|length}) }}
|
{{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations|length) }}
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if entry.originUrl is not empty %}
|
{% if entry.originUrl is not empty %}
|
||||||
@ -332,33 +298,9 @@
|
|||||||
<i class="material-icons">menu</i>
|
<i class="material-icons">menu</i>
|
||||||
</a>
|
</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li><a class="btn-floating" href="{{ path('archive_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a></li>
|
||||||
<form action="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
|
<li><a class="btn-floating" href="{{ path('star_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i></a></li>
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('archive-entry') }}"/>
|
<li><a class="btn-floating" href="{{ path('delete_entry', {'id': entry.id}) }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')"><i class="material-icons">delete</i></a></li>
|
||||||
|
|
||||||
<button type="submit" class="btn-floating">
|
|
||||||
<i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<form action="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('star-entry') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-floating">
|
|
||||||
<i class="material-icons">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<form action="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
|
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('delete-entry') }}"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-floating" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')">
|
|
||||||
<i class="material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -102,7 +102,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/wallabag/wallabag/issues/">{{ 'quickstart.support.github'|trans }}</a></li>
|
<li><a href="https://github.com/wallabag/wallabag/issues/">{{ 'quickstart.support.github'|trans }}</a></li>
|
||||||
<li><a href="mailto:hello@wallabag.org">{{ 'quickstart.support.email'|trans }}</a></li>
|
<li><a href="mailto:hello@wallabag.org">{{ 'quickstart.support.email'|trans }}</a></li>
|
||||||
<li><a href="https://matrix.to/#/#wallabag:matrix.org">{{ 'quickstart.support.matrix'|trans }}</a></li>
|
<li><a href="https://gitter.im/wallabag/wallabag">{{ 'quickstart.support.gitter'|trans }}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<form class="tags-add-form" name="tag" method="post" action="{{ path('new_tag', {'entry': entry.id}) }}">
|
<form name="tag" method="post" action="{{ path('new_tag', {'entry': entry.id}) }}">
|
||||||
{% if form_errors(form) %}
|
{% if form_errors(form) %}
|
||||||
<span class="black-text">{{ form_errors(form) }}</span>
|
<span class="black-text">{{ form_errors(form) }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -9,6 +9,6 @@
|
|||||||
|
|
||||||
{{ form_widget(form.label, {'attr': {'autocomplete': 'off'}}) }}
|
{{ form_widget(form.label, {'attr': {'autocomplete': 'off'}}) }}
|
||||||
|
|
||||||
{{ form_widget(form.add, {'attr': {'class': 'btn waves-effect waves-light tags-add-form-submit'}}) }}
|
{{ form_widget(form.add, {'attr': {'class': 'btn waves-effect waves-light hide-on-large-only'}}) }}
|
||||||
{{ form_widget(form._token) }}
|
{{ form_widget(form._token) }}
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -3,10 +3,8 @@
|
|||||||
{% block title %}{{ 'tag.page_title'|trans }}{% endblock %}
|
{% block title %}{{ 'tag.page_title'|trans }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
|
|
||||||
|
|
||||||
<div class="results clearfix">
|
<div class="results clearfix">
|
||||||
{{ 'tag.list.number_on_the_page'|trans({'%count%': tags|length}) }}
|
{{ 'tag.list.number_on_the_page'|transchoice(tags|length) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -20,7 +18,7 @@
|
|||||||
{{ tag.label }} ({{ tag.nbEntries }})
|
{{ tag.label }} ({{ tag.nbEntries }})
|
||||||
</a>
|
</a>
|
||||||
{% if renameForms is defined and renameForms[tag.id] is defined %}
|
{% if renameForms is defined and renameForms[tag.id] is defined %}
|
||||||
<form class="card-tag-form hidden" data-handle="tag-rename-form" action="{{ path('tag_rename', {'slug': tag.slug, redirect: current_path}) }}" method="POST">
|
<form class="card-tag-form hidden" data-handle="tag-rename-form" action="{{ path('tag_rename', {'slug': tag.slug}) }}" method="POST">
|
||||||
{{ form_widget(renameForms[tag.id].label, {'attr': {'value': tag.label}}) }}
|
{{ form_widget(renameForms[tag.id].label, {'attr': {'value': tag.label}}) }}
|
||||||
{{ form_rest(renameForms[tag.id]) }}
|
{{ form_rest(renameForms[tag.id]) }}
|
||||||
</form>
|
</form>
|
||||||
@ -28,13 +26,9 @@
|
|||||||
<i class="material-icons">mode_edit</i>
|
<i class="material-icons">mode_edit</i>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<form action="{{ path('tag_delete', {'slug': tag.slug, redirect: current_path}) }}" method="post" class="inline-block">
|
<a id="delete-{{ tag.slug }}" href="{{ path('tag_delete', {'slug': tag.slug}) }}" class="card-tag-icon card-tag-delete" onclick="return confirm('{{ 'tag.confirm.delete'|trans({'%name%': tag.label})|escape('js') }}')">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('tag-delete') }}"/>
|
<i class="material-icons">delete</i>
|
||||||
|
</a>
|
||||||
<button type="submit" class="btn-link card-tag-icon card-tag-delete" onclick="return confirm('{{ 'tag.confirm.delete'|trans({'%name%': tag.label})|escape('js') }}')">
|
|
||||||
<i class="material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
{% if app.user.config.feedToken %}
|
{% if app.user.config.feedToken %}
|
||||||
<a rel="alternate" type="application/atom+xml" href="{{ path('tag_feed', {'username': app.user.username, 'token': app.user.config.feedToken, 'slug': tag.slug}) }}" class="card-tag-icon"><i class="material-icons">rss_feed</i></a>
|
<a rel="alternate" type="application/atom+xml" href="{{ path('tag_feed', {'username': app.user.username, 'token': app.user.config.feedToken, 'slug': tag.slug}) }}" class="card-tag-icon"><i class="material-icons">rss_feed</i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@ -168,7 +168,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col m12 l8">
|
<div class="col m12 l8">
|
||||||
<p class="footer-text">
|
<p class="footer-text" title="{{ display_stats()|raw|striptags }}">
|
||||||
{{ display_stats() }}
|
{{ display_stats() }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -8,7 +8,6 @@ use Twig\Extension\AbstractExtension;
|
|||||||
use Twig\Extension\GlobalsInterface;
|
use Twig\Extension\GlobalsInterface;
|
||||||
use Twig\TwigFilter;
|
use Twig\TwigFilter;
|
||||||
use Twig\TwigFunction;
|
use Twig\TwigFunction;
|
||||||
use Wallabag\AnnotationBundle\Repository\AnnotationRepository;
|
|
||||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||||
use Wallabag\CoreBundle\Repository\TagRepository;
|
use Wallabag\CoreBundle\Repository\TagRepository;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
@ -17,21 +16,19 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
|||||||
{
|
{
|
||||||
private $tokenStorage;
|
private $tokenStorage;
|
||||||
private $entryRepository;
|
private $entryRepository;
|
||||||
private $annotationRepository;
|
|
||||||
private $tagRepository;
|
private $tagRepository;
|
||||||
private $lifeTime;
|
private $lifeTime;
|
||||||
private $translator;
|
private $translator;
|
||||||
private $projectDir;
|
private $rootDir;
|
||||||
|
|
||||||
public function __construct(EntryRepository $entryRepository, AnnotationRepository $annotationRepository, TagRepository $tagRepository, TokenStorageInterface $tokenStorage, $lifeTime, TranslatorInterface $translator, string $projectDir)
|
public function __construct(EntryRepository $entryRepository, TagRepository $tagRepository, TokenStorageInterface $tokenStorage, $lifeTime, TranslatorInterface $translator, string $rootDir)
|
||||||
{
|
{
|
||||||
$this->entryRepository = $entryRepository;
|
$this->entryRepository = $entryRepository;
|
||||||
$this->annotationRepository = $annotationRepository;
|
|
||||||
$this->tagRepository = $tagRepository;
|
$this->tagRepository = $tagRepository;
|
||||||
$this->tokenStorage = $tokenStorage;
|
$this->tokenStorage = $tokenStorage;
|
||||||
$this->lifeTime = $lifeTime;
|
$this->lifeTime = $lifeTime;
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
$this->projectDir = $projectDir;
|
$this->rootDir = $rootDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getGlobals(): array
|
public function getGlobals(): array
|
||||||
@ -91,29 +88,35 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
|||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'starred':
|
case 'starred':
|
||||||
$qb = $this->entryRepository->getCountBuilderForStarredByUser($user->getId())->select('COUNT(e.id)');
|
$qb = $this->entryRepository->getBuilderForStarredByUser($user->getId());
|
||||||
break;
|
break;
|
||||||
case 'archive':
|
case 'archive':
|
||||||
$qb = $this->entryRepository->getCountBuilderForArchiveByUser($user->getId())->select('COUNT(e.id)');
|
$qb = $this->entryRepository->getBuilderForArchiveByUser($user->getId());
|
||||||
break;
|
break;
|
||||||
case 'unread':
|
case 'unread':
|
||||||
$qb = $this->entryRepository->getCountBuilderForUnreadByUser($user->getId())->select('COUNT(e.id)');
|
$qb = $this->entryRepository->getBuilderForUnreadByUser($user->getId());
|
||||||
break;
|
break;
|
||||||
case 'annotated':
|
case 'annotated':
|
||||||
$qb = $this->annotationRepository->getCountBuilderByUser($user->getId())->select('COUNT(DISTINCT e.entry)');
|
$qb = $this->entryRepository->getBuilderForAnnotationsByUser($user->getId());
|
||||||
break;
|
break;
|
||||||
case 'all':
|
case 'all':
|
||||||
$qb = $this->entryRepository->getCountBuilderForAllByUser($user->getId())->select('COUNT(e.id)');
|
$qb = $this->entryRepository->getBuilderForAllByUser($user->getId());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
|
throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = $qb->getQuery();
|
// THANKS to PostgreSQL we CAN'T make a DEAD SIMPLE count(e.id)
|
||||||
|
// ERROR: column "e0_.id" must appear in the GROUP BY clause or be used in an aggregate function
|
||||||
|
$query = $qb
|
||||||
|
->select('e.id')
|
||||||
|
->groupBy('e.id')
|
||||||
|
->getQuery();
|
||||||
|
|
||||||
$query->useQueryCache(true);
|
$query->useQueryCache(true);
|
||||||
$query->enableResultCache($this->lifeTime);
|
$query->enableResultCache($this->lifeTime);
|
||||||
|
|
||||||
return $query->getSingleScalarResult();
|
return \count($query->getArrayResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -145,14 +148,15 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = $this->entryRepository->getCountBuilderForArchiveByUser($user->getId())
|
$query = $this->entryRepository->getBuilderForArchiveByUser($user->getId())
|
||||||
->select('COUNT(e.id)')
|
->select('e.id')
|
||||||
|
->groupBy('e.id')
|
||||||
->getQuery();
|
->getQuery();
|
||||||
|
|
||||||
$query->useQueryCache(true);
|
$query->useQueryCache(true);
|
||||||
$query->enableResultCache($this->lifeTime);
|
$query->enableResultCache($this->lifeTime);
|
||||||
|
|
||||||
$nbArchives = $query->getSingleScalarResult();
|
$nbArchives = \count($query->getArrayResult());
|
||||||
|
|
||||||
$interval = $user->getCreatedAt()->diff(new \DateTime('now'));
|
$interval = $user->getCreatedAt()->diff(new \DateTime('now'));
|
||||||
$nbDays = (int) $interval->format('%a') ?: 1;
|
$nbDays = (int) $interval->format('%a') ?: 1;
|
||||||
@ -170,7 +174,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
|||||||
|
|
||||||
public function assetFileExists($name)
|
public function assetFileExists($name)
|
||||||
{
|
{
|
||||||
return file_exists(realpath($this->projectDir . '/web/' . $name));
|
return file_exists(realpath($this->rootDir . '/../web/' . $name));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function themeClass()
|
public function themeClass()
|
||||||
|
|||||||
@ -13,15 +13,10 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
|
|||||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||||
use Wallabag\ImportBundle\Import\ChromeImport;
|
use Wallabag\ImportBundle\Import\ChromeImport;
|
||||||
use Wallabag\ImportBundle\Import\DeliciousImport;
|
use Wallabag\ImportBundle\Import\DeliciousImport;
|
||||||
use Wallabag\ImportBundle\Import\ElcuratorImport;
|
|
||||||
use Wallabag\ImportBundle\Import\FirefoxImport;
|
use Wallabag\ImportBundle\Import\FirefoxImport;
|
||||||
use Wallabag\ImportBundle\Import\InstapaperImport;
|
use Wallabag\ImportBundle\Import\InstapaperImport;
|
||||||
use Wallabag\ImportBundle\Import\OmnivoreImport;
|
|
||||||
use Wallabag\ImportBundle\Import\PinboardImport;
|
use Wallabag\ImportBundle\Import\PinboardImport;
|
||||||
use Wallabag\ImportBundle\Import\PocketCsvImport;
|
|
||||||
use Wallabag\ImportBundle\Import\PocketHtmlImport;
|
|
||||||
use Wallabag\ImportBundle\Import\ReadabilityImport;
|
use Wallabag\ImportBundle\Import\ReadabilityImport;
|
||||||
use Wallabag\ImportBundle\Import\ShaarliImport;
|
|
||||||
use Wallabag\ImportBundle\Import\WallabagV1Import;
|
use Wallabag\ImportBundle\Import\WallabagV1Import;
|
||||||
use Wallabag\ImportBundle\Import\WallabagV2Import;
|
use Wallabag\ImportBundle\Import\WallabagV2Import;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
@ -39,31 +34,10 @@ class ImportCommand extends Command
|
|||||||
private InstapaperImport $instapaperImport;
|
private InstapaperImport $instapaperImport;
|
||||||
private PinboardImport $pinboardImport;
|
private PinboardImport $pinboardImport;
|
||||||
private DeliciousImport $deliciousImport;
|
private DeliciousImport $deliciousImport;
|
||||||
private OmnivoreImport $omnivoreImport;
|
|
||||||
private WallabagV1Import $wallabagV1Import;
|
private WallabagV1Import $wallabagV1Import;
|
||||||
private ElcuratorImport $elcuratorImport;
|
|
||||||
private ShaarliImport $shaarliImport;
|
|
||||||
private PocketHtmlImport $pocketHtmlImport;
|
|
||||||
private PocketCsvImport $pocketCsvImport;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(EntityManagerInterface $entityManager, TokenStorageInterface $tokenStorage, UserRepository $userRepository, WallabagV2Import $wallabagV2Import, FirefoxImport $firefoxImport, ChromeImport $chromeImport, ReadabilityImport $readabilityImport, InstapaperImport $instapaperImport, PinboardImport $pinboardImport, DeliciousImport $deliciousImport, WallabagV1Import $wallabagV1Import)
|
||||||
EntityManagerInterface $entityManager,
|
{
|
||||||
TokenStorageInterface $tokenStorage,
|
|
||||||
UserRepository $userRepository,
|
|
||||||
WallabagV2Import $wallabagV2Import,
|
|
||||||
FirefoxImport $firefoxImport,
|
|
||||||
ChromeImport $chromeImport,
|
|
||||||
ReadabilityImport $readabilityImport,
|
|
||||||
InstapaperImport $instapaperImport,
|
|
||||||
PinboardImport $pinboardImport,
|
|
||||||
DeliciousImport $deliciousImport,
|
|
||||||
WallabagV1Import $wallabagV1Import,
|
|
||||||
ElcuratorImport $elcuratorImport,
|
|
||||||
OmnivoreImport $omnivoreImport,
|
|
||||||
ShaarliImport $shaarliImport,
|
|
||||||
PocketHtmlImport $pocketHtmlImport,
|
|
||||||
PocketCsvImport $pocketCsvImport
|
|
||||||
) {
|
|
||||||
$this->entityManager = $entityManager;
|
$this->entityManager = $entityManager;
|
||||||
$this->tokenStorage = $tokenStorage;
|
$this->tokenStorage = $tokenStorage;
|
||||||
$this->userRepository = $userRepository;
|
$this->userRepository = $userRepository;
|
||||||
@ -74,12 +48,7 @@ class ImportCommand extends Command
|
|||||||
$this->instapaperImport = $instapaperImport;
|
$this->instapaperImport = $instapaperImport;
|
||||||
$this->pinboardImport = $pinboardImport;
|
$this->pinboardImport = $pinboardImport;
|
||||||
$this->deliciousImport = $deliciousImport;
|
$this->deliciousImport = $deliciousImport;
|
||||||
$this->omnivoreImport = $omnivoreImport;
|
|
||||||
$this->wallabagV1Import = $wallabagV1Import;
|
$this->wallabagV1Import = $wallabagV1Import;
|
||||||
$this->elcuratorImport = $elcuratorImport;
|
|
||||||
$this->shaarliImport = $shaarliImport;
|
|
||||||
$this->pocketHtmlImport = $pocketHtmlImport;
|
|
||||||
$this->pocketCsvImport = $pocketCsvImport;
|
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
@ -91,7 +60,7 @@ class ImportCommand extends Command
|
|||||||
->setDescription('Import entries from a JSON export')
|
->setDescription('Import entries from a JSON export')
|
||||||
->addArgument('username', InputArgument::REQUIRED, 'User to populate')
|
->addArgument('username', InputArgument::REQUIRED, 'User to populate')
|
||||||
->addArgument('filepath', InputArgument::REQUIRED, 'Path to the JSON file')
|
->addArgument('filepath', InputArgument::REQUIRED, 'Path to the JSON file')
|
||||||
->addOption('importer', null, InputOption::VALUE_OPTIONAL, 'The importer to use: v1, v2, instapaper, pinboard, delicious, readability, firefox, chrome, elcurator, shaarli, pocket or pocket_csv', 'v1')
|
->addOption('importer', null, InputOption::VALUE_OPTIONAL, 'The importer to use: v1, v2, instapaper, pinboard, delicious, readability, firefox or chrome', 'v1')
|
||||||
->addOption('markAsRead', null, InputOption::VALUE_OPTIONAL, 'Mark all entries as read', false)
|
->addOption('markAsRead', null, InputOption::VALUE_OPTIONAL, 'Mark all entries as read', false)
|
||||||
->addOption('useUserId', null, InputOption::VALUE_NONE, 'Use user id instead of username to find account')
|
->addOption('useUserId', null, InputOption::VALUE_NONE, 'Use user id instead of username to find account')
|
||||||
->addOption('disableContentUpdate', null, InputOption::VALUE_NONE, 'Disable fetching updated content from URL')
|
->addOption('disableContentUpdate', null, InputOption::VALUE_NONE, 'Disable fetching updated content from URL')
|
||||||
@ -151,21 +120,6 @@ class ImportCommand extends Command
|
|||||||
case 'delicious':
|
case 'delicious':
|
||||||
$import = $this->deliciousImport;
|
$import = $this->deliciousImport;
|
||||||
break;
|
break;
|
||||||
case 'omnivore':
|
|
||||||
$import = $this->omnivoreImport;
|
|
||||||
break;
|
|
||||||
case 'elcurator':
|
|
||||||
$import = $this->elcuratorImport;
|
|
||||||
break;
|
|
||||||
case 'shaarli':
|
|
||||||
$import = $this->shaarliImport;
|
|
||||||
break;
|
|
||||||
case 'pocket':
|
|
||||||
$import = $this->pocketHtmlImport;
|
|
||||||
break;
|
|
||||||
case 'pocket_csv':
|
|
||||||
$import = $this->pocketCsvImport;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
$import = $this->wallabagV1Import;
|
$import = $this->wallabagV1Import;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class RedisWorkerCommand extends Command
|
|||||||
$this
|
$this
|
||||||
->setName('wallabag:import:redis-worker')
|
->setName('wallabag:import:redis-worker')
|
||||||
->setDescription('Launch Redis worker')
|
->setDescription('Launch Redis worker')
|
||||||
->addArgument('serviceName', InputArgument::REQUIRED, 'Service to use: wallabag_v1, wallabag_v2, pocket, readability, pinboard, delicious, omnivore, firefox, chrome or instapaper')
|
->addArgument('serviceName', InputArgument::REQUIRED, 'Service to use: wallabag_v1, wallabag_v2, pocket, readability, pinboard, delicious, firefox, chrome or instapaper')
|
||||||
->addOption('maxIterations', '', InputOption::VALUE_OPTIONAL, 'Number of iterations before stopping', false)
|
->addOption('maxIterations', '', InputOption::VALUE_OPTIONAL, 'Number of iterations before stopping', false)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,27 +20,9 @@ class RabbitMQConsumerTotalProxy
|
|||||||
private Consumer $pinboardConsumer;
|
private Consumer $pinboardConsumer;
|
||||||
private Consumer $deliciousConsumer;
|
private Consumer $deliciousConsumer;
|
||||||
private Consumer $elcuratorConsumer;
|
private Consumer $elcuratorConsumer;
|
||||||
private Consumer $omnivoreConsumer;
|
|
||||||
private Consumer $shaarliConsumer;
|
|
||||||
private Consumer $pocketHtmlConsumer;
|
|
||||||
private Consumer $pocketCsvConsumer;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(Consumer $pocketConsumer, Consumer $readabilityConsumer, Consumer $wallabagV1Consumer, Consumer $wallabagV2Consumer, Consumer $firefoxConsumer, Consumer $chromeConsumer, Consumer $instapaperConsumer, Consumer $pinboardConsumer, Consumer $deliciousConsumer, Consumer $elcuratorConsumer)
|
||||||
Consumer $pocketConsumer,
|
{
|
||||||
Consumer $readabilityConsumer,
|
|
||||||
Consumer $wallabagV1Consumer,
|
|
||||||
Consumer $wallabagV2Consumer,
|
|
||||||
Consumer $firefoxConsumer,
|
|
||||||
Consumer $chromeConsumer,
|
|
||||||
Consumer $instapaperConsumer,
|
|
||||||
Consumer $pinboardConsumer,
|
|
||||||
Consumer $deliciousConsumer,
|
|
||||||
Consumer $elcuratorConsumer,
|
|
||||||
Consumer $omnivoreConsumer,
|
|
||||||
Consumer $shaarliConsumer,
|
|
||||||
Consumer $pocketHtmlConsumer,
|
|
||||||
Consumer $pocketCsvConsumer
|
|
||||||
) {
|
|
||||||
$this->pocketConsumer = $pocketConsumer;
|
$this->pocketConsumer = $pocketConsumer;
|
||||||
$this->readabilityConsumer = $readabilityConsumer;
|
$this->readabilityConsumer = $readabilityConsumer;
|
||||||
$this->wallabagV1Consumer = $wallabagV1Consumer;
|
$this->wallabagV1Consumer = $wallabagV1Consumer;
|
||||||
@ -51,10 +33,6 @@ class RabbitMQConsumerTotalProxy
|
|||||||
$this->pinboardConsumer = $pinboardConsumer;
|
$this->pinboardConsumer = $pinboardConsumer;
|
||||||
$this->deliciousConsumer = $deliciousConsumer;
|
$this->deliciousConsumer = $deliciousConsumer;
|
||||||
$this->elcuratorConsumer = $elcuratorConsumer;
|
$this->elcuratorConsumer = $elcuratorConsumer;
|
||||||
$this->omnivoreConsumer = $omnivoreConsumer;
|
|
||||||
$this->shaarliConsumer = $shaarliConsumer;
|
|
||||||
$this->pocketHtmlConsumer = $pocketHtmlConsumer;
|
|
||||||
$this->pocketCsvConsumer = $pocketCsvConsumer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,18 +77,6 @@ class RabbitMQConsumerTotalProxy
|
|||||||
case 'elcurator':
|
case 'elcurator':
|
||||||
$consumer = $this->elcuratorConsumer;
|
$consumer = $this->elcuratorConsumer;
|
||||||
break;
|
break;
|
||||||
case 'omnivore':
|
|
||||||
$consumer = $this->omnivoreConsumer;
|
|
||||||
break;
|
|
||||||
case 'shaarli':
|
|
||||||
$consumer = $this->shaarliConsumer;
|
|
||||||
break;
|
|
||||||
case 'pocket_html':
|
|
||||||
$consumer = $this->pocketHtmlConsumer;
|
|
||||||
break;
|
|
||||||
case 'pocket_csv':
|
|
||||||
$consumer = $this->pocketCsvConsumer;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,83 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Wallabag\ImportBundle\Controller;
|
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
|
||||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
|
||||||
use Wallabag\ImportBundle\Import\ImportInterface;
|
|
||||||
|
|
||||||
abstract class HtmlController extends AbstractController
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @Route("/html", name="import_html")
|
|
||||||
*
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
|
||||||
{
|
|
||||||
$form = $this->createForm(UploadImportType::class);
|
|
||||||
$form->handleRequest($request);
|
|
||||||
|
|
||||||
$wallabag = $this->getImportService();
|
|
||||||
$wallabag->setUser($this->getUser());
|
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
|
||||||
$file = $form->get('file')->getData();
|
|
||||||
$markAsRead = $form->get('mark_as_read')->getData();
|
|
||||||
$name = $this->getUser()->getId() . '.html';
|
|
||||||
|
|
||||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) {
|
|
||||||
$res = $wallabag
|
|
||||||
->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name)
|
|
||||||
->setMarkAsRead($markAsRead)
|
|
||||||
->import();
|
|
||||||
|
|
||||||
$message = 'flashes.import.notice.failed';
|
|
||||||
|
|
||||||
if (true === $res) {
|
|
||||||
$summary = $wallabag->getSummary();
|
|
||||||
$message = $translator->trans('flashes.import.notice.summary', [
|
|
||||||
'%imported%' => $summary['imported'],
|
|
||||||
'%skipped%' => $summary['skipped'],
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (0 < $summary['queued']) {
|
|
||||||
$message = $translator->trans('flashes.import.notice.summary_with_queue', [
|
|
||||||
'%queued%' => $summary['queued'],
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->addFlash('notice', $message);
|
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('homepage'));
|
|
||||||
}
|
|
||||||
$this->addFlash('notice', 'flashes.import.notice.failed_on_file');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->render($this->getImportTemplate(), [
|
|
||||||
'form' => $form->createView(),
|
|
||||||
'import' => $wallabag,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the service to handle the import.
|
|
||||||
*
|
|
||||||
* @return ImportInterface
|
|
||||||
*/
|
|
||||||
abstract protected function getImportService();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the template used for the form.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
abstract protected function getImportTemplate();
|
|
||||||
}
|
|
||||||
@ -4,13 +4,13 @@ namespace Wallabag\ImportBundle\Controller;
|
|||||||
|
|
||||||
use Craue\ConfigBundle\Util\Config;
|
use Craue\ConfigBundle\Util\Config;
|
||||||
use Predis\Client;
|
use Predis\Client;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Wallabag\ImportBundle\Consumer\RabbitMQConsumerTotalProxy;
|
use Wallabag\ImportBundle\Consumer\RabbitMQConsumerTotalProxy;
|
||||||
use Wallabag\ImportBundle\Import\ImportChain;
|
use Wallabag\ImportBundle\Import\ImportChain;
|
||||||
|
|
||||||
class ImportController extends AbstractController
|
class ImportController extends Controller
|
||||||
{
|
{
|
||||||
private RabbitMQConsumerTotalProxy $rabbitMQConsumerTotalProxy;
|
private RabbitMQConsumerTotalProxy $rabbitMQConsumerTotalProxy;
|
||||||
|
|
||||||
@ -57,10 +57,6 @@ class ImportController extends AbstractController
|
|||||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('pinboard')
|
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('pinboard')
|
||||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('delicious')
|
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('delicious')
|
||||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('elcurator')
|
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('elcurator')
|
||||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('omnivore')
|
|
||||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('shaarli')
|
|
||||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('pocket_html')
|
|
||||||
+ $this->rabbitMQConsumerTotalProxy->getTotalMessage('pocket_csv')
|
|
||||||
;
|
;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$rabbitNotInstalled = true;
|
$rabbitNotInstalled = true;
|
||||||
@ -79,10 +75,6 @@ class ImportController extends AbstractController
|
|||||||
+ $redis->llen('wallabag.import.pinboard')
|
+ $redis->llen('wallabag.import.pinboard')
|
||||||
+ $redis->llen('wallabag.import.delicious')
|
+ $redis->llen('wallabag.import.delicious')
|
||||||
+ $redis->llen('wallabag.import.elcurator')
|
+ $redis->llen('wallabag.import.elcurator')
|
||||||
+ $redis->llen('wallabag.import.omnivore')
|
|
||||||
+ $redis->llen('wallabag.import.shaarli')
|
|
||||||
+ $redis->llen('wallabag.import.pocket_html')
|
|
||||||
+ $redis->llen('wallabag.import.pocket_csv')
|
|
||||||
;
|
;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$redisNotInstalled = true;
|
$redisNotInstalled = true;
|
||||||
|
|||||||
@ -1,84 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Wallabag\ImportBundle\Controller;
|
|
||||||
|
|
||||||
use Craue\ConfigBundle\Util\Config;
|
|
||||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
|
||||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
|
||||||
use Wallabag\ImportBundle\Import\OmnivoreImport;
|
|
||||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
|
||||||
|
|
||||||
class OmnivoreController extends AbstractController
|
|
||||||
{
|
|
||||||
private RabbitMqProducer $rabbitMqProducer;
|
|
||||||
private RedisProducer $redisProducer;
|
|
||||||
|
|
||||||
public function __construct(RabbitMqProducer $rabbitMqProducer, RedisProducer $redisProducer)
|
|
||||||
{
|
|
||||||
$this->rabbitMqProducer = $rabbitMqProducer;
|
|
||||||
$this->redisProducer = $redisProducer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route("/omnivore", name="import_omnivore")
|
|
||||||
*/
|
|
||||||
public function indexAction(Request $request, OmnivoreImport $omnivore, Config $craueConfig, TranslatorInterface $translator)
|
|
||||||
{
|
|
||||||
$form = $this->createForm(UploadImportType::class);
|
|
||||||
$form->handleRequest($request);
|
|
||||||
|
|
||||||
$omnivore->setUser($this->getUser());
|
|
||||||
|
|
||||||
if ($craueConfig->get('import_with_rabbitmq')) {
|
|
||||||
$omnivore->setProducer($this->rabbitMqProducer);
|
|
||||||
} elseif ($craueConfig->get('import_with_redis')) {
|
|
||||||
$omnivore->setProducer($this->redisProducer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
|
||||||
$file = $form->get('file')->getData();
|
|
||||||
$markAsRead = $form->get('mark_as_read')->getData();
|
|
||||||
$name = 'omnivore_' . $this->getUser()->getId() . '.json';
|
|
||||||
|
|
||||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) {
|
|
||||||
$res = $omnivore
|
|
||||||
->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name)
|
|
||||||
->setMarkAsRead($markAsRead)
|
|
||||||
->import();
|
|
||||||
|
|
||||||
$message = 'flashes.import.notice.failed';
|
|
||||||
|
|
||||||
if (true === $res) {
|
|
||||||
$summary = $omnivore->getSummary();
|
|
||||||
$message = $translator->trans('flashes.import.notice.summary', [
|
|
||||||
'%imported%' => $summary['imported'],
|
|
||||||
'%skipped%' => $summary['skipped'],
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (0 < $summary['queued']) {
|
|
||||||
$message = $translator->trans('flashes.import.notice.summary_with_queue', [
|
|
||||||
'%queued%' => $summary['queued'],
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->addFlash('notice', $message);
|
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('homepage'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->addFlash('notice', 'flashes.import.notice.failed_on_file');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->render('@WallabagImport/Omnivore/index.html.twig', [
|
|
||||||
'form' => $form->createView(),
|
|
||||||
'import' => $omnivore,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Wallabag\ImportBundle\Controller;
|
|
||||||
|
|
||||||
use Craue\ConfigBundle\Util\Config;
|
|
||||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
|
||||||
use Wallabag\ImportBundle\Import\PocketCsvImport;
|
|
||||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
|
||||||
|
|
||||||
class PocketCsvController extends HtmlController
|
|
||||||
{
|
|
||||||
private PocketCsvImport $pocketCsvImport;
|
|
||||||
private Config $craueConfig;
|
|
||||||
private RabbitMqProducer $rabbitMqProducer;
|
|
||||||
private RedisProducer $redisProducer;
|
|
||||||
|
|
||||||
public function __construct(PocketCsvImport $pocketCsvImport, Config $craueConfig, RabbitMqProducer $rabbitMqProducer, RedisProducer $redisProducer)
|
|
||||||
{
|
|
||||||
$this->pocketCsvImport = $pocketCsvImport;
|
|
||||||
$this->craueConfig = $craueConfig;
|
|
||||||
$this->rabbitMqProducer = $rabbitMqProducer;
|
|
||||||
$this->redisProducer = $redisProducer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route("/pocket_csv", name="import_pocket_csv")
|
|
||||||
*/
|
|
||||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
|
||||||
{
|
|
||||||
return parent::indexAction($request, $translator);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
protected function getImportService()
|
|
||||||
{
|
|
||||||
if ($this->craueConfig->get('import_with_rabbitmq')) {
|
|
||||||
$this->pocketCsvImport->setProducer($this->rabbitMqProducer);
|
|
||||||
} elseif ($this->craueConfig->get('import_with_redis')) {
|
|
||||||
$this->pocketCsvImport->setProducer($this->redisProducer);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->pocketCsvImport;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
protected function getImportTemplate()
|
|
||||||
{
|
|
||||||
return '@WallabagImport/PocketCsv/index.html.twig';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user