forked from wallabag/wallabag
Compare commits
3 Commits
master
...
fix-instal
| Author | SHA1 | Date | |
|---|---|---|---|
| 357ce8f7c3 | |||
| e185e03c6e | |||
| 2c688daf2a |
15
.github/dependabot.yml
vendored
15
.github/dependabot.yml
vendored
@ -7,13 +7,6 @@ updates:
|
|||||||
time: "04:00"
|
time: "04:00"
|
||||||
timezone: Europe/Paris
|
timezone: Europe/Paris
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
groups:
|
|
||||||
babel-dependencies:
|
|
||||||
patterns:
|
|
||||||
- "*babel*"
|
|
||||||
fontsource-dependencies:
|
|
||||||
patterns:
|
|
||||||
- "*fontsource*"
|
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: materialize-css
|
- dependency-name: materialize-css
|
||||||
versions:
|
versions:
|
||||||
@ -25,10 +18,6 @@ updates:
|
|||||||
time: "04:00"
|
time: "04:00"
|
||||||
timezone: Europe/Paris
|
timezone: Europe/Paris
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
groups:
|
|
||||||
symfony-dependencies:
|
|
||||||
patterns:
|
|
||||||
- "symfony/*"
|
|
||||||
reviewers:
|
reviewers:
|
||||||
- j0k3r
|
- j0k3r
|
||||||
- tcitworld
|
- tcitworld
|
||||||
@ -37,10 +26,6 @@ updates:
|
|||||||
- dependency-name: lcobucci/jwt
|
- dependency-name: lcobucci/jwt
|
||||||
versions:
|
versions:
|
||||||
- ">= 4.2.0"
|
- ">= 4.2.0"
|
||||||
# until we add support for Symfony 5+
|
|
||||||
- dependency-name: symfony/*
|
|
||||||
versions:
|
|
||||||
- ">= 5.0.0"
|
|
||||||
- package-ecosystem: github-actions
|
- package-ecosystem: github-actions
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
|
|||||||
44
.github/workflows/assets.yml
vendored
Normal file
44
.github/workflows/assets.yml
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
name: "Assets"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- 2.*
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
js:
|
||||||
|
name: "Building assets"
|
||||||
|
runs-on: "ubuntu-20.04"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: "actions/checkout@v3"
|
||||||
|
|
||||||
|
- name: "Install Node"
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
|
||||||
|
- name: "Install dependencies with Yarn"
|
||||||
|
run: "yarn install"
|
||||||
|
|
||||||
|
- name: "Build dev assets"
|
||||||
|
run: "yarn run build:dev"
|
||||||
|
|
||||||
|
- name: "Build prod assets"
|
||||||
|
run: "yarn run build:prod"
|
||||||
|
|
||||||
|
- name: "Validate no change were created"
|
||||||
|
run: |
|
||||||
|
GITDIFF=`git diff`
|
||||||
|
if [ "$GITDIFF" == "" ]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
git diff
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
4
.github/workflows/coding-standards.yml
vendored
4
.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
|
||||||
@ -17,7 +17,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"
|
||||||
|
|||||||
62
.github/workflows/continuous-integration.yml
vendored
62
.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
|
||||||
@ -33,7 +33,6 @@ jobs:
|
|||||||
- "8.0"
|
- "8.0"
|
||||||
- "8.1"
|
- "8.1"
|
||||||
- "8.2"
|
- "8.2"
|
||||||
- "8.3"
|
|
||||||
database:
|
database:
|
||||||
- "sqlite"
|
- "sqlite"
|
||||||
- "mysql"
|
- "mysql"
|
||||||
@ -41,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
|
||||||
|
|
||||||
@ -107,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
|
||||||
|
|
||||||
@ -152,3 +151,58 @@ jobs:
|
|||||||
|
|
||||||
- name: "Run PHPUnit"
|
- name: "Run PHPUnit"
|
||||||
run: "php bin/simple-phpunit -v"
|
run: "php bin/simple-phpunit -v"
|
||||||
|
|
||||||
|
phpunit_no_database:
|
||||||
|
name: "PHP ${{ matrix.php }} using ${{ matrix.database }} without DB created"
|
||||||
|
runs-on: "ubuntu-20.04"
|
||||||
|
services:
|
||||||
|
rabbitmq:
|
||||||
|
image: rabbitmq:3-alpine
|
||||||
|
ports:
|
||||||
|
- 5672:5672
|
||||||
|
redis:
|
||||||
|
image: redis:6-alpine
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
php:
|
||||||
|
- "8.2"
|
||||||
|
database:
|
||||||
|
- "mysql"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: "actions/checkout@v3"
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: "Install PHP"
|
||||||
|
uses: "shivammathur/setup-php@v2"
|
||||||
|
with:
|
||||||
|
php-version: "${{ matrix.php }}"
|
||||||
|
coverage: none
|
||||||
|
tools: pecl
|
||||||
|
extensions: json, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, curl, imagick, pgsql, gd, tidy
|
||||||
|
ini-values: "date.timezone=Europe/Paris"
|
||||||
|
|
||||||
|
- name: "Setup MySQL"
|
||||||
|
if: "${{ matrix.database == 'mysql' }}"
|
||||||
|
run: |
|
||||||
|
sudo systemctl start mysql.service
|
||||||
|
|
||||||
|
- name: "Install dependencies with Composer"
|
||||||
|
uses: "ramsey/composer-install@v2"
|
||||||
|
with:
|
||||||
|
composer-options: "--optimize-autoloader --prefer-dist"
|
||||||
|
|
||||||
|
- name: "Install wallabag"
|
||||||
|
run: "php bin/console wallabag:install --env=test"
|
||||||
|
|
||||||
|
- name: "Prepare fixtures"
|
||||||
|
run: "make fixtures"
|
||||||
|
|
||||||
|
- name: "Run PHPUnit"
|
||||||
|
run: "php bin/simple-phpunit -v"
|
||||||
|
|||||||
4
.github/workflows/translations.yml
vendored
4
.github/workflows/translations.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- "2.**"
|
- 2.*
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -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"
|
||||||
|
|||||||
8
.github/workflows/upload-release-package.yml
vendored
8
.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"
|
||||||
@ -29,12 +29,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: "Install Node"
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: ".nvmrc"
|
|
||||||
cache: "yarn"
|
|
||||||
|
|
||||||
- name: Create the package
|
- name: Create the package
|
||||||
run: make release VERSION=${{ github.event.release.tag_name }}
|
run: make release VERSION=${{ github.event.release.tag_name }}
|
||||||
|
|
||||||
|
|||||||
2
.gitignore
vendored
2
.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
|
||||||
@ -51,7 +50,6 @@ bin
|
|||||||
app/Resources/build/
|
app/Resources/build/
|
||||||
!/src/Wallabag/CoreBundle/Resources/public
|
!/src/Wallabag/CoreBundle/Resources/public
|
||||||
/src/Wallabag/CoreBundle/Resources/public/*
|
/src/Wallabag/CoreBundle/Resources/public/*
|
||||||
package-lock.json
|
|
||||||
|
|
||||||
# Test-generated files
|
# Test-generated files
|
||||||
admin-export.json
|
admin-export.json
|
||||||
|
|||||||
72
CHANGELOG.md
72
CHANGELOG.md
@ -1,77 +1,5 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [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)
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Application\Migrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove demonstration mode settings.
|
|
||||||
*/
|
|
||||||
final class Version20230728085538 extends WallabagMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('DELETE FROM' . $this->getTable('internal_setting') . " WHERE name = 'demo_mode_enabled';");
|
|
||||||
$this->addSql('DELETE FROM' . $this->getTable('internal_setting') . " WHERE name = 'demo_mode_username';");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('INSERT INTO ' . $this->getTable('internal_setting') . " (name, value, section) VALUES ('demo_mode_enabled', '0', 'misc');");
|
|
||||||
$this->addSql('INSERT INTO ' . $this->getTable('internal_setting') . " (name, value, section) VALUES ('demo_mode_username', 'wallabag', 'misc');");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Application\Migrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove mobi export.
|
|
||||||
*/
|
|
||||||
final class Version20230728091417 extends WallabagMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('DELETE FROM' . $this->getTable('internal_setting') . " WHERE name = 'export_mobi';");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('INSERT INTO ' . $this->getTable('internal_setting') . " (name, value, section) VALUES ('export_mobi', '1', 'export');");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Application\Migrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add is_not_parsed field to entry table.
|
|
||||||
*/
|
|
||||||
final class Version20230728093912 extends WallabagMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
|
||||||
|
|
||||||
$this->skipIf($entryTable->hasColumn('is_not_parsed'), 'It seems that you already played this migration.');
|
|
||||||
|
|
||||||
$entryTable->addColumn('is_not_parsed', 'boolean', [
|
|
||||||
'default' => 0,
|
|
||||||
'notnull' => false,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query to update entries where content is equal to `fetching_error_message`.
|
|
||||||
*/
|
|
||||||
public function postUp(Schema $schema): void
|
|
||||||
{
|
|
||||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
|
||||||
$this->skipIf(!$entryTable->hasColumn('is_not_parsed'), 'Unable to update is_not_parsed colum');
|
|
||||||
|
|
||||||
// Need to do a `LIKE` with a final percent to handle the new line character
|
|
||||||
$this->connection->executeQuery(
|
|
||||||
'UPDATE ' . $this->getTable('entry') . ' SET is_not_parsed = :isNotParsed WHERE content LIKE :content',
|
|
||||||
[
|
|
||||||
'isNotParsed' => true,
|
|
||||||
'content' => str_replace("\n", '', addslashes($this->container->getParameter('wallabag_core.fetching_error_message'))) . '%',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
|
||||||
$entryTable->dropColumn('is_not_parsed');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Application\Migrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add custom_css column to config table.
|
|
||||||
*/
|
|
||||||
final class Version20230729093853 extends WallabagMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$configTable = $schema->getTable($this->getTable('config'));
|
|
||||||
|
|
||||||
$this->skipIf($configTable->hasColumn('custom_css'), 'It seems that you already played this migration.');
|
|
||||||
|
|
||||||
$configTable->addColumn('custom_css', 'text', [
|
|
||||||
'notnull' => false,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$configTable->addColumn('font', 'text', [
|
|
||||||
'notnull' => false,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$configTable->addColumn('fontsize', 'float', [
|
|
||||||
'notnull' => false,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$configTable->addColumn('line_height', 'float', [
|
|
||||||
'notnull' => false,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$configTable->addColumn('max_width', 'float', [
|
|
||||||
'notnull' => false,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$configTable = $schema->getTable($this->getTable('config'));
|
|
||||||
$configTable->dropColumn('custom_css');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -10,18 +10,13 @@ import 'mathjax/es5/tex-svg';
|
|||||||
/* Fonts */
|
/* Fonts */
|
||||||
import 'material-design-icons-iconfont/dist/material-design-icons.css';
|
import 'material-design-icons-iconfont/dist/material-design-icons.css';
|
||||||
import 'lato-font/css/lato-font.css';
|
import 'lato-font/css/lato-font.css';
|
||||||
import 'open-dyslexic/open-dyslexic-regular.css';
|
|
||||||
import '@fontsource/atkinson-hyperlegible';
|
|
||||||
import '@fontsource/eb-garamond';
|
|
||||||
import '@fontsource/montserrat';
|
|
||||||
import '@fontsource/oswald';
|
|
||||||
import './global.scss';
|
import './global.scss';
|
||||||
|
|
||||||
/* Shortcuts */
|
/* Shortcuts */
|
||||||
import './js/shortcuts/entry';
|
import './js/shortcuts/entry';
|
||||||
import './js/shortcuts/main';
|
import './js/shortcuts/main';
|
||||||
|
|
||||||
/* Highlight */
|
/* Hightlight */
|
||||||
import './js/highlight';
|
import './js/highlight';
|
||||||
|
|
||||||
import { savePercent, retrievePercent } from './js/tools';
|
import { savePercent, retrievePercent } from './js/tools';
|
||||||
@ -31,7 +26,7 @@ import { savePercent, retrievePercent } from './js/tools';
|
|||||||
========================================================================== */
|
========================================================================== */
|
||||||
|
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
if ($('#article').length) {
|
if ($('article').length) {
|
||||||
const app = new annotator.App();
|
const app = new annotator.App();
|
||||||
|
|
||||||
app.include(annotator.ui.main, {
|
app.include(annotator.ui.main, {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
Article
|
Article
|
||||||
========================================================================== */
|
========================================================================== */
|
||||||
|
|
||||||
#article, #preview-article {
|
#article {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
max-width: 45em;
|
max-width: 45em;
|
||||||
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -324,12 +324,6 @@ a.original:not(.waves-effect) {
|
|||||||
height: 3rem;
|
height: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings .settings-range-label {
|
|
||||||
position: absolute;
|
|
||||||
top: -14px;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.entries-row {
|
.entries-row {
|
||||||
display: grid;
|
display: grid;
|
||||||
margin: 0.4rem 0 0;
|
margin: 0.4rem 0 0;
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,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;
|
||||||
}
|
}
|
||||||
@ -80,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 {
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,9 +8,7 @@ import 'materialize-css/dist/js/materialize';
|
|||||||
import '../_global/index';
|
import '../_global/index';
|
||||||
|
|
||||||
/* Tools */
|
/* Tools */
|
||||||
import {
|
import { initExport, initFilters, initRandom } from './js/tools';
|
||||||
initExport, initFilters, initRandom, initPreviewText,
|
|
||||||
} from './js/tools';
|
|
||||||
|
|
||||||
/* Import shortcuts */
|
/* Import shortcuts */
|
||||||
import './js/shortcuts/main';
|
import './js/shortcuts/main';
|
||||||
@ -179,7 +177,6 @@ $(document).ready(() => {
|
|||||||
initRandom();
|
initRandom();
|
||||||
stickyNav();
|
stickyNav();
|
||||||
articleScroll();
|
articleScroll();
|
||||||
initPreviewText();
|
|
||||||
|
|
||||||
const toggleNav = (toShow, toFocus) => {
|
const toggleNav = (toShow, toFocus) => {
|
||||||
$('.nav-panel-actions').hide(100);
|
$('.nav-panel-actions').hide(100);
|
||||||
@ -202,29 +199,6 @@ $(document).ready(() => {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#config_fontsize').on('input', () => {
|
|
||||||
const value = $('#config_fontsize').val();
|
|
||||||
const css = `${value}em`;
|
|
||||||
$('#preview-content').css('font-size', css);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#config_font').on('change', () => {
|
|
||||||
const value = $('#config_font').val();
|
|
||||||
$('#preview-content').css('font-family', value);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#config_lineHeight').on('input', () => {
|
|
||||||
const value = $('#config_lineHeight').val();
|
|
||||||
const css = `${value}em`;
|
|
||||||
$('#preview-content').css('line-height', css);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#config_maxWidth').on('input', () => {
|
|
||||||
const value = $('#config_maxWidth').val();
|
|
||||||
const css = `${value}em`;
|
|
||||||
$('#preview-article').css('max-width', css);
|
|
||||||
});
|
|
||||||
|
|
||||||
const materialAddForm = $('.nav-panel-add');
|
const materialAddForm = $('.nav-panel-add');
|
||||||
materialAddForm.on('submit', () => {
|
materialAddForm.on('submit', () => {
|
||||||
materialAddForm.addClass('disabled');
|
materialAddForm.addClass('disabled');
|
||||||
|
|||||||
@ -29,25 +29,8 @@ function initRandom() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initPreviewText() {
|
|
||||||
// no display if preview_text not available
|
|
||||||
if ($('div').is('#preview-article')) {
|
|
||||||
const defaultFontFamily = $('#config_font').val();
|
|
||||||
const defaultFontSize = $('#config_fontsize').val();
|
|
||||||
const defaultLineHeight = $('#config_lineHeight').val();
|
|
||||||
const defaultMaxWidth = $('#config_maxWidth').val();
|
|
||||||
const previewContent = $('#preview-content');
|
|
||||||
|
|
||||||
previewContent.css('font-family', defaultFontFamily);
|
|
||||||
previewContent.css('font-size', `${defaultFontSize}em`);
|
|
||||||
previewContent.css('line-height', `${defaultLineHeight}em`);
|
|
||||||
$('#preview-article').css('max-width', `${defaultMaxWidth}em`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
initExport,
|
initExport,
|
||||||
initFilters,
|
initFilters,
|
||||||
initRandom,
|
initRandom,
|
||||||
initPreviewText,
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -23,13 +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
|
|
||||||
fragments: ~
|
fragments: ~
|
||||||
http_method_override: true
|
http_method_override: true
|
||||||
assets: ~
|
assets: ~
|
||||||
@ -42,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%'
|
||||||
|
|
||||||
@ -96,6 +98,8 @@ fos_rest:
|
|||||||
- 'application/pdf'
|
- 'application/pdf'
|
||||||
epub:
|
epub:
|
||||||
- 'application/epub+zip'
|
- 'application/epub+zip'
|
||||||
|
mobi:
|
||||||
|
- 'application/x-mobipocket-ebook'
|
||||||
view_response_listener: 'force'
|
view_response_listener: 'force'
|
||||||
formats:
|
formats:
|
||||||
xml: true
|
xml: true
|
||||||
@ -104,12 +108,13 @@ fos_rest:
|
|||||||
csv: true
|
csv: true
|
||||||
pdf: true
|
pdf: true
|
||||||
epub: true
|
epub: true
|
||||||
|
mobi: true
|
||||||
failed_validation: HTTP_BAD_REQUEST
|
failed_validation: HTTP_BAD_REQUEST
|
||||||
routing_loader: false
|
routing_loader: false
|
||||||
format_listener:
|
format_listener:
|
||||||
enabled: true
|
enabled: true
|
||||||
rules:
|
rules:
|
||||||
- { path: "^/api/entries/([0-9]+)/export.(.*)", priorities: ['epub', 'pdf', 'txt', 'csv'], fallback_format: json, prefer_extension: false }
|
- { path: "^/api/entries/([0-9]+)/export.(.*)", priorities: ['epub', 'mobi', 'pdf', 'txt', 'csv'], fallback_format: json, prefer_extension: false }
|
||||||
- { path: "^/api", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false }
|
- { path: "^/api", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false }
|
||||||
- { path: "^/annotations", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false }
|
- { path: "^/annotations", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false }
|
||||||
# for an unknown reason, EACH REQUEST goes to FOS\RestBundle\EventListener\FormatListener
|
# for an unknown reason, EACH REQUEST goes to FOS\RestBundle\EventListener\FormatListener
|
||||||
@ -274,16 +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
|
|
||||||
consumers:
|
consumers:
|
||||||
import_pocket:
|
import_pocket:
|
||||||
connection: default
|
connection: default
|
||||||
@ -375,24 +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%"}
|
|
||||||
|
|
||||||
fos_js_routing:
|
fos_js_routing:
|
||||||
routes_to_expose:
|
routes_to_expose:
|
||||||
|
|||||||
@ -37,7 +37,7 @@ parameters:
|
|||||||
twofactor_sender: no-reply@wallabag.org
|
twofactor_sender: no-reply@wallabag.org
|
||||||
|
|
||||||
# fosuser stuff
|
# fosuser stuff
|
||||||
fosuser_registration: false
|
fosuser_registration: true
|
||||||
fosuser_confirmation: true
|
fosuser_confirmation: true
|
||||||
|
|
||||||
# how long the access token should live in seconds for the API
|
# how long the access token should live in seconds for the API
|
||||||
|
|||||||
@ -5,5 +5,5 @@ parameters:
|
|||||||
opera: https://addons.opera.com/en/extensions/details/wallabagger/?display=en
|
opera: https://addons.opera.com/en/extensions/details/wallabagger/?display=en
|
||||||
f_droid: https://f-droid.org/app/fr.gaulupeau.apps.InThePoche
|
f_droid: https://f-droid.org/app/fr.gaulupeau.apps.InThePoche
|
||||||
google_play: https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche
|
google_play: https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche
|
||||||
ios: https://apps.apple.com/app/wallabag-2/id1170800946?mt=8
|
ios: https://itunes.apple.com/app/wallabag-2/id1170800946?mt=8
|
||||||
windows: https://www.microsoft.com/store/apps/wallabag/9nblggh11646
|
windows: https://www.microsoft.com/store/apps/wallabag/9nblggh11646
|
||||||
|
|||||||
@ -8,4 +8,3 @@ parameters:
|
|||||||
test_database_path: "%env(TEST_DATABASE_PATH)%"
|
test_database_path: "%env(TEST_DATABASE_PATH)%"
|
||||||
env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
|
env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
|
||||||
test_database_charset: utf8
|
test_database_charset: utf8
|
||||||
fosuser_registration: true
|
|
||||||
|
|||||||
@ -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%'
|
||||||
@ -30,7 +30,6 @@ services:
|
|||||||
$senderName: "%scheb_two_factor.email.sender_name%"
|
$senderName: "%scheb_two_factor.email.sender_name%"
|
||||||
$storeArticleHeaders: '@=service(''craue_config'').get(''store_article_headers'')'
|
$storeArticleHeaders: '@=service(''craue_config'').get(''store_article_headers'')'
|
||||||
$supportUrl: '@=service(''craue_config'').get(''wallabag_support_url'')'
|
$supportUrl: '@=service(''craue_config'').get(''wallabag_support_url'')'
|
||||||
$fonts: '%wallabag_core.fonts%'
|
|
||||||
|
|
||||||
Wallabag\AnnotationBundle\:
|
Wallabag\AnnotationBundle\:
|
||||||
resource: '../../src/Wallabag/AnnotationBundle/*'
|
resource: '../../src/Wallabag/AnnotationBundle/*'
|
||||||
@ -117,16 +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\:
|
Wallabag\ImportBundle\:
|
||||||
resource: '../../src/Wallabag/ImportBundle/*'
|
resource: '../../src/Wallabag/ImportBundle/*'
|
||||||
exclude: '../../src/Wallabag/ImportBundle/{Consumer,Controller,Redis}'
|
exclude: '../../src/Wallabag/ImportBundle/{Consumer,Controller,Redis}'
|
||||||
@ -183,9 +172,6 @@ services:
|
|||||||
MatomoTwigExtension\MatomoTwigExtension:
|
MatomoTwigExtension\MatomoTwigExtension:
|
||||||
public: false
|
public: false
|
||||||
|
|
||||||
ScssPhp\ScssPhp\Compiler:
|
|
||||||
public: false
|
|
||||||
|
|
||||||
Wallabag\CoreBundle\Event\Listener\UserLocaleListener:
|
Wallabag\CoreBundle\Event\Listener\UserLocaleListener:
|
||||||
tags:
|
tags:
|
||||||
- { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin }
|
- { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin }
|
||||||
@ -365,14 +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 }
|
|
||||||
|
|
||||||
# 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,8 +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'
|
||||||
$shaarliConsumer: '@old_sound_rabbit_mq.import_shaarli_consumer'
|
|
||||||
$pocketHtmlConsumer: '@old_sound_rabbit_mq.import_pocket_html_consumer'
|
|
||||||
|
|
||||||
wallabag_import.consumer.amqp.pocket:
|
wallabag_import.consumer.amqp.pocket:
|
||||||
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
@ -70,13 +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'
|
|
||||||
|
|||||||
@ -164,35 +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'
|
|
||||||
|
|||||||
@ -8,4 +8,3 @@ parameters:
|
|||||||
test_database_path: ~
|
test_database_path: ~
|
||||||
env(TEST_DATABASE_PATH): ~
|
env(TEST_DATABASE_PATH): ~
|
||||||
test_database_charset: utf8mb4
|
test_database_charset: utf8mb4
|
||||||
fosuser_registration: true
|
|
||||||
|
|||||||
@ -8,4 +8,3 @@ parameters:
|
|||||||
test_database_path: ~
|
test_database_path: ~
|
||||||
env(TEST_DATABASE_PATH): ~
|
env(TEST_DATABASE_PATH): ~
|
||||||
test_database_charset: utf8
|
test_database_charset: utf8
|
||||||
fosuser_registration: true
|
|
||||||
|
|||||||
@ -5,9 +5,8 @@ parameters:
|
|||||||
test_database_name: ~
|
test_database_name: ~
|
||||||
test_database_user: ~
|
test_database_user: ~
|
||||||
test_database_password: ~
|
test_database_password: ~
|
||||||
# Using an environment variable in order to avoid the error "attempt to write a readonly database"
|
# Using an environnement variable in order to avoid the error "attempt to write a readonly database"
|
||||||
# when the schema is dropped then recreate
|
# when the schema is dropped then recreate
|
||||||
test_database_path: "%env(TEST_DATABASE_PATH)%"
|
test_database_path: "%env(TEST_DATABASE_PATH)%"
|
||||||
env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
|
env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
|
||||||
test_database_charset: utf8
|
test_database_charset: utf8
|
||||||
fosuser_registration: true
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
wallabag_core:
|
wallabag_core:
|
||||||
version: 2.6.7
|
version: 2.6.2
|
||||||
paypal_url: "https://liberapay.com/wallabag/donate"
|
paypal_url: "https://liberapay.com/wallabag/donate"
|
||||||
languages:
|
languages:
|
||||||
en: 'English'
|
en: 'English'
|
||||||
@ -85,6 +85,10 @@ wallabag_core:
|
|||||||
name: export_epub
|
name: export_epub
|
||||||
value: 1
|
value: 1
|
||||||
section: export
|
section: export
|
||||||
|
-
|
||||||
|
name: export_mobi
|
||||||
|
value: 0
|
||||||
|
section: export
|
||||||
-
|
-
|
||||||
name: export_pdf
|
name: export_pdf
|
||||||
value: 1
|
value: 1
|
||||||
@ -125,6 +129,14 @@ wallabag_core:
|
|||||||
name: matomo_site_id
|
name: matomo_site_id
|
||||||
value: 1
|
value: 1
|
||||||
section: analytics
|
section: analytics
|
||||||
|
-
|
||||||
|
name: demo_mode_enabled
|
||||||
|
value: 0
|
||||||
|
section: misc
|
||||||
|
-
|
||||||
|
name: demo_mode_username
|
||||||
|
value: wallabag
|
||||||
|
section: misc
|
||||||
-
|
-
|
||||||
name: download_images_enabled
|
name: download_images_enabled
|
||||||
value: 0
|
value: 0
|
||||||
@ -153,16 +165,7 @@ wallabag_core:
|
|||||||
rule: host = "feeds.reuters.com"
|
rule: host = "feeds.reuters.com"
|
||||||
-
|
-
|
||||||
rule: _all ~ "https?://www\.lemonde\.fr/tiny.*"
|
rule: _all ~ "https?://www\.lemonde\.fr/tiny.*"
|
||||||
fonts:
|
|
||||||
- 'Sans-serif'
|
|
||||||
- 'Serif'
|
|
||||||
- 'Atkinson Hyperlegible'
|
|
||||||
- 'EB Garamond'
|
|
||||||
- 'Lato'
|
|
||||||
- 'Montserrat'
|
|
||||||
- 'OpenDyslexicRegular'
|
|
||||||
- 'Oswald'
|
|
||||||
|
|
||||||
wallabag_import:
|
wallabag_import:
|
||||||
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv', 'text/html']
|
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv']
|
||||||
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
|
||||||
|
|||||||
@ -86,6 +86,7 @@
|
|||||||
"kphoen/rulerz": "^0.21",
|
"kphoen/rulerz": "^0.21",
|
||||||
"kphoen/rulerz-bundle": "~0.13",
|
"kphoen/rulerz-bundle": "~0.13",
|
||||||
"laminas/laminas-code": "^4.7",
|
"laminas/laminas-code": "^4.7",
|
||||||
|
"laminas/laminas-diactoros": "^2.3",
|
||||||
"lcobucci/jwt": "~4.1.5",
|
"lcobucci/jwt": "~4.1.5",
|
||||||
"lexik/form-filter-bundle": "^7.0",
|
"lexik/form-filter-bundle": "^7.0",
|
||||||
"mgargano/simplehtmldom": "~1.5",
|
"mgargano/simplehtmldom": "~1.5",
|
||||||
@ -114,41 +115,19 @@
|
|||||||
"scheb/2fa-google-authenticator": "^5.13",
|
"scheb/2fa-google-authenticator": "^5.13",
|
||||||
"scheb/2fa-qr-code": "^5.13",
|
"scheb/2fa-qr-code": "^5.13",
|
||||||
"scheb/2fa-trusted-device": "^5.13",
|
"scheb/2fa-trusted-device": "^5.13",
|
||||||
"scssphp/scssphp": "^1.11",
|
|
||||||
"sensio/framework-extra-bundle": "^6.2",
|
"sensio/framework-extra-bundle": "^6.2",
|
||||||
"sentry/sentry-symfony": "4.12.0",
|
"sentry/sentry-symfony": "4.9.2",
|
||||||
"stof/doctrine-extensions-bundle": "^1.2",
|
"stof/doctrine-extensions-bundle": "^1.2",
|
||||||
"symfony/asset": "^4.4",
|
"symfony/dom-crawler": "^4.0",
|
||||||
"symfony/config": "^4.4",
|
"symfony/mailer": "^4.0",
|
||||||
"symfony/console": "^4.4",
|
|
||||||
"symfony/debug": "^4.4",
|
|
||||||
"symfony/dependency-injection": "^4.4",
|
|
||||||
"symfony/doctrine-bridge": "^4.4",
|
|
||||||
"symfony/dom-crawler": "^4.4",
|
|
||||||
"symfony/error-handler": "^4.4",
|
|
||||||
"symfony/event-dispatcher": "^4.4",
|
|
||||||
"symfony/finder": "^4.4",
|
|
||||||
"symfony/form": "^4.4",
|
|
||||||
"symfony/framework-bundle": "^4.4",
|
|
||||||
"symfony/google-mailer": "^4.4",
|
|
||||||
"symfony/http-foundation": "^4.4",
|
|
||||||
"symfony/http-kernel": "^4.4",
|
|
||||||
"symfony/mailer": "^4.4",
|
|
||||||
"symfony/mime": "^4.4",
|
|
||||||
"symfony/monolog-bundle": "^3.1",
|
"symfony/monolog-bundle": "^3.1",
|
||||||
"symfony/options-resolver": "^4.4",
|
|
||||||
"symfony/proxy-manager-bridge": "^4.4",
|
"symfony/proxy-manager-bridge": "^4.4",
|
||||||
"symfony/routing": "^4.4",
|
"symfony/symfony": "^4.0",
|
||||||
"symfony/security-bundle": "^4.4",
|
|
||||||
"symfony/security-core": "^4.4",
|
|
||||||
"symfony/security-http": "^4.4",
|
|
||||||
"symfony/templating": "^4.4",
|
|
||||||
"symfony/twig-bundle": "^4.4",
|
|
||||||
"symfony/validator": "^4.4",
|
|
||||||
"tecnickcom/tcpdf": "^6.3.0",
|
"tecnickcom/tcpdf": "^6.3.0",
|
||||||
"twig/extra-bundle": "^3.4",
|
"twig/extra-bundle": "^3.4",
|
||||||
"twig/string-extra": "^3.4",
|
"twig/string-extra": "^3.4",
|
||||||
"twig/twig": "^3.4.3",
|
"twig/twig": "^3.4.3",
|
||||||
|
"wallabag/php-mobi": "~1.0",
|
||||||
"wallabag/phpepub": "^4.0.10",
|
"wallabag/phpepub": "^4.0.10",
|
||||||
"willdurand/hateoas": "^3.8",
|
"willdurand/hateoas": "^3.8",
|
||||||
"willdurand/hateoas-bundle": "~2.1"
|
"willdurand/hateoas-bundle": "~2.1"
|
||||||
@ -166,14 +145,8 @@
|
|||||||
"phpstan/phpstan-doctrine": "^1.3",
|
"phpstan/phpstan-doctrine": "^1.3",
|
||||||
"phpstan/phpstan-phpunit": "^1.1",
|
"phpstan/phpstan-phpunit": "^1.1",
|
||||||
"phpstan/phpstan-symfony": "^1.2",
|
"phpstan/phpstan-symfony": "^1.2",
|
||||||
"symfony/browser-kit": "^4.4",
|
|
||||||
"symfony/css-selector": "^4.4",
|
|
||||||
"symfony/debug-bundle": "^4.4",
|
|
||||||
"symfony/maker-bundle": "^1.18",
|
"symfony/maker-bundle": "^1.18",
|
||||||
"symfony/phpunit-bridge": "~6.0",
|
"symfony/phpunit-bridge": "~6.0"
|
||||||
"symfony/var-dumper": "^4.4",
|
|
||||||
"symfony/web-profiler-bundle": "^4.4",
|
|
||||||
"symfony/web-server-bundle": "^4.4"
|
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-imagick": "To keep GIF animation when downloading image is enabled"
|
"ext-imagick": "To keep GIF animation when downloading image is enabled"
|
||||||
@ -192,7 +165,10 @@
|
|||||||
"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": {
|
||||||
@ -210,11 +186,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": [
|
||||||
|
|||||||
5656
composer.lock
generated
5656
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -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}
|
||||||
@ -25,7 +25,7 @@ parameters:
|
|||||||
twofactor_sender: ${TWOFACTOR_SENDER:-no-reply@wallabag.org}
|
twofactor_sender: ${TWOFACTOR_SENDER:-no-reply@wallabag.org}
|
||||||
|
|
||||||
# fosuser stuff
|
# fosuser stuff
|
||||||
fosuser_registration: ${FOSUSER_REGISTRATION:-false}
|
fosuser_registration: ${FOSUSER_REGISTRATION:-true}
|
||||||
fosuser_confirmation: ${FOSUSER_CONFIRMATION:-true}
|
fosuser_confirmation: ${FOSUSER_CONFIRMATION:-true}
|
||||||
|
|
||||||
fos_oauth_server_access_token_lifetime: 3600
|
fos_oauth_server_access_token_lifetime: 3600
|
||||||
|
|||||||
56
package.json
56
package.json
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "wallabag",
|
"name": "wallabag",
|
||||||
"version": "2.6.0",
|
"version": "2.5.0",
|
||||||
"description": "wallabag is a self hostable application for saving web pages",
|
"description": "wallabag is a self hostable application for saving web pages",
|
||||||
"private": true,
|
"private": true,
|
||||||
"directories": {
|
"directories": {
|
||||||
"doc": "docs"
|
"doc": "docs"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=16"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -17,22 +17,17 @@
|
|||||||
{
|
{
|
||||||
"name": "Nicolas Lœuillet",
|
"name": "Nicolas Lœuillet",
|
||||||
"email": "nicolas@loeuillet.org",
|
"email": "nicolas@loeuillet.org",
|
||||||
"homepage": "https://nicolas.loeuillet.org",
|
"homepage": "http://www.cdetc.fr",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Thomas Citharel",
|
"name": "Thomas Citharel",
|
||||||
"homepage": "https://tcit.fr",
|
"homepage": "http://tcit.fr",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Jérémy Benoist",
|
"name": "Jérémy Benoist",
|
||||||
"homepage": "https://www.j0k3r.net",
|
"homepage": "http://www.j0k3r.net",
|
||||||
"role": "Developer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Kevin Decherf",
|
|
||||||
"homepage": "https://kdecherf.com/",
|
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -41,56 +36,53 @@
|
|||||||
"url": "https://github.com/wallabag/wallabag/issues"
|
"url": "https://github.com/wallabag/wallabag/issues"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.23.3",
|
"@babel/core": "^7.22.9",
|
||||||
"@babel/eslint-parser": "^7.23.3",
|
"@babel/eslint-parser": "^7.22.9",
|
||||||
"@babel/preset-env": "^7.23.3",
|
"@babel/preset-env": "^7.22.9",
|
||||||
"autoprefixer": "^10.4.16",
|
"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.53.0",
|
"eslint": "^8.45.0",
|
||||||
"eslint-config-airbnb-base": "^15.0.0",
|
"eslint-config-airbnb-base": "^15.0.0",
|
||||||
"eslint-plugin-import": "^2.29.0",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"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",
|
||||||
"postcss": "^8.4.31",
|
"node-sass": "^9.0.0",
|
||||||
|
"postcss": "^8.4.27",
|
||||||
"postcss-loader": "^7.3.3",
|
"postcss-loader": "^7.3.3",
|
||||||
"postcss-scss": "^4.0.9",
|
"postcss-scss": "^4.0.6",
|
||||||
"sass": "^1.69.5",
|
"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.11.0",
|
"stylelint": "^15.10.2",
|
||||||
"stylelint-config-standard": "^34.0.0",
|
"stylelint-config-standard": "^34.0.0",
|
||||||
"stylelint-config-standard-scss": "^11.1.0",
|
"stylelint-config-standard-scss": "^10.0.0",
|
||||||
"stylelint-scss": "^5.3.1",
|
"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",
|
||||||
"webpack": "^5.89.0",
|
"webpack": "^5.88.2",
|
||||||
"webpack-cli": "^5.1.4",
|
"webpack-cli": "^5.1.4",
|
||||||
"webpack-dev-server": "^4.15.1",
|
"webpack-dev-server": "^4.15.1",
|
||||||
"webpack-manifest-plugin": "^5.0.0",
|
"webpack-manifest-plugin": "^5.0.0",
|
||||||
"webpack-merge": "^5.10.0"
|
"webpack-merge": "^5.9.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/atkinson-hyperlegible": "^5.0.17",
|
|
||||||
"@fontsource/eb-garamond": "^5.0.15",
|
|
||||||
"@fontsource/montserrat": "^5.0.15",
|
|
||||||
"@fontsource/oswald": "^5.0.17",
|
|
||||||
"annotator": "wallabag/annotator#master",
|
"annotator": "wallabag/annotator#master",
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"highlight.js": "^11.9.0",
|
"highlight.js": "^11.8.0",
|
||||||
"icomoon-free-npm": "^0.0.0",
|
"icomoon-free-npm": "^0.0.0",
|
||||||
"jquery": "^3.7.1",
|
"jquery": "^3.7.0",
|
||||||
"jquery.cookie": "^1.4.1",
|
"jquery.cookie": "^1.4.1",
|
||||||
"jr-qrcode": "^1.0.7",
|
"jr-qrcode": "^1.0.7",
|
||||||
"material-design-icons-iconfont": "^6.7.0",
|
"material-design-icons-iconfont": "^6.7.0",
|
||||||
"materialize-css": "^0.100.2",
|
"materialize-css": "^0.98.1",
|
||||||
"mathjax": "^3.2.2",
|
"mathjax": "^3.2.2",
|
||||||
"mousetrap": "^1.6.0",
|
"mousetrap": "^1.6.0",
|
||||||
"open-dyslexic": "^1.0.3",
|
"ptsans-npm-webfont": "^0.0.4",
|
||||||
"roboto-fontface": "^0.10.0",
|
"roboto-fontface": "^0.10.0",
|
||||||
"waypoints": "^4.0.1"
|
"waypoints": "^4.0.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,25 +1,10 @@
|
|||||||
parameters:
|
parameters:
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
-
|
|
||||||
message: "#^Method Wallabag\\\\AnnotationBundle\\\\Controller\\\\WallabagAnnotationController\\:\\:postAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\<mixed\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method Wallabag\\\\AnnotationBundle\\\\Controller\\\\WallabagAnnotationController\\:\\:putAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\<null\\>\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Entity\\\\RuleInterface\\:\\:getConfig\\(\\)\\.$#"
|
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Entity\\\\RuleInterface\\:\\:getConfig\\(\\)\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method FOS\\\\UserBundle\\\\Model\\\\UserManagerInterface\\:\\:updateUser\\(\\) invoked with 2 parameters, 1 required\\.$#"
|
|
||||||
count: 6
|
|
||||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method Lexik\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpressionBuilder\\(\\)\\.$#"
|
message: "#^Call to an undefined method Lexik\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpressionBuilder\\(\\)\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -55,27 +40,27 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
|
path: src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^PHPDoc type Symfony\\\\Component\\\\Mailer\\\\MailerInterface of property Wallabag\\\\UserBundle\\\\Mailer\\\\UserMailer\\:\\:\\$mailer is not covariant with PHPDoc type Swift_Mailer of overridden property FOS\\\\UserBundle\\\\Mailer\\\\TwigSwiftMailer\\:\\:\\$mailer\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Wallabag/UserBundle/Mailer/UserMailer.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method DOMNode\\:\\:getAttribute\\(\\)\\.$#"
|
message: "#^Call to an undefined method DOMNode\\:\\:getAttribute\\(\\)\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php
|
path: tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#"
|
message: "#^Call to method generate\\(\\) on an unknown class PHPUnit_Framework_MockObject_MockObject\\.$#"
|
||||||
count: 1
|
count: 2
|
||||||
path: src/Wallabag/ImportBundle/Controller/HtmlController.php
|
path: tests/Wallabag/CoreBundle/Helper/RedirectTest.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#"
|
message: "#^Property Tests\\\\Wallabag\\\\CoreBundle\\\\Helper\\\\RedirectTest\\:\\:\\$routerMock has unknown class PHPUnit_Framework_MockObject_MockObject as its type\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Wallabag/ImportBundle/Controller/HtmlController.php
|
path: tests/Wallabag/CoreBundle/Helper/RedirectTest.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch()#"
|
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch()#"
|
||||||
count: 16
|
count: 15
|
||||||
path: src/*
|
path: src/*
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Method FOS\\\\UserBundle\\\\Model\\\\UserManagerInterface\\:\\:updateUser()#"
|
||||||
|
count: 7
|
||||||
|
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||||
|
|||||||
@ -2,7 +2,7 @@ includes:
|
|||||||
- phpstan-baseline.neon
|
- phpstan-baseline.neon
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
level: 3
|
level: 2
|
||||||
paths:
|
paths:
|
||||||
- src
|
- src
|
||||||
- tests
|
- tests
|
||||||
|
|||||||
@ -10,8 +10,6 @@ ENV=$4
|
|||||||
rm -rf "${TMP_FOLDER:?}"/"$RELEASE_FOLDER"
|
rm -rf "${TMP_FOLDER:?}"/"$RELEASE_FOLDER"
|
||||||
mkdir "$TMP_FOLDER"/"$RELEASE_FOLDER"
|
mkdir "$TMP_FOLDER"/"$RELEASE_FOLDER"
|
||||||
git clone https://github.com/wallabag/wallabag.git --single-branch --depth 1 --branch $1 "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION"
|
git clone https://github.com/wallabag/wallabag.git --single-branch --depth 1 --branch $1 "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION"
|
||||||
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && yarn install --non-interactive
|
|
||||||
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && yarn run --non-interactive build:prod
|
|
||||||
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && SYMFONY_ENV="$ENV" COMPOSER_MEMORY_LIMIT=-1 composer install -n --no-dev
|
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && SYMFONY_ENV="$ENV" COMPOSER_MEMORY_LIMIT=-1 composer install -n --no-dev
|
||||||
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && php bin/console wallabag:install --env="$ENV" -n
|
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && php bin/console wallabag:install --env="$ENV" -n
|
||||||
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && php bin/console assets:install --env="$ENV" --symlink --relative
|
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && php bin/console assets:install --env="$ENV" --symlink --relative
|
||||||
|
|||||||
@ -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');
|
||||||
|
|
||||||
|
|||||||
@ -123,7 +123,7 @@ class AnnotationRepository extends ServiceEntityRepository
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all annotations for a user id.
|
* Remove all annotations for a user id.
|
||||||
* Used when a user wants to reset all information.
|
* Used when a user want to reset all informations.
|
||||||
*
|
*
|
||||||
* @param int $userId
|
* @param int $userId
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -4,8 +4,8 @@ namespace Wallabag\ApiBundle\Controller;
|
|||||||
|
|
||||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
@ -36,7 +36,7 @@ class AnnotationRestController extends WallabagRestController
|
|||||||
*
|
*
|
||||||
* @Route("/api/annotations/{entry}.{_format}", methods={"GET"}, name="api_get_annotations", defaults={"_format": "json"})
|
* @Route("/api/annotations/{entry}.{_format}", methods={"GET"}, name="api_get_annotations", defaults={"_format": "json"})
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getAnnotationsAction(Entry $entry)
|
public function getAnnotationsAction(Entry $entry)
|
||||||
{
|
{
|
||||||
@ -102,7 +102,7 @@ class AnnotationRestController extends WallabagRestController
|
|||||||
*
|
*
|
||||||
* @Route("/api/annotations/{entry}.{_format}", methods={"POST"}, name="api_post_annotation", defaults={"_format": "json"})
|
* @Route("/api/annotations/{entry}.{_format}", methods={"POST"}, name="api_post_annotation", defaults={"_format": "json"})
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function postAnnotationAction(Request $request, Entry $entry)
|
public function postAnnotationAction(Request $request, Entry $entry)
|
||||||
{
|
{
|
||||||
@ -138,7 +138,7 @@ class AnnotationRestController extends WallabagRestController
|
|||||||
*
|
*
|
||||||
* @Route("/api/annotations/{annotation}.{_format}", methods={"PUT"}, name="api_put_annotation", defaults={"_format": "json"})
|
* @Route("/api/annotations/{annotation}.{_format}", methods={"PUT"}, name="api_put_annotation", defaults={"_format": "json"})
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function putAnnotationAction(int $annotation, Request $request)
|
public function putAnnotationAction(int $annotation, Request $request)
|
||||||
{
|
{
|
||||||
@ -174,7 +174,7 @@ class AnnotationRestController extends WallabagRestController
|
|||||||
*
|
*
|
||||||
* @Route("/api/annotations/{annotation}.{_format}", methods={"DELETE"}, name="api_delete_annotation", defaults={"_format": "json"})
|
* @Route("/api/annotations/{annotation}.{_format}", methods={"DELETE"}, name="api_delete_annotation", defaults={"_format": "json"})
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function deleteAnnotationAction(int $annotation)
|
public function deleteAnnotationAction(int $annotation)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -69,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 $this->createAccessDeniedException('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.');
|
||||||
}
|
}
|
||||||
@ -103,9 +99,6 @@ class DeveloperController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
public function howtoFirstAppAction()
|
public function howtoFirstAppAction()
|
||||||
{
|
{
|
||||||
return $this->render('@WallabagCore/Developer/howto_app.html.twig',
|
return $this->render('@WallabagCore/Developer/howto_app.html.twig');
|
||||||
[
|
|
||||||
'wallabag_url' => $this->getParameter('domain_name'),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,17 +176,6 @@ class EntryRestController extends WallabagRestController
|
|||||||
* )
|
* )
|
||||||
* ),
|
* ),
|
||||||
* @OA\Parameter(
|
* @OA\Parameter(
|
||||||
* name="notParsed",
|
|
||||||
* in="query",
|
|
||||||
* description="filter by notParsed status. all entries by default",
|
|
||||||
* required=false,
|
|
||||||
* @OA\Schema(
|
|
||||||
* type="integer",
|
|
||||||
* enum={"1", "0"},
|
|
||||||
* default="0"
|
|
||||||
* )
|
|
||||||
* ),
|
|
||||||
* @OA\Parameter(
|
|
||||||
* name="sort",
|
* name="sort",
|
||||||
* in="query",
|
* in="query",
|
||||||
* description="sort entries by date.",
|
* description="sort entries by date.",
|
||||||
@ -297,7 +286,6 @@ class EntryRestController extends WallabagRestController
|
|||||||
$isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
|
$isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
|
||||||
$isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred');
|
$isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred');
|
||||||
$isPublic = (null === $request->query->get('public')) ? null : (bool) $request->query->get('public');
|
$isPublic = (null === $request->query->get('public')) ? null : (bool) $request->query->get('public');
|
||||||
$isNotParsed = (null === $request->query->get('notParsed')) ? null : (bool) $request->query->get('notParsed');
|
|
||||||
$sort = strtolower($request->query->get('sort', 'created'));
|
$sort = strtolower($request->query->get('sort', 'created'));
|
||||||
$order = strtolower($request->query->get('order', 'desc'));
|
$order = strtolower($request->query->get('order', 'desc'));
|
||||||
$page = (int) $request->query->get('page', 1);
|
$page = (int) $request->query->get('page', 1);
|
||||||
@ -319,8 +307,7 @@ class EntryRestController extends WallabagRestController
|
|||||||
$since,
|
$since,
|
||||||
$tags,
|
$tags,
|
||||||
$detail,
|
$detail,
|
||||||
$domainName,
|
$domainName
|
||||||
$isNotParsed
|
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw new BadRequestHttpException($e->getMessage());
|
throw new BadRequestHttpException($e->getMessage());
|
||||||
@ -338,7 +325,6 @@ class EntryRestController extends WallabagRestController
|
|||||||
'archive' => $isArchived,
|
'archive' => $isArchived,
|
||||||
'starred' => $isStarred,
|
'starred' => $isStarred,
|
||||||
'public' => $isPublic,
|
'public' => $isPublic,
|
||||||
'notParsed' => $isNotParsed,
|
|
||||||
'sort' => $sort,
|
'sort' => $sort,
|
||||||
'order' => $order,
|
'order' => $order,
|
||||||
'page' => $page,
|
'page' => $page,
|
||||||
@ -411,7 +397,7 @@ class EntryRestController extends WallabagRestController
|
|||||||
* required=true,
|
* required=true,
|
||||||
* @OA\Schema(
|
* @OA\Schema(
|
||||||
* type="string",
|
* type="string",
|
||||||
* enum={"xml", "json", "txt", "csv", "pdf", "epub"},
|
* enum={"xml", "json", "txt", "csv", "pdf", "epub", "mobi"},
|
||||||
* )
|
* )
|
||||||
* ),
|
* ),
|
||||||
* @OA\Response(
|
* @OA\Response(
|
||||||
|
|||||||
@ -22,11 +22,11 @@ use Wallabag\UserBundle\Form\NewUserType;
|
|||||||
class UserRestController extends WallabagRestController
|
class UserRestController extends WallabagRestController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Retrieve current logged in user information.
|
* Retrieve current logged in user informations.
|
||||||
*
|
*
|
||||||
* @Operation(
|
* @Operation(
|
||||||
* tags={"User"},
|
* tags={"User"},
|
||||||
* summary="Retrieve current logged in user information.",
|
* summary="Retrieve current logged in user informations.",
|
||||||
* @OA\Response(
|
* @OA\Response(
|
||||||
* response="200",
|
* response="200",
|
||||||
* description="Returned when successful",
|
* description="Returned when successful",
|
||||||
|
|||||||
@ -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;
|
||||||
@ -115,7 +112,7 @@ class InstallCommand extends Command
|
|||||||
|
|
||||||
$rows[] = [sprintf($label, $this->databaseDriver), $status, $help];
|
$rows[] = [sprintf($label, $this->databaseDriver), $status, $help];
|
||||||
|
|
||||||
// testing if connection to the database can be established
|
// testing if connection to the database can be etablished
|
||||||
$label = '<comment>Database connection</comment>';
|
$label = '<comment>Database connection</comment>';
|
||||||
$status = '<info>OK!</info>';
|
$status = '<info>OK!</info>';
|
||||||
$help = '';
|
$help = '';
|
||||||
@ -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();
|
||||||
|
|
||||||
@ -375,26 +372,27 @@ class InstallCommand extends Command
|
|||||||
private function isDatabasePresent()
|
private function isDatabasePresent()
|
||||||
{
|
{
|
||||||
$connection = $this->entityManager->getConnection();
|
$connection = $this->entityManager->getConnection();
|
||||||
$databaseName = $connection->getDatabase();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$schemaManager = $connection->getSchemaManager();
|
$databaseName = $connection->getDatabase();
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
// mysql & sqlite
|
// mysql & sqlite
|
||||||
if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) {
|
if (false !== strpos($exception->getMessage(), 'Unknown database')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pgsql
|
// pgsql
|
||||||
if (false !== strpos($exception->getMessage(), sprintf('database "%s" does not exist', $databaseName))) {
|
if (false !== strpos($exception->getMessage(), 'does not exist')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw $exception;
|
throw $exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$schemaManager = $connection->getSchemaManager();
|
||||||
|
|
||||||
// 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'])) {
|
||||||
@ -415,7 +413,7 @@ class InstallCommand extends Command
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the schema is already created.
|
* Check if the schema is already created.
|
||||||
* If we found at least one table, it means the schema exists.
|
* If we found at least oen table, it means the schema exists.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -7,7 +7,6 @@ use Doctrine\ORM\NoResultException;
|
|||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
@ -42,19 +41,13 @@ class ReloadEntryCommand extends Command
|
|||||||
->setDescription('Reload entries')
|
->setDescription('Reload entries')
|
||||||
->setHelp('This command reload entries')
|
->setHelp('This command reload entries')
|
||||||
->addArgument('username', InputArgument::OPTIONAL, 'Reload entries only for the given user')
|
->addArgument('username', InputArgument::OPTIONAL, 'Reload entries only for the given user')
|
||||||
->addOption(
|
;
|
||||||
'only-not-parsed',
|
|
||||||
null,
|
|
||||||
InputOption::VALUE_NONE,
|
|
||||||
'Only reload entries which have `is_not_parsed` set to `true`'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$io = new SymfonyStyle($input, $output);
|
$io = new SymfonyStyle($input, $output);
|
||||||
|
|
||||||
$onlyNotParsed = (bool) $input->getOption('only-not-parsed');
|
|
||||||
$userId = null;
|
$userId = null;
|
||||||
if ($username = $input->getArgument('username')) {
|
if ($username = $input->getArgument('username')) {
|
||||||
try {
|
try {
|
||||||
@ -68,8 +61,7 @@ class ReloadEntryCommand extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$methodName = $onlyNotParsed ? 'findAllEntriesIdByUserIdAndNotParsed' : 'findAllEntriesIdByUserId';
|
$entryIds = $this->entryRepository->findAllEntriesIdByUserId($userId);
|
||||||
$entryIds = $this->entryRepository->$methodName($userId);
|
|
||||||
|
|
||||||
$nbEntries = \count($entryIds);
|
$nbEntries = \count($entryIds);
|
||||||
if (!$nbEntries) {
|
if (!$nbEntries) {
|
||||||
|
|||||||
@ -1,70 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Wallabag\CoreBundle\Command;
|
|
||||||
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
|
||||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
|
||||||
|
|
||||||
class UpdatePicturesPathCommand extends Command
|
|
||||||
{
|
|
||||||
private EntityManagerInterface $entityManager;
|
|
||||||
private EntryRepository $entryRepository;
|
|
||||||
private string $wallabagUrl;
|
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $entityManager, EntryRepository $entryRepository, $wallabagUrl)
|
|
||||||
{
|
|
||||||
$this->entityManager = $entityManager;
|
|
||||||
$this->entryRepository = $entryRepository;
|
|
||||||
$this->wallabagUrl = $wallabagUrl;
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function configure()
|
|
||||||
{
|
|
||||||
$this
|
|
||||||
->setName('wallabag:update-pictures-path')
|
|
||||||
->setDescription('Update the path of the pictures for each entry when you changed your wallabag instance URL.')
|
|
||||||
->addArgument(
|
|
||||||
'old-url',
|
|
||||||
InputArgument::REQUIRED,
|
|
||||||
'URL to replace'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
|
||||||
{
|
|
||||||
$io = new SymfonyStyle($input, $output);
|
|
||||||
|
|
||||||
$oldUrl = $input->getArgument('old-url');
|
|
||||||
|
|
||||||
$query = $this->entryRepository->createQueryBuilder('e')->getQuery();
|
|
||||||
$io->text('Retrieve existing entries');
|
|
||||||
$i = 1;
|
|
||||||
foreach ($query->toIterable() as $entry) {
|
|
||||||
$content = $entry->getContent();
|
|
||||||
if (null !== $content) {
|
|
||||||
$entry->setContent(str_replace($oldUrl, $this->wallabagUrl, $content));
|
|
||||||
}
|
|
||||||
|
|
||||||
$previewPicture = $entry->getPreviewPicture();
|
|
||||||
if (null !== $previewPicture) {
|
|
||||||
$entry->setPreviewPicture(str_replace($oldUrl, $this->wallabagUrl, $previewPicture));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (0 === ($i % 20)) {
|
|
||||||
$this->entityManager->flush();
|
|
||||||
}
|
|
||||||
++$i;
|
|
||||||
}
|
|
||||||
$this->entityManager->flush();
|
|
||||||
|
|
||||||
$io->success('Finished updating.');
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -11,7 +11,6 @@ use JMS\Serializer\SerializerBuilder;
|
|||||||
use PragmaRX\Recovery\Recovery as BackupCodes;
|
use PragmaRX\Recovery\Recovery as BackupCodes;
|
||||||
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
|
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -26,7 +25,6 @@ use Wallabag\CoreBundle\Entity\Config as ConfigEntity;
|
|||||||
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
||||||
use Wallabag\CoreBundle\Entity\RuleInterface;
|
use Wallabag\CoreBundle\Entity\RuleInterface;
|
||||||
use Wallabag\CoreBundle\Entity\TaggingRule;
|
use Wallabag\CoreBundle\Entity\TaggingRule;
|
||||||
use Wallabag\CoreBundle\Event\ConfigUpdatedEvent;
|
|
||||||
use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
|
use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
|
||||||
use Wallabag\CoreBundle\Form\Type\ConfigType;
|
use Wallabag\CoreBundle\Form\Type\ConfigType;
|
||||||
use Wallabag\CoreBundle\Form\Type\FeedType;
|
use Wallabag\CoreBundle\Form\Type\FeedType;
|
||||||
@ -50,24 +48,15 @@ class ConfigController extends AbstractController
|
|||||||
private TagRepository $tagRepository;
|
private TagRepository $tagRepository;
|
||||||
private AnnotationRepository $annotationRepository;
|
private AnnotationRepository $annotationRepository;
|
||||||
private ConfigRepository $configRepository;
|
private ConfigRepository $configRepository;
|
||||||
private EventDispatcherInterface $eventDispatcher;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(EntityManagerInterface $entityManager, UserManagerInterface $userManager, EntryRepository $entryRepository, TagRepository $tagRepository, AnnotationRepository $annotationRepository, ConfigRepository $configRepository)
|
||||||
EntityManagerInterface $entityManager,
|
{
|
||||||
UserManagerInterface $userManager,
|
|
||||||
EntryRepository $entryRepository,
|
|
||||||
TagRepository $tagRepository,
|
|
||||||
AnnotationRepository $annotationRepository,
|
|
||||||
ConfigRepository $configRepository,
|
|
||||||
EventDispatcherInterface $eventDispatcher
|
|
||||||
) {
|
|
||||||
$this->entityManager = $entityManager;
|
$this->entityManager = $entityManager;
|
||||||
$this->userManager = $userManager;
|
$this->userManager = $userManager;
|
||||||
$this->entryRepository = $entryRepository;
|
$this->entryRepository = $entryRepository;
|
||||||
$this->tagRepository = $tagRepository;
|
$this->tagRepository = $tagRepository;
|
||||||
$this->annotationRepository = $annotationRepository;
|
$this->annotationRepository = $annotationRepository;
|
||||||
$this->configRepository = $configRepository;
|
$this->configRepository = $configRepository;
|
||||||
$this->eventDispatcher = $eventDispatcher;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -83,7 +72,6 @@ class ConfigController extends AbstractController
|
|||||||
$configForm->handleRequest($request);
|
$configForm->handleRequest($request);
|
||||||
|
|
||||||
if ($configForm->isSubmitted() && $configForm->isValid()) {
|
if ($configForm->isSubmitted() && $configForm->isValid()) {
|
||||||
$this->eventDispatcher->dispatch(new ConfigUpdatedEvent($config), ConfigUpdatedEvent::NAME);
|
|
||||||
$this->entityManager->persist($config);
|
$this->entityManager->persist($config);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
@ -102,10 +90,14 @@ class ConfigController extends AbstractController
|
|||||||
$pwdForm->handleRequest($request);
|
$pwdForm->handleRequest($request);
|
||||||
|
|
||||||
if ($pwdForm->isSubmitted() && $pwdForm->isValid()) {
|
if ($pwdForm->isSubmitted() && $pwdForm->isValid()) {
|
||||||
$message = 'flashes.config.notice.password_updated';
|
if ($craueConfig->get('demo_mode_enabled') && $craueConfig->get('demo_mode_username') === $user->getUsername()) {
|
||||||
|
$message = 'flashes.config.notice.password_not_updated_demo';
|
||||||
|
} else {
|
||||||
|
$message = 'flashes.config.notice.password_updated';
|
||||||
|
|
||||||
$user->setPlainPassword($pwdForm->get('new_password')->getData());
|
$user->setPlainPassword($pwdForm->get('new_password')->getData());
|
||||||
$this->userManager->updateUser($user, true);
|
$this->userManager->updateUser($user, true);
|
||||||
|
}
|
||||||
|
|
||||||
$this->addFlash('notice', $message);
|
$this->addFlash('notice', $message);
|
||||||
|
|
||||||
@ -262,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 $this->createAccessDeniedException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$user->setEmailTwoFactor(false);
|
$user->setEmailTwoFactor(false);
|
||||||
|
|
||||||
@ -286,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 $this->createAccessDeniedException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
|
||||||
$user->setGoogleAuthenticatorSecret(null);
|
$user->setGoogleAuthenticatorSecret(null);
|
||||||
@ -313,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 $this->createAccessDeniedException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
|
||||||
$user->setGoogleAuthenticatorSecret('');
|
$user->setGoogleAuthenticatorSecret('');
|
||||||
@ -339,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 $this->createAccessDeniedException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$secret = $googleAuthenticator->generateSecret();
|
$secret = $googleAuthenticator->generateSecret();
|
||||||
|
|
||||||
@ -381,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);
|
||||||
@ -393,19 +367,15 @@ class ConfigController extends AbstractController
|
|||||||
$this->userManager->updateUser($user, true);
|
$this->userManager->updateUser($user, true);
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('config') . '#set3');
|
return $this->redirect($this->generateUrl('config') . '#set3');
|
||||||
}*/
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate OTP code.
|
* Validate OTP code.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/app/check", name="config_otp_app_check", methods={"POST"})
|
* @Route("/config/otp/app/check", name="config_otp_app_check")
|
||||||
*/
|
*/
|
||||||
public function otpAppCheckAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
|
public function otpAppCheckAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
|
||||||
{
|
{
|
||||||
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
|
||||||
throw $this->createAccessDeniedException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$isValid = $googleAuthenticator->checkCode(
|
$isValid = $googleAuthenticator->checkCode(
|
||||||
$this->getUser(),
|
$this->getUser(),
|
||||||
$request->get('_auth_code')
|
$request->get('_auth_code')
|
||||||
@ -425,12 +395,7 @@ class ConfigController extends AbstractController
|
|||||||
'scheb_two_factor.code_invalid'
|
'scheb_two_factor.code_invalid'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->addFlash(
|
return $this->redirect($this->generateUrl('config_otp_app'));
|
||||||
'notice',
|
|
||||||
'scheb_two_factor.code_invalid'
|
|
||||||
);
|
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('config') . '#set3');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -558,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 $this->createAccessDeniedException('Bad CSRF token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'annotations':
|
case 'annotations':
|
||||||
$annotationRepository->removeAllByUserId($this->getUser()->getId());
|
$annotationRepository->removeAllByUserId($this->getUser()->getId());
|
||||||
@ -654,7 +615,7 @@ class ConfigController extends AbstractController
|
|||||||
$this->entityManager->persist($user);
|
$this->entityManager->persist($user);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
return $this->redirect($request->getSession()->get('prevUrl'));
|
return $this->redirect($request->headers->get('referer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -128,7 +128,7 @@ class EntryController extends AbstractController
|
|||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
|
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -390,7 +390,6 @@ class EntryController extends AbstractController
|
|||||||
public function viewAction(Entry $entry)
|
public function viewAction(Entry $entry)
|
||||||
{
|
{
|
||||||
$this->checkUserAction($entry);
|
$this->checkUserAction($entry);
|
||||||
$this->get('session')->set('prevUrl', $this->generateUrl('view', ['id' => $entry->getId()]));
|
|
||||||
|
|
||||||
return $this->render(
|
return $this->render(
|
||||||
'@WallabagCore/Entry/entry.html.twig',
|
'@WallabagCore/Entry/entry.html.twig',
|
||||||
@ -452,7 +451,7 @@ class EntryController extends AbstractController
|
|||||||
$message
|
$message
|
||||||
);
|
);
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
|
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -482,7 +481,7 @@ class EntryController extends AbstractController
|
|||||||
$message
|
$message
|
||||||
);
|
);
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
|
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -518,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->getSession()->get('prevUrl', '');
|
$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);
|
||||||
|
|
||||||
@ -615,9 +614,8 @@ class EntryController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
private function showEntries($type, Request $request, $page)
|
private function showEntries($type, Request $request, $page)
|
||||||
{
|
{
|
||||||
$searchTerm = (isset($request->get('search_entry')['term']) ? trim($request->get('search_entry')['term']) : '');
|
$searchTerm = (isset($request->get('search_entry')['term']) ? $request->get('search_entry')['term'] : '');
|
||||||
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
|
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
|
||||||
$request->getSession()->set('prevUrl', $request->getRequestUri());
|
|
||||||
|
|
||||||
$formOptions = [];
|
$formOptions = [];
|
||||||
|
|
||||||
@ -675,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(),
|
||||||
@ -682,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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -21,7 +21,7 @@ class ExportController extends AbstractController
|
|||||||
* Gets one entry content.
|
* Gets one entry content.
|
||||||
*
|
*
|
||||||
* @Route("/export/{id}.{format}", name="export_entry", requirements={
|
* @Route("/export/{id}.{format}", name="export_entry", requirements={
|
||||||
* "format": "epub|pdf|json|xml|txt|csv",
|
* "format": "epub|mobi|pdf|json|xml|txt|csv",
|
||||||
* "id": "\d+"
|
* "id": "\d+"
|
||||||
* })
|
* })
|
||||||
*
|
*
|
||||||
@ -55,7 +55,7 @@ class ExportController extends AbstractController
|
|||||||
* Export all entries for current user.
|
* Export all entries for current user.
|
||||||
*
|
*
|
||||||
* @Route("/export/{category}.{format}", name="export_entries", requirements={
|
* @Route("/export/{category}.{format}", name="export_entries", requirements={
|
||||||
* "format": "epub|pdf|json|xml|txt|csv",
|
* "format": "epub|mobi|pdf|json|xml|txt|csv",
|
||||||
* "category": "all|unread|starred|archive|tag_entries|untagged|search|annotated|same_domain"
|
* "category": "all|unread|starred|archive|tag_entries|untagged|search|annotated|same_domain"
|
||||||
* })
|
* })
|
||||||
*
|
*
|
||||||
|
|||||||
@ -5,7 +5,6 @@ namespace Wallabag\CoreBundle\Controller;
|
|||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\Form\Form;
|
use Symfony\Component\Form\Form;
|
||||||
use Symfony\Component\Form\FormInterface;
|
|
||||||
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;
|
||||||
@ -139,7 +138,7 @@ class IgnoreOriginInstanceRuleController extends AbstractController
|
|||||||
*
|
*
|
||||||
* @param IgnoreOriginInstanceRule $ignoreOriginInstanceRule The ignore origin instance rule entity
|
* @param IgnoreOriginInstanceRule $ignoreOriginInstanceRule The ignore origin instance rule entity
|
||||||
*
|
*
|
||||||
* @return FormInterface The form
|
* @return Form The form
|
||||||
*/
|
*/
|
||||||
private function createDeleteForm(IgnoreOriginInstanceRule $ignoreOriginInstanceRule)
|
private function createDeleteForm(IgnoreOriginInstanceRule $ignoreOriginInstanceRule)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,7 +6,6 @@ use Craue\ConfigBundle\Util\Config;
|
|||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\Form\Form;
|
use Symfony\Component\Form\Form;
|
||||||
use Symfony\Component\Form\FormInterface;
|
|
||||||
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;
|
||||||
@ -174,7 +173,7 @@ class SiteCredentialController extends AbstractController
|
|||||||
*
|
*
|
||||||
* @param SiteCredential $siteCredential The site credential entity
|
* @param SiteCredential $siteCredential The site credential entity
|
||||||
*
|
*
|
||||||
* @return FormInterface The form
|
* @return Form The form
|
||||||
*/
|
*/
|
||||||
private function createDeleteForm(SiteCredential $siteCredential)
|
private function createDeleteForm(SiteCredential $siteCredential)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -45,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
|
||||||
@ -104,7 +104,7 @@ class TagController extends AbstractController
|
|||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true);
|
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -185,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->getSession()->get('prevUrl'), '', 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();
|
||||||
@ -257,7 +257,7 @@ class TagController extends AbstractController
|
|||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirect($this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true));
|
return $this->redirect($this->redirectHelper->to($request->headers->get('referer'), '', true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -279,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->getSession()->get('prevUrl'), '', 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
|
||||||
{
|
{
|
||||||
@ -17,8 +15,6 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager): void
|
public function load(ObjectManager $manager): void
|
||||||
{
|
{
|
||||||
$now = new \DateTime();
|
|
||||||
|
|
||||||
$entries = [
|
$entries = [
|
||||||
'entry1' => [
|
'entry1' => [
|
||||||
'user' => 'admin-user',
|
'user' => 'admin-user',
|
||||||
@ -74,7 +70,6 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
'content' => 'This is my content /o/',
|
'content' => 'This is my content /o/',
|
||||||
'language' => 'fr',
|
'language' => 'fr',
|
||||||
'starred' => true,
|
'starred' => true,
|
||||||
'starred_at' => $now,
|
|
||||||
'preview' => 'http://0.0.0.0/image.jpg',
|
'preview' => 'http://0.0.0.0/image.jpg',
|
||||||
],
|
],
|
||||||
'entry6' => [
|
'entry6' => [
|
||||||
@ -87,14 +82,12 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
'content' => 'This is my content /o/',
|
'content' => 'This is my content /o/',
|
||||||
'language' => 'de',
|
'language' => 'de',
|
||||||
'archived' => true,
|
'archived' => true,
|
||||||
'archived_at' => $now,
|
|
||||||
'tags' => ['bar-tag'],
|
'tags' => ['bar-tag'],
|
||||||
'is_not_parsed' => true,
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
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']);
|
||||||
@ -105,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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,26 +110,14 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
$entry->setStarred($item['starred']);
|
$entry->setStarred($item['starred']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($item['starred_at'])) {
|
|
||||||
$entry->setStarredAt($item['starred_at']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($item['archived'])) {
|
if (isset($item['archived'])) {
|
||||||
$entry->setArchived($item['archived']);
|
$entry->setArchived($item['archived']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($item['archived_at'])) {
|
|
||||||
$entry->setArchivedAt($item['archived_at']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($item['preview'])) {
|
if (isset($item['preview'])) {
|
||||||
$entry->setPreviewPicture($item['preview']);
|
$entry->setPreviewPicture($item['preview']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($item['is_not_parsed'])) {
|
|
||||||
$entry->setNotParsed($item['is_not_parsed']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$manager->persist($entry);
|
$manager->persist($entry);
|
||||||
$this->addReference($reference, $entry);
|
$this->addReference($reference, $entry);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
|
|
||||||
|
|||||||
@ -72,9 +72,6 @@ class Configuration implements ConfigurationInterface
|
|||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->arrayNode('fonts')
|
|
||||||
->prototype('scalar')->end()
|
|
||||||
->end()
|
|
||||||
->end()
|
->end()
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,6 @@ class WallabagCoreExtension extends Extension
|
|||||||
$container->setParameter('wallabag_core.default_internal_settings', $config['default_internal_settings']);
|
$container->setParameter('wallabag_core.default_internal_settings', $config['default_internal_settings']);
|
||||||
$container->setParameter('wallabag_core.site_credentials.encryption_key_path', $config['encryption_key_path']);
|
$container->setParameter('wallabag_core.site_credentials.encryption_key_path', $config['encryption_key_path']);
|
||||||
$container->setParameter('wallabag_core.default_ignore_origin_instance_rules', $config['default_ignore_origin_instance_rules']);
|
$container->setParameter('wallabag_core.default_ignore_origin_instance_rules', $config['default_ignore_origin_instance_rules']);
|
||||||
$container->setParameter('wallabag_core.fonts', $config['fonts']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAlias()
|
public function getAlias()
|
||||||
|
|||||||
@ -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 . '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -126,65 +126,18 @@ class Config
|
|||||||
*/
|
*/
|
||||||
private $displayThumbnails;
|
private $displayThumbnails;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="font", type="text", nullable=true)
|
|
||||||
*
|
|
||||||
* @Groups({"config_api"})
|
|
||||||
*/
|
|
||||||
private $font;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var float
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="fontsize", type="float", nullable=true)
|
|
||||||
*
|
|
||||||
* @Groups({"config_api"})
|
|
||||||
*/
|
|
||||||
private $fontsize;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var float
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="line_height", type="float", nullable=true)
|
|
||||||
*
|
|
||||||
* @Groups({"config_api"})
|
|
||||||
*/
|
|
||||||
private $lineHeight;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var float
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="max_width", type="float", nullable=true)
|
|
||||||
*
|
|
||||||
* @Groups({"config_api"})
|
|
||||||
*/
|
|
||||||
private $maxWidth;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="custom_css", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $customCSS;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
|
* @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
|
||||||
*/
|
*/
|
||||||
private $user;
|
private $user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ArrayCollection<TaggingRule>
|
|
||||||
*
|
|
||||||
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
|
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
|
||||||
* @ORM\OrderBy({"id" = "ASC"})
|
* @ORM\OrderBy({"id" = "ASC"})
|
||||||
*/
|
*/
|
||||||
private $taggingRules;
|
private $taggingRules;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@var ArrayCollection<IgnoreOriginUserRule>
|
|
||||||
|
|
||||||
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"})
|
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"})
|
||||||
* @ORM\OrderBy({"id" = "ASC"})
|
* @ORM\OrderBy({"id" = "ASC"})
|
||||||
*/
|
*/
|
||||||
@ -418,9 +371,12 @@ class Config
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDisplayThumbnails(): bool
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function getDisplayThumbnails(): ?bool
|
||||||
{
|
{
|
||||||
return (bool) $this->displayThumbnails;
|
return $this->displayThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -428,94 +384,7 @@ class Config
|
|||||||
*/
|
*/
|
||||||
public function setDisplayThumbnails(bool $displayThumbnails)
|
public function setDisplayThumbnails(bool $displayThumbnails)
|
||||||
{
|
{
|
||||||
$this->displayThumbnails = $displayThumbnails ? 1 : 0;
|
$this->displayThumbnails = $displayThumbnails;
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getFont(): ?string
|
|
||||||
{
|
|
||||||
return $this->font;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function setFont(string $font): self
|
|
||||||
{
|
|
||||||
$this->font = $font;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return float
|
|
||||||
*/
|
|
||||||
public function getFontsize(): ?float
|
|
||||||
{
|
|
||||||
return $this->fontsize;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function setFontsize(float $fontsize): self
|
|
||||||
{
|
|
||||||
$this->fontsize = $fontsize;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return float
|
|
||||||
*/
|
|
||||||
public function getLineHeight(): ?float
|
|
||||||
{
|
|
||||||
return $this->lineHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function setLineHeight(float $lineHeight): self
|
|
||||||
{
|
|
||||||
$this->lineHeight = $lineHeight;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return float
|
|
||||||
*/
|
|
||||||
public function getMaxWidth(): ?float
|
|
||||||
{
|
|
||||||
return $this->maxWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function setMaxWidth(float $maxWidth): self
|
|
||||||
{
|
|
||||||
$this->maxWidth = $maxWidth;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getCustomCSS(): ?string
|
|
||||||
{
|
|
||||||
return $this->customCSS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function setCustomCSS(?string $customCSS): self
|
|
||||||
{
|
|
||||||
$this->customCSS = $customCSS;
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class Entry
|
|||||||
private $id;
|
private $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="uid", type="string", length=23, nullable=true)
|
* @ORM\Column(name="uid", type="string", length=23, nullable=true)
|
||||||
*
|
*
|
||||||
@ -132,7 +132,7 @@ class Entry
|
|||||||
private $isArchived = false;
|
private $isArchived = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTimeInterface
|
* @var \DateTime
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="archived_at", type="datetime", nullable=true)
|
* @ORM\Column(name="archived_at", type="datetime", nullable=true)
|
||||||
*
|
*
|
||||||
@ -161,7 +161,7 @@ class Entry
|
|||||||
private $content;
|
private $content;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTimeInterface
|
* @var \DateTime
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="created_at", type="datetime")
|
* @ORM\Column(name="created_at", type="datetime")
|
||||||
*
|
*
|
||||||
@ -170,7 +170,7 @@ class Entry
|
|||||||
private $createdAt;
|
private $createdAt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTimeInterface
|
* @var \DateTime
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="updated_at", type="datetime")
|
* @ORM\Column(name="updated_at", type="datetime")
|
||||||
*
|
*
|
||||||
@ -179,7 +179,7 @@ class Entry
|
|||||||
private $updatedAt;
|
private $updatedAt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTimeInterface
|
* @var \DateTime
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="published_at", type="datetime", nullable=true)
|
* @ORM\Column(name="published_at", type="datetime", nullable=true)
|
||||||
*
|
*
|
||||||
@ -197,7 +197,7 @@ class Entry
|
|||||||
private $publishedBy;
|
private $publishedBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTimeInterface
|
* @var \DateTime
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="starred_at", type="datetime", nullable=true)
|
* @ORM\Column(name="starred_at", type="datetime", nullable=true)
|
||||||
*
|
*
|
||||||
@ -276,17 +276,6 @@ class Entry
|
|||||||
*/
|
*/
|
||||||
private $headers;
|
private $headers;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*
|
|
||||||
* @Exclude
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="is_not_parsed", type="boolean")
|
|
||||||
*
|
|
||||||
* @Groups({"entries_for_user", "export_all"})
|
|
||||||
*/
|
|
||||||
private $isNotParsed = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Exclude
|
* @Exclude
|
||||||
*
|
*
|
||||||
@ -411,7 +400,7 @@ class Entry
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \DateTimeInterface|null
|
* @return \DateTime|null
|
||||||
*/
|
*/
|
||||||
public function getArchivedAt()
|
public function getArchivedAt()
|
||||||
{
|
{
|
||||||
@ -419,7 +408,7 @@ class Entry
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \DateTimeInterface|null $archivedAt
|
* @param \DateTime|null $archivedAt
|
||||||
*
|
*
|
||||||
* @return Entry
|
* @return Entry
|
||||||
*/
|
*/
|
||||||
@ -493,7 +482,7 @@ class Entry
|
|||||||
|
|
||||||
public function toggleStar()
|
public function toggleStar()
|
||||||
{
|
{
|
||||||
$this->isStarred = !$this->isStarred();
|
$this->isStarred = $this->isStarred() ^ 1;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -571,7 +560,7 @@ class Entry
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \DateTimeInterface
|
* @return \DateTime
|
||||||
*/
|
*/
|
||||||
public function getCreatedAt()
|
public function getCreatedAt()
|
||||||
{
|
{
|
||||||
@ -579,7 +568,7 @@ class Entry
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \DateTimeInterface
|
* @return \DateTime
|
||||||
*/
|
*/
|
||||||
public function getUpdatedAt()
|
public function getUpdatedAt()
|
||||||
{
|
{
|
||||||
@ -587,7 +576,7 @@ class Entry
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \DateTimeInterface|null
|
* @return \DateTime|null
|
||||||
*/
|
*/
|
||||||
public function getStarredAt()
|
public function getStarredAt()
|
||||||
{
|
{
|
||||||
@ -595,7 +584,7 @@ class Entry
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \DateTimeInterface|null $starredAt
|
* @param \DateTime|null $starredAt
|
||||||
*
|
*
|
||||||
* @return Entry
|
* @return Entry
|
||||||
*/
|
*/
|
||||||
@ -892,7 +881,7 @@ class Entry
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \DateTimeInterface
|
* @return \DateTime
|
||||||
*/
|
*/
|
||||||
public function getPublishedAt()
|
public function getPublishedAt()
|
||||||
{
|
{
|
||||||
@ -902,7 +891,7 @@ class Entry
|
|||||||
/**
|
/**
|
||||||
* @return Entry
|
* @return Entry
|
||||||
*/
|
*/
|
||||||
public function setPublishedAt(\DateTimeInterface $publishedAt)
|
public function setPublishedAt(\DateTime $publishedAt)
|
||||||
{
|
{
|
||||||
$this->publishedAt = $publishedAt;
|
$this->publishedAt = $publishedAt;
|
||||||
|
|
||||||
@ -1017,28 +1006,4 @@ class Entry
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set isNotParsed.
|
|
||||||
*
|
|
||||||
* @param bool $isNotParsed
|
|
||||||
*
|
|
||||||
* @return Entry
|
|
||||||
*/
|
|
||||||
public function setNotParsed($isNotParsed)
|
|
||||||
{
|
|
||||||
$this->isNotParsed = $isNotParsed;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get isNotParsed.
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function isNotParsed()
|
|
||||||
{
|
|
||||||
return $this->isNotParsed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Wallabag\CoreBundle\Event;
|
|
||||||
|
|
||||||
use Symfony\Contracts\EventDispatcher\Event;
|
|
||||||
use Wallabag\CoreBundle\Entity\Config;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This event is fired as soon as user configuration is updated.
|
|
||||||
*/
|
|
||||||
class ConfigUpdatedEvent extends Event
|
|
||||||
{
|
|
||||||
public const NAME = 'config.updated';
|
|
||||||
|
|
||||||
protected $config;
|
|
||||||
|
|
||||||
public function __construct(Config $entry)
|
|
||||||
{
|
|
||||||
$this->config = $entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getConfig(): Config
|
|
||||||
{
|
|
||||||
return $this->config;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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()) {
|
||||||
|
|||||||
@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Wallabag\CoreBundle\Event\Subscriber;
|
|
||||||
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
|
||||||
use ScssPhp\ScssPhp\Compiler;
|
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
|
||||||
use Wallabag\CoreBundle\Event\ConfigUpdatedEvent;
|
|
||||||
|
|
||||||
class GenerateCustomCSSSubscriber implements EventSubscriberInterface
|
|
||||||
{
|
|
||||||
private $em;
|
|
||||||
private $compiler;
|
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $em, Compiler $compiler)
|
|
||||||
{
|
|
||||||
$this->em = $em;
|
|
||||||
$this->compiler = $compiler;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getSubscribedEvents()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
ConfigUpdatedEvent::NAME => 'onConfigUpdated',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate custom CSS.
|
|
||||||
*/
|
|
||||||
public function onConfigUpdated(ConfigUpdatedEvent $event)
|
|
||||||
{
|
|
||||||
$config = $event->getConfig();
|
|
||||||
|
|
||||||
$css = $this->compiler->compileString(
|
|
||||||
'h1 { font-family: "' . $config->getFont() . '";}
|
|
||||||
#article {
|
|
||||||
max-width: ' . $config->getMaxWidth() . 'em;
|
|
||||||
font-family: "' . $config->getFont() . '";
|
|
||||||
}
|
|
||||||
#article article {
|
|
||||||
font-size: ' . $config->getFontsize() . 'em;
|
|
||||||
line-height: ' . $config->getLineHeight() . 'em;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
')->getCss();
|
|
||||||
|
|
||||||
$config->setCustomCSS($css);
|
|
||||||
|
|
||||||
$this->em->persist($config);
|
|
||||||
$this->em->flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
|||||||
/**
|
/**
|
||||||
* Puts a prefix to each table.
|
* Puts a prefix to each table.
|
||||||
* This way were used instead of using the built-in strategy from Doctrine, using `naming_strategy`
|
* This way were used instead of using the built-in strategy from Doctrine, using `naming_strategy`
|
||||||
* Because it conflicts with the DefaultQuoteStrategy (that escape table name, like user for Postgres)
|
* Because it conflicts with the DefaultQuoteStrategy (that espace table name, like user for Postgres)
|
||||||
* see #1498 for more detail.
|
* see #1498 for more detail.
|
||||||
*
|
*
|
||||||
* Solution from :
|
* Solution from :
|
||||||
|
|||||||
@ -49,7 +49,7 @@ class StringToListTransformer implements DataTransformerInterface
|
|||||||
public function reverseTransform($string)
|
public function reverseTransform($string)
|
||||||
{
|
{
|
||||||
if (null === $string) {
|
if (null === $string) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_values(array_filter(array_map('trim', explode($this->separator, $string))));
|
return array_values(array_filter(array_map('trim', explode($this->separator, $string))));
|
||||||
|
|||||||
@ -6,7 +6,6 @@ use Symfony\Component\Form\AbstractType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\RangeType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
@ -15,53 +14,18 @@ use Wallabag\CoreBundle\Entity\Config;
|
|||||||
class ConfigType extends AbstractType
|
class ConfigType extends AbstractType
|
||||||
{
|
{
|
||||||
private $languages = [];
|
private $languages = [];
|
||||||
private $fonts = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $languages Languages come from configuration, array just code language as key and label as value
|
* @param array $languages Languages come from configuration, array just code language as key and label as value
|
||||||
* @param array $fonts Fonts come from configuration, array just font name as key / value
|
|
||||||
*/
|
*/
|
||||||
public function __construct($languages, $fonts)
|
public function __construct($languages)
|
||||||
{
|
{
|
||||||
$this->languages = $languages;
|
$this->languages = $languages;
|
||||||
$this->fonts = $fonts;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('font', ChoiceType::class, [
|
|
||||||
'choices' => $this->initFonts(),
|
|
||||||
'label' => 'config.form_settings.font_label',
|
|
||||||
'property_path' => 'font',
|
|
||||||
])
|
|
||||||
->add('fontsize', RangeType::class, [
|
|
||||||
'attr' => [
|
|
||||||
'min' => 0.6,
|
|
||||||
'max' => 2,
|
|
||||||
'step' => 0.1,
|
|
||||||
],
|
|
||||||
'label' => 'config.form_settings.fontsize_label',
|
|
||||||
'property_path' => 'fontsize',
|
|
||||||
])
|
|
||||||
->add('lineHeight', RangeType::class, [
|
|
||||||
'attr' => [
|
|
||||||
'min' => 0.6,
|
|
||||||
'max' => 2,
|
|
||||||
'step' => 0.1,
|
|
||||||
],
|
|
||||||
'label' => 'config.form_settings.lineheight_label',
|
|
||||||
'property_path' => 'lineHeight',
|
|
||||||
])
|
|
||||||
->add('maxWidth', RangeType::class, [
|
|
||||||
'attr' => [
|
|
||||||
'min' => 20,
|
|
||||||
'max' => 60,
|
|
||||||
'step' => 5,
|
|
||||||
],
|
|
||||||
'label' => 'config.form_settings.maxwidth_label',
|
|
||||||
'property_path' => 'maxWidth',
|
|
||||||
])
|
|
||||||
->add('items_per_page', IntegerType::class, [
|
->add('items_per_page', IntegerType::class, [
|
||||||
'label' => 'config.form_settings.items_per_page_label',
|
'label' => 'config.form_settings.items_per_page_label',
|
||||||
'property_path' => 'itemsPerPage',
|
'property_path' => 'itemsPerPage',
|
||||||
@ -108,20 +72,4 @@ class ConfigType extends AbstractType
|
|||||||
{
|
{
|
||||||
return 'config';
|
return 'config';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array with font name as key / value.
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
private function initFonts()
|
|
||||||
{
|
|
||||||
$fonts = [];
|
|
||||||
|
|
||||||
foreach ($this->fonts as $font) {
|
|
||||||
$fonts[$font] = $font;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $fonts;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
@ -95,7 +94,7 @@ class EntryFilterType extends AbstractType
|
|||||||
->add('domainName', TextFilterType::class, [
|
->add('domainName', TextFilterType::class, [
|
||||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||||
$value = $values['value'];
|
$value = $values['value'];
|
||||||
if (empty($value) || \strlen($value) <= 2) {
|
if (\strlen($value) <= 2 || empty($value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->lower($filterQuery->getExpr()->literal('%' . $value . '%')));
|
$expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->lower($filterQuery->getExpr()->literal('%' . $value . '%')));
|
||||||
@ -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',
|
||||||
@ -160,10 +151,6 @@ class EntryFilterType extends AbstractType
|
|||||||
$qb->innerJoin('e.annotations', 'a');
|
$qb->innerJoin('e.annotations', 'a');
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
->add('isNotParsed', CheckboxFilterType::class, [
|
|
||||||
'label' => 'entry.filters.parsed_label',
|
|
||||||
'data' => $options['filter_parsed'],
|
|
||||||
])
|
|
||||||
->add('previewPicture', CheckboxFilterType::class, [
|
->add('previewPicture', CheckboxFilterType::class, [
|
||||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||||
if (false === $values['value']) {
|
if (false === $values['value']) {
|
||||||
@ -211,7 +198,6 @@ class EntryFilterType extends AbstractType
|
|||||||
'filter_starred' => false,
|
'filter_starred' => false,
|
||||||
'filter_unread' => false,
|
'filter_unread' => false,
|
||||||
'filter_annotated' => false,
|
'filter_annotated' => false,
|
||||||
'filter_parsed' => false,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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',
|
||||||
])
|
])
|
||||||
|
|||||||
@ -260,7 +260,6 @@ class ContentProxy
|
|||||||
|
|
||||||
if (empty($content['html'])) {
|
if (empty($content['html'])) {
|
||||||
$content['html'] = $this->fetchingErrorMessage;
|
$content['html'] = $this->fetchingErrorMessage;
|
||||||
$entry->setNotParsed(true);
|
|
||||||
|
|
||||||
if (!empty($content['description'])) {
|
if (!empty($content['description'])) {
|
||||||
$content['html'] .= '<p><i>But we found a short description: </i></p>';
|
$content['html'] .= '<p><i>But we found a short description: </i></p>';
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user