forked from wallabag/wallabag
Compare commits
139 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2555c0a40f | |||
| bffe65478d | |||
| 5a4cbf5b70 | |||
| ea60d76e60 | |||
| d470f817ac | |||
| dc90eab32b | |||
| e01b00298a | |||
| 2daae77094 | |||
| 59a31ed07f | |||
| 060f3ce34c | |||
| ccc3b0a531 | |||
| 0ddfb2956c | |||
| b3bcc6aa06 | |||
| a22b8043b4 | |||
| 078d54411b | |||
| c7e9610b3f | |||
| 3a69628007 | |||
| 3f0dd0f0bc | |||
| da7b8e256f | |||
| 0452e869ec | |||
| 385dac6d31 | |||
| 96823682f9 | |||
| a6e4e83809 | |||
| 1b220426e2 | |||
| 6059967951 | |||
| 44e63667d9 | |||
| 5ba5e22a09 | |||
| b49c87acf1 | |||
| fc040c749d | |||
| e07fadea76 | |||
| 781864b954 | |||
| 4a81360efc | |||
| ae4f7dceec | |||
| c2bd272cf3 | |||
| 0658ce4f11 | |||
| cefbe6a87f | |||
| fbdc665487 | |||
| 0ebf595c11 | |||
| ba69c04c27 | |||
| 78ef840eda | |||
| d73bfdbddb | |||
| f5c862640b | |||
| 9e83c3bdf0 | |||
| 23aa47d828 | |||
| 0f5c15d543 | |||
| 28cc645b93 | |||
| 83f1c3274f | |||
| d64139d812 | |||
| 7a65c2017b | |||
| c01d953292 | |||
| f80f16dfc8 | |||
| 8648f0c005 | |||
| d76a5a6d60 | |||
| 759c91940b | |||
| 84b3bdaac0 | |||
| 8013f35d96 | |||
| c0b65ad1c9 | |||
| 4408ebd40a | |||
| 8d109df851 | |||
| 17476f4d8d | |||
| 495f83c925 | |||
| eb5e3f1d1d | |||
| 04f85fd9a8 | |||
| b8115ff46b | |||
| 0636697289 | |||
| b7c5fda512 | |||
| 69b563948d | |||
| ada5d5b269 | |||
| 2a1ceb67b4 | |||
| 685a5d745e | |||
| 72efc80fdc | |||
| fea06d19f3 | |||
| 681e04b060 | |||
| 2bf568ff46 | |||
| 1421236800 | |||
| e0a9791412 | |||
| 7fd4ad6564 | |||
| d29b18e82e | |||
| e6f12c0734 | |||
| 0f36a88e16 | |||
| e93f37206a | |||
| 4c78612eb4 | |||
| 2fdd512488 | |||
| 9b12f822e1 | |||
| d02e6850c2 | |||
| 6337b46e80 | |||
| 9216bab8c9 | |||
| 9bc086071a | |||
| 80336f77fd | |||
| 200392b462 | |||
| 9c48053b14 | |||
| 18167b9a24 | |||
| 3fbbe0d9f1 | |||
| 6cf7f21dcb | |||
| 8d09f57c0d | |||
| e586d65b64 | |||
| 7ddba67745 | |||
| 7ebd4bdcf7 | |||
| 49b4c87598 | |||
| bfe7a69226 | |||
| 36054f5dd4 | |||
| c00a691019 | |||
| 778543311f | |||
| a550a64c84 | |||
| def73759ae | |||
| 03f2cacb58 | |||
| fea68d1a72 | |||
| 8fe73e076c | |||
| c15bb5ad72 | |||
| 9707ac4661 | |||
| 53ec80be94 | |||
| f136d288d6 | |||
| 1d770f9867 | |||
| a6e5637507 | |||
| 65f499b4ac | |||
| 4745ca3fde | |||
| 7c3184376c | |||
| 609adaca9b | |||
| 9562a8aca8 | |||
| b2e7b8b600 | |||
| 11f15430ff | |||
| a0f126b973 | |||
| 08d6bedcaa | |||
| 8e5b91180e | |||
| 3b46d0f947 | |||
| 80d4260a8e | |||
| 739a4024fa | |||
| 3be96dcb17 | |||
| f400aa1281 | |||
| ed148f6685 | |||
| 10f31ac572 | |||
| 35ce4d5e5f | |||
| 727880c950 | |||
| 2ff26deaf8 | |||
| ad77c3451f | |||
| bf283db8e6 | |||
| 228d317204 | |||
| 4d9128ded9 | |||
| cc09434ea4 |
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -8,9 +8,15 @@
|
||||
| Documentation | yes/no
|
||||
| Translation | yes/no
|
||||
| CHANGELOG.md | yes/no
|
||||
| Fixed tickets | #...
|
||||
| License | MIT
|
||||
|
||||
<!--
|
||||
Please list the issues your PR fixes using special keywords, see
|
||||
https://help.github.com/articles/closing-issues-using-keywords/
|
||||
|
||||
Fixes #…
|
||||
-->
|
||||
|
||||
<!--
|
||||
- Please fill in this template according to the PR you're about to submit.
|
||||
- Replace this comment by a description of what your PR is solving.
|
||||
|
||||
@ -26,3 +26,18 @@ tools:
|
||||
checks:
|
||||
php:
|
||||
code_rating: true
|
||||
|
||||
# use the new PHP analysis engine
|
||||
# https://scrutinizer-ci.com/docs/tools/php/php-analyzer/guides/migrate_to_new_php_analysis
|
||||
build:
|
||||
nodes:
|
||||
analysis:
|
||||
tests:
|
||||
override:
|
||||
- php-scrutinizer-run
|
||||
|
||||
dependencies:
|
||||
override:
|
||||
- npm install -g 'yarn'
|
||||
- yarn install --force
|
||||
- COMPOSER_MEMORY_LIMIT=-1 composer install -o --no-interaction --no-progress --prefer-dist
|
||||
|
||||
40
.travis.yml
40
.travis.yml
@ -1,17 +1,14 @@
|
||||
language: php
|
||||
|
||||
services:
|
||||
- rabbitmq
|
||||
- redis
|
||||
|
||||
# faster builds on docker-container setup
|
||||
sudo: false
|
||||
- rabbitmq
|
||||
- redis
|
||||
|
||||
# used for HHVM
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- tidy
|
||||
apt:
|
||||
packages:
|
||||
- tidy
|
||||
|
||||
# cache vendor dirs
|
||||
cache:
|
||||
@ -44,7 +41,6 @@ matrix:
|
||||
- php: 7.0
|
||||
env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run ASSETS=build DB=sqlite
|
||||
allow_failures:
|
||||
- php: 7.2
|
||||
- php: nightly
|
||||
|
||||
# exclude v1 branches
|
||||
@ -52,6 +48,14 @@ branches:
|
||||
except:
|
||||
- legacy
|
||||
|
||||
before_install:
|
||||
- if [[ $TRAVIS_REPO_SLUG = wallabag/wallabag ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
|
||||
|
||||
install:
|
||||
- if [[ $ASSETS = build ]]; then source ~/.nvm/nvm.sh && nvm install 6.10; fi;
|
||||
- if [[ $ASSETS = build ]]; then npm install -g yarn@latest; fi;
|
||||
- if [[ $ASSETS = build ]]; then yarn install; fi;
|
||||
|
||||
before_script:
|
||||
- PHP=$TRAVIS_PHP_VERSION
|
||||
- if [[ ! $PHP = hhvm* ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
|
||||
@ -59,17 +63,17 @@ before_script:
|
||||
- if [[ ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
|
||||
- composer self-update --no-progress
|
||||
- if [[ $DB = pgsql ]]; then psql -c 'create database wallabag_test;' -U postgres; fi;
|
||||
|
||||
install:
|
||||
- if [[ $ASSETS = build ]]; then source ~/.nvm/nvm.sh && nvm install 6.10; fi;
|
||||
- if [[ $ASSETS = build ]]; then npm install -g yarn@latest; fi;
|
||||
- if [[ $ASSETS = build ]]; then yarn install; fi;
|
||||
|
||||
before_install:
|
||||
- if [[ $TRAVIS_REPO_SLUG = wallabag/wallabag ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
|
||||
# increase swap to avoid "proc_open(): fork failed - Cannot allocate memory"
|
||||
# this should be removed when no more PHP 5 build will be defined
|
||||
- sudo swapon -s
|
||||
- sudo fallocate -l 4G /swapfile
|
||||
- sudo chmod 600 /swapfile
|
||||
- sudo mkswap /swapfile
|
||||
- sudo swapon /swapfile
|
||||
- sudo swapon -s
|
||||
|
||||
script:
|
||||
- travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist
|
||||
- travis_wait bash composer update -o --no-interaction --no-progress --prefer-dist
|
||||
- echo "travis_fold:start:prepare"
|
||||
- make prepare DB=$DB
|
||||
- echo "travis_fold:end:prepare"
|
||||
|
||||
61
CHANGELOG.md
61
CHANGELOG.md
@ -1,5 +1,66 @@
|
||||
# Changelog
|
||||
|
||||
## [2.3.4](https://github.com/wallabag/wallabag/tree/2.3.4)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.3...2.3.4)
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix image downloading on null image path [#3684](https://github.com/wallabag/wallabag/pull/3684)
|
||||
- Remove remaining deprecation notices [#3686](https://github.com/wallabag/wallabag/pull/3686)
|
||||
- Fix mobile viewport on big iframe and video elements [#3683](https://github.com/wallabag/wallabag/pull/3683)
|
||||
- Autofocus the username field on the login page [#3691](https://github.com/wallabag/wallabag/pull/3691)
|
||||
- Feature/svg logo [#3692](https://github.com/wallabag/wallabag/pull/3692)
|
||||
- Fixes a typo [#3702](https://github.com/wallabag/wallabag/pull/3702)
|
||||
- Update release script [#3705](https://github.com/wallabag/wallabag/pull/3705)
|
||||
- Removing failing test from Travis [#3707](https://github.com/wallabag/wallabag/pull/3707)
|
||||
- Replace SO url by lemonde.fr to avoid random failing test [#3685](https://github.com/wallabag/wallabag/pull/3685)
|
||||
- php-cs-fixer: native_function_invocation [#3716](https://github.com/wallabag/wallabag/pull/3716)
|
||||
- PHP 7.2 shouldn't fail [#3717](https://github.com/wallabag/wallabag/pull/3717)
|
||||
- Liberation goes https [#3726](https://github.com/wallabag/wallabag/pull/3726)
|
||||
- Bugfix: Sanitize the title of a saved webpage from invalid UTF-8 characters. [#3725](https://github.com/wallabag/wallabag/pull/3725)
|
||||
- Fix dockerfile php72 [#3734](https://github.com/wallabag/wallabag/pull/3734)
|
||||
- Fix sort parameters [#3719](https://github.com/wallabag/wallabag/pull/3719)
|
||||
- Add note on GitHub PR template to auto-close issues [#3763](https://github.com/wallabag/wallabag/pull/3763)
|
||||
- Fix link to wallabag requirements in documentation [#3766](https://github.com/wallabag/wallabag/pull/3766)
|
||||
- Update translation when marking as read [#3772](https://github.com/wallabag/wallabag/pull/3772)
|
||||
- Makefile fixes for non GNU systems [#3706](https://github.com/wallabag/wallabag/pull/3706)
|
||||
- Card no preview replaced by wallabag logo [#3774](https://github.com/wallabag/wallabag/pull/3774)
|
||||
|
||||
### Changes
|
||||
|
||||
- Propose YunoHost badge for installing [#3678](https://github.com/wallabag/wallabag/pull/3678)
|
||||
- More robust srcset image attribute handling [#3690](https://github.com/wallabag/wallabag/pull/3690)
|
||||
- Rename getBuilderByUser and refactor query for untagged entries [#3712](https://github.com/wallabag/wallabag/pull/3712)
|
||||
- Show tags on non-image gallery preview card [#3743](https://github.com/wallabag/wallabag/pull/3743)
|
||||
- add manifest.json for android pwa [#3606](https://github.com/wallabag/wallabag/pull/3606)
|
||||
- Add placeholder image to card-based gallery entries page [#3745](https://github.com/wallabag/wallabag/pull/3745)
|
||||
- Abort running install and update script if root [#3733](https://github.com/wallabag/wallabag/pull/3733)
|
||||
- Swap entry url with origin url if graby provides an updated one [#3553](https://github.com/wallabag/wallabag/pull/3553)
|
||||
|
||||
## [2.3.3](https://github.com/wallabag/wallabag/tree/2.3.3)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.2...2.3.3)
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix error when withRemove variable is not defined. [#3573](https://github.com/wallabag/wallabag/pull/3573)
|
||||
- Fix title card HTML parsing [#3592](https://github.com/wallabag/wallabag/pull/3592)
|
||||
- Fix tests [#3597](https://github.com/wallabag/wallabag/pull/3597)
|
||||
- Fix tests [#3619](https://github.com/wallabag/wallabag/pull/3619)
|
||||
- Better encoding of the URI for the bookmarklet [#3616](https://github.com/wallabag/wallabag/pull/3616)
|
||||
- Fix overflow wrap issue [#3652](https://github.com/wallabag/wallabag/pull/3652)
|
||||
- Fix/firefox mobile unneeded resize [#3653](https://github.com/wallabag/wallabag/pull/3653)
|
||||
- Fix srcset attribute on images downloaded [#3661](https://github.com/wallabag/wallabag/pull/3661)
|
||||
- Fix authors and preview alt encoding display [#3664](https://github.com/wallabag/wallabag/pull/3664)
|
||||
- Spelling: GitHub, Log out, of the dev [#3614](https://github.com/wallabag/wallabag/pull/3614)
|
||||
- Fix tests [#3668](https://github.com/wallabag/wallabag/pull/3668)
|
||||
- Fixed migrations with dash into db names [#3538](https://github.com/wallabag/wallabag/pull/3538)
|
||||
|
||||
### Changes
|
||||
|
||||
- Allow login by email [#3615](https://github.com/wallabag/wallabag/pull/3615)
|
||||
- Occitan update [#3646](https://github.com/wallabag/wallabag/pull/3646)
|
||||
- Highlight code in articles using highlight.js [#3636](https://github.com/wallabag/wallabag/pull/3636)
|
||||
|
||||
## [2.3.2](https://github.com/wallabag/wallabag/tree/2.3.2)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.1...2.3.2)
|
||||
|
||||
|
||||
53
GNUmakefile
Executable file
53
GNUmakefile
Executable file
@ -0,0 +1,53 @@
|
||||
SHELL=bash
|
||||
TMP_FOLDER=/tmp
|
||||
RELEASE_FOLDER=wllbg-release
|
||||
|
||||
ENV ?= prod
|
||||
|
||||
help: ## Display this help menu
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
clean: ## Clear the application cache
|
||||
rm -rf var/cache/*
|
||||
|
||||
install: ## Install wallabag with the latest version
|
||||
@./scripts/install.sh $(ENV)
|
||||
|
||||
update: ## Update the wallabag installation to the latest version
|
||||
@./scripts/update.sh $(ENV)
|
||||
|
||||
dev: ## Install the latest dev version
|
||||
@./scripts/dev.sh
|
||||
|
||||
run: ## Run the wallabag built-in server
|
||||
@php bin/console server:run --env=dev
|
||||
|
||||
build: ## Run webpack
|
||||
@npm run build:$(ENV)
|
||||
|
||||
prepare: clean ## Prepare database for testsuite
|
||||
ifdef DB
|
||||
cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml
|
||||
endif
|
||||
-php bin/console doctrine:database:drop --force --env=test
|
||||
php bin/console doctrine:database:create --env=test
|
||||
php bin/console doctrine:migrations:migrate --no-interaction --env=test
|
||||
|
||||
fixtures: ## Load fixtures into database
|
||||
php bin/console doctrine:fixtures:load --no-interaction --env=test
|
||||
|
||||
test: prepare fixtures ## Launch wallabag testsuite
|
||||
bin/simple-phpunit -v
|
||||
|
||||
release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
|
||||
ifndef VERSION
|
||||
$(error VERSION is not set)
|
||||
endif
|
||||
@./scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV)
|
||||
|
||||
deploy: ## Deploy wallabag
|
||||
@bundle exec cap staging deploy
|
||||
|
||||
.PHONY: help clean prepare install fixtures update build test release deploy run dev
|
||||
|
||||
.DEFAULT_GOAL := install
|
||||
54
Makefile
Executable file → Normal file
54
Makefile
Executable file → Normal file
@ -1,52 +1,2 @@
|
||||
TMP_FOLDER=/tmp
|
||||
RELEASE_FOLDER=wllbg-release
|
||||
|
||||
ENV ?= prod
|
||||
|
||||
help: ## Display this help menu
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
clean: ## Clear the application cache
|
||||
rm -rf var/cache/*
|
||||
|
||||
install: ## Install wallabag with the latest version
|
||||
@sh scripts/install.sh $(ENV)
|
||||
|
||||
update: ## Update the wallabag installation to the latest version
|
||||
@sh scripts/update.sh $(ENV)
|
||||
|
||||
dev: ## Install the latest dev version
|
||||
@sh scripts/dev.sh
|
||||
|
||||
run: ## Run the wallabag built-in server
|
||||
@php bin/console server:run --env=dev
|
||||
|
||||
build: ## Run webpack
|
||||
@npm run build:$(ENV)
|
||||
|
||||
prepare: clean ## Prepare database for testsuite
|
||||
ifdef DB
|
||||
cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml
|
||||
endif
|
||||
-php bin/console doctrine:database:drop --force --env=test
|
||||
php bin/console doctrine:database:create --env=test
|
||||
php bin/console doctrine:migrations:migrate --no-interaction --env=test
|
||||
|
||||
fixtures: ## Load fixtures into database
|
||||
php bin/console doctrine:fixtures:load --no-interaction --env=test
|
||||
|
||||
test: prepare fixtures ## Launch wallabag testsuite
|
||||
bin/simple-phpunit -v
|
||||
|
||||
release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
|
||||
ifndef VERSION
|
||||
$(error VERSION is not set)
|
||||
endif
|
||||
@sh scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV)
|
||||
|
||||
deploy: ## Deploy wallabag
|
||||
@bundle exec cap staging deploy
|
||||
|
||||
.PHONY: help clean prepare install fixtures update build test release deploy run dev
|
||||
|
||||
.DEFAULT_GOAL := install
|
||||
.DEFAULT:
|
||||
gmake $@
|
||||
|
||||
@ -13,7 +13,7 @@ If you do not have your own server, consider [the wallabag.it hosting solution](
|
||||

|
||||
|
||||
# Install wallabag
|
||||
Please read [the documentation to see the wallabag requirements](http://doc.wallabag.org/en/master/user/installation.html#requirements).
|
||||
Please read [the documentation to see the wallabag requirements](https://doc.wallabag.org/en/admin/installation/requirements.html).
|
||||
|
||||
Then you can install wallabag by executing the following commands:
|
||||
|
||||
@ -24,6 +24,11 @@ cd wallabag && make install
|
||||
|
||||
Now, [configure a virtual host](https://doc.wallabag.org/en/admin/installation/virtualhosts.html) to use your wallabag.
|
||||
|
||||
# Run on YunoHost
|
||||
[](https://install-app.yunohost.org/?app=wallabag2)
|
||||
|
||||
Wallabag app for [YunoHost](https://yunohost.org). See [here](https://github.com/YunoHost-Apps/wallabag2_ynh)
|
||||
|
||||
# License
|
||||
Copyright © 2013-2018 Nicolas Lœuillet <nicolas@loeuillet.org>
|
||||
This work is free. You can redistribute it and/or modify it under the
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Initial database structure.
|
||||
*/
|
||||
class Version20160401000000 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20160401000000 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -76,30 +64,30 @@ SQL
|
||||
case 'mysql':
|
||||
$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('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;
|
||||
CREATE TABLE {$this->getTable('entry_tag')} (entry_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_C9F0DD7CBA364942 (entry_id), INDEX IDX_C9F0DD7CBAD26311 (tag_id), PRIMARY KEY(entry_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE `{$this->getTable('config')}` (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE `{$this->getTable('tagging_rule')}` (id INT AUTO_INCREMENT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)', INDEX IDX_2D9B3C5424DB0683 (config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE `{$this->getTable('tag')}` (id INT AUTO_INCREMENT NOT NULL, `label` LONGTEXT NOT NULL, slug VARCHAR(128) NOT NULL, UNIQUE INDEX UNIQ_4CA58A8C989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE {$this->getTable('config')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE {$this->getTable('tagging_rule')} (id INT AUTO_INCREMENT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)', INDEX IDX_2D9B3C5424DB0683 (config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE {$this->getTable('tag')} (id INT AUTO_INCREMENT NOT NULL, `label` LONGTEXT NOT NULL, slug VARCHAR(128) NOT NULL, UNIQUE INDEX UNIQ_4CA58A8C989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE {$this->getTable('oauth2_clients')} (id INT AUTO_INCREMENT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris LONGTEXT NOT NULL COMMENT '(DC2Type:array)', secret VARCHAR(255) NOT NULL, allowed_grant_types LONGTEXT NOT NULL COMMENT '(DC2Type:array)', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE {$this->getTable('oauth2_access_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_368A42095F37A13B (token), INDEX IDX_368A420919EB6921 (client_id), INDEX IDX_368A4209A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE {$this->getTable('oauth2_refresh_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_20C9FB245F37A13B (token), INDEX IDX_20C9FB2419EB6921 (client_id), INDEX IDX_20C9FB24A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE {$this->getTable('oauth2_auth_codes')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri LONGTEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_EE52E3FA5F37A13B (token), INDEX IDX_EE52E3FA19EB6921 (client_id), INDEX IDX_EE52E3FAA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE `{$this->getTable('user')}` (id INT AUTO_INCREMENT 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 TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json_array)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE {$this->getTable('user')} (id INT AUTO_INCREMENT 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 TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json_array)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE {$this->getTable('annotation')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges LONGTEXT NOT NULL COMMENT '(DC2Type:array)', INDEX IDX_A7AED006A76ED395 (user_id), INDEX IDX_A7AED006BA364942 (entry_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
ALTER TABLE `{$this->getTable('entry')}` ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id);
|
||||
ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES `{$this->getTable('entry')}` (id);
|
||||
ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES `{$this->getTable('tag')}` (id);
|
||||
ALTER TABLE `{$this->getTable('config')}` ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id);
|
||||
ALTER TABLE `{$this->getTable('tagging_rule')}` ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES `{$this->getTable('config')}` (id);
|
||||
ALTER TABLE {$this->getTable('entry')} ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
|
||||
ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id);
|
||||
ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES {$this->getTable('tag')} (id);
|
||||
ALTER TABLE {$this->getTable('config')} ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
|
||||
ALTER TABLE {$this->getTable('tagging_rule')} ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES {$this->getTable('config')} (id);
|
||||
ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id);
|
||||
ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id);
|
||||
ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
|
||||
ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id);
|
||||
ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id);
|
||||
ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
|
||||
ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id);
|
||||
ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id);
|
||||
ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id);
|
||||
ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES `{$this->getTable('entry')}` (id);
|
||||
ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
|
||||
ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
|
||||
ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id);
|
||||
SQL
|
||||
;
|
||||
foreach (explode("\n", $sql) as $query) {
|
||||
@ -197,9 +185,4 @@ SQL
|
||||
$this->addSql("DROP TABLE {$this->getTable('user')}");
|
||||
$this->addSql("DROP TABLE {$this->getTable('annotation')}");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added foreign keys for account resetting.
|
||||
*/
|
||||
class Version20160410190541 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20160410190541 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -56,9 +44,4 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_public'");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added name field on wallabag_oauth2_clients.
|
||||
*/
|
||||
class Version20160812120952 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20160812120952 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -65,9 +53,4 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI
|
||||
$clientsTable->dropColumn('name');
|
||||
}
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added settings for RabbitMQ and Redis imports.
|
||||
*/
|
||||
class Version20160911214952 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20160911214952 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -56,9 +44,4 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_redis';");
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_rabbitmq';");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added pocket_consumer_key field on wallabag_config.
|
||||
*/
|
||||
class Version20160916201049 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20160916201049 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -44,9 +32,4 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI
|
||||
$configTable->dropColumn('pocket_consumer_key');
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,27 +2,15 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added pocket_consumer_key field on wallabag_config.
|
||||
*/
|
||||
class Version20161001072726 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161001072726 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -36,7 +24,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
|
||||
$query = $this->connection->query("
|
||||
SELECT CONSTRAINT_NAME
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE TABLE_NAME = '" . $this->getTable('entry_tag') . "' AND CONSTRAINT_NAME LIKE 'FK_%'
|
||||
WHERE TABLE_NAME = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "' AND CONSTRAINT_NAME LIKE 'FK_%'
|
||||
AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'"
|
||||
);
|
||||
$query->execute();
|
||||
@ -54,7 +42,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
|
||||
FROM pg_constraint c
|
||||
JOIN pg_namespace n ON n.oid = c.connamespace
|
||||
WHERE contype = 'f'
|
||||
AND conrelid::regclass::text = '" . $this->getTable('entry_tag') . "'
|
||||
AND conrelid::regclass::text = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "'
|
||||
AND n.nspname = 'public';"
|
||||
);
|
||||
$query->execute();
|
||||
@ -75,7 +63,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
|
||||
$query = $this->connection->query("
|
||||
SELECT CONSTRAINT_NAME
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE TABLE_NAME = '" . $this->getTable('annotation') . "'
|
||||
WHERE TABLE_NAME = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "'
|
||||
AND CONSTRAINT_NAME LIKE 'FK_%'
|
||||
AND COLUMN_NAME = 'entry_id'
|
||||
AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'"
|
||||
@ -95,7 +83,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
|
||||
FROM pg_constraint c
|
||||
JOIN pg_namespace n ON n.oid = c.connamespace
|
||||
WHERE contype = 'f'
|
||||
AND conrelid::regclass::text = '" . $this->getTable('annotation') . "'
|
||||
AND conrelid::regclass::text = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "'
|
||||
AND n.nspname = 'public'
|
||||
AND pg_get_constraintdef(c.oid) LIKE '%entry_id%';"
|
||||
);
|
||||
@ -117,9 +105,4 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
|
||||
{
|
||||
throw new SkipMigrationException('Too complex ...');
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Converted database to utf8mb4 encoding (for MySQL only).
|
||||
*/
|
||||
class Version20161022134138 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161022134138 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -29,7 +17,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
|
||||
{
|
||||
$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;');
|
||||
|
||||
// convert field length for utf8mb4
|
||||
// http://stackoverflow.com/a/31474509/569101
|
||||
@ -60,7 +48,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
|
||||
{
|
||||
$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;');
|
||||
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
|
||||
@ -77,9 +65,4 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,28 +2,16 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added user_id column on oauth2_clients to prevent users to delete API clients from other users.
|
||||
*/
|
||||
class Version20161024212538 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161024212538 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
private $constraintName = 'IDX_user_oauth_client';
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -59,9 +47,4 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI
|
||||
$clientsTable->removeForeignKey($this->constraintName);
|
||||
}
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added the internal setting to enable/disable downloading pictures.
|
||||
*/
|
||||
class Version20161031132655 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161031132655 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -44,9 +32,4 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_images_enabled';");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,28 +2,16 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added created_at index on entry table.
|
||||
*/
|
||||
class Version20161104073720 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161104073720 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
private $indexName = 'IDX_entry_created_at';
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -45,9 +33,4 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$entryTable->dropIndex($this->indexName);
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added action_mark_as_read field on config table.
|
||||
*/
|
||||
class Version20161106113822 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161106113822 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -48,9 +36,4 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$configTable->dropColumn('action_mark_as_read');
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added the internal setting to share articles to unmark.it.
|
||||
*/
|
||||
class Version20161117071626 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161117071626 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -56,9 +44,4 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_unmark';");
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'unmark_url';");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add http_status in `entry_table`.
|
||||
*/
|
||||
class Version20161118134328 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161118134328 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -48,9 +36,4 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$entryTable->dropColumn('http_status');
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add the restricted_access internal setting for articles with paywall.
|
||||
*/
|
||||
class Version20161122144743 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161122144743 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -44,9 +32,4 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'restricted_access';");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,10 +2,8 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Methods and properties removed from `FOS\UserBundle\Model\User`.
|
||||
@ -18,18 +16,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
* You need to drop the fields `expired` and `credentials_expired` from your database
|
||||
* schema, because they aren't mapped anymore.
|
||||
*/
|
||||
class Version20161122203647 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161122203647 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -55,9 +43,4 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI
|
||||
$userTable->addColumn('expired', 'smallint', ['notnull' => false]);
|
||||
$userTable->addColumn('credentials_expired', 'smallint', ['notnull' => false]);
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added list_mode in user config.
|
||||
*/
|
||||
class Version20161128084725 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161128084725 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -41,9 +29,4 @@ class Version20161128084725 extends AbstractMigration implements ContainerAwareI
|
||||
$configTable = $schema->getTable($this->getTable('config'));
|
||||
$configTable->dropColumn('list_mode');
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,15 +2,13 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Removed locked, credentials_expire_at and expires_at.
|
||||
*/
|
||||
class Version20161128131503 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161128131503 extends WallabagMigration
|
||||
{
|
||||
private $fields = [
|
||||
'locked' => 'smallint',
|
||||
@ -18,16 +16,6 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI
|
||||
'expires_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -53,9 +41,4 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI
|
||||
$userTable->addColumn($field, $type, ['notnull' => false]);
|
||||
}
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Renamed uuid to uid in entry table.
|
||||
*/
|
||||
class Version20161214094402 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161214094402 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -67,9 +55,4 @@ class Version20161214094402 extends AbstractMigration implements ContainerAwareI
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid');
|
||||
}
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,28 +2,16 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added index on wallabag_entry.uid.
|
||||
*/
|
||||
class Version20161214094403 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20161214094403 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
private $indexName = 'IDX_entry_uid';
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -45,9 +33,4 @@ class Version20161214094403 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$entryTable->dropIndex($this->indexName);
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,29 +2,17 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added indexes on wallabag_entry.is_starred and wallabag_entry.is_archived.
|
||||
*/
|
||||
class Version20170127093841 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170127093841 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
private $indexStarredName = 'IDX_entry_starred';
|
||||
private $indexArchivedName = 'IDX_entry_archived';
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -48,9 +36,4 @@ class Version20170127093841 extends AbstractMigration implements ContainerAwareI
|
||||
$entryTable->dropIndex($this->indexStarredName);
|
||||
$entryTable->dropIndex($this->indexArchivedName);
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add the share_scuttle internal setting.
|
||||
*/
|
||||
class Version20170327194233 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170327194233 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -46,9 +34,4 @@ class Version20170327194233 extends AbstractMigration implements ContainerAwareI
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_scuttle';");
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'scuttle_url';");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add published_at and published_by in `entry` table.
|
||||
*/
|
||||
class Version20170405182620 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170405182620 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -57,9 +45,4 @@ class Version20170405182620 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$entryTable->dropColumn('published_by');
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Remove isPublic in Entry Table.
|
||||
*/
|
||||
class Version20170407200919 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170407200919 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -43,9 +31,4 @@ class Version20170407200919 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$entryTable->addColumn('is_public', 'boolean', ['notnull' => false, 'default' => 0]);
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Remove download_pictures in craue_config_setting.
|
||||
*/
|
||||
class Version20170420134133 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170420134133 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -44,9 +32,4 @@ class Version20170420134133 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('download_pictures', '1', 'entry')");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add site credential table to store username & password for some website (behind authentication or paywall).
|
||||
*/
|
||||
class Version20170501115751 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170501115751 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -53,9 +41,4 @@ class Version20170501115751 extends AbstractMigration implements ContainerAwareI
|
||||
{
|
||||
$schema->dropTable($this->getTable('site_credential'));
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,15 +2,13 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Changed length for username, username_canonical, email and email_canonical fields in wallabag_user table.
|
||||
*/
|
||||
class Version20170510082609 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170510082609 extends WallabagMigration
|
||||
{
|
||||
private $fields = [
|
||||
'username',
|
||||
@ -19,16 +17,6 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI
|
||||
'email_canonical',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -52,9 +40,4 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;');
|
||||
}
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added `headers` field in entry table.
|
||||
*/
|
||||
class Version20170511115400 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170511115400 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -47,9 +35,4 @@ class Version20170511115400 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$entryTable->dropColumn('headers');
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,27 +2,15 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Increase the length of the "quote" column of "annotation" table.
|
||||
*/
|
||||
class Version20170511211659 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170511211659 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$tableName = $this->getTable('annotation');
|
||||
@ -30,8 +18,8 @@ class Version20170511211659 extends AbstractMigration implements ContainerAwareI
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$this->addSql(<<<EOD
|
||||
CREATE TEMPORARY TABLE __temp__wallabag_annotation AS
|
||||
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
|
||||
CREATE TEMPORARY TABLE __temp__wallabag_annotation AS
|
||||
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
|
||||
FROM ${tableName}
|
||||
EOD
|
||||
);
|
||||
@ -56,8 +44,8 @@ EOD
|
||||
);
|
||||
|
||||
$this->addSql(<<<EOD
|
||||
INSERT INTO ${tableName} (id, user_id, entry_id, text, created_at, updated_at, quote, ranges)
|
||||
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
|
||||
INSERT INTO ${tableName} (id, user_id, entry_id, text, created_at, updated_at, quote, ranges)
|
||||
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
|
||||
FROM __temp__wallabag_annotation;
|
||||
EOD
|
||||
);
|
||||
@ -88,9 +76,4 @@ EOD
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add api_user_registration in craue_config_setting.
|
||||
*/
|
||||
class Version20170602075214 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170602075214 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -44,9 +32,4 @@ class Version20170602075214 extends AbstractMigration implements ContainerAwareI
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'api_user_registration';");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,27 +2,15 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Remove wallabag_url from craue_config_setting.
|
||||
* It has been moved into the parameters.yml.
|
||||
*/
|
||||
class Version20170606155640 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170606155640 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -45,9 +33,4 @@ class Version20170606155640 extends AbstractMigration implements ContainerAwareI
|
||||
{
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Changed tags to lowercase.
|
||||
*/
|
||||
class Version20170719231144 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170719231144 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -67,7 +55,7 @@ class Version20170719231144 extends AbstractMigration implements ContainerAwareI
|
||||
}
|
||||
|
||||
// Just in case...
|
||||
if (count($ids) > 0) {
|
||||
if (\count($ids) > 0) {
|
||||
// Merge tags
|
||||
$this->addSql('
|
||||
UPDATE ' . $this->getTable('entry_tag') . '
|
||||
@ -108,9 +96,4 @@ class Version20170719231144 extends AbstractMigration implements ContainerAwareI
|
||||
{
|
||||
throw new SkipMigrationException('Too complex ...');
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add starred_at column and set its value to updated_at for is_starred entries.
|
||||
*/
|
||||
class Version20170824113337 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20170824113337 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -60,9 +48,4 @@ class Version20170824113337 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$entryTable->dropColumn('starred_at');
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Changed reading_time field to prevent null value.
|
||||
*/
|
||||
class Version20171008195606 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20171008195606 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -57,9 +45,4 @@ class Version20171008195606 extends AbstractMigration implements ContainerAwareI
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add origin_url column.
|
||||
*/
|
||||
class Version20171105202000 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20171105202000 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -47,9 +35,4 @@ class Version20171105202000 extends AbstractMigration implements ContainerAwareI
|
||||
|
||||
$entryTable->dropColumn('origin_url');
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add store_article_headers in craue_config_setting.
|
||||
*/
|
||||
class Version20171120163128 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20171120163128 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -44,9 +32,4 @@ class Version20171120163128 extends AbstractMigration implements ContainerAwareI
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers';");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,26 +2,14 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add shaarli_share_origin_url in craue_config_setting.
|
||||
*/
|
||||
class Version20171125164500 extends AbstractMigration implements ContainerAwareInterface
|
||||
class Version20171125164500 extends WallabagMigration
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
@ -44,9 +32,4 @@ class Version20171125164500 extends AbstractMigration implements ContainerAwareI
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url';");
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ export: "export"
|
||||
import: "import"
|
||||
misc: "misc"
|
||||
modify_settings: "apply"
|
||||
piwik_host: Host of your website in Piwik (without http:// ou https://)
|
||||
piwik_host: Host of your website in Piwik (without http:// or https://)
|
||||
piwik_site_id: ID of your website in Piwik
|
||||
piwik_enabled: Enable Piwik
|
||||
demo_mode_enabled: "Enable demo mode? (Only used for the public wallabag demo)"
|
||||
@ -37,4 +37,4 @@ download_images_enabled: Download images locally
|
||||
restricted_access: Enable authentication for paywalled websites
|
||||
api_user_registration: Enable user to be registered using the API
|
||||
store_article_headers: Enable if wallabag stores HTTP headers for each article
|
||||
shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled
|
||||
shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled
|
||||
|
||||
@ -36,5 +36,5 @@ share_public: Autorizar una URL publica pels articles
|
||||
download_images_enabled: Telecargar los imatges en local
|
||||
restricted_access: Activar l'autenticacion pels sites amb peatge
|
||||
api_user_registration: Autorizar los utilizaires a se marcar amb l'API
|
||||
# store_article_headers: Enable if wallabag stores HTTP headers for each article
|
||||
# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled
|
||||
store_article_headers: Activar se wallabag garda las entèstas HTTP per cada article
|
||||
shaarli_share_origin_url: Activar lo partatge de l’url amb Shaarli, se lo servici es activat
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.2 KiB |
1
app/Resources/static/themes/_global/img/logo-square.svg
Normal file
1
app/Resources/static/themes/_global/img/logo-square.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path fill="none" d="M0 0h200v200H0z"/><path d="M75.899 72.438c1.597-.981 10.207-5.556 24.098.178 14.289 5.897 23.154.776 24.253.079-3.454-5.678-7.562-10.62-12.104-13.943.303-.083.612-.167.939-.263 6.023-1.742 7.553-6.842 7.875-11.21.364-4.954.616-5.03 1.692-9.487 1.032-4.281-.119-5.137-1.181-4.273-.572.465-5.552 1.616-8.505 3.919-4.768 3.72-7.707 10.794-9.039 14.706-.025.06-.205.604-.265.792-.621 1.498-1.857 1.494-1.857 1.494v.001c-.6-.065-1.202-.1-1.809-.1-.54 0-1.079.029-1.616.081-.012.002-.019 0-.031.001-1.581.233-2.45-1.697-2.632-2.157-1.847-5.304-6.816-15.763-17.984-18.577 0 0-2.028-1.554-1.41 1.074.588 2.511 1.804 5.049 1.534 8.741-.124 1.704-1.181 10.442 6.85 14.99.763.432 1.441.795 2.051 1.101-4.042 3.235-7.716 7.74-10.859 12.853zM128.626 152.353c-9.842-6.098-13.153-8.242-12.946-10.575 0 0 .002-.379.099-.957.239-1.236.995-3.348 3.407-4.552.079-.039.146-.084.208-.129 7.668-4.45 13.27-11.614 15.246-20.56-1.99 4.941-16.735 8.78-34.645 8.78-17.903 0-32.651-3.839-34.641-8.78.442 2.008 1.073 3.923 1.864 5.742.666 3.745 1.562 12.563-2.673 20.282-3.731 6.8-22.15 16.069-49.485 10.748 0 0-1.096-.766-1.428-.136-.491.932 1.517 1.685 3.583 2.229 19.031 5.04 47.756 2.989 56.777-4.443 4.116-3.388 5.704-7.953 6.107-12.865l.003.008s.11-1.287 1.719-.32c.461.277 2.125 1.36 2.39 2.585.232 1.743.248 3.883-.652 5.382-1.287 2.144-1.301 2.452.393 3.662 1.04.742 5.287 3.864 11.198 7.415.015.01.023.019.038.027 1.25.753 2.987 2.597 2.987 2.597 2.662 3.079 8.452 9.275 10.972 8.108 1.19-.551-.051-3.032-.051-3.032s1.98 2.571 3.043 1.694c.809-.668-.473-3.229-.473-3.229s1.729 1.499 2.757.944c1.258-.679-.187-4.614-10.079-10.627-9.896-6.018-12.578-6.94-12.814-9.626 0 0-.004-.135.004-.366.077-.593.414-1.847 1.852-1.712 2.141.346 4.348.531 6.608.531 2.587 0 5.107-.237 7.536-.69l.001.003s.127-.025.164-.031c.284-.036.838-.018.84.671-.09.873-.331 1.751-.845 2.519-1.447 2.168-.972 2.466.54 3.859.933.859 5.211 4.622 11.07 8.264.012.009.017.016.031.023 1.249.752 3.41 2.816 3.41 2.816v-.001c2.428 2.466 6.894 6.596 9.327 6.347 1.646-.168.306-3.002.306-3.002s2.078 2.006 3.099 1.416c1.142-.659-.474-2.755-.474-2.755s1.338.708 2.283.473c.948-.236 1.185-2.644-8.656-8.737z"/><path d="M117.631 83.452c-1.181 0-2.161.355-2.912 1.057-.76.71-1.144 1.531-1.144 2.438v16.056c0 2.154-.382 3.742-1.135 4.721-.728.946-1.892 1.406-3.556 1.406-1.703 0-2.863-.457-3.549-1.396-.716-.979-1.078-2.571-1.078-4.731V86.884c0-1.098-.5-1.996-1.448-2.596-1.289-.812-2.57-1.105-4.129-.587-.476.159-.924.366-1.333.615-.435.265-.802.597-1.093.985-.322.432-.486.901-.486 1.396v16.307c0 2.158-.363 3.75-1.079 4.73-.688.939-1.849 1.396-3.548 1.396-1.705 0-2.877-.459-3.584-1.401-.734-.979-1.107-2.57-1.107-4.726V86.947c0-.908-.384-1.728-1.145-2.438-.751-.702-1.751-1.057-2.973-1.057-1.258 0-2.296.352-3.085 1.045-.811.71-1.222 1.535-1.222 2.45v15.806c0 1.988.194 3.869.575 5.588.393 1.758 1.077 3.3 2.035 4.586.968 1.299 2.282 2.323 3.906 3.05 1.607.716 3.617 1.079 5.975 1.079 2.457 0 4.515-.455 6.115-1.354 1.342-.754 2.473-1.744 3.371-2.951.866 1.207 1.971 2.197 3.294 2.95 1.58.899 3.669 1.354 6.211 1.354 2.357 0 4.359-.364 5.947-1.081 1.601-.726 2.902-1.751 3.872-3.048.96-1.29 1.645-2.833 2.034-4.586.381-1.719.575-3.6.575-5.588V86.947c0-.911-.398-1.733-1.184-2.445-.767-.697-1.818-1.05-3.12-1.05z"/></svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 9.2 KiB |
@ -13,8 +13,10 @@ import './global.scss';
|
||||
import './js/shortcuts/entry';
|
||||
import './js/shortcuts/main';
|
||||
|
||||
import { savePercent, retrievePercent } from './js/tools';
|
||||
/* Hightlight */
|
||||
import './js/highlight';
|
||||
|
||||
import { savePercent, retrievePercent } from './js/tools';
|
||||
|
||||
/* ==========================================================================
|
||||
Annotations & Remember position
|
||||
@ -65,7 +67,7 @@ $(document).ready(() => {
|
||||
retrievePercent(x.entryId);
|
||||
|
||||
$(window).resize(() => {
|
||||
retrievePercent(x.entryId);
|
||||
retrievePercent(x.entryId, true);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
8
app/Resources/static/themes/_global/js/highlight.js
Normal file
8
app/Resources/static/themes/_global/js/highlight.js
Normal file
@ -0,0 +1,8 @@
|
||||
import 'highlight.js/styles/atom-one-light.css';
|
||||
import * as hljs from 'highlight.js';
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
document.querySelectorAll('pre').forEach((node) => {
|
||||
hljs.highlightBlock(node);
|
||||
});
|
||||
});
|
||||
@ -19,14 +19,16 @@ function savePercent(id, percent) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function retrievePercent(id) {
|
||||
function retrievePercent(id, resized) {
|
||||
if (!supportsLocalStorage()) { return false; }
|
||||
|
||||
const bheight = $(document).height();
|
||||
const percent = localStorage[`wallabag.article.${id}.percent`];
|
||||
const scroll = bheight * percent;
|
||||
|
||||
$('html,body').animate({ scrollTop: scroll }, 'fast');
|
||||
if (!resized) {
|
||||
$('html,body').animate({ scrollTop: scroll }, 'fast');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -221,6 +221,12 @@ ol li:last-child {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
iframe,
|
||||
video {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
mark {
|
||||
padding: 0 0.2em;
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
color: #424242;
|
||||
font-size: 18px;
|
||||
line-height: 1.7em;
|
||||
overflow-wrap: break-word;
|
||||
|
||||
h1,
|
||||
h2,
|
||||
|
||||
@ -118,9 +118,14 @@ main {
|
||||
|
||||
.card-image .preview,
|
||||
.card-fullimage .preview {
|
||||
height: 14em;
|
||||
height: 100%;
|
||||
background: no-repeat 50%/cover;
|
||||
background-color: #efefef;
|
||||
display: block;
|
||||
|
||||
&--default {
|
||||
background-size: contain;
|
||||
}
|
||||
}
|
||||
|
||||
&.sw {
|
||||
|
||||
@ -24,6 +24,10 @@ main,
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.typo-logo {
|
||||
max-width: 150px;
|
||||
}
|
||||
|
||||
#main {
|
||||
flex: 1 0 auto;
|
||||
|
||||
|
||||
@ -22,6 +22,16 @@
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
table {
|
||||
display: block;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
iframe {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.nav-panels .action {
|
||||
padding-right: 0.75rem;
|
||||
}
|
||||
|
||||
@ -26,7 +26,6 @@ framework:
|
||||
engines: ['twig']
|
||||
default_locale: "%locale%"
|
||||
trusted_hosts: ~
|
||||
trusted_proxies: ~
|
||||
session:
|
||||
# handler_id set to null will use default session handler from php.ini
|
||||
handler_id: session.handler.native_file
|
||||
|
||||
@ -12,7 +12,7 @@ security:
|
||||
class: WallabagUserBundle:User
|
||||
property: username
|
||||
fos_userbundle:
|
||||
id: fos_user.user_provider.username
|
||||
id: fos_user.user_provider.username_email
|
||||
|
||||
# the main part of the security, where you can set up firewalls
|
||||
# for specific sections of your app
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
wallabag_core:
|
||||
version: 2.3.2
|
||||
version: 2.3.4
|
||||
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
|
||||
languages:
|
||||
en: 'English'
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
"liip/theme-bundle": "^1.4.6",
|
||||
"lexik/form-filter-bundle": "^5.0.4",
|
||||
"j0k3r/graby": "^1.0",
|
||||
"friendsofsymfony/user-bundle": "^2.0.1",
|
||||
"friendsofsymfony/user-bundle": "2.0.*",
|
||||
"friendsofsymfony/oauth-server-bundle": "^1.5.2",
|
||||
"stof/doctrine-extensions-bundle": "^1.2",
|
||||
"scheb/two-factor-bundle": "^2.14.0",
|
||||
@ -91,7 +91,7 @@
|
||||
"doctrine/doctrine-fixtures-bundle": "~2.2",
|
||||
"doctrine/data-fixtures": "~1.1",
|
||||
"sensio/generator-bundle": "^3.0",
|
||||
"symfony/phpunit-bridge": "^3.3",
|
||||
"symfony/phpunit-bridge": "3.4.x-dev",
|
||||
"friendsofphp/php-cs-fixer": "~2.0",
|
||||
"m6web/redis-mock": "^2.0",
|
||||
"dama/doctrine-test-bundle": "^4.0"
|
||||
|
||||
7708
composer.lock
generated
Normal file
7708
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -4,10 +4,10 @@ FROM php:fpm
|
||||
ARG timezone='Europe/Paris'
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libmcrypt-dev libicu-dev libpq-dev libxml2-dev libpng12-dev libjpeg-dev \
|
||||
libmcrypt-dev libicu-dev libpq-dev libxml2-dev libpng-dev libjpeg-dev \
|
||||
&& /usr/local/bin/docker-php-ext-configure gd --with-jpeg-dir=/usr/include \
|
||||
&& docker-php-ext-install \
|
||||
iconv mcrypt mbstring intl pdo pdo_mysql pdo_pgsql gd
|
||||
iconv mbstring intl pdo pdo_mysql pdo_pgsql gd
|
||||
|
||||
RUN echo "date.timezone="$timezone > /usr/local/etc/php/conf.d/date_timezone.ini
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "wallabag",
|
||||
"version": "2.2.2",
|
||||
"version": "2.3.3",
|
||||
"description": "wallabag is a self hostable application for saving web pages",
|
||||
"private": true,
|
||||
"directories": {
|
||||
"doc": "docs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">4.8"
|
||||
"node": ">=6.10"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -65,6 +65,7 @@
|
||||
"dependencies": {
|
||||
"annotator": "git://github.com/wallabag/annotator.git#0f076c7d371ed25eb0793346f46982d90f2c4c85",
|
||||
"hammerjs": "^2.0.8",
|
||||
"highlight.js": "^9.12.0",
|
||||
"icomoon-free-npm": "^0.0.0",
|
||||
"jquery": "^2.1.4",
|
||||
"jquery.cookie": "^1.4.1",
|
||||
|
||||
0
scripts/dev.sh
Normal file → Executable file
0
scripts/dev.sh
Normal file → Executable file
14
scripts/install.sh
Normal file → Executable file
14
scripts/install.sh
Normal file → Executable file
@ -2,6 +2,20 @@
|
||||
# You can execute this file to install wallabag
|
||||
# eg: `sh install.sh prod`
|
||||
|
||||
IGNORE_ROOT_ARG="--ignore-root-warning"
|
||||
IGNORE_ROOT=0
|
||||
|
||||
if [ "$1" == "$IGNORE_ROOT_ARG" ]; then
|
||||
IGNORE_ROOT=1
|
||||
fi
|
||||
|
||||
# Abort running this script if root
|
||||
if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then
|
||||
echo "Do not run this script as root!" >&2
|
||||
echo "Use $IGNORE_ROOT_ARG to ignore this error." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
COMPOSER_COMMAND='composer'
|
||||
|
||||
DIR="${BASH_SOURCE}"
|
||||
|
||||
8
scripts/release.sh
Normal file → Executable file
8
scripts/release.sh
Normal file → Executable file
@ -1,6 +1,6 @@
|
||||
#! /usr/bin/env bash
|
||||
# You can execute this file to create a new package for wallabag
|
||||
# eg: `sh release.sh master /tmp wllbg-release prod`
|
||||
# eg: `sh release.sh 2.3.3 /tmp wllbg-release prod`
|
||||
|
||||
VERSION=$1
|
||||
TMP_FOLDER=$2
|
||||
@ -10,11 +10,11 @@ ENV=$4
|
||||
rm -rf $TMP_FOLDER/$RELEASE_FOLDER
|
||||
mkdir $TMP_FOLDER/$RELEASE_FOLDER
|
||||
git clone git@github.com:wallabag/wallabag.git -b $VERSION $TMP_FOLDER/$RELEASE_FOLDER/$VERSION
|
||||
cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && SYMFONY_ENV=$ENV composer up -n --no-dev
|
||||
cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && SYMFONY_ENV=$ENV COMPOSER_MEMORY_LIMIT=-1 composer up -n --no-dev
|
||||
cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && php bin/console wallabag:install --env=$ENV
|
||||
cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && php bin/console assets:install --env=$ENV --symlink --relative
|
||||
cd $TMP_FOLDER/$RELEASE_FOLDER && tar czf wallabag-$VERSION.tar.gz --exclude="var/cache/*" --exclude="var/logs/*" --exclude="var/sessions/*" --exclude=".git" $VERSION
|
||||
echo "MD5 checksum of the package for wallabag $VERSION"
|
||||
md5 $TMP_FOLDER/$RELEASE_FOLDER/wallabag-$VERSION.tar.gz
|
||||
scp $TMP_FOLDER/$RELEASE_FOLDER/wallabag-$VERSION.tar.gz framasoft_bag@78.46.248.87:/var/www/framabag.org/web
|
||||
rm -rf $TMP_FOLDER/$RELEASE_FOLDER
|
||||
echo "Package to upload to the release server:"
|
||||
echo $TMP_FOLDER/$RELEASE_FOLDER/wallabag-$VERSION.tar.gz
|
||||
|
||||
0
scripts/require.sh
Normal file → Executable file
0
scripts/require.sh
Normal file → Executable file
14
scripts/update.sh
Normal file → Executable file
14
scripts/update.sh
Normal file → Executable file
@ -2,6 +2,20 @@
|
||||
# You can execute this file to update wallabag
|
||||
# eg: `sh update.sh prod`
|
||||
|
||||
IGNORE_ROOT_ARG="--ignore-root-warning"
|
||||
IGNORE_ROOT=0
|
||||
|
||||
if [ "$1" == "$IGNORE_ROOT_ARG" ]; then
|
||||
IGNORE_ROOT=1
|
||||
fi
|
||||
|
||||
# Abort running this script if root
|
||||
if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then
|
||||
echo "Do not run this script as root!" >&2
|
||||
echo "Use $IGNORE_ROOT_ARG to ignore this error." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ class WallabagAnnotationController extends FOSRestController
|
||||
->getDoctrine()
|
||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
||||
->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
|
||||
$total = count($annotationRows);
|
||||
$total = \count($annotationRows);
|
||||
$annotations = ['total' => $total, 'rows' => $annotationRows];
|
||||
|
||||
$json = $this->get('jms_serializer')->serialize($annotations, 'json');
|
||||
|
||||
@ -21,7 +21,7 @@ class AnnotationRepository extends EntityRepository
|
||||
public function getBuilderForAllByUser($userId)
|
||||
{
|
||||
return $this
|
||||
->getBuilderByUser($userId)
|
||||
->getSortedQueryBuilderByUser($userId)
|
||||
;
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ class AnnotationRepository extends EntityRepository
|
||||
*
|
||||
* @return QueryBuilder
|
||||
*/
|
||||
private function getBuilderByUser($userId)
|
||||
private function getSortedQueryBuilderByUser($userId)
|
||||
{
|
||||
return $this->createQueryBuilder('a')
|
||||
->leftJoin('a.user', 'u')
|
||||
|
||||
@ -102,7 +102,7 @@ class EntryRestController extends WallabagRestController
|
||||
$order = $request->query->get('order', 'desc');
|
||||
$page = (int) $request->query->get('page', 1);
|
||||
$perPage = (int) $request->query->get('perPage', 30);
|
||||
$tags = is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', '');
|
||||
$tags = \is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', '');
|
||||
$since = $request->query->get('since', 0);
|
||||
|
||||
/** @var \Pagerfanta\Pagerfanta $pager */
|
||||
@ -253,7 +253,7 @@ class EntryRestController extends WallabagRestController
|
||||
|
||||
$limit = $this->container->getParameter('wallabag_core.api_limit_mass_actions');
|
||||
|
||||
if (count($urls) > $limit) {
|
||||
if (\count($urls) > $limit) {
|
||||
throw new HttpException(400, 'API limit reached');
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ class EntryRestController extends WallabagRestController
|
||||
'open_graph' => [
|
||||
'og_image' => !empty($data['picture']) ? $data['picture'] : $entry->getPreviewPicture(),
|
||||
],
|
||||
'authors' => is_string($data['authors']) ? explode(',', $data['authors']) : $entry->getPublishedBy(),
|
||||
'authors' => \is_string($data['authors']) ? explode(',', $data['authors']) : $entry->getPublishedBy(),
|
||||
]
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
@ -461,7 +461,7 @@ class EntryRestController extends WallabagRestController
|
||||
$contentProxy->updateLanguage($entry, $data['language']);
|
||||
}
|
||||
|
||||
if (!empty($data['authors']) && is_string($data['authors'])) {
|
||||
if (!empty($data['authors']) && \is_string($data['authors'])) {
|
||||
$entry->setPublishedBy(explode(',', $data['authors']));
|
||||
}
|
||||
|
||||
|
||||
@ -138,14 +138,14 @@ class TagRestController extends WallabagRestController
|
||||
*/
|
||||
private function cleanOrphanTag($tags)
|
||||
{
|
||||
if (!is_array($tags)) {
|
||||
if (!\is_array($tags)) {
|
||||
$tags = [$tags];
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
if (0 === count($tag->getEntries())) {
|
||||
if (0 === \count($tag->getEntries())) {
|
||||
$em->remove($tag);
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
|
||||
} else {
|
||||
$users = $this->getContainer()->get('wallabag_user.user_repository')->findAll();
|
||||
|
||||
$this->io->text(sprintf('Cleaning through <info>%d</info> user accounts', count($users)));
|
||||
$this->io->text(sprintf('Cleaning through <info>%d</info> user accounts', \count($users)));
|
||||
|
||||
foreach ($users as $user) {
|
||||
$this->io->text(sprintf('Processing user <info>%s</info>', $user->getUsername()));
|
||||
@ -79,7 +79,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
|
||||
$url = $this->similarUrl($entry['url']);
|
||||
|
||||
/* @var $entry Entry */
|
||||
if (in_array($url, $urls, true)) {
|
||||
if (\in_array($url, $urls, true)) {
|
||||
++$duplicatesCount;
|
||||
|
||||
$em->remove($repo->find($entry['id']));
|
||||
@ -96,8 +96,8 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
|
||||
|
||||
private function similarUrl($url)
|
||||
{
|
||||
if (in_array(substr($url, -1), ['/', '#'], true)) { // get rid of "/" and "#" and the end of urls
|
||||
return substr($url, 0, strlen($url));
|
||||
if (\in_array(substr($url, -1), ['/', '#'], true)) { // get rid of "/" and "#" and the end of urls
|
||||
return substr($url, 0, \strlen($url));
|
||||
}
|
||||
|
||||
return $url;
|
||||
|
||||
@ -47,7 +47,7 @@ class ExportCommand extends ContainerAwareCommand
|
||||
->getQuery()
|
||||
->getResult();
|
||||
|
||||
$io->text(sprintf('Exporting <info>%d</info> entrie(s) for user <info>%s</info>...', count($entries), $user->getUserName()));
|
||||
$io->text(sprintf('Exporting <info>%d</info> entrie(s) for user <info>%s</info>...', \count($entries), $user->getUserName()));
|
||||
|
||||
$filePath = $input->getArgument('filepath');
|
||||
|
||||
|
||||
@ -81,7 +81,7 @@ class InstallCommand extends ContainerAwareCommand
|
||||
$status = '<info>OK!</info>';
|
||||
$help = '';
|
||||
|
||||
if (!extension_loaded($this->getContainer()->getParameter('database_driver'))) {
|
||||
if (!\extension_loaded($this->getContainer()->getParameter('database_driver'))) {
|
||||
$fulfilled = false;
|
||||
$status = '<error>ERROR!</error>';
|
||||
$help = 'Database driver "' . $this->getContainer()->getParameter('database_driver') . '" is not installed.';
|
||||
@ -146,7 +146,7 @@ class InstallCommand extends ContainerAwareCommand
|
||||
$status = '<info>OK!</info>';
|
||||
$help = '';
|
||||
|
||||
if (!function_exists($functionRequired)) {
|
||||
if (!\function_exists($functionRequired)) {
|
||||
$fulfilled = false;
|
||||
$status = '<error>ERROR!</error>';
|
||||
$help = 'You need the ' . $functionRequired . ' function activated';
|
||||
@ -371,7 +371,7 @@ class InstallCommand extends ContainerAwareCommand
|
||||
}
|
||||
|
||||
try {
|
||||
return in_array($databaseName, $schemaManager->listDatabases(), true);
|
||||
return \in_array($databaseName, $schemaManager->listDatabases(), true);
|
||||
} catch (\Doctrine\DBAL\Exception\DriverException $e) {
|
||||
// it means we weren't able to get database list, assume the database doesn't exist
|
||||
|
||||
@ -389,6 +389,6 @@ class InstallCommand extends ContainerAwareCommand
|
||||
{
|
||||
$schemaManager = $this->getContainer()->get('doctrine')->getManager()->getConnection()->getSchemaManager();
|
||||
|
||||
return count($schemaManager->listTableNames()) > 0 ? true : false;
|
||||
return \count($schemaManager->listTableNames()) > 0 ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ class ListUserCommand extends ContainerAwareCommand
|
||||
$io->success(
|
||||
sprintf(
|
||||
'%s/%s%s user(s) displayed.',
|
||||
count($users),
|
||||
\count($users),
|
||||
$nbUsers,
|
||||
null === $input->getArgument('search') ? '' : ' (filtered)'
|
||||
)
|
||||
|
||||
@ -43,7 +43,7 @@ class ReloadEntryCommand extends ContainerAwareCommand
|
||||
$entryRepository = $this->getContainer()->get('wallabag_core.entry_repository');
|
||||
$entryIds = $entryRepository->findAllEntriesIdByUserId($userId);
|
||||
|
||||
$nbEntries = count($entryIds);
|
||||
$nbEntries = \count($entryIds);
|
||||
if (!$nbEntries) {
|
||||
$io->success('No entry to reload.');
|
||||
|
||||
|
||||
@ -348,7 +348,7 @@ class ConfigController extends Controller
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
if (0 === count($tag->getEntries())) {
|
||||
if (0 === \count($tag->getEntries())) {
|
||||
$em->remove($tag);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ class TagController extends Controller
|
||||
$em->flush();
|
||||
|
||||
// remove orphan tag in case no entries are associated to it
|
||||
if (0 === count($tag->getEntries())) {
|
||||
if (0 === \count($tag->getEntries())) {
|
||||
$em->remove($tag);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
49
src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php
Normal file
49
src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Doctrine;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
abstract class WallabagMigration extends AbstractMigration implements ContainerAwareInterface
|
||||
{
|
||||
const UN_ESCAPED_TABLE = true;
|
||||
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
protected $container;
|
||||
|
||||
// because there are declared as abstract in `AbstractMigration` we need to delarer here too
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
}
|
||||
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
}
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
protected function getTable($tableName, $unEscaped = false)
|
||||
{
|
||||
$table = $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
|
||||
if (self::UN_ESCAPED_TABLE === $unEscaped) {
|
||||
return $table;
|
||||
}
|
||||
|
||||
// escape table name is handled using " on postgresql
|
||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
return '"' . $table . '"';
|
||||
}
|
||||
|
||||
// return escaped table
|
||||
return '`' . $table . '`';
|
||||
}
|
||||
}
|
||||
@ -33,7 +33,7 @@ class EntryFilterType extends AbstractType
|
||||
|
||||
$this->user = $tokenStorage->getToken() ? $tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
if (null === $this->user || !is_object($this->user)) {
|
||||
if (null === $this->user || !\is_object($this->user)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -96,7 +96,7 @@ class EntryFilterType extends AbstractType
|
||||
->add('domainName', TextFilterType::class, [
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||
$value = $values['value'];
|
||||
if (strlen($value) <= 2 || empty($value)) {
|
||||
if (\strlen($value) <= 2 || empty($value)) {
|
||||
return;
|
||||
}
|
||||
$expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->lower($filterQuery->getExpr()->literal('%' . $value . '%')));
|
||||
|
||||
@ -107,7 +107,7 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
|
||||
*/
|
||||
protected function processExtraFields($extraFieldsStrings)
|
||||
{
|
||||
if (!is_array($extraFieldsStrings)) {
|
||||
if (!\is_array($extraFieldsStrings)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@ -53,6 +53,7 @@ class ContentProxy
|
||||
|
||||
if ((empty($content) || false === $this->validateContent($content)) && false === $disableContentUpdate) {
|
||||
$fetchedContent = $this->graby->fetchContent($url);
|
||||
$fetchedContent['title'] = $this->sanitizeContentTitle($fetchedContent['title'], $fetchedContent['content_type']);
|
||||
|
||||
// when content is imported, we have information in $content
|
||||
// in case fetching content goes bad, we'll keep the imported information instead of overriding them
|
||||
@ -65,6 +66,13 @@ class ContentProxy
|
||||
// so we'll be able to refetch it in the future
|
||||
$content['url'] = !empty($content['url']) ? $content['url'] : $url;
|
||||
|
||||
// In one case (at least in tests), url is empty here
|
||||
// so we set it using $url provided in the updateEntry call.
|
||||
// Not sure what are the other possible cases where this property is empty
|
||||
if (empty($entry->getUrl()) && !empty($url)) {
|
||||
$entry->setUrl($url);
|
||||
}
|
||||
|
||||
$this->stockEntry($entry, $content);
|
||||
}
|
||||
|
||||
@ -85,7 +93,7 @@ class ContentProxy
|
||||
(new LocaleConstraint())
|
||||
);
|
||||
|
||||
if (0 === count($errors)) {
|
||||
if (0 === \count($errors)) {
|
||||
$entry->setLanguage($value);
|
||||
|
||||
return;
|
||||
@ -107,7 +115,7 @@ class ContentProxy
|
||||
(new UrlConstraint())
|
||||
);
|
||||
|
||||
if (0 === count($errors)) {
|
||||
if (0 === \count($errors)) {
|
||||
$entry->setPreviewPicture($value);
|
||||
|
||||
return;
|
||||
@ -176,6 +184,59 @@ class ContentProxy
|
||||
$entry->setTitle($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to sanitize the title of the fetched content from wrong character encodings and invalid UTF-8 character.
|
||||
*
|
||||
* @param $title
|
||||
* @param $contentType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function sanitizeContentTitle($title, $contentType)
|
||||
{
|
||||
if ('application/pdf' === $contentType) {
|
||||
$title = $this->convertPdfEncodingToUTF8($title);
|
||||
}
|
||||
|
||||
return $this->sanitizeUTF8Text($title);
|
||||
}
|
||||
|
||||
/**
|
||||
* If the title from the fetched content comes from a PDF, then its very possible that the character encoding is not
|
||||
* UTF-8. This methods tries to identify the character encoding and translate the title to UTF-8.
|
||||
*
|
||||
* @param $title
|
||||
*
|
||||
* @return string (maybe contains invalid UTF-8 character)
|
||||
*/
|
||||
private function convertPdfEncodingToUTF8($title)
|
||||
{
|
||||
// first try UTF-8 because its easier to detect its present/absence
|
||||
foreach (['UTF-8', 'UTF-16BE', 'WINDOWS-1252'] as $encoding) {
|
||||
if (mb_check_encoding($title, $encoding)) {
|
||||
return mb_convert_encoding($title, 'UTF-8', $encoding);
|
||||
}
|
||||
}
|
||||
|
||||
return $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove invalid UTF-8 characters from the given string.
|
||||
*
|
||||
* @param string $rawText
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function sanitizeUTF8Text($rawText)
|
||||
{
|
||||
if (mb_check_encoding($rawText, 'UTF-8')) {
|
||||
return $rawText;
|
||||
}
|
||||
|
||||
return iconv('UTF-8', 'UTF-8//IGNORE', $rawText);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stock entry with fetched or imported content.
|
||||
* Will fall back to OpenGraph data if available.
|
||||
@ -185,7 +246,7 @@ class ContentProxy
|
||||
*/
|
||||
private function stockEntry(Entry $entry, array $content)
|
||||
{
|
||||
$entry->setUrl($content['url']);
|
||||
$this->updateOriginUrl($entry, $content['url']);
|
||||
|
||||
$this->setEntryDomainName($entry);
|
||||
|
||||
@ -212,7 +273,7 @@ class ContentProxy
|
||||
$entry->setHttpStatus($content['status']);
|
||||
}
|
||||
|
||||
if (!empty($content['authors']) && is_array($content['authors'])) {
|
||||
if (!empty($content['authors']) && \is_array($content['authors'])) {
|
||||
$entry->setPublishedBy($content['authors']);
|
||||
}
|
||||
|
||||
@ -233,7 +294,7 @@ class ContentProxy
|
||||
}
|
||||
|
||||
// if content is an image, define it as a preview too
|
||||
if (!empty($content['content_type']) && in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) {
|
||||
if (!empty($content['content_type']) && \in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) {
|
||||
$this->updatePreviewPicture($entry, $content['url']);
|
||||
}
|
||||
|
||||
@ -251,6 +312,115 @@ class ContentProxy
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the origin_url field when a redirection occurs
|
||||
* This field is set if it is empty and new url does not match ignore list.
|
||||
*
|
||||
* @param Entry $entry
|
||||
* @param string $url
|
||||
*/
|
||||
private function updateOriginUrl(Entry $entry, $url)
|
||||
{
|
||||
if (empty($url) || $entry->getUrl() === $url) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$parsed_entry_url = parse_url($entry->getUrl());
|
||||
$parsed_content_url = parse_url($url);
|
||||
|
||||
/**
|
||||
* The following part computes the list of part changes between two
|
||||
* parse_url arrays.
|
||||
*
|
||||
* As array_diff_assoc only computes changes to go from the left array
|
||||
* to the right one, we make two differents arrays to have both
|
||||
* directions. We merge these two arrays and sort keys before passing
|
||||
* the result to the switch.
|
||||
*
|
||||
* The resulting array gives us all changing parts between the two
|
||||
* urls: scheme, host, path, query and/or fragment.
|
||||
*/
|
||||
$diff_ec = array_diff_assoc($parsed_entry_url, $parsed_content_url);
|
||||
$diff_ce = array_diff_assoc($parsed_content_url, $parsed_entry_url);
|
||||
|
||||
$diff = array_merge($diff_ec, $diff_ce);
|
||||
$diff_keys = array_keys($diff);
|
||||
sort($diff_keys);
|
||||
|
||||
if ($this->ignoreUrl($entry->getUrl())) {
|
||||
$entry->setUrl($url);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This switch case lets us apply different behaviors according to
|
||||
* changing parts of urls.
|
||||
*
|
||||
* As $diff_keys is an array, we provide arrays as cases. ['path'] means
|
||||
* 'only the path is different between the two urls' whereas
|
||||
* ['fragment', 'query'] means 'only fragment and query string parts are
|
||||
* different between the two urls'.
|
||||
*
|
||||
* Note that values in $diff_keys are sorted.
|
||||
*/
|
||||
switch ($diff_keys) {
|
||||
case ['path']:
|
||||
if (($parsed_entry_url['path'] . '/' === $parsed_content_url['path']) // diff is trailing slash, we only replace the url of the entry
|
||||
|| ($url === urldecode($entry->getUrl()))) { // we update entry url if new url is a decoded version of it, see EntryRepository#findByUrlAndUserId
|
||||
$entry->setUrl($url);
|
||||
}
|
||||
break;
|
||||
case ['scheme']:
|
||||
$entry->setUrl($url);
|
||||
break;
|
||||
case ['fragment']:
|
||||
// noop
|
||||
break;
|
||||
default:
|
||||
if (empty($entry->getOriginUrl())) {
|
||||
$entry->setOriginUrl($entry->getUrl());
|
||||
}
|
||||
$entry->setUrl($url);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check entry url against an ignore list to replace with content url.
|
||||
*
|
||||
* XXX: move the ignore list in the database to let users handle it
|
||||
*
|
||||
* @param string $url url to test
|
||||
*
|
||||
* @return bool true if url matches ignore list otherwise false
|
||||
*/
|
||||
private function ignoreUrl($url)
|
||||
{
|
||||
$ignored_hosts = ['feedproxy.google.com', 'feeds.reuters.com'];
|
||||
$ignored_patterns = ['https?://www\.lemonde\.fr/tiny.*'];
|
||||
|
||||
$parsed_url = parse_url($url);
|
||||
|
||||
$filtered = array_filter($ignored_hosts, function ($var) use ($parsed_url) {
|
||||
return $var === $parsed_url['host'];
|
||||
});
|
||||
|
||||
if ([] !== $filtered) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$filtered = array_filter($ignored_patterns, function ($var) use ($url) {
|
||||
return preg_match("`$var`i", $url);
|
||||
});
|
||||
|
||||
if ([] !== $filtered) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that the given content has at least a title, an html and a url.
|
||||
*
|
||||
|
||||
@ -81,6 +81,6 @@ class CryptoProxy
|
||||
*/
|
||||
private function mask($value)
|
||||
{
|
||||
return strlen($value) > 0 ? $value[0] . '*****' . $value[strlen($value) - 1] : 'Empty value';
|
||||
return \strlen($value) > 0 ? $value[0] . '*****' . $value[\strlen($value) - 1] : 'Empty value';
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,14 +42,17 @@ class DownloadImages
|
||||
public function processHtml($entryId, $html, $url)
|
||||
{
|
||||
$crawler = new Crawler($html);
|
||||
$result = $crawler
|
||||
->filterXpath('//img')
|
||||
$imagesCrawler = $crawler
|
||||
->filterXpath('//img');
|
||||
$imagesUrls = $imagesCrawler
|
||||
->extract(['src']);
|
||||
$imagesSrcsetUrls = $this->getSrcsetUrls($imagesCrawler);
|
||||
$imagesUrls = array_unique(array_merge($imagesUrls, $imagesSrcsetUrls));
|
||||
|
||||
$relativePath = $this->getRelativePath($entryId);
|
||||
|
||||
// download and save the image to the folder
|
||||
foreach ($result as $image) {
|
||||
foreach ($imagesUrls as $image) {
|
||||
$imagePath = $this->processSingleImage($entryId, $image, $url, $relativePath);
|
||||
|
||||
if (false === $imagePath) {
|
||||
@ -82,6 +85,10 @@ class DownloadImages
|
||||
*/
|
||||
public function processSingleImage($entryId, $imagePath, $url, $relativePath = null)
|
||||
{
|
||||
if (null === $imagePath) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (null === $relativePath) {
|
||||
$relativePath = $this->getRelativePath($entryId);
|
||||
}
|
||||
@ -171,6 +178,38 @@ class DownloadImages
|
||||
@rmdir($folderPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get images urls from the srcset image attribute.
|
||||
*
|
||||
* @param Crawler $imagesCrawler
|
||||
*
|
||||
* @return array An array of urls
|
||||
*/
|
||||
private function getSrcsetUrls(Crawler $imagesCrawler)
|
||||
{
|
||||
$urls = [];
|
||||
$iterator = $imagesCrawler
|
||||
->getIterator();
|
||||
while ($iterator->valid()) {
|
||||
$srcsetAttribute = $iterator->current()->getAttribute('srcset');
|
||||
if ('' !== $srcsetAttribute) {
|
||||
// Couldn't start with " OR ' OR a white space
|
||||
// Could be one or more white space
|
||||
// Must be one or more digits followed by w OR x
|
||||
$pattern = "/(?:[^\"'\s]+\s*(?:\d+[wx])+)/";
|
||||
preg_match_all($pattern, $srcsetAttribute, $matches);
|
||||
$srcset = \call_user_func_array('array_merge', $matches);
|
||||
$srcsetUrls = array_map(function ($src) {
|
||||
return trim(explode(' ', $src, 2)[0]);
|
||||
}, $srcset);
|
||||
$urls = array_merge($srcsetUrls, $urls);
|
||||
}
|
||||
$iterator->next();
|
||||
}
|
||||
|
||||
return $urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup base folder where all images are going to be saved.
|
||||
*/
|
||||
@ -269,7 +308,7 @@ class DownloadImages
|
||||
$this->logger->debug('DownloadImages: Checking extension (alternative)', ['ext' => $ext]);
|
||||
}
|
||||
|
||||
if (!in_array($ext, ['jpeg', 'jpg', 'gif', 'png'], true)) {
|
||||
if (!\in_array($ext, ['jpeg', 'jpg', 'gif', 'png'], true)) {
|
||||
$this->logger->error('DownloadImages: Processed image with not allowed extension. Skipping: ' . $imagePath);
|
||||
|
||||
return false;
|
||||
|
||||
@ -45,7 +45,7 @@ class EntriesExport
|
||||
*/
|
||||
public function setEntries($entries)
|
||||
{
|
||||
if (!is_array($entries)) {
|
||||
if (!\is_array($entries)) {
|
||||
$this->language = $entries->getLanguage();
|
||||
$entries = [$entries];
|
||||
}
|
||||
@ -325,7 +325,7 @@ class EntriesExport
|
||||
{
|
||||
$delimiter = ';';
|
||||
$enclosure = '"';
|
||||
$handle = fopen('php://memory', 'rb+');
|
||||
$handle = fopen('php://memory', 'b+r');
|
||||
|
||||
fputcsv($handle, ['Title', 'URL', 'Content', 'Tags', 'MIME Type', 'Language', 'Creation date'], $delimiter, $enclosure);
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ class PreparePagerForEntries
|
||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
}
|
||||
|
||||
if (null === $user || !is_object($user)) {
|
||||
if (null === $user || !\is_object($user)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ class Redirect
|
||||
{
|
||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
if (null === $user || !is_object($user)) {
|
||||
if (null === $user || !\is_object($user)) {
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ class TagsAssigner
|
||||
{
|
||||
$tagsEntities = [];
|
||||
|
||||
if (!is_array($tags)) {
|
||||
if (!\is_array($tags)) {
|
||||
$tags = explode(',', $tags);
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ class TagsAssigner
|
||||
$label = trim(mb_convert_case($label, MB_CASE_LOWER));
|
||||
|
||||
// avoid empty tag
|
||||
if (0 === strlen($label)) {
|
||||
if (0 === \strlen($label)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ class UsernameRssTokenConverter implements ParamConverterInterface
|
||||
{
|
||||
// If there is no manager, this means that only Doctrine DBAL is configured
|
||||
// In this case we can do nothing and just return
|
||||
if (null === $this->registry || !count($this->registry->getManagers())) {
|
||||
if (null === $this->registry || !\count($this->registry->getManagers())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ class EntryRepository extends EntityRepository
|
||||
public function getBuilderForAllByUser($userId)
|
||||
{
|
||||
return $this
|
||||
->getBuilderByUser($userId)
|
||||
->getSortedQueryBuilderByUser($userId)
|
||||
;
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ class EntryRepository extends EntityRepository
|
||||
public function getBuilderForUnreadByUser($userId)
|
||||
{
|
||||
return $this
|
||||
->getBuilderByUser($userId)
|
||||
->getSortedQueryBuilderByUser($userId)
|
||||
->andWhere('e.isArchived = false')
|
||||
;
|
||||
}
|
||||
@ -50,7 +50,7 @@ class EntryRepository extends EntityRepository
|
||||
public function getBuilderForArchiveByUser($userId)
|
||||
{
|
||||
return $this
|
||||
->getBuilderByUser($userId)
|
||||
->getSortedQueryBuilderByUser($userId)
|
||||
->andWhere('e.isArchived = true')
|
||||
;
|
||||
}
|
||||
@ -65,7 +65,7 @@ class EntryRepository extends EntityRepository
|
||||
public function getBuilderForStarredByUser($userId)
|
||||
{
|
||||
return $this
|
||||
->getBuilderByUser($userId, 'starredAt', 'desc')
|
||||
->getSortedQueryBuilderByUser($userId, 'starredAt', 'desc')
|
||||
->andWhere('e.isStarred = true')
|
||||
;
|
||||
}
|
||||
@ -82,7 +82,7 @@ class EntryRepository extends EntityRepository
|
||||
public function getBuilderForSearchByUser($userId, $term, $currentRoute)
|
||||
{
|
||||
$qb = $this
|
||||
->getBuilderByUser($userId);
|
||||
->getSortedQueryBuilderByUser($userId);
|
||||
|
||||
if ('starred' === $currentRoute) {
|
||||
$qb->andWhere('e.isStarred = true');
|
||||
@ -102,7 +102,7 @@ class EntryRepository extends EntityRepository
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves untagged entries for a user.
|
||||
* Retrieve a sorted list of untagged entries for a user.
|
||||
*
|
||||
* @param int $userId
|
||||
*
|
||||
@ -111,8 +111,21 @@ class EntryRepository extends EntityRepository
|
||||
public function getBuilderForUntaggedByUser($userId)
|
||||
{
|
||||
return $this
|
||||
->getBuilderByUser($userId)
|
||||
->andWhere('size(e.tags) = 0');
|
||||
->sortQueryBuilder($this->getRawBuilderForUntaggedByUser($userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve untagged entries for a user.
|
||||
*
|
||||
* @param int $userId
|
||||
*
|
||||
* @return QueryBuilder
|
||||
*/
|
||||
public function getRawBuilderForUntaggedByUser($userId)
|
||||
{
|
||||
return $this->getQueryBuilderByUser($userId)
|
||||
->leftJoin('e.tags', 't')
|
||||
->andWhere('t.id is null');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -151,7 +164,7 @@ class EntryRepository extends EntityRepository
|
||||
$qb->andWhere('e.updatedAt > :since')->setParameter('since', new \DateTime(date('Y-m-d H:i:s', $since)));
|
||||
}
|
||||
|
||||
if (is_string($tags) && '' !== $tags) {
|
||||
if (\is_string($tags) && '' !== $tags) {
|
||||
foreach (explode(',', $tags) as $i => $tag) {
|
||||
$entryAlias = 'e' . $i;
|
||||
$tagAlias = 't' . $i;
|
||||
@ -260,7 +273,7 @@ class EntryRepository extends EntityRepository
|
||||
*/
|
||||
public function removeTag($userId, Tag $tag)
|
||||
{
|
||||
$entries = $this->getBuilderByUser($userId)
|
||||
$entries = $this->getSortedQueryBuilderByUser($userId)
|
||||
->innerJoin('e.tags', 't')
|
||||
->andWhere('t.id = :tagId')->setParameter('tagId', $tag->getId())
|
||||
->getQuery()
|
||||
@ -296,7 +309,7 @@ class EntryRepository extends EntityRepository
|
||||
*/
|
||||
public function findAllByTagId($userId, $tagId)
|
||||
{
|
||||
return $this->getBuilderByUser($userId)
|
||||
return $this->getSortedQueryBuilderByUser($userId)
|
||||
->innerJoin('e.tags', 't')
|
||||
->andWhere('t.id = :tagId')->setParameter('tagId', $tagId)
|
||||
->getQuery()
|
||||
@ -320,7 +333,7 @@ class EntryRepository extends EntityRepository
|
||||
->getQuery()
|
||||
->getResult();
|
||||
|
||||
if (count($res)) {
|
||||
if (\count($res)) {
|
||||
return current($res);
|
||||
}
|
||||
|
||||
@ -414,7 +427,20 @@ class EntryRepository extends EntityRepository
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a query builder to used by other getBuilderFor* method.
|
||||
* Return a query builder to be used by other getBuilderFor* method.
|
||||
*
|
||||
* @param int $userId
|
||||
*
|
||||
* @return QueryBuilder
|
||||
*/
|
||||
private function getQueryBuilderByUser($userId)
|
||||
{
|
||||
return $this->createQueryBuilder('e')
|
||||
->andWhere('e.user = :userId')->setParameter('userId', $userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a sorted query builder to be used by other getBuilderFor* method.
|
||||
*
|
||||
* @param int $userId
|
||||
* @param string $sortBy
|
||||
@ -422,10 +448,23 @@ class EntryRepository extends EntityRepository
|
||||
*
|
||||
* @return QueryBuilder
|
||||
*/
|
||||
private function getBuilderByUser($userId, $sortBy = 'createdAt', $direction = 'desc')
|
||||
private function getSortedQueryBuilderByUser($userId, $sortBy = 'createdAt', $direction = 'desc')
|
||||
{
|
||||
return $this->createQueryBuilder('e')
|
||||
->andWhere('e.user = :userId')->setParameter('userId', $userId)
|
||||
return $this->sortQueryBuilder($this->getQueryBuilderByUser($userId), $sortBy, $direction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the given QueryBuilder with an orderBy() call.
|
||||
*
|
||||
* @param QueryBuilder $qb
|
||||
* @param string $sortBy
|
||||
* @param string $direction
|
||||
*
|
||||
* @return QueryBuilder
|
||||
*/
|
||||
private function sortQueryBuilder(QueryBuilder $qb, $sortBy = 'createdAt', $direction = 'desc')
|
||||
{
|
||||
return $qb
|
||||
->orderBy(sprintf('e.%s', $sortBy), $direction);
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ class TagRepository extends EntityRepository
|
||||
$query->setResultCacheLifetime($cacheLifeTime);
|
||||
}
|
||||
|
||||
return count($query->getArrayResult());
|
||||
return \count($query->getArrayResult());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -157,8 +157,8 @@ config:
|
||||
# not_equal_to: 'Not equal to...'
|
||||
# or: 'One rule OR another'
|
||||
# and: 'One rule AND another'
|
||||
# matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
|
||||
# notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
|
||||
# matches: 'Tests that a <i>subject</i> matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
|
||||
# notmatches: 'Tests that a <i>subject</i> doesn''t match match a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
|
||||
|
||||
entry:
|
||||
# default_title: 'Title of the entry'
|
||||
|
||||
@ -72,9 +72,9 @@ config:
|
||||
300_word: 'I read ~300 words per minute'
|
||||
400_word: 'I read ~400 words per minute'
|
||||
action_mark_as_read:
|
||||
label: 'Where do you want to be redirected to after marking an article as read?'
|
||||
redirect_homepage: 'To the homepage'
|
||||
redirect_current_page: 'To the current page'
|
||||
label: 'What to do after removing, starring or marking as read an article?'
|
||||
redirect_homepage: 'Go to the homepage'
|
||||
redirect_current_page: 'Stay on the current page'
|
||||
pocket_consumer_key_label: Consumer key for Pocket to import contents
|
||||
android_configuration: Configure your Android application
|
||||
android_instruction: "Touch here to prefill your Android application"
|
||||
@ -116,7 +116,7 @@ config:
|
||||
archived: Remove ALL archived entries
|
||||
confirm: Are you really sure? (THIS CAN'T BE UNDONE)
|
||||
form_password:
|
||||
description: "You can change your password here. Your new password should by at least 8 characters long."
|
||||
description: "You can change your password here. Your new password should be at least 8 characters long."
|
||||
old_password_label: 'Current password'
|
||||
new_password_label: 'New password'
|
||||
repeat_new_password_label: 'Repeat new password'
|
||||
@ -157,8 +157,8 @@ config:
|
||||
not_equal_to: 'Not equal to...'
|
||||
or: 'One rule OR another'
|
||||
and: 'One rule AND another'
|
||||
matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
|
||||
notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
|
||||
matches: 'Tests that a <i>subject</i> matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
|
||||
notmatches: 'Tests that a <i>subject</i> doesn''t match match a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
|
||||
|
||||
entry:
|
||||
default_title: 'Title of the entry'
|
||||
@ -265,7 +265,7 @@ about:
|
||||
who_behind_wallabag:
|
||||
developped_by: 'Developed by'
|
||||
website: 'website'
|
||||
many_contributors: 'And many others contributors ♥ <a href="https://github.com/wallabag/wallabag/graphs/contributors">on Github</a>'
|
||||
many_contributors: 'And many others contributors ♥ <a href="https://github.com/wallabag/wallabag/graphs/contributors">on GitHub</a>'
|
||||
project_website: 'Project website'
|
||||
license: 'License'
|
||||
version: 'Version'
|
||||
@ -323,7 +323,7 @@ howto:
|
||||
go_import: Go to import
|
||||
go_developers: Go to developers
|
||||
go_howto: Go to howto (this page!)
|
||||
go_logout: Logout
|
||||
go_logout: Log out
|
||||
list_title: Shortcuts available in listing pages
|
||||
search: Display the search form
|
||||
article_title: Shortcuts available in entry view
|
||||
@ -373,7 +373,7 @@ quickstart:
|
||||
instapaper: 'Migrate from Instapaper'
|
||||
developer:
|
||||
title: 'Developers'
|
||||
description: 'We also thought to the developers: Docker, API, translations, etc.'
|
||||
description: 'We also thought of the developers: Docker, API, translations, etc.'
|
||||
create_application: 'Create your third-party application'
|
||||
use_docker: 'Use Docker to install wallabag'
|
||||
docs:
|
||||
|
||||
@ -158,7 +158,7 @@ config:
|
||||
or: 'Una regla U otra'
|
||||
and: 'Una regla Y la otra'
|
||||
matches: 'Prueba si un <i>sujeto</i> corresponde a una <i>búsqueda</i> (insensible a mayusculas).<br />Ejemplo : <code>title matches "fútbol"</code>'
|
||||
# notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
|
||||
# notmatches: 'Tests that a <i>subject</i> doesn''t match match a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
|
||||
|
||||
entry:
|
||||
default_title: 'Título del artículo'
|
||||
|
||||
@ -157,8 +157,8 @@ config:
|
||||
# not_equal_to: 'Not equal to...'
|
||||
# or: 'One rule OR another'
|
||||
# and: 'One rule AND another'
|
||||
# matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
|
||||
# notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
|
||||
# matches: 'Tests that a <i>subject</i> matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
|
||||
# notmatches: 'Tests that a <i>subject</i> doesn''t match match a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
|
||||
|
||||
entry:
|
||||
# default_title: 'Title of the entry'
|
||||
|
||||
@ -72,9 +72,9 @@ config:
|
||||
300_word: "Je lis environ 300 mots par minute"
|
||||
400_word: "Je lis environ 400 mots par minute"
|
||||
action_mark_as_read:
|
||||
label: "Où souhaitez-vous être redirigé après avoir marqué un article comme lu ?"
|
||||
redirect_homepage: "À la page d’accueil"
|
||||
redirect_current_page: "À la page courante"
|
||||
label: "Que faire lorsqu'un article est supprimé, marqué comme lu ou marqué comme favoris ?"
|
||||
redirect_homepage: "Retourner à la page d’accueil"
|
||||
redirect_current_page: "Rester sur la page actuelle"
|
||||
pocket_consumer_key_label: "Clé d’authentification Pocket pour importer les données"
|
||||
android_configuration: "Configurez votre application Android"
|
||||
android_instruction: "Appuyez ici pour préremplir votre application Android"
|
||||
|
||||
@ -158,7 +158,7 @@ config:
|
||||
or: "Una regola O un'altra"
|
||||
and: "Una regola E un'altra"
|
||||
matches: 'Verifica che un <i>oggetto</i> risulti in una <i>ricerca</i> (case-insensitive).<br />Esempio: <code>titolo contiene "football"</code>'
|
||||
# notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
|
||||
# notmatches: 'Tests that a <i>subject</i> doesn''t match match a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
|
||||
|
||||
entry:
|
||||
default_title: "Titolo del contenuto"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user