diff options
61 files changed, 807 insertions, 351 deletions
diff --git a/.travis.yml b/.travis.yml index 6b279ed6..c6c03dc3 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -70,11 +70,9 @@ before_install: | |||
70 | 70 | ||
71 | script: | 71 | script: |
72 | - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist | 72 | - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist |
73 | - ant prepare-$DB | 73 | - echo "travis_fold:start:prepare" |
74 | 74 | - make prepare DB=$DB | |
75 | - echo "travis_fold:start:migrations" | 75 | - echo "travis_fold:end:prepare" |
76 | - php bin/console doctrine:migrations:migrate --no-interaction --env=test | ||
77 | - echo "travis_fold:end:migrations" | ||
78 | 76 | ||
79 | - echo "travis_fold:start:fixtures" | 77 | - echo "travis_fold:start:fixtures" |
80 | - php bin/console doctrine:fixtures:load --no-interaction --env=test | 78 | - php bin/console doctrine:fixtures:load --no-interaction --env=test |
@@ -1,15 +1,13 @@ | |||
1 | TMP_FOLDER=/tmp | 1 | TMP_FOLDER=/tmp |
2 | RELEASE_FOLDER=wllbg-release | 2 | RELEASE_FOLDER=wllbg-release |
3 | 3 | ||
4 | ifndef ENV | 4 | ENV ?= prod |
5 | ENV=prod | ||
6 | endif | ||
7 | 5 | ||
8 | help: ## Display this help menu | 6 | help: ## Display this help menu |
9 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | 7 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
10 | 8 | ||
11 | clean: ## Clear the application cache | 9 | clean: ## Clear the application cache |
12 | @rm -rf var/cache/* | 10 | rm -rf var/cache/* |
13 | 11 | ||
14 | install: ## Install wallabag with the latest version | 12 | install: ## Install wallabag with the latest version |
15 | @sh scripts/install.sh $(ENV) | 13 | @sh scripts/install.sh $(ENV) |
@@ -26,8 +24,19 @@ run: ## Run the wallabag built-in server | |||
26 | build: ## Run webpack | 24 | build: ## Run webpack |
27 | @npm run build:$(ENV) | 25 | @npm run build:$(ENV) |
28 | 26 | ||
29 | test: ## Launch wallabag testsuite | 27 | prepare: clean ## Prepare database for testsuite |
30 | @ant prepare && bin/simple-phpunit -v | 28 | ifdef DB |
29 | cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml | ||
30 | endif | ||
31 | -php bin/console doctrine:database:drop --force --env=test | ||
32 | php bin/console doctrine:database:create --env=test | ||
33 | php bin/console doctrine:migrations:migrate --no-interaction --env=test | ||
34 | |||
35 | fixtures: ## Load fixtures into database | ||
36 | php bin/console doctrine:fixtures:load --no-interaction --env=test | ||
37 | |||
38 | test: prepare fixtures ## Launch wallabag testsuite | ||
39 | bin/simple-phpunit -v | ||
31 | 40 | ||
32 | release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`). | 41 | release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`). |
33 | ifndef VERSION | 42 | ifndef VERSION |
@@ -35,11 +44,9 @@ ifndef VERSION | |||
35 | endif | 44 | endif |
36 | @sh scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV) | 45 | @sh scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV) |
37 | 46 | ||
38 | travis: ## Make some stuff for Travis-CI | ||
39 | |||
40 | deploy: ## Deploy wallabag | 47 | deploy: ## Deploy wallabag |
41 | @bundle exec cap staging deploy | 48 | @bundle exec cap staging deploy |
42 | 49 | ||
43 | .PHONY: help clean install update build test release travis deploy run dev | 50 | .PHONY: help clean prepare install fixtures update build test release deploy run dev |
44 | 51 | ||
45 | .DEFAULT_GOAL := install | 52 | .DEFAULT_GOAL := install |
diff --git a/app/DoctrineMigrations/Version20160401000000.php b/app/DoctrineMigrations/Version20160401000000.php new file mode 100644 index 00000000..a8603abf --- /dev/null +++ b/app/DoctrineMigrations/Version20160401000000.php | |||
@@ -0,0 +1,191 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Application\Migrations; | ||
4 | |||
5 | use Doctrine\DBAL\Migrations\AbstractMigration; | ||
6 | use Doctrine\DBAL\Schema\Schema; | ||
7 | |||
8 | /** | ||
9 | * Initial database structure. | ||
10 | */ | ||
11 | class Version20160401000000 extends AbstractMigration | ||
12 | { | ||
13 | /** | ||
14 | * @param Schema $schema | ||
15 | */ | ||
16 | public function up(Schema $schema) | ||
17 | { | ||
18 | if ($this->version->getConfiguration()->getNumberOfExecutedMigrations() > 0) { | ||
19 | $this->version->markMigrated(); | ||
20 | $this->skipIf(true, 'Database already initialized'); | ||
21 | } | ||
22 | |||
23 | switch ($this->connection->getDatabasePlatform()->getName()) { | ||
24 | case 'sqlite': | ||
25 | $sql = <<<'SQL' | ||
26 | CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name)); | ||
27 | CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name); | ||
28 | CREATE TABLE "wallabag_tagging_rule" (id INTEGER NOT NULL, config_id INTEGER DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
29 | CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id); | ||
30 | CREATE TABLE "wallabag_tag" (id INTEGER NOT NULL, label CLOB NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id)); | ||
31 | CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug); | ||
32 | CREATE TABLE "wallabag_entry" (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, title CLOB DEFAULT NULL, url CLOB DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL, language CLOB DEFAULT NULL, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL, preview_picture CLOB DEFAULT NULL, is_public BOOLEAN DEFAULT '0', PRIMARY KEY(id), CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
33 | CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id); | ||
34 | CREATE TABLE wallabag_entry_tag (entry_id INTEGER NOT NULL, tag_id INTEGER NOT NULL, PRIMARY KEY(entry_id, tag_id), CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
35 | CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id); | ||
36 | CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id); | ||
37 | CREATE TABLE "wallabag_config" (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INTEGER DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
38 | CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id); | ||
39 | CREATE TABLE wallabag_oauth2_refresh_tokens (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
40 | CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token); | ||
41 | CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id); | ||
42 | CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id); | ||
43 | CREATE TABLE wallabag_oauth2_access_tokens (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
44 | CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token); | ||
45 | CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id); | ||
46 | CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id); | ||
47 | CREATE TABLE wallabag_oauth2_auth_codes (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri CLOB NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
48 | CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token); | ||
49 | CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id); | ||
50 | CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id); | ||
51 | CREATE TABLE wallabag_oauth2_clients (id INTEGER NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris CLOB NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types CLOB NOT NULL, PRIMARY KEY(id)); | ||
52 | CREATE TABLE "wallabag_user" (id INTEGER NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted CLOB DEFAULT NULL, PRIMARY KEY(id)); | ||
53 | CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical); | ||
54 | CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical); | ||
55 | CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token); | ||
56 | CREATE TABLE wallabag_annotation (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, entry_id INTEGER DEFAULT NULL, text CLOB NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
57 | CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id); | ||
58 | CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id); | ||
59 | SQL | ||
60 | ; | ||
61 | |||
62 | foreach (explode("\n", $sql) as $query) { | ||
63 | $this->addSql($query); | ||
64 | } | ||
65 | |||
66 | break; | ||
67 | case 'mysql': | ||
68 | $sql = <<<'SQL' | ||
69 | CREATE TABLE wallabag_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; | ||
70 | CREATE TABLE `wallabag_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; | ||
71 | CREATE TABLE wallabag_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; | ||
72 | CREATE TABLE `wallabag_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; | ||
73 | CREATE TABLE `wallabag_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; | ||
74 | CREATE TABLE `wallabag_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; | ||
75 | CREATE TABLE wallabag_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; | ||
76 | CREATE TABLE wallabag_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; | ||
77 | CREATE TABLE wallabag_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; | ||
78 | CREATE TABLE wallabag_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; | ||
79 | CREATE TABLE `wallabag_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; | ||
80 | CREATE TABLE wallabag_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; | ||
81 | ALTER TABLE `wallabag_entry` ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
82 | ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id); | ||
83 | ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES `wallabag_tag` (id); | ||
84 | ALTER TABLE `wallabag_config` ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
85 | ALTER TABLE `wallabag_tagging_rule` ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES `wallabag_config` (id); | ||
86 | ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); | ||
87 | ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
88 | ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); | ||
89 | ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
90 | ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); | ||
91 | ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
92 | ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
93 | ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id); | ||
94 | SQL | ||
95 | ; | ||
96 | foreach (explode("\n", $sql) as $query) { | ||
97 | $this->addSql($query); | ||
98 | } | ||
99 | break; | ||
100 | case 'postgresql': | ||
101 | $sql = <<<'SQL' | ||
102 | CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name)); | ||
103 | CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name); | ||
104 | CREATE TABLE "wallabag_entry" (id INT NOT NULL, user_id INT DEFAULT NULL, title TEXT DEFAULT NULL, url TEXT DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, mimetype TEXT DEFAULT NULL, language TEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name TEXT DEFAULT NULL, preview_picture TEXT DEFAULT NULL, is_public BOOLEAN DEFAULT 'false', PRIMARY KEY(id)); | ||
105 | CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id); | ||
106 | CREATE TABLE wallabag_entry_tag (entry_id INT NOT NULL, tag_id INT NOT NULL, PRIMARY KEY(entry_id, tag_id)); | ||
107 | CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id); | ||
108 | CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id); | ||
109 | CREATE TABLE "wallabag_config" (id INT 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, PRIMARY KEY(id)); | ||
110 | CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id); | ||
111 | CREATE TABLE "wallabag_tagging_rule" (id INT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags TEXT NOT NULL, PRIMARY KEY(id)); | ||
112 | CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id); | ||
113 | COMMENT ON COLUMN "wallabag_tagging_rule".tags IS '(DC2Type:simple_array)'; | ||
114 | CREATE TABLE "wallabag_tag" (id INT NOT NULL, label TEXT NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id)); | ||
115 | CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug); | ||
116 | CREATE TABLE wallabag_oauth2_clients (id INT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris TEXT NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types TEXT NOT NULL, PRIMARY KEY(id)); | ||
117 | COMMENT ON COLUMN wallabag_oauth2_clients.redirect_uris IS '(DC2Type:array)'; | ||
118 | COMMENT ON COLUMN wallabag_oauth2_clients.allowed_grant_types IS '(DC2Type:array)'; | ||
119 | CREATE TABLE wallabag_oauth2_access_tokens (id INT 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, PRIMARY KEY(id)); | ||
120 | CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token); | ||
121 | CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id); | ||
122 | CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id); | ||
123 | CREATE TABLE wallabag_oauth2_refresh_tokens (id INT 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, PRIMARY KEY(id)); | ||
124 | CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token); | ||
125 | CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id); | ||
126 | CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id); | ||
127 | CREATE TABLE wallabag_oauth2_auth_codes (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri TEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)); | ||
128 | CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token); | ||
129 | CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id); | ||
130 | CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id); | ||
131 | CREATE TABLE "wallabag_user" (id INT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, roles TEXT NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, name TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted TEXT DEFAULT NULL, PRIMARY KEY(id)); | ||
132 | CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical); | ||
133 | CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical); | ||
134 | CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token); | ||
135 | COMMENT ON COLUMN "wallabag_user".roles IS '(DC2Type:array)'; | ||
136 | COMMENT ON COLUMN "wallabag_user".trusted IS '(DC2Type:json_array)'; | ||
137 | CREATE TABLE wallabag_annotation (id INT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text TEXT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, quote VARCHAR(255) NOT NULL, ranges TEXT NOT NULL, PRIMARY KEY(id)); | ||
138 | CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id); | ||
139 | CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id); | ||
140 | COMMENT ON COLUMN wallabag_annotation.ranges IS '(DC2Type:array)'; | ||
141 | CREATE SEQUENCE "entry_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; | ||
142 | CREATE SEQUENCE "config_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; | ||
143 | CREATE SEQUENCE "tagging_rule_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; | ||
144 | CREATE SEQUENCE "tag_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; | ||
145 | CREATE SEQUENCE oauth2_clients_id_seq INCREMENT BY 1 MINVALUE 1 START 1; | ||
146 | CREATE SEQUENCE oauth2_access_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1; | ||
147 | CREATE SEQUENCE oauth2_refresh_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1; | ||
148 | CREATE SEQUENCE oauth2_auth_codes_id_seq INCREMENT BY 1 MINVALUE 1 START 1; | ||
149 | CREATE SEQUENCE "user_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; | ||
150 | CREATE SEQUENCE annotation_id_seq INCREMENT BY 1 MINVALUE 1 START 1; | ||
151 | ALTER TABLE "wallabag_entry" ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
152 | ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
153 | ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
154 | ALTER TABLE "wallabag_config" ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
155 | ALTER TABLE "wallabag_tagging_rule" ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
156 | ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
157 | ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
158 | ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
159 | ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
160 | ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
161 | ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
162 | ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
163 | ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
164 | SQL | ||
165 | ; | ||
166 | foreach (explode("\n", $sql) as $query) { | ||
167 | $this->addSql($query); | ||
168 | } | ||
169 | break; | ||
170 | } | ||
171 | } | ||
172 | |||
173 | /** | ||
174 | * @param Schema $schema | ||
175 | */ | ||
176 | public function down(Schema $schema) | ||
177 | { | ||
178 | $this->addSql('DROP TABLE wallabag_craue_config_setting'); | ||
179 | $this->addSql('DROP TABLE "wallabag_tagging_rule"'); | ||
180 | $this->addSql('DROP TABLE "wallabag_config"'); | ||
181 | $this->addSql('DROP TABLE "wallabag_entry"'); | ||
182 | $this->addSql('DROP TABLE wallabag_entry_tag'); | ||
183 | $this->addSql('DROP TABLE "wallabag_tag"'); | ||
184 | $this->addSql('DROP TABLE wallabag_oauth2_refresh_tokens'); | ||
185 | $this->addSql('DROP TABLE wallabag_oauth2_access_tokens'); | ||
186 | $this->addSql('DROP TABLE wallabag_oauth2_clients'); | ||
187 | $this->addSql('DROP TABLE wallabag_oauth2_auth_codes'); | ||
188 | $this->addSql('DROP TABLE "wallabag_user"'); | ||
189 | $this->addSql('DROP TABLE wallabag_annotation'); | ||
190 | } | ||
191 | } | ||
diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index 677f30c3..d28f3a71 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php | |||
@@ -30,7 +30,20 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI | |||
30 | $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); | 30 | $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); |
31 | $this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.'); | 31 | $this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.'); |
32 | 32 | ||
33 | $clientsTable->addColumn('name', 'blob'); | 33 | if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) { |
34 | // Can't use $clientsTable->addColumn('name', 'blob'); | ||
35 | // because of the error: | ||
36 | // SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL | ||
37 | $databaseTablePrefix = $this->container->getParameter('database_table_prefix'); | ||
38 | $this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients'); | ||
39 | $this->addSql('DROP TABLE ' . $databaseTablePrefix . 'oauth2_clients'); | ||
40 | $this->addSql('CREATE TABLE ' . $databaseTablePrefix . 'oauth2_clients (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, random_id VARCHAR(255) NOT NULL COLLATE BINARY, secret VARCHAR(255) NOT NULL COLLATE BINARY, redirect_uris CLOB NOT NULL, allowed_grant_types CLOB NOT NULL, name CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_635D765EA76ED395 FOREIGN KEY (user_id) REFERENCES "' . $databaseTablePrefix . 'user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); | ||
41 | $this->addSql('INSERT INTO ' . $databaseTablePrefix . 'oauth2_clients (id, random_id, redirect_uris, secret, allowed_grant_types) SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM __temp__' . $databaseTablePrefix . 'oauth2_clients'); | ||
42 | $this->addSql('DROP TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients'); | ||
43 | $this->addSql('CREATE INDEX IDX_635D765EA76ED395 ON ' . $databaseTablePrefix . 'oauth2_clients (user_id)'); | ||
44 | } else { | ||
45 | $clientsTable->addColumn('name', 'blob'); | ||
46 | } | ||
34 | } | 47 | } |
35 | 48 | ||
36 | /** | 49 | /** |
@@ -39,7 +52,18 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI | |||
39 | public function down(Schema $schema) | 52 | public function down(Schema $schema) |
40 | { | 53 | { |
41 | $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); | 54 | $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); |
42 | $clientsTable->dropColumn('name'); | 55 | |
56 | if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) { | ||
57 | $databaseTablePrefix = $this->container->getParameter('database_table_prefix'); | ||
58 | $this->addSql('DROP INDEX IDX_635D765EA76ED395'); | ||
59 | $this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients'); | ||
60 | $this->addSql('DROP TABLE ' . $databaseTablePrefix . 'oauth2_clients'); | ||
61 | $this->addSql('CREATE TABLE ' . $databaseTablePrefix . 'oauth2_clients (id INTEGER NOT NULL, random_id VARCHAR(255) NOT NULL, secret VARCHAR(255) NOT NULL, redirect_uris CLOB NOT NULL COLLATE BINARY, allowed_grant_types CLOB NOT NULL COLLATE BINARY, PRIMARY KEY(id))'); | ||
62 | $this->addSql('INSERT INTO ' . $databaseTablePrefix . 'oauth2_clients (id, random_id, redirect_uris, secret, allowed_grant_types) SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM __temp__' . $databaseTablePrefix . 'oauth2_clients'); | ||
63 | $this->addSql('DROP TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients'); | ||
64 | } else { | ||
65 | $clientsTable->dropColumn('name'); | ||
66 | } | ||
43 | } | 67 | } |
44 | 68 | ||
45 | private function getTable($tableName) | 69 | private function getTable($tableName) |
diff --git a/app/DoctrineMigrations/Version20170824113337.php b/app/DoctrineMigrations/Version20170824113337.php index 7393d683..e54a9bcf 100644 --- a/app/DoctrineMigrations/Version20170824113337.php +++ b/app/DoctrineMigrations/Version20170824113337.php | |||
@@ -41,7 +41,12 @@ class Version20170824113337 extends AbstractMigration implements ContainerAwareI | |||
41 | $entryTable = $schema->getTable($this->getTable('entry')); | 41 | $entryTable = $schema->getTable($this->getTable('entry')); |
42 | $this->skipIf(!$entryTable->hasColumn('starred_at'), 'Unable to add starred_at colum'); | 42 | $this->skipIf(!$entryTable->hasColumn('starred_at'), 'Unable to add starred_at colum'); |
43 | 43 | ||
44 | $this->connection->executeQuery('UPDATE ' . $this->getTable('entry') . ' SET starred_at = updated_at WHERE is_starred = true'); | 44 | $this->connection->executeQuery( |
45 | 'UPDATE ' . $this->getTable('entry') . ' SET starred_at = updated_at WHERE is_starred = :is_starred', | ||
46 | [ | ||
47 | 'is_starred' => true, | ||
48 | ] | ||
49 | ); | ||
45 | } | 50 | } |
46 | 51 | ||
47 | /** | 52 | /** |
diff --git a/app/DoctrineMigrations/Version20171008195606.php b/app/DoctrineMigrations/Version20171008195606.php index c190f4ed..f09726c8 100644 --- a/app/DoctrineMigrations/Version20171008195606.php +++ b/app/DoctrineMigrations/Version20171008195606.php | |||
@@ -31,6 +31,7 @@ class Version20171008195606 extends AbstractMigration implements ContainerAwareI | |||
31 | 31 | ||
32 | switch ($this->connection->getDatabasePlatform()->getName()) { | 32 | switch ($this->connection->getDatabasePlatform()->getName()) { |
33 | case 'mysql': | 33 | case 'mysql': |
34 | $this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;'); | ||
34 | $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;'); | 35 | $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;'); |
35 | break; | 36 | break; |
36 | case 'postgresql': | 37 | case 'postgresql': |
diff --git a/app/DoctrineMigrations/Version20171105202000.php b/app/DoctrineMigrations/Version20171105202000.php new file mode 100644 index 00000000..3769045f --- /dev/null +++ b/app/DoctrineMigrations/Version20171105202000.php | |||
@@ -0,0 +1,55 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Application\Migrations; | ||
4 | |||
5 | use Doctrine\DBAL\Migrations\AbstractMigration; | ||
6 | use Doctrine\DBAL\Schema\Schema; | ||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | ||
9 | |||
10 | /** | ||
11 | * Add origin_url column. | ||
12 | */ | ||
13 | class Version20171105202000 extends AbstractMigration implements ContainerAwareInterface | ||
14 | { | ||
15 | /** | ||
16 | * @var ContainerInterface | ||
17 | */ | ||
18 | private $container; | ||
19 | |||
20 | public function setContainer(ContainerInterface $container = null) | ||
21 | { | ||
22 | $this->container = $container; | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * @param Schema $schema | ||
27 | */ | ||
28 | public function up(Schema $schema) | ||
29 | { | ||
30 | $entryTable = $schema->getTable($this->getTable('entry')); | ||
31 | |||
32 | $this->skipIf($entryTable->hasColumn('origin_url'), 'It seems that you already played this migration.'); | ||
33 | |||
34 | $entryTable->addColumn('origin_url', 'text', [ | ||
35 | 'notnull' => false, | ||
36 | ]); | ||
37 | } | ||
38 | |||
39 | /** | ||
40 | * @param Schema $schema | ||
41 | */ | ||
42 | public function down(Schema $schema) | ||
43 | { | ||
44 | $entryTable = $schema->getTable($this->getTable('entry')); | ||
45 | |||
46 | $this->skipIf(!$entryTable->hasColumn('origin_url'), 'It seems that you already played this migration.'); | ||
47 | |||
48 | $entryTable->dropColumn('origin_url'); | ||
49 | } | ||
50 | |||
51 | private function getTable($tableName) | ||
52 | { | ||
53 | return $this->container->getParameter('database_table_prefix') . $tableName; | ||
54 | } | ||
55 | } | ||
diff --git a/app/DoctrineMigrations/Version20171120163128.php b/app/DoctrineMigrations/Version20171120163128.php new file mode 100644 index 00000000..fc3d4c37 --- /dev/null +++ b/app/DoctrineMigrations/Version20171120163128.php | |||
@@ -0,0 +1,52 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Application\Migrations; | ||
4 | |||
5 | use Doctrine\DBAL\Migrations\AbstractMigration; | ||
6 | use Doctrine\DBAL\Schema\Schema; | ||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | ||
9 | |||
10 | /** | ||
11 | * Add store_article_headers in craue_config_setting. | ||
12 | */ | ||
13 | class Version20171120163128 extends AbstractMigration implements ContainerAwareInterface | ||
14 | { | ||
15 | /** | ||
16 | * @var ContainerInterface | ||
17 | */ | ||
18 | private $container; | ||
19 | |||
20 | public function setContainer(ContainerInterface $container = null) | ||
21 | { | ||
22 | $this->container = $container; | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * @param Schema $schema | ||
27 | */ | ||
28 | public function up(Schema $schema) | ||
29 | { | ||
30 | $storeArticleHeaders = $this->container | ||
31 | ->get('doctrine.orm.default_entity_manager') | ||
32 | ->getConnection() | ||
33 | ->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers'"); | ||
34 | |||
35 | $this->skipIf(false !== $storeArticleHeaders, 'It seems that you already played this migration.'); | ||
36 | |||
37 | $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('store_article_headers', '0', 'entry')"); | ||
38 | } | ||
39 | |||
40 | /** | ||
41 | * @param Schema $schema | ||
42 | */ | ||
43 | public function down(Schema $schema) | ||
44 | { | ||
45 | $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers';"); | ||
46 | } | ||
47 | |||
48 | private function getTable($tableName) | ||
49 | { | ||
50 | return $this->container->getParameter('database_table_prefix') . $tableName; | ||
51 | } | ||
52 | } | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml index 5475e571..c3fd843f 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml | |||
@@ -12,6 +12,8 @@ export_xml: Aktiver eksport til XML | |||
12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously | 12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously |
13 | # import_with_redis: Enable Redis to import data asynchronously | 13 | # import_with_redis: Enable Redis to import data asynchronously |
14 | shaarli_url: Shaarli-URL, hvis tjenesten er aktiv | 14 | shaarli_url: Shaarli-URL, hvis tjenesten er aktiv |
15 | scuttle_url: Scuttle-URL, hvis tjenesten er aktiv | ||
16 | unmark_url: Unmark-URL, hvis tjenesten er aktiv | ||
15 | share_diaspora: Aktiver deling til Diaspora | 17 | share_diaspora: Aktiver deling til Diaspora |
16 | share_mail: Aktiver deling med email | 18 | share_mail: Aktiver deling med email |
17 | share_shaarli: Aktiver deling gennem Shaarli | 19 | share_shaarli: Aktiver deling gennem Shaarli |
@@ -34,3 +36,4 @@ demo_mode_username: "Demobruger" | |||
34 | # download_images_enabled: Download images locally | 36 | # download_images_enabled: Download images locally |
35 | # restricted_access: Enable authentication for websites with paywall | 37 | # restricted_access: Enable authentication for websites with paywall |
36 | # api_user_registration: Enable user to be registered using the API | 38 | # api_user_registration: Enable user to be registered using the API |
39 | # store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml index a066c8e3..37da383e 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml | |||
@@ -12,6 +12,8 @@ export_xml: 'XML-Export aktivieren' | |||
12 | import_with_rabbitmq: 'Aktiviere RabbitMQ, um Artikel asynchron zu importieren' | 12 | import_with_rabbitmq: 'Aktiviere RabbitMQ, um Artikel asynchron zu importieren' |
13 | import_with_redis: 'Aktiviere Redis, um Artikel asynchron zu importieren' | 13 | import_with_redis: 'Aktiviere Redis, um Artikel asynchron zu importieren' |
14 | shaarli_url: 'Shaarli-URL, sofern der Service aktiviert ist' | 14 | shaarli_url: 'Shaarli-URL, sofern der Service aktiviert ist' |
15 | scuttle_url: 'Scuttle-URL, sofern der Service aktiviert ist' | ||
16 | unmark_url: 'Unmark-URL, sofern der Service aktiviert ist' | ||
15 | share_diaspora: 'Teilen zu Diaspora aktiveren' | 17 | share_diaspora: 'Teilen zu Diaspora aktiveren' |
16 | share_mail: 'Teilen via E-Mail aktiveren' | 18 | share_mail: 'Teilen via E-Mail aktiveren' |
17 | share_shaarli: 'Teilen zu Shaarli aktiveren' | 19 | share_shaarli: 'Teilen zu Shaarli aktiveren' |
@@ -34,3 +36,4 @@ share_public: 'Erlaube eine öffentliche URL für Einträge' | |||
34 | download_images_enabled: 'Bilder lokal herunterladen' | 36 | download_images_enabled: 'Bilder lokal herunterladen' |
35 | restricted_access: 'Authentifizierung für Webseiten mit Paywall aktivieren' | 37 | restricted_access: 'Authentifizierung für Webseiten mit Paywall aktivieren' |
36 | api_user_registration: 'Registrierung eines Benutzers über die API ermöglichen' | 38 | api_user_registration: 'Registrierung eines Benutzers über die API ermöglichen' |
39 | # store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index 1e4f4668..0a89ce2c 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml | |||
@@ -1,7 +1,7 @@ | |||
1 | settings_changed: Configuration updated | 1 | settings_changed: Configuration updated |
2 | download_pictures: Download pictures on your server | 2 | download_pictures: Download pictures on your server |
3 | carrot: Enable share to Carrot | 3 | carrot: Enable share to Carrot |
4 | diaspora_url: Diaspora URL, if the service is enabled | 4 | diaspora_url: diaspora* URL, if the service is enabled |
5 | export_epub: Enable ePub export | 5 | export_epub: Enable ePub export |
6 | export_mobi: Enable .mobi export | 6 | export_mobi: Enable .mobi export |
7 | export_pdf: Enable PDF export | 7 | export_pdf: Enable PDF export |
@@ -12,12 +12,14 @@ export_xml: Enable XML export | |||
12 | import_with_rabbitmq: Enable RabbitMQ to import data asynchronously | 12 | import_with_rabbitmq: Enable RabbitMQ to import data asynchronously |
13 | import_with_redis: Enable Redis to import data asynchronously | 13 | import_with_redis: Enable Redis to import data asynchronously |
14 | shaarli_url: Shaarli URL, if the service is enabled | 14 | shaarli_url: Shaarli URL, if the service is enabled |
15 | share_diaspora: Enable share to Diaspora | 15 | scuttle_url: Scuttle URL, if the service is enabled |
16 | share_mail: Enable share by email | 16 | unmark_url: Unmark URL, if the service is enabled |
17 | share_shaarli: Enable share to Shaarli | 17 | share_diaspora: Enable share to diaspora* |
18 | share_scuttle: Enable share to Scuttle | 18 | share_mail: Enable share by e-mail |
19 | share_twitter: Enable share to Twitter | 19 | share_shaarli: Enable sharing to Shaarli |
20 | share_unmark: Enable share to Unmark.it | 20 | share_scuttle: Enable sharing to Scuttle |
21 | share_twitter: Enable sharing to Twitter | ||
22 | share_unmark: Enable sharing to Unmark.it | ||
21 | show_printlink: Display a link to print content | 23 | show_printlink: Display a link to print content |
22 | wallabag_support_url: Support URL for wallabag | 24 | wallabag_support_url: Support URL for wallabag |
23 | entry: "article" | 25 | entry: "article" |
@@ -28,9 +30,10 @@ modify_settings: "apply" | |||
28 | piwik_host: Host of your website in Piwik (without http:// ou https://) | 30 | piwik_host: Host of your website in Piwik (without http:// ou https://) |
29 | piwik_site_id: ID of your website in Piwik | 31 | piwik_site_id: ID of your website in Piwik |
30 | piwik_enabled: Enable Piwik | 32 | piwik_enabled: Enable Piwik |
31 | demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" | 33 | demo_mode_enabled: "Enable demo mode? (Only used for the public wallabag demo)" |
32 | demo_mode_username: "Demo user" | 34 | demo_mode_username: "Demo user" |
33 | share_public: Allow public url for entries | 35 | share_public: Allow public URL for entries |
34 | download_images_enabled: Download images locally | 36 | download_images_enabled: Download images locally |
35 | restricted_access: Enable authentication for websites with paywall | 37 | restricted_access: Enable authentication for paywalled websites |
36 | api_user_registration: Enable user to be registered using the API | 38 | api_user_registration: Enable user to be registered using the API |
39 | store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml index 46ed4040..db5858d6 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml | |||
@@ -12,6 +12,8 @@ export_xml: Activar exportación a XML | |||
12 | import_with_rabbitmq: Activar RabbitMQ para importar datos de forma asíncrona | 12 | import_with_rabbitmq: Activar RabbitMQ para importar datos de forma asíncrona |
13 | import_with_redis: Activar Redis para importar datos de forma asíncrona | 13 | import_with_redis: Activar Redis para importar datos de forma asíncrona |
14 | shaarli_url: URL de Shaarli, si el servicio está activado | 14 | shaarli_url: URL de Shaarli, si el servicio está activado |
15 | scuttle_url: URL de Scuttle, si el servicio está activado | ||
16 | unmark_url: URL de Unmark, si el servicio está activado | ||
15 | share_diaspora: Activar compartir con Diaspora | 17 | share_diaspora: Activar compartir con Diaspora |
16 | share_mail: Activar compartir con Email | 18 | share_mail: Activar compartir con Email |
17 | share_shaarli: Activar compartir con Shaarli | 19 | share_shaarli: Activar compartir con Shaarli |
@@ -34,3 +36,4 @@ share_public: Permitir URL pública para los artículos | |||
34 | download_images_enabled: Descargar imágenes localmente | 36 | download_images_enabled: Descargar imágenes localmente |
35 | restricted_access: Activar autenticación para websites con paywall | 37 | restricted_access: Activar autenticación para websites con paywall |
36 | # api_user_registration: Enable user to be registered using the API | 38 | # api_user_registration: Enable user to be registered using the API |
39 | # store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml index f8da4acf..11cc601b 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml | |||
@@ -12,6 +12,8 @@ export_xml: فعالسازی برونسپاری به XML | |||
12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously | 12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously |
13 | # import_with_redis: Enable Redis to import data asynchronously | 13 | # import_with_redis: Enable Redis to import data asynchronously |
14 | shaarli_url: نشانی Shaarli، اگر فعال بود | 14 | shaarli_url: نشانی Shaarli، اگر فعال بود |
15 | scuttle_url: نشانی Scuttle، اگر فعال بود | ||
16 | unmark_url: نشانی Unmark، اگر فعال بود | ||
15 | share_diaspora: فعالسازی همرسانی به Diaspora | 17 | share_diaspora: فعالسازی همرسانی به Diaspora |
16 | share_mail: فعالسازی همرسانی با ایمیل | 18 | share_mail: فعالسازی همرسانی با ایمیل |
17 | share_shaarli: فعالسازی همرسانی به Shaarli | 19 | share_shaarli: فعالسازی همرسانی به Shaarli |
@@ -34,3 +36,4 @@ modify_settings: "اعمال" | |||
34 | # download_images_enabled: Download images locally | 36 | # download_images_enabled: Download images locally |
35 | # restricted_access: Enable authentication for websites with paywall | 37 | # restricted_access: Enable authentication for websites with paywall |
36 | # api_user_registration: Enable user to be registered using the API | 38 | # api_user_registration: Enable user to be registered using the API |
39 | # store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index a79409b4..f23b5bf9 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml | |||
@@ -12,6 +12,8 @@ export_xml: Activer l'export XML | |||
12 | import_with_rabbitmq: Activer RabbitMQ pour gérer les imports de façon asynchrone | 12 | import_with_rabbitmq: Activer RabbitMQ pour gérer les imports de façon asynchrone |
13 | import_with_redis: Activer Redis pour gérer les imports de façon asynchrone | 13 | import_with_redis: Activer Redis pour gérer les imports de façon asynchrone |
14 | shaarli_url: URL de Shaarli, si le service Shaarli est activé | 14 | shaarli_url: URL de Shaarli, si le service Shaarli est activé |
15 | scuttle_url: URL de Scuttle, si le service Scuttle est activé | ||
16 | unmark_url: URL de Unmark, si le service Unmark est activé | ||
15 | share_diaspora: Activer le partage vers Diaspora | 17 | share_diaspora: Activer le partage vers Diaspora |
16 | share_mail: Activer le partage par email | 18 | share_mail: Activer le partage par email |
17 | share_shaarli: Activer le partage vers Shaarli | 19 | share_shaarli: Activer le partage vers Shaarli |
@@ -34,3 +36,4 @@ share_public: Autoriser une URL publique pour les articles | |||
34 | download_images_enabled: Télécharger les images en local | 36 | download_images_enabled: Télécharger les images en local |
35 | restricted_access: Activer l'authentification pour les articles derrière un paywall | 37 | restricted_access: Activer l'authentification pour les articles derrière un paywall |
36 | api_user_registration: Activer la création de compte depuis l'API | 38 | api_user_registration: Activer la création de compte depuis l'API |
39 | store_article_headers: Activer le stockage des en-têtes HTTP de chaque article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml index dd4def4b..ade6f7da 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml | |||
@@ -12,6 +12,8 @@ export_xml: Abilita esportazione XML | |||
12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously | 12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously |
13 | # import_with_redis: Enable Redis to import data asynchronously | 13 | # import_with_redis: Enable Redis to import data asynchronously |
14 | shaarli_url: Shaarli URL, se il servizio è abilitato | 14 | shaarli_url: Shaarli URL, se il servizio è abilitato |
15 | scuttle_url: Scuttle URL, se il servizio è abilitato | ||
16 | unmark_url: Unmark URL, se il servizio è abilitato | ||
15 | share_diaspora: Abilita la condivisione con Diaspora | 17 | share_diaspora: Abilita la condivisione con Diaspora |
16 | share_mail: Abilita la condivisione per email | 18 | share_mail: Abilita la condivisione per email |
17 | share_shaarli: Abilita la condivisione con Shaarli | 19 | share_shaarli: Abilita la condivisione con Shaarli |
@@ -34,3 +36,4 @@ demo_mode_username: "Utente Demo" | |||
34 | # download_images_enabled: Download images locally | 36 | # download_images_enabled: Download images locally |
35 | # restricted_access: Enable authentication for websites with paywall | 37 | # restricted_access: Enable authentication for websites with paywall |
36 | api_user_registration: Abilita la registrazione dell'utente attraverso l'API | 38 | api_user_registration: Abilita la registrazione dell'utente attraverso l'API |
39 | # store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index fb163ce7..99986642 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml | |||
@@ -12,6 +12,8 @@ export_xml: Activar l'expòrt XML | |||
12 | import_with_rabbitmq: Activar RabbitMQ per importar de donadas de manièra asincròna | 12 | import_with_rabbitmq: Activar RabbitMQ per importar de donadas de manièra asincròna |
13 | import_with_redis: Activar Redis per importar de donadas de manièra asincròna | 13 | import_with_redis: Activar Redis per importar de donadas de manièra asincròna |
14 | shaarli_url: URL de Shaarli, se lo servici Shaarli es activat | 14 | shaarli_url: URL de Shaarli, se lo servici Shaarli es activat |
15 | scuttle_url: URL de Scuttle, se lo servici Scuttle es activat | ||
16 | unmark_url: URL de Unmark, se lo servici Scuttle es activat | ||
15 | share_diaspora: Activar lo partatge cap a Diaspora* | 17 | share_diaspora: Activar lo partatge cap a Diaspora* |
16 | share_mail: Activar lo partatge per corrièl | 18 | share_mail: Activar lo partatge per corrièl |
17 | share_shaarli: Activar lo partatge cap a Shaarli | 19 | share_shaarli: Activar lo partatge cap a Shaarli |
@@ -34,3 +36,4 @@ share_public: Autorizar una URL publica pels articles | |||
34 | download_images_enabled: Telecargar los imatges en local | 36 | download_images_enabled: Telecargar los imatges en local |
35 | restricted_access: Activar l'autenticacion pels sites amb peatge | 37 | restricted_access: Activar l'autenticacion pels sites amb peatge |
36 | api_user_registration: Autorizar los utilizaires a se marcar amb l'API | 38 | api_user_registration: Autorizar los utilizaires a se marcar amb l'API |
39 | # store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml index 04ad4fd3..8b8f2ebd 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml | |||
@@ -12,6 +12,7 @@ export_xml: Włącz eksport do XML | |||
12 | import_with_rabbitmq: Włącz RabbitMQ dla asynchronicznego importu danych | 12 | import_with_rabbitmq: Włącz RabbitMQ dla asynchronicznego importu danych |
13 | import_with_redis: Włącz Redis dla asynchronicznego importu danych | 13 | import_with_redis: Włącz Redis dla asynchronicznego importu danych |
14 | shaarli_url: Adress URL Shaarli, jeżeli usługa jest włączona | 14 | shaarli_url: Adress URL Shaarli, jeżeli usługa jest włączona |
15 | scuttle_url: Adress URL Scuttle, jeżeli usługa jest włączona | ||
15 | share_diaspora: Włącz udostępnianie dla Diaspora | 16 | share_diaspora: Włącz udostępnianie dla Diaspora |
16 | share_mail: Włącz udostępnianie przez email | 17 | share_mail: Włącz udostępnianie przez email |
17 | share_shaarli: Włącz udostępnianie dla Shaarli | 18 | share_shaarli: Włącz udostępnianie dla Shaarli |
@@ -34,3 +35,4 @@ share_public: Zezwalaj na publiczny adres url dla wpisow | |||
34 | download_images_enabled: Pobierz obrazy lokalnie | 35 | download_images_enabled: Pobierz obrazy lokalnie |
35 | restricted_access: Włącz autoryzację dla stron z paywallem | 36 | restricted_access: Włącz autoryzację dla stron z paywallem |
36 | api_user_registration: Włącz rejestrację użytkownika przy użyciu API | 37 | api_user_registration: Włącz rejestrację użytkownika przy użyciu API |
38 | # store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml index 77e22b37..76cb0174 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml | |||
@@ -12,6 +12,8 @@ export_xml: Habilita exportação para XML | |||
12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously | 12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously |
13 | # import_with_redis: Enable Redis to import data asynchronously | 13 | # import_with_redis: Enable Redis to import data asynchronously |
14 | shaarli_url: URL Shaarli, se o serviço está habilitado | 14 | shaarli_url: URL Shaarli, se o serviço está habilitado |
15 | scuttle_url: URL Scuttle, se o serviço está habilitado | ||
16 | unmark_url: URL Unmark, se o serviço está habilitado | ||
15 | share_diaspora: Habilitar compartilhamento para o Diaspora | 17 | share_diaspora: Habilitar compartilhamento para o Diaspora |
16 | share_mail: Habilitar compartilhamento por e-mail | 18 | share_mail: Habilitar compartilhamento por e-mail |
17 | share_shaarli: Habilitar compartilhamento para o Shaarli | 19 | share_shaarli: Habilitar compartilhamento para o Shaarli |
@@ -34,3 +36,4 @@ demo_mode_username: "Usuário demo" | |||
34 | # download_images_enabled: Download images locally | 36 | # download_images_enabled: Download images locally |
35 | # restricted_access: Enable authentication for websites with paywall | 37 | # restricted_access: Enable authentication for websites with paywall |
36 | # api_user_registration: Enable user to be registered using the API | 38 | # api_user_registration: Enable user to be registered using the API |
39 | # store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml index 1b4bfb5b..8300cec8 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml | |||
@@ -12,6 +12,8 @@ export_xml: Permite exportare XML | |||
12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously | 12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously |
13 | # import_with_redis: Enable Redis to import data asynchronously | 13 | # import_with_redis: Enable Redis to import data asynchronously |
14 | shaarli_url: Shaarli URL, dacă serviciul este permis | 14 | shaarli_url: Shaarli URL, dacă serviciul este permis |
15 | scuttle_url: Scuttle URL, dacă serviciul este permis | ||
16 | unmark_url: Unmark URL, dacă serviciul este permis | ||
15 | share_diaspora: Permite share către Diaspora | 17 | share_diaspora: Permite share către Diaspora |
16 | share_mail: Permite share prin email | 18 | share_mail: Permite share prin email |
17 | share_shaarli: Permite share către Shaarli | 19 | share_shaarli: Permite share către Shaarli |
@@ -34,3 +36,4 @@ modify_settings: "aplică" | |||
34 | # download_images_enabled: Download images locally | 36 | # download_images_enabled: Download images locally |
35 | # restricted_access: Enable authentication for websites with paywall | 37 | # restricted_access: Enable authentication for websites with paywall |
36 | # api_user_registration: Enable user to be registered using the API | 38 | # api_user_registration: Enable user to be registered using the API |
39 | # store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml index 37b4bbfd..8fed84ae 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml | |||
@@ -12,6 +12,8 @@ export_xml: "Включить XML экспорт" | |||
12 | import_with_rabbitmq: "Включить RabbitMQ для импорта данных(асинхронно)" | 12 | import_with_rabbitmq: "Включить RabbitMQ для импорта данных(асинхронно)" |
13 | import_with_redis: "Включить Redis для импорта данных(асинхронно)" | 13 | import_with_redis: "Включить Redis для импорта данных(асинхронно)" |
14 | shaarli_url: "Shaarli URL, если сервис включен" | 14 | shaarli_url: "Shaarli URL, если сервис включен" |
15 | scuttle_url: "Scuttle URL, если сервис включен" | ||
16 | unmark_url: "Unmark URL, если сервис включен" | ||
15 | share_diaspora: "Включить возможность поделиться в соц.сети Diaspora" | 17 | share_diaspora: "Включить возможность поделиться в соц.сети Diaspora" |
16 | share_mail: "Включить возможность поделиться по email" | 18 | share_mail: "Включить возможность поделиться по email" |
17 | share_shaarli: "Включить возможность поделиться в Shaarli" | 19 | share_shaarli: "Включить возможность поделиться в Shaarli" |
@@ -33,3 +35,5 @@ demo_mode_username: "Демо пользователь" | |||
33 | share_public: "Разрешить публичные ссылки на записи" | 35 | share_public: "Разрешить публичные ссылки на записи" |
34 | download_images_enabled: "Скачивать изображения локально" | 36 | download_images_enabled: "Скачивать изображения локально" |
35 | restricted_access: "Включить авторизацию на сайте с помощью paywall" | 37 | restricted_access: "Включить авторизацию на сайте с помощью paywall" |
38 | # api_user_registration: Enable user to be registered using the API | ||
39 | # store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml index 1579366d..b992ccc2 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml | |||
@@ -12,6 +12,8 @@ | |||
12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously | 12 | # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously |
13 | # import_with_redis: Enable Redis to import data asynchronously | 13 | # import_with_redis: Enable Redis to import data asynchronously |
14 | # shaarli_url: Shaarli URL, if the service is enabled | 14 | # shaarli_url: Shaarli URL, if the service is enabled |
15 | # scuttle_url: Scuttle URL, if the service is enabled | ||
16 | # unmark_url: Unmark URL, if the service is enabled | ||
15 | # share_diaspora: Enable share to Diaspora | 17 | # share_diaspora: Enable share to Diaspora |
16 | # share_mail: Enable share by email | 18 | # share_mail: Enable share by email |
17 | # share_shaarli: Enable share to Shaarli | 19 | # share_shaarli: Enable share to Shaarli |
@@ -35,3 +37,4 @@ | |||
35 | # download_images_enabled: Download images locally | 37 | # download_images_enabled: Download images locally |
36 | # restricted_access: Enable authentication for websites with paywall | 38 | # restricted_access: Enable authentication for websites with paywall |
37 | # api_user_registration: Enable user to be registered using the API | 39 | # api_user_registration: Enable user to be registered using the API |
40 | # store_article_headers: Enable if wallabag stores HTTP headers for each article | ||
diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml index 19401aa7..ec6aae63 100644 --- a/app/config/wallabag.yml +++ b/app/config/wallabag.yml | |||
@@ -154,6 +154,10 @@ wallabag_core: | |||
154 | name: api_user_registration | 154 | name: api_user_registration |
155 | value: 0 | 155 | value: 0 |
156 | section: api | 156 | section: api |
157 | - | ||
158 | name: store_article_headers | ||
159 | value: 0 | ||
160 | section: entry | ||
157 | 161 | ||
158 | wallabag_user: | 162 | wallabag_user: |
159 | registration_enabled: "%fosuser_registration%" | 163 | registration_enabled: "%fosuser_registration%" |
diff --git a/build.xml b/build.xml deleted file mode 100644 index b9fe6136..00000000 --- a/build.xml +++ /dev/null | |||
@@ -1,136 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <project name="wallabag" default="build"> | ||
3 | <target name="build" depends="clean,prepare,phpunit"/> | ||
4 | <target name="prepare-mysql" depends="clean,prepare_mysql"/> | ||
5 | <target name="prepare-sqlite" depends="clean,prepare_sqlite"/> | ||
6 | <target name="prepare-pgsql" depends="clean,prepare_pgsql"/> | ||
7 | |||
8 | <target name="clean" description="Cleanup build artifacts"> | ||
9 | <delete dir="${basedir}/var/cache"/> | ||
10 | </target> | ||
11 | |||
12 | <target name="prepare" description="Prepare for build"> | ||
13 | <exec executable="php"> | ||
14 | <arg value="${basedir}/bin/console"/> | ||
15 | <arg value="doctrine:database:drop"/> | ||
16 | <arg value="--force"/> | ||
17 | <arg value="--env=test"/> | ||
18 | </exec> | ||
19 | <exec executable="php"> | ||
20 | <arg value="${basedir}/bin/console"/> | ||
21 | <arg value="doctrine:database:create"/> | ||
22 | <arg value="--env=test"/> | ||
23 | </exec> | ||
24 | <exec executable="php"> | ||
25 | <arg value="${basedir}/bin/console"/> | ||
26 | <arg value="doctrine:schema:create"/> | ||
27 | <arg value="--env=test"/> | ||
28 | </exec> | ||
29 | <exec executable="php"> | ||
30 | <arg value="${basedir}/bin/console"/> | ||
31 | <arg value="doctrine:fixtures:load"/> | ||
32 | <arg value="--no-interaction"/> | ||
33 | <arg value="--env=test"/> | ||
34 | </exec> | ||
35 | </target> | ||
36 | |||
37 | <target name="prepare_mysql" description="Run test for MySQL"> | ||
38 | <delete dir="${basedir}/app/config/parameters.yml"/> | ||
39 | <exec executable="cp"> | ||
40 | <arg value="${basedir}/app/config/tests/parameters_test.mysql.yml"/> | ||
41 | <arg value="${basedir}/app/config/parameters_test.yml"/> | ||
42 | </exec> | ||
43 | <exec executable="php"> | ||
44 | <arg value="${basedir}/bin/console"/> | ||
45 | <arg value="cache:clear"/> | ||
46 | <arg value="--env=test"/> | ||
47 | </exec> | ||
48 | <exec executable="php"> | ||
49 | <arg value="${basedir}/bin/console"/> | ||
50 | <arg value="doctrine:database:drop"/> | ||
51 | <arg value="--force"/> | ||
52 | <arg value="--env=test"/> | ||
53 | </exec> | ||
54 | <exec executable="php"> | ||
55 | <arg value="${basedir}/bin/console"/> | ||
56 | <arg value="doctrine:database:create"/> | ||
57 | <arg value="--env=test"/> | ||
58 | </exec> | ||
59 | <exec executable="php"> | ||
60 | <arg value="${basedir}/bin/console"/> | ||
61 | <arg value="doctrine:database:import"/> | ||
62 | <arg value="data/sql/mysql_base.sql"/> | ||
63 | <arg value="--env=test"/> | ||
64 | </exec> | ||
65 | </target> | ||
66 | |||
67 | <target name="prepare_sqlite" description="Run test for SQLite"> | ||
68 | <delete dir="${basedir}/app/config/parameters.yml"/> | ||
69 | <exec executable="cp"> | ||
70 | <arg value="${basedir}/app/config/tests/parameters_test.sqlite.yml"/> | ||
71 | <arg value="${basedir}/app/config/parameters_test.yml"/> | ||
72 | </exec> | ||
73 | <exec executable="php"> | ||
74 | <arg value="${basedir}/bin/console"/> | ||
75 | <arg value="cache:clear"/> | ||
76 | <arg value="--env=test"/> | ||
77 | </exec> | ||
78 | <exec executable="php"> | ||
79 | <arg value="${basedir}/bin/console"/> | ||
80 | <arg value="doctrine:database:drop"/> | ||
81 | <arg value="--force"/> | ||
82 | <arg value="--env=test"/> | ||
83 | </exec> | ||
84 | <exec executable="php"> | ||
85 | <arg value="${basedir}/bin/console"/> | ||
86 | <arg value="doctrine:database:create"/> | ||
87 | <arg value="--env=test"/> | ||
88 | </exec> | ||
89 | <exec executable="php"> | ||
90 | <arg value="${basedir}/bin/console"/> | ||
91 | <arg value="doctrine:schema:create"/> | ||
92 | <arg value="--env=test"/> | ||
93 | </exec> | ||
94 | </target> | ||
95 | |||
96 | <target name="prepare_pgsql" description="Run test for PostgreSQL"> | ||
97 | <delete dir="${basedir}/app/config/parameters.yml"/> | ||
98 | <exec executable="cp"> | ||
99 | <arg value="${basedir}/app/config/tests/parameters_test.pgsql.yml"/> | ||
100 | <arg value="${basedir}/app/config/parameters_test.yml"/> | ||
101 | </exec> | ||
102 | <exec executable="php"> | ||
103 | <arg value="${basedir}/bin/console"/> | ||
104 | <arg value="cache:clear"/> | ||
105 | <arg value="--env=test"/> | ||
106 | </exec> | ||
107 | <exec executable="php"> | ||
108 | <arg value="${basedir}/bin/console"/> | ||
109 | <arg value="doctrine:database:drop"/> | ||
110 | <arg value="--force"/> | ||
111 | <arg value="--env=test"/> | ||
112 | </exec> | ||
113 | <exec executable="php"> | ||
114 | <arg value="${basedir}/bin/console"/> | ||
115 | <arg value="doctrine:database:create"/> | ||
116 | <arg value="--env=test"/> | ||
117 | </exec> | ||
118 | <exec executable="psql"> | ||
119 | <arg value="-h"/> | ||
120 | <arg value="localhost"/> | ||
121 | <arg value="-d"/> | ||
122 | <arg value="wallabag_test"/> | ||
123 | <arg value="-U"/> | ||
124 | <arg value="travis"/> | ||
125 | <arg value="-f"/> | ||
126 | <arg value="data/sql/pgsql_base.sql"/> | ||
127 | </exec> | ||
128 | </target> | ||
129 | |||
130 | <target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage"> | ||
131 | <exec executable="phpunit" failonerror="true"> | ||
132 | <arg value="--coverage-html"/> | ||
133 | <arg value="build/coverage"/> | ||
134 | </exec> | ||
135 | </target> | ||
136 | </project> | ||
diff --git a/composer.json b/composer.json index d1f970c7..23c7cdc2 100644 --- a/composer.json +++ b/composer.json | |||
@@ -43,46 +43,46 @@ | |||
43 | "ext-iconv": "*", | 43 | "ext-iconv": "*", |
44 | "ext-tokenizer": "*", | 44 | "ext-tokenizer": "*", |
45 | "ext-pdo": "*", | 45 | "ext-pdo": "*", |
46 | "symfony/symfony": "3.3.*", | 46 | "symfony/symfony": "~3.3.13", |
47 | "doctrine/orm": "^2.5", | 47 | "doctrine/orm": "^2.5.12", |
48 | "doctrine/doctrine-bundle": "^1.6", | 48 | "doctrine/doctrine-bundle": "^1.8.0", |
49 | "doctrine/doctrine-cache-bundle": "^1.2", | 49 | "doctrine/doctrine-cache-bundle": "^1.3.2", |
50 | "twig/extensions": "~1.0", | 50 | "twig/extensions": "^1.5.1", |
51 | "symfony/swiftmailer-bundle": "^2.3", | 51 | "symfony/swiftmailer-bundle": "^2.6.7", |
52 | "symfony/monolog-bundle": "^3.0", | 52 | "symfony/monolog-bundle": "^3.1.2", |
53 | "sensio/distribution-bundle": "^5.0", | 53 | "sensio/distribution-bundle": "^5.0.21", |
54 | "sensio/framework-extra-bundle": "^3.0", | 54 | "sensio/framework-extra-bundle": "^3.0.28", |
55 | "incenteev/composer-parameter-handler": "^2.0", | 55 | "incenteev/composer-parameter-handler": "^2.1.2", |
56 | "nelmio/cors-bundle": "~1.4", | 56 | "nelmio/cors-bundle": "~1.5", |
57 | "friendsofsymfony/rest-bundle": "~2.1", | 57 | "friendsofsymfony/rest-bundle": "~2.1", |
58 | "jms/serializer-bundle": "~2.2", | 58 | "jms/serializer-bundle": "~2.2", |
59 | "nelmio/api-doc-bundle": "~2.7", | 59 | "nelmio/api-doc-bundle": "^2.13.2", |
60 | "mgargano/simplehtmldom": "~1.5", | 60 | "mgargano/simplehtmldom": "~1.5", |
61 | "wallabag/tcpdf": "^6.2", | 61 | "wallabag/tcpdf": "^6.2.15", |
62 | "simplepie/simplepie": "~1.5", | 62 | "simplepie/simplepie": "~1.5", |
63 | "willdurand/hateoas-bundle": "~1.0", | 63 | "willdurand/hateoas-bundle": "~1.3", |
64 | "liip/theme-bundle": "~1.1", | 64 | "liip/theme-bundle": "^1.4.6", |
65 | "lexik/form-filter-bundle": "~5.0", | 65 | "lexik/form-filter-bundle": "^5.0.4", |
66 | "j0k3r/graby": "^1.0", | 66 | "j0k3r/graby": "^1.0", |
67 | "friendsofsymfony/user-bundle": "^2.0", | 67 | "friendsofsymfony/user-bundle": "^2.0.1", |
68 | "friendsofsymfony/oauth-server-bundle": "^1.5", | 68 | "friendsofsymfony/oauth-server-bundle": "^1.5.2", |
69 | "stof/doctrine-extensions-bundle": "^1.2", | 69 | "stof/doctrine-extensions-bundle": "^1.2", |
70 | "scheb/two-factor-bundle": "~2.0", | 70 | "scheb/two-factor-bundle": "^2.14.0", |
71 | "grandt/phpepub": "~4.0", | 71 | "grandt/phpepub": "^4.0.7", |
72 | "wallabag/php-mobi": "~1.0.0", | 72 | "wallabag/php-mobi": "~1.0.0", |
73 | "kphoen/rulerz-bundle": "~0.13", | 73 | "kphoen/rulerz-bundle": "~0.13", |
74 | "guzzlehttp/guzzle": "^5.3.1", | 74 | "guzzlehttp/guzzle": "^5.3.1", |
75 | "doctrine/doctrine-migrations-bundle": "^1.0", | 75 | "doctrine/doctrine-migrations-bundle": "^1.3", |
76 | "paragonie/random_compat": "~2.0", | 76 | "paragonie/random_compat": "^2.0.11", |
77 | "craue/config-bundle": "~2.0", | 77 | "craue/config-bundle": "~2.0", |
78 | "mnapoli/piwik-twig-extension": "^1.0", | 78 | "mnapoli/piwik-twig-extension": "^1.0", |
79 | "ocramius/proxy-manager": "1.*", | 79 | "ocramius/proxy-manager": "^1.0.2", |
80 | "white-october/pagerfanta-bundle": "^1.0", | 80 | "white-october/pagerfanta-bundle": "^1.1.0", |
81 | "php-amqplib/rabbitmq-bundle": "^1.8", | 81 | "php-amqplib/rabbitmq-bundle": "^1.14", |
82 | "predis/predis": "^1.0", | 82 | "predis/predis": "^1.1.1", |
83 | "javibravo/simpleue": "^1.0", | 83 | "javibravo/simpleue": "^2.0", |
84 | "symfony/dom-crawler": "^3.1", | 84 | "symfony/dom-crawler": "^3.3.13", |
85 | "friendsofsymfony/jsrouting-bundle": "^1.6", | 85 | "friendsofsymfony/jsrouting-bundle": "^1.6.3", |
86 | "bdunogier/guzzle-site-authenticator": "^1.0.0@dev", | 86 | "bdunogier/guzzle-site-authenticator": "^1.0.0@dev", |
87 | "defuse/php-encryption": "^2.1", | 87 | "defuse/php-encryption": "^2.1", |
88 | "html2text/html2text": "^4.1" | 88 | "html2text/html2text": "^4.1" |
diff --git a/data/sql/mysql_base.sql b/data/sql/mysql_base.sql deleted file mode 100644 index 13fa6302..00000000 --- a/data/sql/mysql_base.sql +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | CREATE TABLE wallabag_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; | ||
2 | CREATE TABLE `wallabag_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; | ||
3 | CREATE TABLE wallabag_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; | ||
4 | CREATE TABLE `wallabag_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; | ||
5 | CREATE TABLE `wallabag_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; | ||
6 | CREATE TABLE `wallabag_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; | ||
7 | CREATE TABLE wallabag_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; | ||
8 | CREATE TABLE wallabag_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; | ||
9 | CREATE TABLE wallabag_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; | ||
10 | CREATE TABLE wallabag_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; | ||
11 | CREATE TABLE `wallabag_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; | ||
12 | CREATE TABLE wallabag_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; | ||
13 | ALTER TABLE `wallabag_entry` ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
14 | ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id); | ||
15 | ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES `wallabag_tag` (id); | ||
16 | ALTER TABLE `wallabag_config` ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
17 | ALTER TABLE `wallabag_tagging_rule` ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES `wallabag_config` (id); | ||
18 | ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); | ||
19 | ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
20 | ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); | ||
21 | ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
22 | ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); | ||
23 | ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
24 | ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); | ||
25 | ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id); | ||
diff --git a/data/sql/pgsql_base.sql b/data/sql/pgsql_base.sql deleted file mode 100644 index 6688fe83..00000000 --- a/data/sql/pgsql_base.sql +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name)); | ||
2 | CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name); | ||
3 | CREATE TABLE "wallabag_entry" (id INT NOT NULL, user_id INT DEFAULT NULL, title TEXT DEFAULT NULL, url TEXT DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, mimetype TEXT DEFAULT NULL, language TEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name TEXT DEFAULT NULL, preview_picture TEXT DEFAULT NULL, is_public BOOLEAN DEFAULT 'false', PRIMARY KEY(id)); | ||
4 | CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id); | ||
5 | CREATE TABLE wallabag_entry_tag (entry_id INT NOT NULL, tag_id INT NOT NULL, PRIMARY KEY(entry_id, tag_id)); | ||
6 | CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id); | ||
7 | CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id); | ||
8 | CREATE TABLE "wallabag_config" (id INT 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, PRIMARY KEY(id)); | ||
9 | CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id); | ||
10 | CREATE TABLE "wallabag_tagging_rule" (id INT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags TEXT NOT NULL, PRIMARY KEY(id)); | ||
11 | CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id); | ||
12 | COMMENT ON COLUMN "wallabag_tagging_rule".tags IS '(DC2Type:simple_array)'; | ||
13 | CREATE TABLE "wallabag_tag" (id INT NOT NULL, label TEXT NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id)); | ||
14 | CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug); | ||
15 | CREATE TABLE wallabag_oauth2_clients (id INT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris TEXT NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types TEXT NOT NULL, PRIMARY KEY(id)); | ||
16 | COMMENT ON COLUMN wallabag_oauth2_clients.redirect_uris IS '(DC2Type:array)'; | ||
17 | COMMENT ON COLUMN wallabag_oauth2_clients.allowed_grant_types IS '(DC2Type:array)'; | ||
18 | CREATE TABLE wallabag_oauth2_access_tokens (id INT 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, PRIMARY KEY(id)); | ||
19 | CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token); | ||
20 | CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id); | ||
21 | CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id); | ||
22 | CREATE TABLE wallabag_oauth2_refresh_tokens (id INT 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, PRIMARY KEY(id)); | ||
23 | CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token); | ||
24 | CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id); | ||
25 | CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id); | ||
26 | CREATE TABLE wallabag_oauth2_auth_codes (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri TEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)); | ||
27 | CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token); | ||
28 | CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id); | ||
29 | CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id); | ||
30 | CREATE TABLE "wallabag_user" (id INT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, roles TEXT NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, name TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted TEXT DEFAULT NULL, PRIMARY KEY(id)); | ||
31 | CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical); | ||
32 | CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical); | ||
33 | CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token); | ||
34 | COMMENT ON COLUMN "wallabag_user".roles IS '(DC2Type:array)'; | ||
35 | COMMENT ON COLUMN "wallabag_user".trusted IS '(DC2Type:json_array)'; | ||
36 | CREATE TABLE wallabag_annotation (id INT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text TEXT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, quote VARCHAR(255) NOT NULL, ranges TEXT NOT NULL, PRIMARY KEY(id)); | ||
37 | CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id); | ||
38 | CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id); | ||
39 | COMMENT ON COLUMN wallabag_annotation.ranges IS '(DC2Type:array)'; | ||
40 | CREATE SEQUENCE "entry_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; | ||
41 | CREATE SEQUENCE "config_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; | ||
42 | CREATE SEQUENCE "tagging_rule_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; | ||
43 | CREATE SEQUENCE "tag_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; | ||
44 | CREATE SEQUENCE oauth2_clients_id_seq INCREMENT BY 1 MINVALUE 1 START 1; | ||
45 | CREATE SEQUENCE oauth2_access_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1; | ||
46 | CREATE SEQUENCE oauth2_refresh_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1; | ||
47 | CREATE SEQUENCE oauth2_auth_codes_id_seq INCREMENT BY 1 MINVALUE 1 START 1; | ||
48 | CREATE SEQUENCE "user_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; | ||
49 | CREATE SEQUENCE annotation_id_seq INCREMENT BY 1 MINVALUE 1 START 1; | ||
50 | ALTER TABLE "wallabag_entry" ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
51 | ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
52 | ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
53 | ALTER TABLE "wallabag_config" ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
54 | ALTER TABLE "wallabag_tagging_rule" ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
55 | ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
56 | ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
57 | ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
58 | ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
59 | ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
60 | ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
61 | ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
62 | ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
diff --git a/data/sql/sqlite_base.sql b/data/sql/sqlite_base.sql deleted file mode 100644 index d2780d96..00000000 --- a/data/sql/sqlite_base.sql +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name)); | ||
2 | CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name); | ||
3 | CREATE TABLE "wallabag_tagging_rule" (id INTEGER NOT NULL, config_id INTEGER DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
4 | CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id); | ||
5 | CREATE TABLE "wallabag_tag" (id INTEGER NOT NULL, label CLOB NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id)); | ||
6 | CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug); | ||
7 | CREATE TABLE "wallabag_entry" (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, title CLOB DEFAULT NULL, url CLOB DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL, language CLOB DEFAULT NULL, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL, preview_picture CLOB DEFAULT NULL, is_public BOOLEAN DEFAULT '0', PRIMARY KEY(id), CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
8 | CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id); | ||
9 | CREATE TABLE wallabag_entry_tag (entry_id INTEGER NOT NULL, tag_id INTEGER NOT NULL, PRIMARY KEY(entry_id, tag_id), CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
10 | CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id); | ||
11 | CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id); | ||
12 | CREATE TABLE "wallabag_config" (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INTEGER DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
13 | CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id); | ||
14 | CREATE TABLE wallabag_oauth2_refresh_tokens (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
15 | CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token); | ||
16 | CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id); | ||
17 | CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id); | ||
18 | CREATE TABLE wallabag_oauth2_access_tokens (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
19 | CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token); | ||
20 | CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id); | ||
21 | CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id); | ||
22 | CREATE TABLE wallabag_oauth2_auth_codes (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri CLOB NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
23 | CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token); | ||
24 | CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id); | ||
25 | CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id); | ||
26 | CREATE TABLE wallabag_oauth2_clients (id INTEGER NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris CLOB NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types CLOB NOT NULL, PRIMARY KEY(id)); | ||
27 | CREATE TABLE "wallabag_user" (id INTEGER NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted CLOB DEFAULT NULL, PRIMARY KEY(id)); | ||
28 | CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical); | ||
29 | CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical); | ||
30 | CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token); | ||
31 | CREATE TABLE wallabag_annotation (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, entry_id INTEGER DEFAULT NULL, text CLOB NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); | ||
32 | CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id); | ||
33 | CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id); | ||
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 6f161a08..7d820c7e 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -309,6 +309,7 @@ class EntryRestController extends WallabagRestController | |||
309 | * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, | 309 | * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, |
310 | * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, | 310 | * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, |
311 | * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, | 311 | * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, |
312 | * {"name"="origin_url", "dataType"="string", "required"=false, "format"="http://www.test.com/article.html", "description"="Origin url for the entry (from where you found it)."}, | ||
312 | * } | 313 | * } |
313 | * ) | 314 | * ) |
314 | * | 315 | * |
@@ -368,6 +369,10 @@ class EntryRestController extends WallabagRestController | |||
368 | $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $data['tags']); | 369 | $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $data['tags']); |
369 | } | 370 | } |
370 | 371 | ||
372 | if (!empty($data['origin_url'])) { | ||
373 | $entry->setOriginUrl($data['origin_url']); | ||
374 | } | ||
375 | |||
371 | if (null !== $data['isPublic']) { | 376 | if (null !== $data['isPublic']) { |
372 | if (true === (bool) $data['isPublic'] && null === $entry->getUid()) { | 377 | if (true === (bool) $data['isPublic'] && null === $entry->getUid()) { |
373 | $entry->generateUid(); | 378 | $entry->generateUid(); |
@@ -404,6 +409,7 @@ class EntryRestController extends WallabagRestController | |||
404 | * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, | 409 | * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, |
405 | * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, | 410 | * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, |
406 | * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, | 411 | * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, |
412 | * {"name"="origin_url", "dataType"="string", "required"=false, "format"="http://www.test.com/article.html", "description"="Origin url for the entry (from where you found it)."}, | ||
407 | * } | 413 | * } |
408 | * ) | 414 | * ) |
409 | * | 415 | * |
@@ -480,6 +486,10 @@ class EntryRestController extends WallabagRestController | |||
480 | } | 486 | } |
481 | } | 487 | } |
482 | 488 | ||
489 | if (!empty($data['origin_url'])) { | ||
490 | $entry->setOriginUrl($data['origin_url']); | ||
491 | } | ||
492 | |||
483 | $em = $this->getDoctrine()->getManager(); | 493 | $em = $this->getDoctrine()->getManager(); |
484 | $em->persist($entry); | 494 | $em->persist($entry); |
485 | $em->flush(); | 495 | $em->flush(); |
@@ -778,6 +788,7 @@ class EntryRestController extends WallabagRestController | |||
778 | 'picture' => $request->request->get('preview_picture'), | 788 | 'picture' => $request->request->get('preview_picture'), |
779 | 'publishedAt' => $request->request->get('published_at'), | 789 | 'publishedAt' => $request->request->get('published_at'), |
780 | 'authors' => $request->request->get('authors', ''), | 790 | 'authors' => $request->request->get('authors', ''), |
791 | 'origin_url' => $request->request->get('origin_url', ''), | ||
781 | ]; | 792 | ]; |
782 | } | 793 | } |
783 | 794 | ||
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 877dbfa2..dec2bf9c 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php | |||
@@ -61,7 +61,6 @@ class InstallCommand extends ContainerAwareCommand | |||
61 | ->setupDatabase() | 61 | ->setupDatabase() |
62 | ->setupAdmin() | 62 | ->setupAdmin() |
63 | ->setupConfig() | 63 | ->setupConfig() |
64 | ->runMigrations() | ||
65 | ; | 64 | ; |
66 | 65 | ||
67 | $this->io->success('Wallabag has been successfully installed.'); | 66 | $this->io->success('Wallabag has been successfully installed.'); |
@@ -70,7 +69,7 @@ class InstallCommand extends ContainerAwareCommand | |||
70 | 69 | ||
71 | protected function checkRequirements() | 70 | protected function checkRequirements() |
72 | { | 71 | { |
73 | $this->io->section('Step 1 of 5: Checking system requirements.'); | 72 | $this->io->section('Step 1 of 4: Checking system requirements.'); |
74 | 73 | ||
75 | $doctrineManager = $this->getContainer()->get('doctrine')->getManager(); | 74 | $doctrineManager = $this->getContainer()->get('doctrine')->getManager(); |
76 | 75 | ||
@@ -169,7 +168,7 @@ class InstallCommand extends ContainerAwareCommand | |||
169 | 168 | ||
170 | protected function setupDatabase() | 169 | protected function setupDatabase() |
171 | { | 170 | { |
172 | $this->io->section('Step 2 of 5: Setting up database.'); | 171 | $this->io->section('Step 2 of 4: Setting up database.'); |
173 | 172 | ||
174 | // user want to reset everything? Don't care about what is already here | 173 | // user want to reset everything? Don't care about what is already here |
175 | if (true === $this->defaultInput->getOption('reset')) { | 174 | if (true === $this->defaultInput->getOption('reset')) { |
@@ -178,7 +177,7 @@ class InstallCommand extends ContainerAwareCommand | |||
178 | $this | 177 | $this |
179 | ->runCommand('doctrine:database:drop', ['--force' => true]) | 178 | ->runCommand('doctrine:database:drop', ['--force' => true]) |
180 | ->runCommand('doctrine:database:create') | 179 | ->runCommand('doctrine:database:create') |
181 | ->runCommand('doctrine:schema:create') | 180 | ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]) |
182 | ->runCommand('cache:clear') | 181 | ->runCommand('cache:clear') |
183 | ; | 182 | ; |
184 | 183 | ||
@@ -192,7 +191,7 @@ class InstallCommand extends ContainerAwareCommand | |||
192 | 191 | ||
193 | $this | 192 | $this |
194 | ->runCommand('doctrine:database:create') | 193 | ->runCommand('doctrine:database:create') |
195 | ->runCommand('doctrine:schema:create') | 194 | ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]) |
196 | ->runCommand('cache:clear') | 195 | ->runCommand('cache:clear') |
197 | ; | 196 | ; |
198 | 197 | ||
@@ -207,7 +206,7 @@ class InstallCommand extends ContainerAwareCommand | |||
207 | $this | 206 | $this |
208 | ->runCommand('doctrine:database:drop', ['--force' => true]) | 207 | ->runCommand('doctrine:database:drop', ['--force' => true]) |
209 | ->runCommand('doctrine:database:create') | 208 | ->runCommand('doctrine:database:create') |
210 | ->runCommand('doctrine:schema:create') | 209 | ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]) |
211 | ; | 210 | ; |
212 | } elseif ($this->isSchemaPresent()) { | 211 | } elseif ($this->isSchemaPresent()) { |
213 | if ($this->io->confirm('Seems like your database contains schema. Do you want to reset it?', false)) { | 212 | if ($this->io->confirm('Seems like your database contains schema. Do you want to reset it?', false)) { |
@@ -215,14 +214,14 @@ class InstallCommand extends ContainerAwareCommand | |||
215 | 214 | ||
216 | $this | 215 | $this |
217 | ->runCommand('doctrine:schema:drop', ['--force' => true]) | 216 | ->runCommand('doctrine:schema:drop', ['--force' => true]) |
218 | ->runCommand('doctrine:schema:create') | 217 | ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]) |
219 | ; | 218 | ; |
220 | } | 219 | } |
221 | } else { | 220 | } else { |
222 | $this->io->text('Creating schema...'); | 221 | $this->io->text('Creating schema...'); |
223 | 222 | ||
224 | $this | 223 | $this |
225 | ->runCommand('doctrine:schema:create') | 224 | ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]) |
226 | ; | 225 | ; |
227 | } | 226 | } |
228 | 227 | ||
@@ -237,7 +236,7 @@ class InstallCommand extends ContainerAwareCommand | |||
237 | 236 | ||
238 | protected function setupAdmin() | 237 | protected function setupAdmin() |
239 | { | 238 | { |
240 | $this->io->section('Step 3 of 5: Administration setup.'); | 239 | $this->io->section('Step 3 of 4: Administration setup.'); |
241 | 240 | ||
242 | if (!$this->io->confirm('Would you like to create a new admin user (recommended)?', true)) { | 241 | if (!$this->io->confirm('Would you like to create a new admin user (recommended)?', true)) { |
243 | return $this; | 242 | return $this; |
@@ -272,7 +271,7 @@ class InstallCommand extends ContainerAwareCommand | |||
272 | 271 | ||
273 | protected function setupConfig() | 272 | protected function setupConfig() |
274 | { | 273 | { |
275 | $this->io->section('Step 4 of 5: Config setup.'); | 274 | $this->io->section('Step 4 of 4: Config setup.'); |
276 | $em = $this->getContainer()->get('doctrine.orm.entity_manager'); | 275 | $em = $this->getContainer()->get('doctrine.orm.entity_manager'); |
277 | 276 | ||
278 | // cleanup before insert new stuff | 277 | // cleanup before insert new stuff |
@@ -293,18 +292,6 @@ class InstallCommand extends ContainerAwareCommand | |||
293 | return $this; | 292 | return $this; |
294 | } | 293 | } |
295 | 294 | ||
296 | protected function runMigrations() | ||
297 | { | ||
298 | $this->io->section('Step 5 of 5: Run migrations.'); | ||
299 | |||
300 | $this | ||
301 | ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]); | ||
302 | |||
303 | $this->io->text('<info>Migrations successfully executed.</info>'); | ||
304 | |||
305 | return $this; | ||
306 | } | ||
307 | |||
308 | /** | 295 | /** |
309 | * Run a command. | 296 | * Run a command. |
310 | * | 297 | * |
diff --git a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php index fa2066dc..548de744 100644 --- a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php +++ b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php | |||
@@ -24,6 +24,8 @@ class SiteCredentialController extends Controller | |||
24 | */ | 24 | */ |
25 | public function indexAction() | 25 | public function indexAction() |
26 | { | 26 | { |
27 | $this->isSiteCredentialsEnabled(); | ||
28 | |||
27 | $credentials = $this->get('wallabag_core.site_credential_repository')->findByUser($this->getUser()); | 29 | $credentials = $this->get('wallabag_core.site_credential_repository')->findByUser($this->getUser()); |
28 | 30 | ||
29 | return $this->render('WallabagCoreBundle:SiteCredential:index.html.twig', [ | 31 | return $this->render('WallabagCoreBundle:SiteCredential:index.html.twig', [ |
@@ -43,6 +45,8 @@ class SiteCredentialController extends Controller | |||
43 | */ | 45 | */ |
44 | public function newAction(Request $request) | 46 | public function newAction(Request $request) |
45 | { | 47 | { |
48 | $this->isSiteCredentialsEnabled(); | ||
49 | |||
46 | $credential = new SiteCredential($this->getUser()); | 50 | $credential = new SiteCredential($this->getUser()); |
47 | 51 | ||
48 | $form = $this->createForm('Wallabag\CoreBundle\Form\Type\SiteCredentialType', $credential); | 52 | $form = $this->createForm('Wallabag\CoreBundle\Form\Type\SiteCredentialType', $credential); |
@@ -83,6 +87,8 @@ class SiteCredentialController extends Controller | |||
83 | */ | 87 | */ |
84 | public function editAction(Request $request, SiteCredential $siteCredential) | 88 | public function editAction(Request $request, SiteCredential $siteCredential) |
85 | { | 89 | { |
90 | $this->isSiteCredentialsEnabled(); | ||
91 | |||
86 | $this->checkUserAction($siteCredential); | 92 | $this->checkUserAction($siteCredential); |
87 | 93 | ||
88 | $deleteForm = $this->createDeleteForm($siteCredential); | 94 | $deleteForm = $this->createDeleteForm($siteCredential); |
@@ -125,6 +131,8 @@ class SiteCredentialController extends Controller | |||
125 | */ | 131 | */ |
126 | public function deleteAction(Request $request, SiteCredential $siteCredential) | 132 | public function deleteAction(Request $request, SiteCredential $siteCredential) |
127 | { | 133 | { |
134 | $this->isSiteCredentialsEnabled(); | ||
135 | |||
128 | $this->checkUserAction($siteCredential); | 136 | $this->checkUserAction($siteCredential); |
129 | 137 | ||
130 | $form = $this->createDeleteForm($siteCredential); | 138 | $form = $this->createDeleteForm($siteCredential); |
@@ -145,6 +153,16 @@ class SiteCredentialController extends Controller | |||
145 | } | 153 | } |
146 | 154 | ||
147 | /** | 155 | /** |
156 | * Throw a 404 if the feature is disabled. | ||
157 | */ | ||
158 | private function isSiteCredentialsEnabled() | ||
159 | { | ||
160 | if (!$this->get('craue_config')->get('restricted_access')) { | ||
161 | throw $this->createNotFoundException('Feature "restricted_access" is disabled, controllers too.'); | ||
162 | } | ||
163 | } | ||
164 | |||
165 | /** | ||
148 | * Creates a form to delete a site credential entity. | 166 | * Creates a form to delete a site credential entity. |
149 | * | 167 | * |
150 | * @param SiteCredential $siteCredential The site credential entity | 168 | * @param SiteCredential $siteCredential The site credential entity |
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php index fedad009..0e1510a2 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php | |||
@@ -37,6 +37,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface | |||
37 | $entry2->setMimetype('text/html'); | 37 | $entry2->setMimetype('text/html'); |
38 | $entry2->setTitle('test title entry2'); | 38 | $entry2->setTitle('test title entry2'); |
39 | $entry2->setContent('This is my content /o/'); | 39 | $entry2->setContent('This is my content /o/'); |
40 | $entry2->setOriginUrl('ftp://oneftp.tld'); | ||
40 | $entry2->setLanguage('fr'); | 41 | $entry2->setLanguage('fr'); |
41 | 42 | ||
42 | $manager->persist($entry2); | 43 | $manager->persist($entry2); |
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index cfb8db75..2b1f2e05 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -245,6 +245,15 @@ class Entry | |||
245 | */ | 245 | */ |
246 | private $tags; | 246 | private $tags; |
247 | 247 | ||
248 | /** | ||
249 | * @var string | ||
250 | * | ||
251 | * @ORM\Column(name="origin_url", type="text", nullable=true) | ||
252 | * | ||
253 | * @Groups({"entries_for_user", "export_all"}) | ||
254 | */ | ||
255 | private $originUrl; | ||
256 | |||
248 | /* | 257 | /* |
249 | * @param User $user | 258 | * @param User $user |
250 | */ | 259 | */ |
@@ -831,4 +840,28 @@ class Entry | |||
831 | 840 | ||
832 | return $this; | 841 | return $this; |
833 | } | 842 | } |
843 | |||
844 | /** | ||
845 | * Set origin url. | ||
846 | * | ||
847 | * @param string $originUrl | ||
848 | * | ||
849 | * @return Entry | ||
850 | */ | ||
851 | public function setOriginUrl($originUrl) | ||
852 | { | ||
853 | $this->originUrl = $originUrl; | ||
854 | |||
855 | return $this; | ||
856 | } | ||
857 | |||
858 | /** | ||
859 | * Get origin url. | ||
860 | * | ||
861 | * @return string | ||
862 | */ | ||
863 | public function getOriginUrl() | ||
864 | { | ||
865 | return $this->originUrl; | ||
866 | } | ||
834 | } | 867 | } |
diff --git a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php index 1627cc44..08355928 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php | |||
@@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Form\Type; | |||
5 | use Symfony\Component\Form\AbstractType; | 5 | use Symfony\Component\Form\AbstractType; |
6 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | 6 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; |
7 | use Symfony\Component\Form\Extension\Core\Type\TextType; | 7 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
8 | use Symfony\Component\Form\Extension\Core\Type\UrlType; | ||
8 | use Symfony\Component\Form\FormBuilderInterface; | 9 | use Symfony\Component\Form\FormBuilderInterface; |
9 | use Symfony\Component\OptionsResolver\OptionsResolver; | 10 | use Symfony\Component\OptionsResolver\OptionsResolver; |
10 | 11 | ||
@@ -17,11 +18,16 @@ class EditEntryType extends AbstractType | |||
17 | 'required' => true, | 18 | 'required' => true, |
18 | 'label' => 'entry.edit.title_label', | 19 | 'label' => 'entry.edit.title_label', |
19 | ]) | 20 | ]) |
20 | ->add('url', TextType::class, [ | 21 | ->add('url', UrlType::class, [ |
21 | 'disabled' => true, | 22 | 'disabled' => true, |
22 | 'required' => false, | 23 | 'required' => false, |
23 | 'label' => 'entry.edit.url_label', | 24 | 'label' => 'entry.edit.url_label', |
24 | ]) | 25 | ]) |
26 | ->add('origin_url', UrlType::class, [ | ||
27 | 'required' => false, | ||
28 | 'property_path' => 'originUrl', | ||
29 | 'label' => 'entry.edit.origin_url_label', | ||
30 | ]) | ||
25 | ->add('save', SubmitType::class, [ | 31 | ->add('save', SubmitType::class, [ |
26 | 'label' => 'entry.edit.save_label', | 32 | 'label' => 'entry.edit.save_label', |
27 | ]) | 33 | ]) |
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 854acb6a..4cc20c9c 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php | |||
@@ -24,8 +24,9 @@ class ContentProxy | |||
24 | protected $mimeGuesser; | 24 | protected $mimeGuesser; |
25 | protected $fetchingErrorMessage; | 25 | protected $fetchingErrorMessage; |
26 | protected $eventDispatcher; | 26 | protected $eventDispatcher; |
27 | protected $storeArticleHeaders; | ||
27 | 28 | ||
28 | public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage) | 29 | public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage, $storeArticleHeaders = false) |
29 | { | 30 | { |
30 | $this->graby = $graby; | 31 | $this->graby = $graby; |
31 | $this->tagger = $tagger; | 32 | $this->tagger = $tagger; |
@@ -33,6 +34,7 @@ class ContentProxy | |||
33 | $this->logger = $logger; | 34 | $this->logger = $logger; |
34 | $this->mimeGuesser = new MimeTypeExtensionGuesser(); | 35 | $this->mimeGuesser = new MimeTypeExtensionGuesser(); |
35 | $this->fetchingErrorMessage = $fetchingErrorMessage; | 36 | $this->fetchingErrorMessage = $fetchingErrorMessage; |
37 | $this->storeArticleHeaders = $storeArticleHeaders; | ||
36 | } | 38 | } |
37 | 39 | ||
38 | /** | 40 | /** |
@@ -185,7 +187,7 @@ class ContentProxy | |||
185 | $entry->setPublishedBy($content['authors']); | 187 | $entry->setPublishedBy($content['authors']); |
186 | } | 188 | } |
187 | 189 | ||
188 | if (!empty($content['all_headers'])) { | 190 | if (!empty($content['all_headers']) && $this->storeArticleHeaders) { |
189 | $entry->setHeaders($content['all_headers']); | 191 | $entry->setHeaders($content['all_headers']); |
190 | } | 192 | } |
191 | 193 | ||
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 31b16739..85306276 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml | |||
@@ -94,6 +94,7 @@ services: | |||
94 | - "@validator" | 94 | - "@validator" |
95 | - "@logger" | 95 | - "@logger" |
96 | - '%wallabag_core.fetching_error_message%' | 96 | - '%wallabag_core.fetching_error_message%' |
97 | - '@=service(''craue_config'').get(''store_article_headers'')' | ||
97 | 98 | ||
98 | wallabag_core.tags_assigner: | 99 | wallabag_core.tags_assigner: |
99 | class: Wallabag\CoreBundle\Helper\TagsAssigner | 100 | class: Wallabag\CoreBundle\Helper\TagsAssigner |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index d0a38f7e..27dbb388 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Oprettelsesdato' | 233 | created_at: 'Oprettelsesdato' |
234 | # published_at: 'Publication date' | 234 | # published_at: 'Publication date' |
235 | # published_by: 'Published by' | 235 | # published_by: 'Published by' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Gem ny artikel' | 238 | page_title: 'Gem ny artikel' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | # page_title: 'Edit an entry' | 245 | # page_title: 'Edit an entry' |
245 | # title_label: 'Title' | 246 | # title_label: 'Title' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Gem' | 249 | save_label: 'Gem' |
248 | public: | 250 | public: |
249 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" | 251 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 158762a9..d47986e5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Erstellungsdatum' | 233 | created_at: 'Erstellungsdatum' |
234 | published_at: 'Erscheinungsdatum' | 234 | published_at: 'Erscheinungsdatum' |
235 | published_by: 'Veröffentlicht von' | 235 | published_by: 'Veröffentlicht von' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Neuen Artikel speichern' | 238 | page_title: 'Neuen Artikel speichern' |
238 | placeholder: 'https://website.de' | 239 | placeholder: 'https://website.de' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Eintrag bearbeiten' | 245 | page_title: 'Eintrag bearbeiten' |
245 | title_label: 'Titel' | 246 | title_label: 'Titel' |
246 | url_label: 'URL' | 247 | url_label: 'URL' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Speichern' | 249 | save_label: 'Speichern' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: 'Dieser Artikel wurde von %username% mittels <a href="%wallabag_instance%">wallabag</a> geteilt' | 251 | shared_by_wallabag: 'Dieser Artikel wurde von %username% mittels <a href="%wallabag_instance%">wallabag</a> geteilt' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index de3e11fe..bbaecb24 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Creation date' | 233 | created_at: 'Creation date' |
234 | published_at: 'Publication date' | 234 | published_at: 'Publication date' |
235 | published_by: 'Published by' | 235 | published_by: 'Published by' |
236 | provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Save new entry' | 238 | page_title: 'Save new entry' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Edit an entry' | 245 | page_title: 'Edit an entry' |
245 | title_label: 'Title' | 246 | title_label: 'Title' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Save' | 249 | save_label: 'Save' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 6dfc1525..e3b625f7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Fecha de creación' | 233 | created_at: 'Fecha de creación' |
234 | # published_at: 'Publication date' | 234 | # published_at: 'Publication date' |
235 | # published_by: 'Published by' | 235 | # published_by: 'Published by' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Guardar un nuevo artículo' | 238 | page_title: 'Guardar un nuevo artículo' |
238 | placeholder: 'http://sitioweb.com' | 239 | placeholder: 'http://sitioweb.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Editar un artículo' | 245 | page_title: 'Editar un artículo' |
245 | title_label: 'Título' | 246 | title_label: 'Título' |
246 | url_label: 'URL' | 247 | url_label: 'URL' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Guardar' | 249 | save_label: 'Guardar' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Este artículo se ha compartido con <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "Este artículo se ha compartido con <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index ffc48933..c03cca46 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'زمان ساخت' | 233 | created_at: 'زمان ساخت' |
234 | # published_at: 'Publication date' | 234 | # published_at: 'Publication date' |
235 | # published_by: 'Published by' | 235 | # published_by: 'Published by' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'ذخیرهٔ مقالهٔ تازه' | 238 | page_title: 'ذخیرهٔ مقالهٔ تازه' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'ویرایش مقاله' | 245 | page_title: 'ویرایش مقاله' |
245 | title_label: 'عنوان' | 246 | title_label: 'عنوان' |
246 | url_label: 'نشانی' | 247 | url_label: 'نشانی' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'ذخیره' | 249 | save_label: 'ذخیره' |
248 | public: | 250 | public: |
249 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" | 251 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index c9d95e2b..b0037ad2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: "Date de création" | 233 | created_at: "Date de création" |
234 | published_at: "Date de publication" | 234 | published_at: "Date de publication" |
235 | published_by: "Publié par" | 235 | published_by: "Publié par" |
236 | provided_by: "Fourni par" | ||
236 | new: | 237 | new: |
237 | page_title: "Sauvegarder un nouvel article" | 238 | page_title: "Sauvegarder un nouvel article" |
238 | placeholder: "http://website.com" | 239 | placeholder: "http://website.com" |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: "Éditer un article" | 245 | page_title: "Éditer un article" |
245 | title_label: "Titre" | 246 | title_label: "Titre" |
246 | url_label: "Adresse" | 247 | url_label: "Adresse" |
248 | origin_url_label: "Adresse d'origine (d'où vous avez trouvé cet article)" | ||
247 | save_label: "Enregistrer" | 249 | save_label: "Enregistrer" |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Cet article a été partagé par %username% avec <a href=\"%wallabag_instance%\">wallabag</a>" | 251 | shared_by_wallabag: "Cet article a été partagé par %username% avec <a href=\"%wallabag_instance%\">wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index c53266ca..56cf341b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Data di creazione' | 233 | created_at: 'Data di creazione' |
234 | published_at: 'Data di pubblicazione' | 234 | published_at: 'Data di pubblicazione' |
235 | published_by: 'Pubblicato da' | 235 | published_by: 'Pubblicato da' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Salva un nuovo contenuto' | 238 | page_title: 'Salva un nuovo contenuto' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Modifica voce' | 245 | page_title: 'Modifica voce' |
245 | title_label: 'Titolo' | 246 | title_label: 'Titolo' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Salva' | 249 | save_label: 'Salva' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Questo articolo è stato condiviso da %username% con <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "Questo articolo è stato condiviso da %username% con <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 3ae64c49..1b5b221f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Data de creacion' | 233 | created_at: 'Data de creacion' |
234 | published_at: 'Data de publicacion' | 234 | published_at: 'Data de publicacion' |
235 | published_by: 'Publicat per' | 235 | published_by: 'Publicat per' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Enregistrar un novèl article' | 238 | page_title: 'Enregistrar un novèl article' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Modificar un article' | 245 | page_title: 'Modificar un article' |
245 | title_label: 'Títol' | 246 | title_label: 'Títol' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Enregistrar' | 249 | save_label: 'Enregistrar' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Aqueste article es estat partejat per <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "Aqueste article es estat partejat per <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index e642c530..88f35738 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Czas stworzenia' | 233 | created_at: 'Czas stworzenia' |
234 | published_at: 'Data publikacji' | 234 | published_at: 'Data publikacji' |
235 | published_by: 'Opublikowane przez' | 235 | published_by: 'Opublikowane przez' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Zapisz nowy wpis' | 238 | page_title: 'Zapisz nowy wpis' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Edytuj wpis' | 245 | page_title: 'Edytuj wpis' |
245 | title_label: 'Tytuł' | 246 | title_label: 'Tytuł' |
246 | url_label: 'Adres URL' | 247 | url_label: 'Adres URL' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Zapisz' | 249 | save_label: 'Zapisz' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Ten artykuł został udostępniony przez <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "Ten artykuł został udostępniony przez <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 9b3fea6b..3987cec3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Data de criação' | 233 | created_at: 'Data de criação' |
234 | # published_at: 'Publication date' | 234 | # published_at: 'Publication date' |
235 | # published_by: 'Published by' | 235 | # published_by: 'Published by' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Salvar nova entrada' | 238 | page_title: 'Salvar nova entrada' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Editar uma entrada' | 245 | page_title: 'Editar uma entrada' |
245 | title_label: 'Título' | 246 | title_label: 'Título' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Salvar' | 249 | save_label: 'Salvar' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Este artigo foi compartilhado pelo <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "Este artigo foi compartilhado pelo <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 673ca183..4d2fd569 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Data creării' | 233 | created_at: 'Data creării' |
234 | # published_at: 'Publication date' | 234 | # published_at: 'Publication date' |
235 | # published_by: 'Published by' | 235 | # published_by: 'Published by' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Salvează un nou articol' | 238 | page_title: 'Salvează un nou articol' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | # page_title: 'Edit an entry' | 245 | # page_title: 'Edit an entry' |
245 | # title_label: 'Title' | 246 | # title_label: 'Title' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Salvează' | 249 | save_label: 'Salvează' |
248 | public: | 250 | public: |
249 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" | 251 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index eceecabf..a560e58d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml | |||
@@ -223,6 +223,7 @@ entry: | |||
223 | original_article: 'оригинал' | 223 | original_article: 'оригинал' |
224 | annotations_on_the_entry: '{0} Нет аннотации|{1} Одна аннотация|]1,Inf[ %count% аннотаций' | 224 | annotations_on_the_entry: '{0} Нет аннотации|{1} Одна аннотация|]1,Inf[ %count% аннотаций' |
225 | created_at: 'Дата создания' | 225 | created_at: 'Дата создания' |
226 | # provided_by: 'Provided by' | ||
226 | new: | 227 | new: |
227 | page_title: 'Сохранить новую запись' | 228 | page_title: 'Сохранить новую запись' |
228 | placeholder: 'http://website.com' | 229 | placeholder: 'http://website.com' |
@@ -234,6 +235,7 @@ entry: | |||
234 | page_title: 'Изменить запись' | 235 | page_title: 'Изменить запись' |
235 | title_label: 'Название' | 236 | title_label: 'Название' |
236 | url_label: 'Ссылка' | 237 | url_label: 'Ссылка' |
238 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
237 | is_public_label: 'Публичная' | 239 | is_public_label: 'Публичная' |
238 | save_label: 'Сохранить' | 240 | save_label: 'Сохранить' |
239 | public: | 241 | public: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 563bc50b..0fd6e989 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | |||
@@ -231,6 +231,7 @@ entry: | |||
231 | created_at: 'Oluşturulma tarihi' | 231 | created_at: 'Oluşturulma tarihi' |
232 | # published_at: 'Publication date' | 232 | # published_at: 'Publication date' |
233 | # published_by: 'Published by' | 233 | # published_by: 'Published by' |
234 | # provided_by: 'Provided by' | ||
234 | new: | 235 | new: |
235 | page_title: 'Yeni makaleyi kaydet' | 236 | page_title: 'Yeni makaleyi kaydet' |
236 | placeholder: 'http://website.com' | 237 | placeholder: 'http://website.com' |
@@ -242,6 +243,7 @@ entry: | |||
242 | page_title: 'Makaleyi düzenle' | 243 | page_title: 'Makaleyi düzenle' |
243 | title_label: 'Başlık' | 244 | title_label: 'Başlık' |
244 | url_label: 'Url' | 245 | url_label: 'Url' |
246 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
245 | save_label: 'Kaydet' | 247 | save_label: 'Kaydet' |
246 | public: | 248 | public: |
247 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" | 249 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig index f8723189..0c7cbaa6 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig | |||
@@ -71,6 +71,14 @@ | |||
71 | </i> | 71 | </i> |
72 | 72 | ||
73 | <span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span> | 73 | <span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span> |
74 | |||
75 | {% if entry.originUrl is not empty %} | ||
76 | <i class="material-icons" title="{{ 'entry.view.provided_by'|trans }}">launch</i> | ||
77 | <a href="{{ entry.originUrl|e }}" target="_blank" class="tool"> | ||
78 | {{ entry.originUrl|striptags|removeSchemeAndWww|truncate(32) }} | ||
79 | </a> | ||
80 | {% endif %} | ||
81 | |||
74 | <aside class="tags"> | 82 | <aside class="tags"> |
75 | <div class="card-entry-tags"> | 83 | <div class="card-entry-tags"> |
76 | {% for tag in entry.tags %} | 84 | {% for tag in entry.tags %} |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/edit.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/edit.html.twig index b9537975..ed225957 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/edit.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/edit.html.twig | |||
@@ -27,6 +27,11 @@ | |||
27 | {{ form_label(form.url) }} | 27 | {{ form_label(form.url) }} |
28 | {{ form_widget(form.url) }} | 28 | {{ form_widget(form.url) }} |
29 | </div> | 29 | </div> |
30 | |||
31 | <div class="input-field s12"> | ||
32 | {{ form_label(form.origin_url) }} | ||
33 | {{ form_widget(form.origin_url) }} | ||
34 | </div> | ||
30 | <br> | 35 | <br> |
31 | 36 | ||
32 | {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} | 37 | {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig index 4cff7bf2..019569f7 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig | |||
@@ -125,7 +125,7 @@ | |||
125 | {% endif %} | 125 | {% endif %} |
126 | {% if craue_setting('share_shaarli') %} | 126 | {% if craue_setting('share_shaarli') %} |
127 | <li> | 127 | <li> |
128 | <a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|striptags|url_encode }}&tags={{ entry.tags|join(',')|striptags|url_encode }}" target="_blank" title="shaarli" class="tool icon-image shaarli"> | 128 | <a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|striptags|url_encode }}&tags={{ entry.tags|join(',')|striptags|url_encode }}&lf_original_url={{ entry.originUrl|url_encode }}" target="_blank" title="shaarli" class="tool icon-image shaarli"> |
129 | <span>shaarli</span> | 129 | <span>shaarli</span> |
130 | </a> | 130 | </a> |
131 | </li> | 131 | </li> |
@@ -249,6 +249,14 @@ | |||
249 | <i class="material-icons link">comment</i> | 249 | <i class="material-icons link">comment</i> |
250 | {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }} | 250 | {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }} |
251 | </li> | 251 | </li> |
252 | {% if entry.originUrl is not empty %} | ||
253 | <li> | ||
254 | <i class="material-icons" title="{{ 'entry.view.provided_by'|trans }}">launch</i> | ||
255 | <a href="{{ entry.originUrl|e }}" target="_blank" class="tool"> | ||
256 | {{ entry.originUrl|striptags|removeSchemeAndWww|truncate(32) }} | ||
257 | </a> | ||
258 | </li> | ||
259 | {% endif %} | ||
252 | </ul> | 260 | </ul> |
253 | <ul class="tags"> | 261 | <ul class="tags"> |
254 | {% for tag in entry.tags %} | 262 | {% for tag in entry.tags %} |
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index 351172c4..8992117e 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php | |||
@@ -28,6 +28,7 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa | |||
28 | { | 28 | { |
29 | return [ | 29 | return [ |
30 | new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), | 30 | new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), |
31 | new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']), | ||
31 | ]; | 32 | ]; |
32 | } | 33 | } |
33 | 34 | ||
@@ -45,6 +46,13 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa | |||
45 | return preg_replace('/^www\./i', '', $url); | 46 | return preg_replace('/^www\./i', '', $url); |
46 | } | 47 | } |
47 | 48 | ||
49 | public function removeSchemeAndWww($url) | ||
50 | { | ||
51 | return $this->removeWww( | ||
52 | preg_replace('@^https?://@i', '', $url) | ||
53 | ); | ||
54 | } | ||
55 | |||
48 | /** | 56 | /** |
49 | * Return number of entries depending of the type (unread, archive, starred or all). | 57 | * Return number of entries depending of the type (unread, archive, starred or all). |
50 | * | 58 | * |
diff --git a/src/Wallabag/ImportBundle/Consumer/RedisEntryConsumer.php b/src/Wallabag/ImportBundle/Consumer/RedisEntryConsumer.php index 450b71ff..862d0c43 100644 --- a/src/Wallabag/ImportBundle/Consumer/RedisEntryConsumer.php +++ b/src/Wallabag/ImportBundle/Consumer/RedisEntryConsumer.php | |||
@@ -21,9 +21,26 @@ class RedisEntryConsumer extends AbstractConsumer implements Job | |||
21 | /** | 21 | /** |
22 | * Should tell if the given job will kill the worker. | 22 | * Should tell if the given job will kill the worker. |
23 | * We don't want to stop it :). | 23 | * We don't want to stop it :). |
24 | * | ||
25 | * @param string $job Content of the message (directly from Redis) | ||
26 | * | ||
27 | * @return false | ||
24 | */ | 28 | */ |
25 | public function isStopJob($job) | 29 | public function isStopJob($job) |
26 | { | 30 | { |
27 | return false; | 31 | return false; |
28 | } | 32 | } |
33 | |||
34 | /** | ||
35 | * This abstract method is only used when we use one queue for multiple job type. | ||
36 | * We don't do that, so we'll always return true. | ||
37 | * | ||
38 | * @param string $job Content of the message (directly from Redis) | ||
39 | * | ||
40 | * @return true | ||
41 | */ | ||
42 | public function isMyJob($job) | ||
43 | { | ||
44 | return true; | ||
45 | } | ||
29 | } | 46 | } |
diff --git a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml index ee0a27d5..5fc57617 100644 --- a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml +++ b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml | |||
@@ -5,7 +5,7 @@ auth_code: | |||
5 | subject: 'wallabag authentication code' | 5 | subject: 'wallabag authentication code' |
6 | body: | 6 | body: |
7 | hello: "Hi %user%," | 7 | hello: "Hi %user%," |
8 | first_para: "Since you enable two factor authentication on your wallabag account and you just logged in from a new device (computer, phone, etc.), we send you a code to validate your connection." | 8 | first_para: "Since you require two factor authentication to log in on your wallabag account, and a new device just used it, we send you a code to validate its connection." |
9 | second_para: "Here is the code:" | 9 | second_para: "Here is the code:" |
10 | support: "Please don't hesitate to contact us if you have any problems:" | 10 | support: "Please don't hesitate to contact us if you have any problems:" |
11 | signature: "The wallabag team" | 11 | signature: "The wallabag team" |
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 95c64501..b0d4c4e1 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | |||
@@ -36,6 +36,25 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
36 | $this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type')); | 36 | $this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type')); |
37 | } | 37 | } |
38 | 38 | ||
39 | public function testGetOneEntryWithOriginUrl() | ||
40 | { | ||
41 | $entry = $this->client->getContainer() | ||
42 | ->get('doctrine.orm.entity_manager') | ||
43 | ->getRepository('WallabagCoreBundle:Entry') | ||
44 | ->findOneBy(['user' => 1, 'url' => 'http://0.0.0.0/entry2']); | ||
45 | |||
46 | if (!$entry) { | ||
47 | $this->markTestSkipped('No content found in db.'); | ||
48 | } | ||
49 | |||
50 | $this->client->request('GET', '/api/entries/' . $entry->getId() . '.json'); | ||
51 | $this->assertSame(200, $this->client->getResponse()->getStatusCode()); | ||
52 | |||
53 | $content = json_decode($this->client->getResponse()->getContent(), true); | ||
54 | |||
55 | $this->assertSame($entry->getOriginUrl(), $content['origin_url']); | ||
56 | } | ||
57 | |||
39 | public function testExportEntry() | 58 | public function testExportEntry() |
40 | { | 59 | { |
41 | $entry = $this->client->getContainer() | 60 | $entry = $this->client->getContainer() |
@@ -421,6 +440,7 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
421 | $this->assertSame('New title for my article', $content['title']); | 440 | $this->assertSame('New title for my article', $content['title']); |
422 | $this->assertSame(1, $content['user_id']); | 441 | $this->assertSame(1, $content['user_id']); |
423 | $this->assertCount(2, $content['tags']); | 442 | $this->assertCount(2, $content['tags']); |
443 | $this->assertNull($content['origin_url']); | ||
424 | $this->assertSame('my content', $content['content']); | 444 | $this->assertSame('my content', $content['content']); |
425 | $this->assertSame('de', $content['language']); | 445 | $this->assertSame('de', $content['language']); |
426 | $this->assertSame('2016-09-08T11:55:58+0200', $content['published_at']); | 446 | $this->assertSame('2016-09-08T11:55:58+0200', $content['published_at']); |
@@ -531,6 +551,29 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
531 | $this->assertSame(1, $content['is_starred']); | 551 | $this->assertSame(1, $content['is_starred']); |
532 | } | 552 | } |
533 | 553 | ||
554 | public function testPostEntryWithOriginUrl() | ||
555 | { | ||
556 | $this->client->request('POST', '/api/entries.json', [ | ||
557 | 'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', | ||
558 | 'tags' => 'google', | ||
559 | 'title' => 'New title for my article', | ||
560 | 'content' => 'my content', | ||
561 | 'language' => 'de', | ||
562 | 'published_at' => '2016-09-08T11:55:58+0200', | ||
563 | 'authors' => 'bob,helen', | ||
564 | 'public' => 1, | ||
565 | 'origin_url' => 'http://mysource.tld', | ||
566 | ]); | ||
567 | |||
568 | $this->assertSame(200, $this->client->getResponse()->getStatusCode()); | ||
569 | |||
570 | $content = json_decode($this->client->getResponse()->getContent(), true); | ||
571 | |||
572 | $this->assertGreaterThan(0, $content['id']); | ||
573 | $this->assertSame('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']); | ||
574 | $this->assertSame('http://mysource.tld', $content['origin_url']); | ||
575 | } | ||
576 | |||
534 | public function testPatchEntry() | 577 | public function testPatchEntry() |
535 | { | 578 | { |
536 | $entry = $this->client->getContainer() | 579 | $entry = $this->client->getContainer() |
@@ -607,6 +650,91 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
607 | $this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved'); | 650 | $this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved'); |
608 | } | 651 | } |
609 | 652 | ||
653 | public function testPatchEntryWithOriginUrl() | ||
654 | { | ||
655 | $entry = $this->client->getContainer() | ||
656 | ->get('doctrine.orm.entity_manager') | ||
657 | ->getRepository('WallabagCoreBundle:Entry') | ||
658 | ->findOneByUser(1); | ||
659 | |||
660 | if (!$entry) { | ||
661 | $this->markTestSkipped('No content found in db.'); | ||
662 | } | ||
663 | |||
664 | $previousContent = $entry->getContent(); | ||
665 | $previousLanguage = $entry->getLanguage(); | ||
666 | |||
667 | $this->client->request('PATCH', '/api/entries/' . $entry->getId() . '.json', [ | ||
668 | 'title' => 'Another awesome title just for profit', | ||
669 | 'origin_url' => 'https://myawesomesource.example.com', | ||
670 | ]); | ||
671 | |||
672 | $this->assertSame(200, $this->client->getResponse()->getStatusCode()); | ||
673 | |||
674 | $content = json_decode($this->client->getResponse()->getContent(), true); | ||
675 | |||
676 | $this->assertSame($entry->getId(), $content['id']); | ||
677 | $this->assertSame($entry->getUrl(), $content['url']); | ||
678 | $this->assertSame('https://myawesomesource.example.com', $content['origin_url']); | ||
679 | $this->assertEmpty($content['published_by'], 'Authors were not saved because of an array instead of a string'); | ||
680 | $this->assertSame($previousContent, $content['content'], 'Ensure content has not moved'); | ||
681 | $this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved'); | ||
682 | } | ||
683 | |||
684 | public function testPatchEntryRemoveOriginUrl() | ||
685 | { | ||
686 | $entry = $this->client->getContainer() | ||
687 | ->get('doctrine.orm.entity_manager') | ||
688 | ->getRepository('WallabagCoreBundle:Entry') | ||
689 | ->findOneByUser(1); | ||
690 | |||
691 | if (!$entry) { | ||
692 | $this->markTestSkipped('No content found in db.'); | ||
693 | } | ||
694 | |||
695 | $previousContent = $entry->getContent(); | ||
696 | $previousLanguage = $entry->getLanguage(); | ||
697 | $previousTitle = $entry->getTitle(); | ||
698 | |||
699 | $this->client->request('PATCH', '/api/entries/' . $entry->getId() . '.json', [ | ||
700 | 'origin_url' => '', | ||
701 | ]); | ||
702 | |||
703 | $this->assertSame(200, $this->client->getResponse()->getStatusCode()); | ||
704 | |||
705 | $content = json_decode($this->client->getResponse()->getContent(), true); | ||
706 | |||
707 | $this->assertSame($entry->getId(), $content['id']); | ||
708 | $this->assertSame($entry->getUrl(), $content['url']); | ||
709 | $this->assertEmpty($content['origin_url']); | ||
710 | $this->assertEmpty($content['published_by'], 'Authors were not saved because of an array instead of a string'); | ||
711 | $this->assertSame($previousContent, $content['content'], 'Ensure content has not moved'); | ||
712 | $this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved'); | ||
713 | $this->assertSame($previousTitle, $content['title'], 'Ensure title has not moved'); | ||
714 | } | ||
715 | |||
716 | public function testPatchEntryNullOriginUrl() | ||
717 | { | ||
718 | $entry = $this->client->getContainer() | ||
719 | ->get('doctrine.orm.entity_manager') | ||
720 | ->getRepository('WallabagCoreBundle:Entry') | ||
721 | ->findOneByUser(1); | ||
722 | |||
723 | if (!$entry) { | ||
724 | $this->markTestSkipped('No content found in db.'); | ||
725 | } | ||
726 | |||
727 | $this->client->request('PATCH', '/api/entries/' . $entry->getId() . '.json', [ | ||
728 | 'origin_url' => null, | ||
729 | ]); | ||
730 | |||
731 | $this->assertSame(200, $this->client->getResponse()->getStatusCode()); | ||
732 | |||
733 | $content = json_decode($this->client->getResponse()->getContent(), true); | ||
734 | |||
735 | $this->assertNull($content['origin_url']); | ||
736 | } | ||
737 | |||
610 | public function testGetTagsEntry() | 738 | public function testGetTagsEntry() |
611 | { | 739 | { |
612 | $entry = $this->client->getContainer() | 740 | $entry = $this->client->getContainer() |
@@ -855,7 +983,7 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
855 | 983 | ||
856 | $content = json_decode($this->client->getResponse()->getContent(), true); | 984 | $content = json_decode($this->client->getResponse()->getContent(), true); |
857 | 985 | ||
858 | $this->assertSame(false, $content['exists']); | 986 | $this->assertFalse($content['exists']); |
859 | } | 987 | } |
860 | 988 | ||
861 | public function testGetEntriesExistsWithNoUrl() | 989 | public function testGetEntriesExistsWithNoUrl() |
diff --git a/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php b/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php index f684a206..bd351b18 100644 --- a/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php | |||
@@ -5,6 +5,7 @@ namespace Tests\Wallabag\CoreBundle\Command; | |||
5 | use DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticDriver; | 5 | use DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticDriver; |
6 | use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand; | 6 | use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand; |
7 | use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand; | 7 | use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand; |
8 | use Doctrine\Bundle\MigrationsBundle\Command\MigrationsMigrateDoctrineCommand; | ||
8 | use Doctrine\DBAL\Platforms\PostgreSqlPlatform; | 9 | use Doctrine\DBAL\Platforms\PostgreSqlPlatform; |
9 | use Doctrine\DBAL\Platforms\SqlitePlatform; | 10 | use Doctrine\DBAL\Platforms\SqlitePlatform; |
10 | use Symfony\Bundle\FrameworkBundle\Console\Application; | 11 | use Symfony\Bundle\FrameworkBundle\Console\Application; |
@@ -98,7 +99,6 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
98 | $this->assertContains('Setting up database.', $tester->getDisplay()); | 99 | $this->assertContains('Setting up database.', $tester->getDisplay()); |
99 | $this->assertContains('Administration setup.', $tester->getDisplay()); | 100 | $this->assertContains('Administration setup.', $tester->getDisplay()); |
100 | $this->assertContains('Config setup.', $tester->getDisplay()); | 101 | $this->assertContains('Config setup.', $tester->getDisplay()); |
101 | $this->assertContains('Run migrations.', $tester->getDisplay()); | ||
102 | } | 102 | } |
103 | 103 | ||
104 | public function testRunInstallCommandWithReset() | 104 | public function testRunInstallCommandWithReset() |
@@ -125,7 +125,6 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
125 | $this->assertContains('Dropping database, creating database and schema, clearing the cache', $tester->getDisplay()); | 125 | $this->assertContains('Dropping database, creating database and schema, clearing the cache', $tester->getDisplay()); |
126 | $this->assertContains('Administration setup.', $tester->getDisplay()); | 126 | $this->assertContains('Administration setup.', $tester->getDisplay()); |
127 | $this->assertContains('Config setup.', $tester->getDisplay()); | 127 | $this->assertContains('Config setup.', $tester->getDisplay()); |
128 | $this->assertContains('Run migrations.', $tester->getDisplay()); | ||
129 | 128 | ||
130 | // we force to reset everything | 129 | // we force to reset everything |
131 | $this->assertContains('Dropping database, creating database and schema, clearing the cache', $tester->getDisplay()); | 130 | $this->assertContains('Dropping database, creating database and schema, clearing the cache', $tester->getDisplay()); |
@@ -171,7 +170,6 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
171 | $this->assertContains('Setting up database.', $tester->getDisplay()); | 170 | $this->assertContains('Setting up database.', $tester->getDisplay()); |
172 | $this->assertContains('Administration setup.', $tester->getDisplay()); | 171 | $this->assertContains('Administration setup.', $tester->getDisplay()); |
173 | $this->assertContains('Config setup.', $tester->getDisplay()); | 172 | $this->assertContains('Config setup.', $tester->getDisplay()); |
174 | $this->assertContains('Run migrations.', $tester->getDisplay()); | ||
175 | 173 | ||
176 | // the current database doesn't already exist | 174 | // the current database doesn't already exist |
177 | $this->assertContains('Creating database and schema, clearing the cache', $tester->getDisplay()); | 175 | $this->assertContains('Creating database and schema, clearing the cache', $tester->getDisplay()); |
@@ -198,7 +196,6 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
198 | $this->assertContains('Setting up database.', $tester->getDisplay()); | 196 | $this->assertContains('Setting up database.', $tester->getDisplay()); |
199 | $this->assertContains('Administration setup.', $tester->getDisplay()); | 197 | $this->assertContains('Administration setup.', $tester->getDisplay()); |
200 | $this->assertContains('Config setup.', $tester->getDisplay()); | 198 | $this->assertContains('Config setup.', $tester->getDisplay()); |
201 | $this->assertContains('Run migrations.', $tester->getDisplay()); | ||
202 | 199 | ||
203 | $this->assertContains('Dropping schema and creating schema', $tester->getDisplay()); | 200 | $this->assertContains('Dropping schema and creating schema', $tester->getDisplay()); |
204 | } | 201 | } |
@@ -209,6 +206,7 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
209 | $application->add(new InstallCommand()); | 206 | $application->add(new InstallCommand()); |
210 | $application->add(new DropDatabaseDoctrineCommand()); | 207 | $application->add(new DropDatabaseDoctrineCommand()); |
211 | $application->add(new CreateDatabaseDoctrineCommand()); | 208 | $application->add(new CreateDatabaseDoctrineCommand()); |
209 | $application->add(new MigrationsMigrateDoctrineCommand()); | ||
212 | 210 | ||
213 | // drop database first, so the install command won't ask to reset things | 211 | // drop database first, so the install command won't ask to reset things |
214 | $command = new DropDatabaseDoctrineCommand(); | 212 | $command = new DropDatabaseDoctrineCommand(); |
@@ -242,7 +240,6 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
242 | $this->assertContains('Setting up database.', $tester->getDisplay()); | 240 | $this->assertContains('Setting up database.', $tester->getDisplay()); |
243 | $this->assertContains('Administration setup.', $tester->getDisplay()); | 241 | $this->assertContains('Administration setup.', $tester->getDisplay()); |
244 | $this->assertContains('Config setup.', $tester->getDisplay()); | 242 | $this->assertContains('Config setup.', $tester->getDisplay()); |
245 | $this->assertContains('Run migrations.', $tester->getDisplay()); | ||
246 | 243 | ||
247 | $this->assertContains('Creating schema', $tester->getDisplay()); | 244 | $this->assertContains('Creating schema', $tester->getDisplay()); |
248 | } | 245 | } |
@@ -265,6 +262,5 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
265 | $this->assertContains('Setting up database.', $tester->getDisplay()); | 262 | $this->assertContains('Setting up database.', $tester->getDisplay()); |
266 | $this->assertContains('Administration setup.', $tester->getDisplay()); | 263 | $this->assertContains('Administration setup.', $tester->getDisplay()); |
267 | $this->assertContains('Config setup.', $tester->getDisplay()); | 264 | $this->assertContains('Config setup.', $tester->getDisplay()); |
268 | $this->assertContains('Run migrations.', $tester->getDisplay()); | ||
269 | } | 265 | } |
270 | } | 266 | } |
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 6e806553..4ac4548b 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -137,6 +137,8 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
137 | $this->logInAs('admin'); | 137 | $this->logInAs('admin'); |
138 | $client = $this->getClient(); | 138 | $client = $this->getClient(); |
139 | 139 | ||
140 | $client->getContainer()->get('craue_config')->set('store_article_headers', 1); | ||
141 | |||
140 | $crawler = $client->request('GET', '/new'); | 142 | $crawler = $client->request('GET', '/new'); |
141 | 143 | ||
142 | $this->assertSame(200, $client->getResponse()->getStatusCode()); | 144 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
@@ -165,6 +167,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
165 | $this->assertSame('2015-03-28 11:43:19', $content->getPublishedAt()->format('Y-m-d H:i:s')); | 167 | $this->assertSame('2015-03-28 11:43:19', $content->getPublishedAt()->format('Y-m-d H:i:s')); |
166 | $this->assertSame('Morgane Tual', $author[0]); | 168 | $this->assertSame('Morgane Tual', $author[0]); |
167 | $this->assertArrayHasKey('x-varnish1', $content->getHeaders()); | 169 | $this->assertArrayHasKey('x-varnish1', $content->getHeaders()); |
170 | $client->getContainer()->get('craue_config')->set('store_article_headers', 0); | ||
168 | } | 171 | } |
169 | 172 | ||
170 | public function testPostWithMultipleAuthors() | 173 | public function testPostWithMultipleAuthors() |
@@ -475,6 +478,40 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
475 | 478 | ||
476 | $data = [ | 479 | $data = [ |
477 | 'entry[title]' => 'My updated title hehe :)', | 480 | 'entry[title]' => 'My updated title hehe :)', |
481 | 'entry[origin_url]' => 'https://example.io', | ||
482 | ]; | ||
483 | |||
484 | $client->submit($form, $data); | ||
485 | |||
486 | $this->assertSame(302, $client->getResponse()->getStatusCode()); | ||
487 | |||
488 | $crawler = $client->followRedirect(); | ||
489 | |||
490 | $this->assertGreaterThan(1, $title = $crawler->filter('div[id=article] h1')->extract(['_text'])); | ||
491 | $this->assertContains('My updated title hehe :)', $title[0]); | ||
492 | $this->assertGreaterThan(1, $stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text'])); | ||
493 | $this->assertContains('example.io', trim($stats[1])); | ||
494 | } | ||
495 | |||
496 | public function testEditRemoveOriginUrl() | ||
497 | { | ||
498 | $this->logInAs('admin'); | ||
499 | $client = $this->getClient(); | ||
500 | |||
501 | $entry = new Entry($this->getLoggedInUser()); | ||
502 | $entry->setUrl($this->url); | ||
503 | $this->getEntityManager()->persist($entry); | ||
504 | $this->getEntityManager()->flush(); | ||
505 | |||
506 | $crawler = $client->request('GET', '/edit/' . $entry->getId()); | ||
507 | |||
508 | $this->assertSame(200, $client->getResponse()->getStatusCode()); | ||
509 | |||
510 | $form = $crawler->filter('button[type=submit]')->form(); | ||
511 | |||
512 | $data = [ | ||
513 | 'entry[title]' => 'My updated title hehe :)', | ||
514 | 'entry[origin_url]' => '', | ||
478 | ]; | 515 | ]; |
479 | 516 | ||
480 | $client->submit($form, $data); | 517 | $client->submit($form, $data); |
@@ -483,8 +520,10 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
483 | 520 | ||
484 | $crawler = $client->followRedirect(); | 521 | $crawler = $client->followRedirect(); |
485 | 522 | ||
486 | $this->assertGreaterThan(1, $alert = $crawler->filter('div[id=article] h1')->extract(['_text'])); | 523 | $this->assertGreaterThan(1, $title = $crawler->filter('div[id=article] h1')->extract(['_text'])); |
487 | $this->assertContains('My updated title hehe :)', $alert[0]); | 524 | $this->assertContains('My updated title hehe :)', $title[0]); |
525 | $this->assertSame(1, count($stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text']))); | ||
526 | $this->assertNotContains('example.io', trim($stats[0])); | ||
488 | } | 527 | } |
489 | 528 | ||
490 | public function testToggleArchive() | 529 | public function testToggleArchive() |
diff --git a/tests/Wallabag/CoreBundle/Controller/SiteCredentialControllerTest.php b/tests/Wallabag/CoreBundle/Controller/SiteCredentialControllerTest.php index 87ea2867..f5074403 100644 --- a/tests/Wallabag/CoreBundle/Controller/SiteCredentialControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/SiteCredentialControllerTest.php | |||
@@ -8,6 +8,20 @@ use Wallabag\CoreBundle\Entity\SiteCredential; | |||
8 | 8 | ||
9 | class SiteCredentialControllerTest extends WallabagCoreTestCase | 9 | class SiteCredentialControllerTest extends WallabagCoreTestCase |
10 | { | 10 | { |
11 | public function testAccessDeniedBecauseFeatureDisabled() | ||
12 | { | ||
13 | $this->logInAs('admin'); | ||
14 | $client = $this->getClient(); | ||
15 | |||
16 | $client->getContainer()->get('craue_config')->set('restricted_access', 0); | ||
17 | |||
18 | $client->request('GET', '/site-credentials/'); | ||
19 | |||
20 | $this->assertSame(404, $client->getResponse()->getStatusCode()); | ||
21 | |||
22 | $client->getContainer()->get('craue_config')->set('restricted_access', 1); | ||
23 | } | ||
24 | |||
11 | public function testListSiteCredential() | 25 | public function testListSiteCredential() |
12 | { | 26 | { |
13 | $this->logInAs('admin'); | 27 | $this->logInAs('admin'); |
diff --git a/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php b/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php index 5d6a29fe..5aee9f5c 100644 --- a/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php +++ b/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php | |||
@@ -68,7 +68,7 @@ class GrabySiteConfigBuilderTest extends \PHPUnit_Framework_TestCase | |||
68 | $config = $this->builder->buildForHost('www.example.com'); | 68 | $config = $this->builder->buildForHost('www.example.com'); |
69 | 69 | ||
70 | $this->assertSame('example.com', $config->getHost()); | 70 | $this->assertSame('example.com', $config->getHost()); |
71 | $this->assertSame(true, $config->requiresLogin()); | 71 | $this->assertTrue($config->requiresLogin()); |
72 | $this->assertSame('http://www.example.com/login', $config->getLoginUri()); | 72 | $this->assertSame('http://www.example.com/login', $config->getLoginUri()); |
73 | $this->assertSame('login', $config->getUsernameField()); | 73 | $this->assertSame('login', $config->getUsernameField()); |
74 | $this->assertSame('password', $config->getPasswordField()); | 74 | $this->assertSame('password', $config->getPasswordField()); |
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php index f94c2137..5c99e461 100644 --- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php +++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php | |||
@@ -51,7 +51,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
51 | $this->assertEmpty($entry->getMimetype()); | 51 | $this->assertEmpty($entry->getMimetype()); |
52 | $this->assertEmpty($entry->getLanguage()); | 52 | $this->assertEmpty($entry->getLanguage()); |
53 | $this->assertSame(0.0, $entry->getReadingTime()); | 53 | $this->assertSame(0.0, $entry->getReadingTime()); |
54 | $this->assertSame(null, $entry->getDomainName()); | 54 | $this->assertNull($entry->getDomainName()); |
55 | } | 55 | } |
56 | 56 | ||
57 | public function testWithEmptyContent() | 57 | public function testWithEmptyContent() |
@@ -311,7 +311,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
311 | $tagger->expects($this->once()) | 311 | $tagger->expects($this->once()) |
312 | ->method('tag'); | 312 | ->method('tag'); |
313 | 313 | ||
314 | $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); | 314 | $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, true); |
315 | $entry = new Entry(new User()); | 315 | $entry = new Entry(new User()); |
316 | $proxy->updateEntry( | 316 | $proxy->updateEntry( |
317 | $entry, | 317 | $entry, |
@@ -341,6 +341,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
341 | $this->assertContains('Jeremy', $entry->getPublishedBy()); | 341 | $this->assertContains('Jeremy', $entry->getPublishedBy()); |
342 | $this->assertContains('Nico', $entry->getPublishedBy()); | 342 | $this->assertContains('Nico', $entry->getPublishedBy()); |
343 | $this->assertContains('Thomas', $entry->getPublishedBy()); | 343 | $this->assertContains('Thomas', $entry->getPublishedBy()); |
344 | $this->assertNotNull($entry->getHeaders(), 'Headers are stored, so value is not null'); | ||
344 | $this->assertContains('no-cache', $entry->getHeaders()); | 345 | $this->assertContains('no-cache', $entry->getHeaders()); |
345 | } | 346 | } |
346 | 347 | ||
diff --git a/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php b/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php index ceec4b37..82336060 100644 --- a/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php +++ b/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php | |||
@@ -30,4 +30,31 @@ class WallabagExtensionTest extends \PHPUnit_Framework_TestCase | |||
30 | $this->assertSame('lemonde.fr', $extension->removeWww('lemonde.fr')); | 30 | $this->assertSame('lemonde.fr', $extension->removeWww('lemonde.fr')); |
31 | $this->assertSame('gist.github.com', $extension->removeWww('gist.github.com')); | 31 | $this->assertSame('gist.github.com', $extension->removeWww('gist.github.com')); |
32 | } | 32 | } |
33 | |||
34 | public function testRemoveSchemeAndWww() | ||
35 | { | ||
36 | $entryRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') | ||
37 | ->disableOriginalConstructor() | ||
38 | ->getMock(); | ||
39 | |||
40 | $tagRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\TagRepository') | ||
41 | ->disableOriginalConstructor() | ||
42 | ->getMock(); | ||
43 | |||
44 | $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface') | ||
45 | ->disableOriginalConstructor() | ||
46 | ->getMock(); | ||
47 | |||
48 | $translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface') | ||
49 | ->disableOriginalConstructor() | ||
50 | ->getMock(); | ||
51 | |||
52 | $extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator); | ||
53 | |||
54 | $this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('www.lemonde.fr')); | ||
55 | $this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('http://lemonde.fr')); | ||
56 | $this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('https://www.lemonde.fr')); | ||
57 | $this->assertSame('gist.github.com', $extension->removeSchemeAndWww('https://gist.github.com')); | ||
58 | $this->assertSame('ftp://gist.github.com', $extension->removeSchemeAndWww('ftp://gist.github.com')); | ||
59 | } | ||
33 | } | 60 | } |