script:
- travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist
- - ant prepare-$DB
-
- - echo "travis_fold:start:migrations"
- - php bin/console doctrine:migrations:migrate --no-interaction --env=test
- - echo "travis_fold:end:migrations"
+ - echo "travis_fold:start:prepare"
+ - make prepare DB=$DB
+ - echo "travis_fold:end:prepare"
- echo "travis_fold:start:fixtures"
- php bin/console doctrine:fixtures:load --no-interaction --env=test
TMP_FOLDER=/tmp
RELEASE_FOLDER=wllbg-release
-ifndef ENV
- ENV=prod
-endif
+ENV ?= prod
help: ## Display this help menu
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
clean: ## Clear the application cache
- @rm -rf var/cache/*
+ rm -rf var/cache/*
install: ## Install wallabag with the latest version
@sh scripts/install.sh $(ENV)
build: ## Run webpack
@npm run build:$(ENV)
-test: ## Launch wallabag testsuite
- @ant prepare && bin/simple-phpunit -v
+prepare: clean ## Prepare database for testsuite
+ifdef DB
+ cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml
+endif
+ -php bin/console doctrine:database:drop --force --env=test
+ php bin/console doctrine:database:create --env=test
+ php bin/console doctrine:migrations:migrate --no-interaction --env=test
+
+fixtures: ## Load fixtures into database
+ php bin/console doctrine:fixtures:load --no-interaction --env=test
+
+test: prepare fixtures ## Launch wallabag testsuite
+ bin/simple-phpunit -v
release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
ifndef VERSION
endif
@sh scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV)
-travis: ## Make some stuff for Travis-CI
-
deploy: ## Deploy wallabag
@bundle exec cap staging deploy
-.PHONY: help clean install update build test release travis deploy run dev
+.PHONY: help clean prepare install fixtures update build test release deploy run dev
.DEFAULT_GOAL := install
--- /dev/null
+<?php
+
+namespace Application\Migrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Schema\Schema;
+
+/**
+ * Initial database structure.
+ */
+class Version20160401000000 extends AbstractMigration
+{
+ /**
+ * @param Schema $schema
+ */
+ public function up(Schema $schema)
+ {
+ if ($this->version->getConfiguration()->getNumberOfExecutedMigrations() > 0) {
+ $this->version->markMigrated();
+ $this->skipIf(true, 'Database already initialized');
+ }
+
+ switch ($this->connection->getDatabasePlatform()->getName()) {
+ case 'sqlite':
+ $sql = <<<'SQL'
+CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
+CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name);
+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);
+CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id);
+CREATE TABLE "wallabag_tag" (id INTEGER NOT NULL, label CLOB NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id));
+CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug);
+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);
+CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id);
+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);
+CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id);
+CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id);
+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);
+CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id);
+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);
+CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token);
+CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id);
+CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id);
+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);
+CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token);
+CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id);
+CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id);
+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);
+CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token);
+CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id);
+CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id);
+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));
+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));
+CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical);
+CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical);
+CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token);
+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);
+CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id);
+CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id);
+SQL
+ ;
+
+ foreach (explode("\n", $sql) as $query) {
+ $this->addSql($query);
+ }
+
+ break;
+ case 'mysql':
+ $sql = <<<'SQL'
+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;
+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;
+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;
+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;
+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;
+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;
+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;
+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;
+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;
+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;
+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;
+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;
+ALTER TABLE `wallabag_entry` ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
+ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id);
+ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES `wallabag_tag` (id);
+ALTER TABLE `wallabag_config` ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
+ALTER TABLE `wallabag_tagging_rule` ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES `wallabag_config` (id);
+ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id);
+ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
+ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id);
+ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
+ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id);
+ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
+ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
+ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id);
+SQL
+ ;
+ foreach (explode("\n", $sql) as $query) {
+ $this->addSql($query);
+ }
+ break;
+ case 'postgresql':
+ $sql = <<<'SQL'
+CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
+CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name);
+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));
+CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id);
+CREATE TABLE wallabag_entry_tag (entry_id INT NOT NULL, tag_id INT NOT NULL, PRIMARY KEY(entry_id, tag_id));
+CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id);
+CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id);
+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));
+CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id);
+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));
+CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id);
+COMMENT ON COLUMN "wallabag_tagging_rule".tags IS '(DC2Type:simple_array)';
+CREATE TABLE "wallabag_tag" (id INT NOT NULL, label TEXT NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id));
+CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug);
+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));
+COMMENT ON COLUMN wallabag_oauth2_clients.redirect_uris IS '(DC2Type:array)';
+COMMENT ON COLUMN wallabag_oauth2_clients.allowed_grant_types IS '(DC2Type:array)';
+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));
+CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token);
+CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id);
+CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id);
+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));
+CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token);
+CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id);
+CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id);
+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));
+CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token);
+CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id);
+CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id);
+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));
+CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical);
+CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical);
+CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token);
+COMMENT ON COLUMN "wallabag_user".roles IS '(DC2Type:array)';
+COMMENT ON COLUMN "wallabag_user".trusted IS '(DC2Type:json_array)';
+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));
+CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id);
+CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id);
+COMMENT ON COLUMN wallabag_annotation.ranges IS '(DC2Type:array)';
+CREATE SEQUENCE "entry_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
+CREATE SEQUENCE "config_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
+CREATE SEQUENCE "tagging_rule_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
+CREATE SEQUENCE "tag_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
+CREATE SEQUENCE oauth2_clients_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
+CREATE SEQUENCE oauth2_access_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
+CREATE SEQUENCE oauth2_refresh_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
+CREATE SEQUENCE oauth2_auth_codes_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
+CREATE SEQUENCE "user_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
+CREATE SEQUENCE annotation_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
+ALTER TABLE "wallabag_entry" ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE "wallabag_config" ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE "wallabag_tagging_rule" ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+SQL
+ ;
+ foreach (explode("\n", $sql) as $query) {
+ $this->addSql($query);
+ }
+ break;
+ }
+ }
+
+ /**
+ * @param Schema $schema
+ */
+ public function down(Schema $schema)
+ {
+ $this->addSql('DROP TABLE wallabag_craue_config_setting');
+ $this->addSql('DROP TABLE "wallabag_tagging_rule"');
+ $this->addSql('DROP TABLE "wallabag_config"');
+ $this->addSql('DROP TABLE "wallabag_entry"');
+ $this->addSql('DROP TABLE wallabag_entry_tag');
+ $this->addSql('DROP TABLE "wallabag_tag"');
+ $this->addSql('DROP TABLE wallabag_oauth2_refresh_tokens');
+ $this->addSql('DROP TABLE wallabag_oauth2_access_tokens');
+ $this->addSql('DROP TABLE wallabag_oauth2_clients');
+ $this->addSql('DROP TABLE wallabag_oauth2_auth_codes');
+ $this->addSql('DROP TABLE "wallabag_user"');
+ $this->addSql('DROP TABLE wallabag_annotation');
+ }
+}
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
$this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.');
- $clientsTable->addColumn('name', 'blob');
+ if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
+ // Can't use $clientsTable->addColumn('name', 'blob');
+ // because of the error:
+ // SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL
+ $databaseTablePrefix = $this->container->getParameter('database_table_prefix');
+ $this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients');
+ $this->addSql('DROP TABLE ' . $databaseTablePrefix . 'oauth2_clients');
+ $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)');
+ $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');
+ $this->addSql('DROP TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients');
+ $this->addSql('CREATE INDEX IDX_635D765EA76ED395 ON ' . $databaseTablePrefix . 'oauth2_clients (user_id)');
+ } else {
+ $clientsTable->addColumn('name', 'blob');
+ }
}
/**
public function down(Schema $schema)
{
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
- $clientsTable->dropColumn('name');
+
+ if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
+ $databaseTablePrefix = $this->container->getParameter('database_table_prefix');
+ $this->addSql('DROP INDEX IDX_635D765EA76ED395');
+ $this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients');
+ $this->addSql('DROP TABLE ' . $databaseTablePrefix . 'oauth2_clients');
+ $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))');
+ $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');
+ $this->addSql('DROP TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients');
+ } else {
+ $clientsTable->dropColumn('name');
+ }
}
private function getTable($tableName)
$entryTable = $schema->getTable($this->getTable('entry'));
$this->skipIf(!$entryTable->hasColumn('starred_at'), 'Unable to add starred_at colum');
- $this->connection->executeQuery('UPDATE ' . $this->getTable('entry') . ' SET starred_at = updated_at WHERE is_starred = true');
+ $this->connection->executeQuery(
+ 'UPDATE ' . $this->getTable('entry') . ' SET starred_at = updated_at WHERE is_starred = :is_starred',
+ [
+ 'is_starred' => true,
+ ]
+ );
}
/**
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'mysql':
+ $this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;');
break;
case 'postgresql':
--- /dev/null
+<?php
+
+namespace Application\Migrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Schema\Schema;
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Add origin_url column.
+ */
+class Version20171105202000 extends AbstractMigration implements ContainerAwareInterface
+{
+ /**
+ * @var ContainerInterface
+ */
+ private $container;
+
+ public function setContainer(ContainerInterface $container = null)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * @param Schema $schema
+ */
+ public function up(Schema $schema)
+ {
+ $entryTable = $schema->getTable($this->getTable('entry'));
+
+ $this->skipIf($entryTable->hasColumn('origin_url'), 'It seems that you already played this migration.');
+
+ $entryTable->addColumn('origin_url', 'text', [
+ 'notnull' => false,
+ ]);
+ }
+
+ /**
+ * @param Schema $schema
+ */
+ public function down(Schema $schema)
+ {
+ $entryTable = $schema->getTable($this->getTable('entry'));
+
+ $this->skipIf(!$entryTable->hasColumn('origin_url'), 'It seems that you already played this migration.');
+
+ $entryTable->dropColumn('origin_url');
+ }
+
+ private function getTable($tableName)
+ {
+ return $this->container->getParameter('database_table_prefix') . $tableName;
+ }
+}
--- /dev/null
+<?php
+
+namespace Application\Migrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Schema\Schema;
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Add store_article_headers in craue_config_setting.
+ */
+class Version20171120163128 extends AbstractMigration implements ContainerAwareInterface
+{
+ /**
+ * @var ContainerInterface
+ */
+ private $container;
+
+ public function setContainer(ContainerInterface $container = null)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * @param Schema $schema
+ */
+ public function up(Schema $schema)
+ {
+ $storeArticleHeaders = $this->container
+ ->get('doctrine.orm.default_entity_manager')
+ ->getConnection()
+ ->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers'");
+
+ $this->skipIf(false !== $storeArticleHeaders, 'It seems that you already played this migration.');
+
+ $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('store_article_headers', '0', 'entry')");
+ }
+
+ /**
+ * @param Schema $schema
+ */
+ public function down(Schema $schema)
+ {
+ $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers';");
+ }
+
+ private function getTable($tableName)
+ {
+ return $this->container->getParameter('database_table_prefix') . $tableName;
+ }
+}
# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
# import_with_redis: Enable Redis to import data asynchronously
shaarli_url: Shaarli-URL, hvis tjenesten er aktiv
+scuttle_url: Scuttle-URL, hvis tjenesten er aktiv
+unmark_url: Unmark-URL, hvis tjenesten er aktiv
share_diaspora: Aktiver deling til Diaspora
share_mail: Aktiver deling med email
share_shaarli: Aktiver deling gennem Shaarli
# download_images_enabled: Download images locally
# restricted_access: Enable authentication for websites with paywall
# api_user_registration: Enable user to be registered using the API
+# store_article_headers: Enable if wallabag stores HTTP headers for each article
import_with_rabbitmq: 'Aktiviere RabbitMQ, um Artikel asynchron zu importieren'
import_with_redis: 'Aktiviere Redis, um Artikel asynchron zu importieren'
shaarli_url: 'Shaarli-URL, sofern der Service aktiviert ist'
+scuttle_url: 'Scuttle-URL, sofern der Service aktiviert ist'
+unmark_url: 'Unmark-URL, sofern der Service aktiviert ist'
share_diaspora: 'Teilen zu Diaspora aktiveren'
share_mail: 'Teilen via E-Mail aktiveren'
share_shaarli: 'Teilen zu Shaarli aktiveren'
download_images_enabled: 'Bilder lokal herunterladen'
restricted_access: 'Authentifizierung für Webseiten mit Paywall aktivieren'
api_user_registration: 'Registrierung eines Benutzers über die API ermöglichen'
+# store_article_headers: Enable if wallabag stores HTTP headers for each article
settings_changed: Configuration updated
download_pictures: Download pictures on your server
carrot: Enable share to Carrot
-diaspora_url: Diaspora URL, if the service is enabled
+diaspora_url: diaspora* URL, if the service is enabled
export_epub: Enable ePub export
export_mobi: Enable .mobi export
export_pdf: Enable PDF export
import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
import_with_redis: Enable Redis to import data asynchronously
shaarli_url: Shaarli URL, if the service is enabled
-share_diaspora: Enable share to Diaspora
-share_mail: Enable share by email
-share_shaarli: Enable share to Shaarli
-share_scuttle: Enable share to Scuttle
-share_twitter: Enable share to Twitter
-share_unmark: Enable share to Unmark.it
+scuttle_url: Scuttle URL, if the service is enabled
+unmark_url: Unmark URL, if the service is enabled
+share_diaspora: Enable share to diaspora*
+share_mail: Enable share by e-mail
+share_shaarli: Enable sharing to Shaarli
+share_scuttle: Enable sharing to Scuttle
+share_twitter: Enable sharing to Twitter
+share_unmark: Enable sharing to Unmark.it
show_printlink: Display a link to print content
wallabag_support_url: Support URL for wallabag
entry: "article"
piwik_host: Host of your website in Piwik (without http:// ou https://)
piwik_site_id: ID of your website in Piwik
piwik_enabled: Enable Piwik
-demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)"
+demo_mode_enabled: "Enable demo mode? (Only used for the public wallabag demo)"
demo_mode_username: "Demo user"
-share_public: Allow public url for entries
+share_public: Allow public URL for entries
download_images_enabled: Download images locally
-restricted_access: Enable authentication for websites with paywall
+restricted_access: Enable authentication for paywalled websites
api_user_registration: Enable user to be registered using the API
+store_article_headers: Enable if wallabag stores HTTP headers for each article
import_with_rabbitmq: Activar RabbitMQ para importar datos de forma asíncrona
import_with_redis: Activar Redis para importar datos de forma asíncrona
shaarli_url: URL de Shaarli, si el servicio está activado
+scuttle_url: URL de Scuttle, si el servicio está activado
+unmark_url: URL de Unmark, si el servicio está activado
share_diaspora: Activar compartir con Diaspora
share_mail: Activar compartir con Email
share_shaarli: Activar compartir con Shaarli
download_images_enabled: Descargar imágenes localmente
restricted_access: Activar autenticación para websites con paywall
# api_user_registration: Enable user to be registered using the API
+# store_article_headers: Enable if wallabag stores HTTP headers for each article
# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
# import_with_redis: Enable Redis to import data asynchronously
shaarli_url: نشانی Shaarli، اگر فعال بود
+scuttle_url: نشانی Scuttle، اگر فعال بود
+unmark_url: نشانی Unmark، اگر فعال بود
share_diaspora: فعالسازی همرسانی به Diaspora
share_mail: فعالسازی همرسانی با ایمیل
share_shaarli: فعالسازی همرسانی به Shaarli
# download_images_enabled: Download images locally
# restricted_access: Enable authentication for websites with paywall
# api_user_registration: Enable user to be registered using the API
+# store_article_headers: Enable if wallabag stores HTTP headers for each article
import_with_rabbitmq: Activer RabbitMQ pour gérer les imports de façon asynchrone
import_with_redis: Activer Redis pour gérer les imports de façon asynchrone
shaarli_url: URL de Shaarli, si le service Shaarli est activé
+scuttle_url: URL de Scuttle, si le service Scuttle est activé
+unmark_url: URL de Unmark, si le service Unmark est activé
share_diaspora: Activer le partage vers Diaspora
share_mail: Activer le partage par email
share_shaarli: Activer le partage vers Shaarli
download_images_enabled: Télécharger les images en local
restricted_access: Activer l'authentification pour les articles derrière un paywall
api_user_registration: Activer la création de compte depuis l'API
+store_article_headers: Activer le stockage des en-têtes HTTP de chaque article
# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
# import_with_redis: Enable Redis to import data asynchronously
shaarli_url: Shaarli URL, se il servizio è abilitato
+scuttle_url: Scuttle URL, se il servizio è abilitato
+unmark_url: Unmark URL, se il servizio è abilitato
share_diaspora: Abilita la condivisione con Diaspora
share_mail: Abilita la condivisione per email
share_shaarli: Abilita la condivisione con Shaarli
# download_images_enabled: Download images locally
# restricted_access: Enable authentication for websites with paywall
api_user_registration: Abilita la registrazione dell'utente attraverso l'API
+# store_article_headers: Enable if wallabag stores HTTP headers for each article
import_with_rabbitmq: Activar RabbitMQ per importar de donadas de manièra asincròna
import_with_redis: Activar Redis per importar de donadas de manièra asincròna
shaarli_url: URL de Shaarli, se lo servici Shaarli es activat
+scuttle_url: URL de Scuttle, se lo servici Scuttle es activat
+unmark_url: URL de Unmark, se lo servici Scuttle es activat
share_diaspora: Activar lo partatge cap a Diaspora*
share_mail: Activar lo partatge per corrièl
share_shaarli: Activar lo partatge cap a Shaarli
download_images_enabled: Telecargar los imatges en local
restricted_access: Activar l'autenticacion pels sites amb peatge
api_user_registration: Autorizar los utilizaires a se marcar amb l'API
+# store_article_headers: Enable if wallabag stores HTTP headers for each article
import_with_rabbitmq: Włącz RabbitMQ dla asynchronicznego importu danych
import_with_redis: Włącz Redis dla asynchronicznego importu danych
shaarli_url: Adress URL Shaarli, jeżeli usługa jest włączona
+scuttle_url: Adress URL Scuttle, jeżeli usługa jest włączona
share_diaspora: Włącz udostępnianie dla Diaspora
share_mail: Włącz udostępnianie przez email
share_shaarli: Włącz udostępnianie dla Shaarli
download_images_enabled: Pobierz obrazy lokalnie
restricted_access: Włącz autoryzację dla stron z paywallem
api_user_registration: Włącz rejestrację użytkownika przy użyciu API
+# store_article_headers: Enable if wallabag stores HTTP headers for each article
# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
# import_with_redis: Enable Redis to import data asynchronously
shaarli_url: URL Shaarli, se o serviço está habilitado
+scuttle_url: URL Scuttle, se o serviço está habilitado
+unmark_url: URL Unmark, se o serviço está habilitado
share_diaspora: Habilitar compartilhamento para o Diaspora
share_mail: Habilitar compartilhamento por e-mail
share_shaarli: Habilitar compartilhamento para o Shaarli
# download_images_enabled: Download images locally
# restricted_access: Enable authentication for websites with paywall
# api_user_registration: Enable user to be registered using the API
+# store_article_headers: Enable if wallabag stores HTTP headers for each article
# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
# import_with_redis: Enable Redis to import data asynchronously
shaarli_url: Shaarli URL, dacă serviciul este permis
+scuttle_url: Scuttle URL, dacă serviciul este permis
+unmark_url: Unmark URL, dacă serviciul este permis
share_diaspora: Permite share către Diaspora
share_mail: Permite share prin email
share_shaarli: Permite share către Shaarli
# download_images_enabled: Download images locally
# restricted_access: Enable authentication for websites with paywall
# api_user_registration: Enable user to be registered using the API
+# store_article_headers: Enable if wallabag stores HTTP headers for each article
import_with_rabbitmq: "Включить RabbitMQ для импорта данных(асинхронно)"
import_with_redis: "Включить Redis для импорта данных(асинхронно)"
shaarli_url: "Shaarli URL, если сервис включен"
+scuttle_url: "Scuttle URL, если сервис включен"
+unmark_url: "Unmark URL, если сервис включен"
share_diaspora: "Включить возможность поделиться в соц.сети Diaspora"
share_mail: "Включить возможность поделиться по email"
share_shaarli: "Включить возможность поделиться в Shaarli"
share_public: "Разрешить публичные ссылки на записи"
download_images_enabled: "Скачивать изображения локально"
restricted_access: "Включить авторизацию на сайте с помощью paywall"
+# api_user_registration: Enable user to be registered using the API
+# store_article_headers: Enable if wallabag stores HTTP headers for each article
# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
# import_with_redis: Enable Redis to import data asynchronously
# shaarli_url: Shaarli URL, if the service is enabled
+# scuttle_url: Scuttle URL, if the service is enabled
+# unmark_url: Unmark URL, if the service is enabled
# share_diaspora: Enable share to Diaspora
# share_mail: Enable share by email
# share_shaarli: Enable share to Shaarli
# download_images_enabled: Download images locally
# restricted_access: Enable authentication for websites with paywall
# api_user_registration: Enable user to be registered using the API
+# store_article_headers: Enable if wallabag stores HTTP headers for each article
name: api_user_registration
value: 0
section: api
+ -
+ name: store_article_headers
+ value: 0
+ section: entry
wallabag_user:
registration_enabled: "%fosuser_registration%"
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="wallabag" default="build">
- <target name="build" depends="clean,prepare,phpunit"/>
- <target name="prepare-mysql" depends="clean,prepare_mysql"/>
- <target name="prepare-sqlite" depends="clean,prepare_sqlite"/>
- <target name="prepare-pgsql" depends="clean,prepare_pgsql"/>
-
- <target name="clean" description="Cleanup build artifacts">
- <delete dir="${basedir}/var/cache"/>
- </target>
-
- <target name="prepare" description="Prepare for build">
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:database:drop"/>
- <arg value="--force"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:database:create"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:schema:create"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:fixtures:load"/>
- <arg value="--no-interaction"/>
- <arg value="--env=test"/>
- </exec>
- </target>
-
- <target name="prepare_mysql" description="Run test for MySQL">
- <delete dir="${basedir}/app/config/parameters.yml"/>
- <exec executable="cp">
- <arg value="${basedir}/app/config/tests/parameters_test.mysql.yml"/>
- <arg value="${basedir}/app/config/parameters_test.yml"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="cache:clear"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:database:drop"/>
- <arg value="--force"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:database:create"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:database:import"/>
- <arg value="data/sql/mysql_base.sql"/>
- <arg value="--env=test"/>
- </exec>
- </target>
-
- <target name="prepare_sqlite" description="Run test for SQLite">
- <delete dir="${basedir}/app/config/parameters.yml"/>
- <exec executable="cp">
- <arg value="${basedir}/app/config/tests/parameters_test.sqlite.yml"/>
- <arg value="${basedir}/app/config/parameters_test.yml"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="cache:clear"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:database:drop"/>
- <arg value="--force"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:database:create"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:schema:create"/>
- <arg value="--env=test"/>
- </exec>
- </target>
-
- <target name="prepare_pgsql" description="Run test for PostgreSQL">
- <delete dir="${basedir}/app/config/parameters.yml"/>
- <exec executable="cp">
- <arg value="${basedir}/app/config/tests/parameters_test.pgsql.yml"/>
- <arg value="${basedir}/app/config/parameters_test.yml"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="cache:clear"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:database:drop"/>
- <arg value="--force"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="php">
- <arg value="${basedir}/bin/console"/>
- <arg value="doctrine:database:create"/>
- <arg value="--env=test"/>
- </exec>
- <exec executable="psql">
- <arg value="-h"/>
- <arg value="localhost"/>
- <arg value="-d"/>
- <arg value="wallabag_test"/>
- <arg value="-U"/>
- <arg value="travis"/>
- <arg value="-f"/>
- <arg value="data/sql/pgsql_base.sql"/>
- </exec>
- </target>
-
- <target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
- <exec executable="phpunit" failonerror="true">
- <arg value="--coverage-html"/>
- <arg value="build/coverage"/>
- </exec>
- </target>
-</project>
"ext-iconv": "*",
"ext-tokenizer": "*",
"ext-pdo": "*",
- "symfony/symfony": "3.3.*",
- "doctrine/orm": "^2.5",
- "doctrine/doctrine-bundle": "^1.6",
- "doctrine/doctrine-cache-bundle": "^1.2",
- "twig/extensions": "~1.0",
- "symfony/swiftmailer-bundle": "^2.3",
- "symfony/monolog-bundle": "^3.0",
- "sensio/distribution-bundle": "^5.0",
- "sensio/framework-extra-bundle": "^3.0",
- "incenteev/composer-parameter-handler": "^2.0",
- "nelmio/cors-bundle": "~1.4",
+ "symfony/symfony": "~3.3.13",
+ "doctrine/orm": "^2.5.12",
+ "doctrine/doctrine-bundle": "^1.8.0",
+ "doctrine/doctrine-cache-bundle": "^1.3.2",
+ "twig/extensions": "^1.5.1",
+ "symfony/swiftmailer-bundle": "^2.6.7",
+ "symfony/monolog-bundle": "^3.1.2",
+ "sensio/distribution-bundle": "^5.0.21",
+ "sensio/framework-extra-bundle": "^3.0.28",
+ "incenteev/composer-parameter-handler": "^2.1.2",
+ "nelmio/cors-bundle": "~1.5",
"friendsofsymfony/rest-bundle": "~2.1",
"jms/serializer-bundle": "~2.2",
- "nelmio/api-doc-bundle": "~2.7",
+ "nelmio/api-doc-bundle": "^2.13.2",
"mgargano/simplehtmldom": "~1.5",
- "wallabag/tcpdf": "^6.2",
+ "wallabag/tcpdf": "^6.2.15",
"simplepie/simplepie": "~1.5",
- "willdurand/hateoas-bundle": "~1.0",
- "liip/theme-bundle": "~1.1",
- "lexik/form-filter-bundle": "~5.0",
+ "willdurand/hateoas-bundle": "~1.3",
+ "liip/theme-bundle": "^1.4.6",
+ "lexik/form-filter-bundle": "^5.0.4",
"j0k3r/graby": "^1.0",
- "friendsofsymfony/user-bundle": "^2.0",
- "friendsofsymfony/oauth-server-bundle": "^1.5",
+ "friendsofsymfony/user-bundle": "^2.0.1",
+ "friendsofsymfony/oauth-server-bundle": "^1.5.2",
"stof/doctrine-extensions-bundle": "^1.2",
- "scheb/two-factor-bundle": "~2.0",
- "grandt/phpepub": "~4.0",
+ "scheb/two-factor-bundle": "^2.14.0",
+ "grandt/phpepub": "^4.0.7",
"wallabag/php-mobi": "~1.0.0",
"kphoen/rulerz-bundle": "~0.13",
"guzzlehttp/guzzle": "^5.3.1",
- "doctrine/doctrine-migrations-bundle": "^1.0",
- "paragonie/random_compat": "~2.0",
+ "doctrine/doctrine-migrations-bundle": "^1.3",
+ "paragonie/random_compat": "^2.0.11",
"craue/config-bundle": "~2.0",
"mnapoli/piwik-twig-extension": "^1.0",
- "ocramius/proxy-manager": "1.*",
- "white-october/pagerfanta-bundle": "^1.0",
- "php-amqplib/rabbitmq-bundle": "^1.8",
- "predis/predis": "^1.0",
- "javibravo/simpleue": "^1.0",
- "symfony/dom-crawler": "^3.1",
- "friendsofsymfony/jsrouting-bundle": "^1.6",
+ "ocramius/proxy-manager": "^1.0.2",
+ "white-october/pagerfanta-bundle": "^1.1.0",
+ "php-amqplib/rabbitmq-bundle": "^1.14",
+ "predis/predis": "^1.1.1",
+ "javibravo/simpleue": "^2.0",
+ "symfony/dom-crawler": "^3.3.13",
+ "friendsofsymfony/jsrouting-bundle": "^1.6.3",
"bdunogier/guzzle-site-authenticator": "^1.0.0@dev",
"defuse/php-encryption": "^2.1",
"html2text/html2text": "^4.1"
+++ /dev/null
-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;
-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;
-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;
-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;
-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;
-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;
-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;
-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;
-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;
-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;
-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;
-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;
-ALTER TABLE `wallabag_entry` ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
-ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id);
-ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES `wallabag_tag` (id);
-ALTER TABLE `wallabag_config` ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
-ALTER TABLE `wallabag_tagging_rule` ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES `wallabag_config` (id);
-ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id);
-ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
-ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id);
-ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
-ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id);
-ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
-ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
-ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id);
+++ /dev/null
-CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
-CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name);
-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));
-CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id);
-CREATE TABLE wallabag_entry_tag (entry_id INT NOT NULL, tag_id INT NOT NULL, PRIMARY KEY(entry_id, tag_id));
-CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id);
-CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id);
-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));
-CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id);
-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));
-CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id);
-COMMENT ON COLUMN "wallabag_tagging_rule".tags IS '(DC2Type:simple_array)';
-CREATE TABLE "wallabag_tag" (id INT NOT NULL, label TEXT NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id));
-CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug);
-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));
-COMMENT ON COLUMN wallabag_oauth2_clients.redirect_uris IS '(DC2Type:array)';
-COMMENT ON COLUMN wallabag_oauth2_clients.allowed_grant_types IS '(DC2Type:array)';
-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));
-CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token);
-CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id);
-CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id);
-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));
-CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token);
-CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id);
-CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id);
-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));
-CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token);
-CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id);
-CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id);
-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));
-CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical);
-CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical);
-CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token);
-COMMENT ON COLUMN "wallabag_user".roles IS '(DC2Type:array)';
-COMMENT ON COLUMN "wallabag_user".trusted IS '(DC2Type:json_array)';
-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));
-CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id);
-CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id);
-COMMENT ON COLUMN wallabag_annotation.ranges IS '(DC2Type:array)';
-CREATE SEQUENCE "entry_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
-CREATE SEQUENCE "config_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
-CREATE SEQUENCE "tagging_rule_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
-CREATE SEQUENCE "tag_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
-CREATE SEQUENCE oauth2_clients_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
-CREATE SEQUENCE oauth2_access_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
-CREATE SEQUENCE oauth2_refresh_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
-CREATE SEQUENCE oauth2_auth_codes_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
-CREATE SEQUENCE "user_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
-CREATE SEQUENCE annotation_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
-ALTER TABLE "wallabag_entry" ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE "wallabag_config" ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE "wallabag_tagging_rule" ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
-ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
+++ /dev/null
-CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
-CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name);
-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);
-CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id);
-CREATE TABLE "wallabag_tag" (id INTEGER NOT NULL, label CLOB NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id));
-CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug);
-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);
-CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id);
-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);
-CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id);
-CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id);
-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);
-CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id);
-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);
-CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token);
-CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id);
-CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id);
-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);
-CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token);
-CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id);
-CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id);
-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);
-CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token);
-CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id);
-CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id);
-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));
-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));
-CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical);
-CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical);
-CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token);
-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);
-CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id);
-CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id);
* {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"},
* {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"},
* {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"},
+ * {"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)."},
* }
* )
*
$this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $data['tags']);
}
+ if (!empty($data['origin_url'])) {
+ $entry->setOriginUrl($data['origin_url']);
+ }
+
if (null !== $data['isPublic']) {
if (true === (bool) $data['isPublic'] && null === $entry->getUid()) {
$entry->generateUid();
* {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"},
* {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"},
* {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"},
+ * {"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)."},
* }
* )
*
}
}
+ if (!empty($data['origin_url'])) {
+ $entry->setOriginUrl($data['origin_url']);
+ }
+
$em = $this->getDoctrine()->getManager();
$em->persist($entry);
$em->flush();
'picture' => $request->request->get('preview_picture'),
'publishedAt' => $request->request->get('published_at'),
'authors' => $request->request->get('authors', ''),
+ 'origin_url' => $request->request->get('origin_url', ''),
];
}
->setupDatabase()
->setupAdmin()
->setupConfig()
- ->runMigrations()
;
$this->io->success('Wallabag has been successfully installed.');
protected function checkRequirements()
{
- $this->io->section('Step 1 of 5: Checking system requirements.');
+ $this->io->section('Step 1 of 4: Checking system requirements.');
$doctrineManager = $this->getContainer()->get('doctrine')->getManager();
protected function setupDatabase()
{
- $this->io->section('Step 2 of 5: Setting up database.');
+ $this->io->section('Step 2 of 4: Setting up database.');
// user want to reset everything? Don't care about what is already here
if (true === $this->defaultInput->getOption('reset')) {
$this
->runCommand('doctrine:database:drop', ['--force' => true])
->runCommand('doctrine:database:create')
- ->runCommand('doctrine:schema:create')
+ ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true])
->runCommand('cache:clear')
;
$this
->runCommand('doctrine:database:create')
- ->runCommand('doctrine:schema:create')
+ ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true])
->runCommand('cache:clear')
;
$this
->runCommand('doctrine:database:drop', ['--force' => true])
->runCommand('doctrine:database:create')
- ->runCommand('doctrine:schema:create')
+ ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true])
;
} elseif ($this->isSchemaPresent()) {
if ($this->io->confirm('Seems like your database contains schema. Do you want to reset it?', false)) {
$this
->runCommand('doctrine:schema:drop', ['--force' => true])
- ->runCommand('doctrine:schema:create')
+ ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true])
;
}
} else {
$this->io->text('Creating schema...');
$this
- ->runCommand('doctrine:schema:create')
+ ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true])
;
}
protected function setupAdmin()
{
- $this->io->section('Step 3 of 5: Administration setup.');
+ $this->io->section('Step 3 of 4: Administration setup.');
if (!$this->io->confirm('Would you like to create a new admin user (recommended)?', true)) {
return $this;
protected function setupConfig()
{
- $this->io->section('Step 4 of 5: Config setup.');
+ $this->io->section('Step 4 of 4: Config setup.');
$em = $this->getContainer()->get('doctrine.orm.entity_manager');
// cleanup before insert new stuff
return $this;
}
- protected function runMigrations()
- {
- $this->io->section('Step 5 of 5: Run migrations.');
-
- $this
- ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]);
-
- $this->io->text('<info>Migrations successfully executed.</info>');
-
- return $this;
- }
-
/**
* Run a command.
*
*/
public function indexAction()
{
+ $this->isSiteCredentialsEnabled();
+
$credentials = $this->get('wallabag_core.site_credential_repository')->findByUser($this->getUser());
return $this->render('WallabagCoreBundle:SiteCredential:index.html.twig', [
*/
public function newAction(Request $request)
{
+ $this->isSiteCredentialsEnabled();
+
$credential = new SiteCredential($this->getUser());
$form = $this->createForm('Wallabag\CoreBundle\Form\Type\SiteCredentialType', $credential);
*/
public function editAction(Request $request, SiteCredential $siteCredential)
{
+ $this->isSiteCredentialsEnabled();
+
$this->checkUserAction($siteCredential);
$deleteForm = $this->createDeleteForm($siteCredential);
*/
public function deleteAction(Request $request, SiteCredential $siteCredential)
{
+ $this->isSiteCredentialsEnabled();
+
$this->checkUserAction($siteCredential);
$form = $this->createDeleteForm($siteCredential);
return $this->redirectToRoute('site_credentials_index');
}
+ /**
+ * Throw a 404 if the feature is disabled.
+ */
+ private function isSiteCredentialsEnabled()
+ {
+ if (!$this->get('craue_config')->get('restricted_access')) {
+ throw $this->createNotFoundException('Feature "restricted_access" is disabled, controllers too.');
+ }
+ }
+
/**
* Creates a form to delete a site credential entity.
*
$entry2->setMimetype('text/html');
$entry2->setTitle('test title entry2');
$entry2->setContent('This is my content /o/');
+ $entry2->setOriginUrl('ftp://oneftp.tld');
$entry2->setLanguage('fr');
$manager->persist($entry2);
*/
private $tags;
+ /**
+ * @var string
+ *
+ * @ORM\Column(name="origin_url", type="text", nullable=true)
+ *
+ * @Groups({"entries_for_user", "export_all"})
+ */
+ private $originUrl;
+
/*
* @param User $user
*/
return $this;
}
+
+ /**
+ * Set origin url.
+ *
+ * @param string $originUrl
+ *
+ * @return Entry
+ */
+ public function setOriginUrl($originUrl)
+ {
+ $this->originUrl = $originUrl;
+
+ return $this;
+ }
+
+ /**
+ * Get origin url.
+ *
+ * @return string
+ */
+ public function getOriginUrl()
+ {
+ return $this->originUrl;
+ }
}
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
+use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
'required' => true,
'label' => 'entry.edit.title_label',
])
- ->add('url', TextType::class, [
+ ->add('url', UrlType::class, [
'disabled' => true,
'required' => false,
'label' => 'entry.edit.url_label',
])
+ ->add('origin_url', UrlType::class, [
+ 'required' => false,
+ 'property_path' => 'originUrl',
+ 'label' => 'entry.edit.origin_url_label',
+ ])
->add('save', SubmitType::class, [
'label' => 'entry.edit.save_label',
])
protected $mimeGuesser;
protected $fetchingErrorMessage;
protected $eventDispatcher;
+ protected $storeArticleHeaders;
- public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage)
+ public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage, $storeArticleHeaders = false)
{
$this->graby = $graby;
$this->tagger = $tagger;
$this->logger = $logger;
$this->mimeGuesser = new MimeTypeExtensionGuesser();
$this->fetchingErrorMessage = $fetchingErrorMessage;
+ $this->storeArticleHeaders = $storeArticleHeaders;
}
/**
$entry->setPublishedBy($content['authors']);
}
- if (!empty($content['all_headers'])) {
+ if (!empty($content['all_headers']) && $this->storeArticleHeaders) {
$entry->setHeaders($content['all_headers']);
}
- "@validator"
- "@logger"
- '%wallabag_core.fetching_error_message%'
+ - '@=service(''craue_config'').get(''store_article_headers'')'
wallabag_core.tags_assigner:
class: Wallabag\CoreBundle\Helper\TagsAssigner
created_at: 'Oprettelsesdato'
# published_at: 'Publication date'
# published_by: 'Published by'
+ # provided_by: 'Provided by'
new:
page_title: 'Gem ny artikel'
placeholder: 'http://website.com'
# page_title: 'Edit an entry'
# title_label: 'Title'
url_label: 'Url'
+ # origin_url_label: 'Origin url (from where you found that entry)'
save_label: 'Gem'
public:
# shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>"
created_at: 'Erstellungsdatum'
published_at: 'Erscheinungsdatum'
published_by: 'Veröffentlicht von'
+ # provided_by: 'Provided by'
new:
page_title: 'Neuen Artikel speichern'
placeholder: 'https://website.de'
page_title: 'Eintrag bearbeiten'
title_label: 'Titel'
url_label: 'URL'
+ # origin_url_label: 'Origin url (from where you found that entry)'
save_label: 'Speichern'
public:
shared_by_wallabag: 'Dieser Artikel wurde von %username% mittels <a href="%wallabag_instance%">wallabag</a> geteilt'
created_at: 'Creation date'
published_at: 'Publication date'
published_by: 'Published by'
+ provided_by: 'Provided by'
new:
page_title: 'Save new entry'
placeholder: 'http://website.com'
page_title: 'Edit an entry'
title_label: 'Title'
url_label: 'Url'
+ origin_url_label: 'Origin url (from where you found that entry)'
save_label: 'Save'
public:
shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>"
created_at: 'Fecha de creación'
# published_at: 'Publication date'
# published_by: 'Published by'
+ # provided_by: 'Provided by'
new:
page_title: 'Guardar un nuevo artículo'
placeholder: 'http://sitioweb.com'
page_title: 'Editar un artículo'
title_label: 'Título'
url_label: 'URL'
+ # origin_url_label: 'Origin url (from where you found that entry)'
save_label: 'Guardar'
public:
shared_by_wallabag: "Este artículo se ha compartido con <a href='%wallabag_instance%'>wallabag</a>"
created_at: 'زمان ساخت'
# published_at: 'Publication date'
# published_by: 'Published by'
+ # provided_by: 'Provided by'
new:
page_title: 'ذخیرهٔ مقالهٔ تازه'
placeholder: 'http://website.com'
page_title: 'ویرایش مقاله'
title_label: 'عنوان'
url_label: 'نشانی'
+ # origin_url_label: 'Origin url (from where you found that entry)'
save_label: 'ذخیره'
public:
# shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>"
created_at: "Date de création"
published_at: "Date de publication"
published_by: "Publié par"
+ provided_by: "Fourni par"
new:
page_title: "Sauvegarder un nouvel article"
placeholder: "http://website.com"
page_title: "Éditer un article"
title_label: "Titre"
url_label: "Adresse"
+ origin_url_label: "Adresse d'origine (d'où vous avez trouvé cet article)"
save_label: "Enregistrer"
public:
shared_by_wallabag: "Cet article a été partagé par %username% avec <a href=\"%wallabag_instance%\">wallabag</a>"
created_at: 'Data di creazione'
published_at: 'Data di pubblicazione'
published_by: 'Pubblicato da'
+ # provided_by: 'Provided by'
new:
page_title: 'Salva un nuovo contenuto'
placeholder: 'http://website.com'
page_title: 'Modifica voce'
title_label: 'Titolo'
url_label: 'Url'
+ # origin_url_label: 'Origin url (from where you found that entry)'
save_label: 'Salva'
public:
shared_by_wallabag: "Questo articolo è stato condiviso da %username% con <a href='%wallabag_instance%'>wallabag</a>"
created_at: 'Data de creacion'
published_at: 'Data de publicacion'
published_by: 'Publicat per'
+ # provided_by: 'Provided by'
new:
page_title: 'Enregistrar un novèl article'
placeholder: 'http://website.com'
page_title: 'Modificar un article'
title_label: 'Títol'
url_label: 'Url'
+ # origin_url_label: 'Origin url (from where you found that entry)'
save_label: 'Enregistrar'
public:
shared_by_wallabag: "Aqueste article es estat partejat per <a href='%wallabag_instance%'>wallabag</a>"
created_at: 'Czas stworzenia'
published_at: 'Data publikacji'
published_by: 'Opublikowane przez'
+ # provided_by: 'Provided by'
new:
page_title: 'Zapisz nowy wpis'
placeholder: 'http://website.com'
page_title: 'Edytuj wpis'
title_label: 'Tytuł'
url_label: 'Adres URL'
+ # origin_url_label: 'Origin url (from where you found that entry)'
save_label: 'Zapisz'
public:
shared_by_wallabag: "Ten artykuł został udostępniony przez <a href='%wallabag_instance%'>wallabag</a>"
created_at: 'Data de criação'
# published_at: 'Publication date'
# published_by: 'Published by'
+ # provided_by: 'Provided by'
new:
page_title: 'Salvar nova entrada'
placeholder: 'http://website.com'
page_title: 'Editar uma entrada'
title_label: 'Título'
url_label: 'Url'
+ # origin_url_label: 'Origin url (from where you found that entry)'
save_label: 'Salvar'
public:
shared_by_wallabag: "Este artigo foi compartilhado pelo <a href='%wallabag_instance%'>wallabag</a>"
created_at: 'Data creării'
# published_at: 'Publication date'
# published_by: 'Published by'
+ # provided_by: 'Provided by'
new:
page_title: 'Salvează un nou articol'
placeholder: 'http://website.com'
# page_title: 'Edit an entry'
# title_label: 'Title'
url_label: 'Url'
+ # origin_url_label: 'Origin url (from where you found that entry)'
save_label: 'Salvează'
public:
# shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>"
original_article: 'оригинал'
annotations_on_the_entry: '{0} Нет аннотации|{1} Одна аннотация|]1,Inf[ %count% аннотаций'
created_at: 'Дата создания'
+ # provided_by: 'Provided by'
new:
page_title: 'Сохранить новую запись'
placeholder: 'http://website.com'
page_title: 'Изменить запись'
title_label: 'Название'
url_label: 'Ссылка'
+ # origin_url_label: 'Origin url (from where you found that entry)'
is_public_label: 'Публичная'
save_label: 'Сохранить'
public:
created_at: 'Oluşturulma tarihi'
# published_at: 'Publication date'
# published_by: 'Published by'
+ # provided_by: 'Provided by'
new:
page_title: 'Yeni makaleyi kaydet'
placeholder: 'http://website.com'
page_title: 'Makaleyi düzenle'
title_label: 'Başlık'
url_label: 'Url'
+ # origin_url_label: 'Origin url (from where you found that entry)'
save_label: 'Kaydet'
public:
# shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>"
</i>
<span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span>
+
+ {% if entry.originUrl is not empty %}
+ <i class="material-icons" title="{{ 'entry.view.provided_by'|trans }}">launch</i>
+ <a href="{{ entry.originUrl|e }}" target="_blank" class="tool">
+ {{ entry.originUrl|striptags|removeSchemeAndWww|truncate(32) }}
+ </a>
+ {% endif %}
+
<aside class="tags">
<div class="card-entry-tags">
{% for tag in entry.tags %}
{{ form_label(form.url) }}
{{ form_widget(form.url) }}
</div>
+
+ <div class="input-field s12">
+ {{ form_label(form.origin_url) }}
+ {{ form_widget(form.origin_url) }}
+ </div>
<br>
{{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
{% endif %}
{% if craue_setting('share_shaarli') %}
<li>
- <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">
+ <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">
<span>shaarli</span>
</a>
</li>
<i class="material-icons link">comment</i>
{{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}
</li>
+ {% if entry.originUrl is not empty %}
+ <li>
+ <i class="material-icons" title="{{ 'entry.view.provided_by'|trans }}">launch</i>
+ <a href="{{ entry.originUrl|e }}" target="_blank" class="tool">
+ {{ entry.originUrl|striptags|removeSchemeAndWww|truncate(32) }}
+ </a>
+ </li>
+ {% endif %}
</ul>
<ul class="tags">
{% for tag in entry.tags %}
{
return [
new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']),
+ new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']),
];
}
return preg_replace('/^www\./i', '', $url);
}
+ public function removeSchemeAndWww($url)
+ {
+ return $this->removeWww(
+ preg_replace('@^https?://@i', '', $url)
+ );
+ }
+
/**
* Return number of entries depending of the type (unread, archive, starred or all).
*
/**
* Should tell if the given job will kill the worker.
* We don't want to stop it :).
+ *
+ * @param string $job Content of the message (directly from Redis)
+ *
+ * @return false
*/
public function isStopJob($job)
{
return false;
}
+
+ /**
+ * This abstract method is only used when we use one queue for multiple job type.
+ * We don't do that, so we'll always return true.
+ *
+ * @param string $job Content of the message (directly from Redis)
+ *
+ * @return true
+ */
+ public function isMyJob($job)
+ {
+ return true;
+ }
}
subject: 'wallabag authentication code'
body:
hello: "Hi %user%,"
- 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."
+ 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."
second_para: "Here is the code:"
support: "Please don't hesitate to contact us if you have any problems:"
signature: "The wallabag team"
$this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type'));
}
+ public function testGetOneEntryWithOriginUrl()
+ {
+ $entry = $this->client->getContainer()
+ ->get('doctrine.orm.entity_manager')
+ ->getRepository('WallabagCoreBundle:Entry')
+ ->findOneBy(['user' => 1, 'url' => 'http://0.0.0.0/entry2']);
+
+ if (!$entry) {
+ $this->markTestSkipped('No content found in db.');
+ }
+
+ $this->client->request('GET', '/api/entries/' . $entry->getId() . '.json');
+ $this->assertSame(200, $this->client->getResponse()->getStatusCode());
+
+ $content = json_decode($this->client->getResponse()->getContent(), true);
+
+ $this->assertSame($entry->getOriginUrl(), $content['origin_url']);
+ }
+
public function testExportEntry()
{
$entry = $this->client->getContainer()
$this->assertSame('New title for my article', $content['title']);
$this->assertSame(1, $content['user_id']);
$this->assertCount(2, $content['tags']);
+ $this->assertNull($content['origin_url']);
$this->assertSame('my content', $content['content']);
$this->assertSame('de', $content['language']);
$this->assertSame('2016-09-08T11:55:58+0200', $content['published_at']);
$this->assertSame(1, $content['is_starred']);
}
+ public function testPostEntryWithOriginUrl()
+ {
+ $this->client->request('POST', '/api/entries.json', [
+ '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',
+ 'tags' => 'google',
+ 'title' => 'New title for my article',
+ 'content' => 'my content',
+ 'language' => 'de',
+ 'published_at' => '2016-09-08T11:55:58+0200',
+ 'authors' => 'bob,helen',
+ 'public' => 1,
+ 'origin_url' => 'http://mysource.tld',
+ ]);
+
+ $this->assertSame(200, $this->client->getResponse()->getStatusCode());
+
+ $content = json_decode($this->client->getResponse()->getContent(), true);
+
+ $this->assertGreaterThan(0, $content['id']);
+ $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']);
+ $this->assertSame('http://mysource.tld', $content['origin_url']);
+ }
+
public function testPatchEntry()
{
$entry = $this->client->getContainer()
$this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved');
}
+ public function testPatchEntryWithOriginUrl()
+ {
+ $entry = $this->client->getContainer()
+ ->get('doctrine.orm.entity_manager')
+ ->getRepository('WallabagCoreBundle:Entry')
+ ->findOneByUser(1);
+
+ if (!$entry) {
+ $this->markTestSkipped('No content found in db.');
+ }
+
+ $previousContent = $entry->getContent();
+ $previousLanguage = $entry->getLanguage();
+
+ $this->client->request('PATCH', '/api/entries/' . $entry->getId() . '.json', [
+ 'title' => 'Another awesome title just for profit',
+ 'origin_url' => 'https://myawesomesource.example.com',
+ ]);
+
+ $this->assertSame(200, $this->client->getResponse()->getStatusCode());
+
+ $content = json_decode($this->client->getResponse()->getContent(), true);
+
+ $this->assertSame($entry->getId(), $content['id']);
+ $this->assertSame($entry->getUrl(), $content['url']);
+ $this->assertSame('https://myawesomesource.example.com', $content['origin_url']);
+ $this->assertEmpty($content['published_by'], 'Authors were not saved because of an array instead of a string');
+ $this->assertSame($previousContent, $content['content'], 'Ensure content has not moved');
+ $this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved');
+ }
+
+ public function testPatchEntryRemoveOriginUrl()
+ {
+ $entry = $this->client->getContainer()
+ ->get('doctrine.orm.entity_manager')
+ ->getRepository('WallabagCoreBundle:Entry')
+ ->findOneByUser(1);
+
+ if (!$entry) {
+ $this->markTestSkipped('No content found in db.');
+ }
+
+ $previousContent = $entry->getContent();
+ $previousLanguage = $entry->getLanguage();
+ $previousTitle = $entry->getTitle();
+
+ $this->client->request('PATCH', '/api/entries/' . $entry->getId() . '.json', [
+ 'origin_url' => '',
+ ]);
+
+ $this->assertSame(200, $this->client->getResponse()->getStatusCode());
+
+ $content = json_decode($this->client->getResponse()->getContent(), true);
+
+ $this->assertSame($entry->getId(), $content['id']);
+ $this->assertSame($entry->getUrl(), $content['url']);
+ $this->assertEmpty($content['origin_url']);
+ $this->assertEmpty($content['published_by'], 'Authors were not saved because of an array instead of a string');
+ $this->assertSame($previousContent, $content['content'], 'Ensure content has not moved');
+ $this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved');
+ $this->assertSame($previousTitle, $content['title'], 'Ensure title has not moved');
+ }
+
+ public function testPatchEntryNullOriginUrl()
+ {
+ $entry = $this->client->getContainer()
+ ->get('doctrine.orm.entity_manager')
+ ->getRepository('WallabagCoreBundle:Entry')
+ ->findOneByUser(1);
+
+ if (!$entry) {
+ $this->markTestSkipped('No content found in db.');
+ }
+
+ $this->client->request('PATCH', '/api/entries/' . $entry->getId() . '.json', [
+ 'origin_url' => null,
+ ]);
+
+ $this->assertSame(200, $this->client->getResponse()->getStatusCode());
+
+ $content = json_decode($this->client->getResponse()->getContent(), true);
+
+ $this->assertNull($content['origin_url']);
+ }
+
public function testGetTagsEntry()
{
$entry = $this->client->getContainer()
$content = json_decode($this->client->getResponse()->getContent(), true);
- $this->assertSame(false, $content['exists']);
+ $this->assertFalse($content['exists']);
}
public function testGetEntriesExistsWithNoUrl()
use DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticDriver;
use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand;
use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand;
+use Doctrine\Bundle\MigrationsBundle\Command\MigrationsMigrateDoctrineCommand;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Symfony\Bundle\FrameworkBundle\Console\Application;
$this->assertContains('Setting up database.', $tester->getDisplay());
$this->assertContains('Administration setup.', $tester->getDisplay());
$this->assertContains('Config setup.', $tester->getDisplay());
- $this->assertContains('Run migrations.', $tester->getDisplay());
}
public function testRunInstallCommandWithReset()
$this->assertContains('Dropping database, creating database and schema, clearing the cache', $tester->getDisplay());
$this->assertContains('Administration setup.', $tester->getDisplay());
$this->assertContains('Config setup.', $tester->getDisplay());
- $this->assertContains('Run migrations.', $tester->getDisplay());
// we force to reset everything
$this->assertContains('Dropping database, creating database and schema, clearing the cache', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay());
$this->assertContains('Administration setup.', $tester->getDisplay());
$this->assertContains('Config setup.', $tester->getDisplay());
- $this->assertContains('Run migrations.', $tester->getDisplay());
// the current database doesn't already exist
$this->assertContains('Creating database and schema, clearing the cache', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay());
$this->assertContains('Administration setup.', $tester->getDisplay());
$this->assertContains('Config setup.', $tester->getDisplay());
- $this->assertContains('Run migrations.', $tester->getDisplay());
$this->assertContains('Dropping schema and creating schema', $tester->getDisplay());
}
$application->add(new InstallCommand());
$application->add(new DropDatabaseDoctrineCommand());
$application->add(new CreateDatabaseDoctrineCommand());
+ $application->add(new MigrationsMigrateDoctrineCommand());
// drop database first, so the install command won't ask to reset things
$command = new DropDatabaseDoctrineCommand();
$this->assertContains('Setting up database.', $tester->getDisplay());
$this->assertContains('Administration setup.', $tester->getDisplay());
$this->assertContains('Config setup.', $tester->getDisplay());
- $this->assertContains('Run migrations.', $tester->getDisplay());
$this->assertContains('Creating schema', $tester->getDisplay());
}
$this->assertContains('Setting up database.', $tester->getDisplay());
$this->assertContains('Administration setup.', $tester->getDisplay());
$this->assertContains('Config setup.', $tester->getDisplay());
- $this->assertContains('Run migrations.', $tester->getDisplay());
}
}
$this->logInAs('admin');
$client = $this->getClient();
+ $client->getContainer()->get('craue_config')->set('store_article_headers', 1);
+
$crawler = $client->request('GET', '/new');
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertSame('2015-03-28 11:43:19', $content->getPublishedAt()->format('Y-m-d H:i:s'));
$this->assertSame('Morgane Tual', $author[0]);
$this->assertArrayHasKey('x-varnish1', $content->getHeaders());
+ $client->getContainer()->get('craue_config')->set('store_article_headers', 0);
}
public function testPostWithMultipleAuthors()
$data = [
'entry[title]' => 'My updated title hehe :)',
+ 'entry[origin_url]' => 'https://example.io',
+ ];
+
+ $client->submit($form, $data);
+
+ $this->assertSame(302, $client->getResponse()->getStatusCode());
+
+ $crawler = $client->followRedirect();
+
+ $this->assertGreaterThan(1, $title = $crawler->filter('div[id=article] h1')->extract(['_text']));
+ $this->assertContains('My updated title hehe :)', $title[0]);
+ $this->assertGreaterThan(1, $stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text']));
+ $this->assertContains('example.io', trim($stats[1]));
+ }
+
+ public function testEditRemoveOriginUrl()
+ {
+ $this->logInAs('admin');
+ $client = $this->getClient();
+
+ $entry = new Entry($this->getLoggedInUser());
+ $entry->setUrl($this->url);
+ $this->getEntityManager()->persist($entry);
+ $this->getEntityManager()->flush();
+
+ $crawler = $client->request('GET', '/edit/' . $entry->getId());
+
+ $this->assertSame(200, $client->getResponse()->getStatusCode());
+
+ $form = $crawler->filter('button[type=submit]')->form();
+
+ $data = [
+ 'entry[title]' => 'My updated title hehe :)',
+ 'entry[origin_url]' => '',
];
$client->submit($form, $data);
$crawler = $client->followRedirect();
- $this->assertGreaterThan(1, $alert = $crawler->filter('div[id=article] h1')->extract(['_text']));
- $this->assertContains('My updated title hehe :)', $alert[0]);
+ $this->assertGreaterThan(1, $title = $crawler->filter('div[id=article] h1')->extract(['_text']));
+ $this->assertContains('My updated title hehe :)', $title[0]);
+ $this->assertSame(1, count($stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text'])));
+ $this->assertNotContains('example.io', trim($stats[0]));
}
public function testToggleArchive()
class SiteCredentialControllerTest extends WallabagCoreTestCase
{
+ public function testAccessDeniedBecauseFeatureDisabled()
+ {
+ $this->logInAs('admin');
+ $client = $this->getClient();
+
+ $client->getContainer()->get('craue_config')->set('restricted_access', 0);
+
+ $client->request('GET', '/site-credentials/');
+
+ $this->assertSame(404, $client->getResponse()->getStatusCode());
+
+ $client->getContainer()->get('craue_config')->set('restricted_access', 1);
+ }
+
public function testListSiteCredential()
{
$this->logInAs('admin');
$config = $this->builder->buildForHost('www.example.com');
$this->assertSame('example.com', $config->getHost());
- $this->assertSame(true, $config->requiresLogin());
+ $this->assertTrue($config->requiresLogin());
$this->assertSame('http://www.example.com/login', $config->getLoginUri());
$this->assertSame('login', $config->getUsernameField());
$this->assertSame('password', $config->getPasswordField());
$this->assertEmpty($entry->getMimetype());
$this->assertEmpty($entry->getLanguage());
$this->assertSame(0.0, $entry->getReadingTime());
- $this->assertSame(null, $entry->getDomainName());
+ $this->assertNull($entry->getDomainName());
}
public function testWithEmptyContent()
$tagger->expects($this->once())
->method('tag');
- $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage);
+ $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, true);
$entry = new Entry(new User());
$proxy->updateEntry(
$entry,
$this->assertContains('Jeremy', $entry->getPublishedBy());
$this->assertContains('Nico', $entry->getPublishedBy());
$this->assertContains('Thomas', $entry->getPublishedBy());
+ $this->assertNotNull($entry->getHeaders(), 'Headers are stored, so value is not null');
$this->assertContains('no-cache', $entry->getHeaders());
}
$this->assertSame('lemonde.fr', $extension->removeWww('lemonde.fr'));
$this->assertSame('gist.github.com', $extension->removeWww('gist.github.com'));
}
+
+ public function testRemoveSchemeAndWww()
+ {
+ $entryRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $tagRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\TagRepository')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator);
+
+ $this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('www.lemonde.fr'));
+ $this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('http://lemonde.fr'));
+ $this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('https://www.lemonde.fr'));
+ $this->assertSame('gist.github.com', $extension->removeSchemeAndWww('https://gist.github.com'));
+ $this->assertSame('ftp://gist.github.com', $extension->removeSchemeAndWww('ftp://gist.github.com'));
+ }
}