diff options
61 files changed, 252 insertions, 146 deletions
diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index f034b0e4..0cdec008 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php | |||
@@ -21,7 +21,7 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI | |||
21 | 21 | ||
22 | private function getTable($tableName) | 22 | private function getTable($tableName) |
23 | { | 23 | { |
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | 24 | return $this->container->getParameter('database_table_prefix').$tableName; |
25 | } | 25 | } |
26 | 26 | ||
27 | /** | 27 | /** |
@@ -29,13 +29,14 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI | |||
29 | */ | 29 | */ |
30 | public function up(Schema $schema) | 30 | public function up(Schema $schema) |
31 | { | 31 | { |
32 | if ($this->connection->getDatabasePlatform()->getName() == 'postgresql') { | 32 | $entryTable = $schema->getTable($this->getTable('entry')); |
33 | $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" ADD uuid UUID DEFAULT NULL'); | ||
34 | } else { | ||
35 | $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" ADD uuid LONGTEXT DEFAULT NULL'); | ||
36 | } | ||
37 | 33 | ||
38 | $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('share_public', '1', 'entry')"); | 34 | $this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.'); |
35 | |||
36 | $entryTable->addColumn('uuid', 'guid', [ | ||
37 | 'notnull' => false, | ||
38 | ]); | ||
39 | $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_public', '1', 'entry')"); | ||
39 | } | 40 | } |
40 | 41 | ||
41 | /** | 42 | /** |
@@ -43,9 +44,9 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI | |||
43 | */ | 44 | */ |
44 | public function down(Schema $schema) | 45 | public function down(Schema $schema) |
45 | { | 46 | { |
46 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); | 47 | $entryTable = $schema->getTable($this->getTable('entry')); |
48 | $entryTable->dropColumn('uuid'); | ||
47 | 49 | ||
48 | $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" DROP uuid'); | 50 | $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'share_public'"); |
49 | $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'share_public'"); | ||
50 | } | 51 | } |
51 | } | 52 | } |
diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index 39423e2f..053b8d88 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php | |||
@@ -21,7 +21,7 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI | |||
21 | 21 | ||
22 | private function getTable($tableName) | 22 | private function getTable($tableName) |
23 | { | 23 | { |
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | 24 | return $this->container->getParameter('database_table_prefix').$tableName; |
25 | } | 25 | } |
26 | 26 | ||
27 | /** | 27 | /** |
@@ -29,18 +29,10 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI | |||
29 | */ | 29 | */ |
30 | public function up(Schema $schema) | 30 | public function up(Schema $schema) |
31 | { | 31 | { |
32 | switch ($this->connection->getDatabasePlatform()->getName()) { | 32 | $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); |
33 | case 'sqlite': | 33 | $this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.'); |
34 | $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext DEFAULT NULL'); | 34 | |
35 | break; | 35 | $clientsTable->addColumn('name', 'blob'); |
36 | |||
37 | case 'mysql': | ||
38 | $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext COLLATE \'utf8_unicode_ci\' DEFAULT NULL'); | ||
39 | break; | ||
40 | |||
41 | case 'postgresql': | ||
42 | $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name text DEFAULT NULL'); | ||
43 | } | ||
44 | } | 36 | } |
45 | 37 | ||
46 | /** | 38 | /** |
@@ -48,8 +40,7 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI | |||
48 | */ | 40 | */ |
49 | public function down(Schema $schema) | 41 | public function down(Schema $schema) |
50 | { | 42 | { |
51 | $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); | 43 | $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); |
52 | 44 | $clientsTable->dropColumn('name'); | |
53 | $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' DROP COLUMN name'); | ||
54 | } | 45 | } |
55 | } | 46 | } |
diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php index f14f7bc6..963821ae 100644 --- a/app/DoctrineMigrations/Version20160911214952.php +++ b/app/DoctrineMigrations/Version20160911214952.php | |||
@@ -21,7 +21,7 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI | |||
21 | 21 | ||
22 | private function getTable($tableName) | 22 | private function getTable($tableName) |
23 | { | 23 | { |
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | 24 | return $this->container->getParameter('database_table_prefix').$tableName; |
25 | } | 25 | } |
26 | 26 | ||
27 | /** | 27 | /** |
@@ -29,8 +29,8 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI | |||
29 | */ | 29 | */ |
30 | public function up(Schema $schema) | 30 | public function up(Schema $schema) |
31 | { | 31 | { |
32 | $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting').'" (name, value, section) VALUES (\'import_with_redis\', \'0\', \'import\')'); | 32 | $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_redis', 0, 'import')"); |
33 | $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting').'" (name, value, section) VALUES (\'import_with_rabbitmq\', \'0\', \'import\')'); | 33 | $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_rabbitmq', 0, 'import')"); |
34 | } | 34 | } |
35 | 35 | ||
36 | /** | 36 | /** |
@@ -38,5 +38,7 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI | |||
38 | */ | 38 | */ |
39 | public function down(Schema $schema) | 39 | public function down(Schema $schema) |
40 | { | 40 | { |
41 | $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'import_with_redis';"); | ||
42 | $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'import_with_rabbitmq';"); | ||
41 | } | 43 | } |
42 | } | 44 | } |
diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 0d2edf9e..9390755e 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php | |||
@@ -21,7 +21,7 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI | |||
21 | 21 | ||
22 | private function getTable($tableName) | 22 | private function getTable($tableName) |
23 | { | 23 | { |
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | 24 | return $this->container->getParameter('database_table_prefix').$tableName; |
25 | } | 25 | } |
26 | 26 | ||
27 | /** | 27 | /** |
@@ -29,8 +29,12 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI | |||
29 | */ | 29 | */ |
30 | public function up(Schema $schema) | 30 | public function up(Schema $schema) |
31 | { | 31 | { |
32 | $this->addSql('ALTER TABLE "'.$this->getTable('config').'" ADD pocket_consumer_key VARCHAR(255) DEFAULT NULL'); | 32 | $configTable = $schema->getTable($this->getTable('config')); |
33 | $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'pocket_consumer_key';"); | 33 | |
34 | $this->skipIf($configTable->hasColumn('pocket_consumer_key'), 'It seems that you already played this migration.'); | ||
35 | |||
36 | $configTable->addColumn('pocket_consumer_key', 'string'); | ||
37 | $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'pocket_consumer_key';"); | ||
34 | } | 38 | } |
35 | 39 | ||
36 | /** | 40 | /** |
@@ -38,9 +42,8 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI | |||
38 | */ | 42 | */ |
39 | public function down(Schema $schema) | 43 | public function down(Schema $schema) |
40 | { | 44 | { |
41 | $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); | 45 | $configTable = $schema->getTable($this->getTable('config')); |
42 | 46 | $configTable->dropColumn('pocket_consumer_key'); | |
43 | $this->addSql('ALTER TABLE "'.$this->getTable('config').'" DROP pocket_consumer_key'); | 47 | $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')"); |
44 | $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')"); | ||
45 | } | 48 | } |
46 | } | 49 | } |
diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php index 237db932..5ab88555 100644 --- a/app/DoctrineMigrations/Version20161001072726.php +++ b/app/DoctrineMigrations/Version20161001072726.php | |||
@@ -21,7 +21,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI | |||
21 | 21 | ||
22 | private function getTable($tableName) | 22 | private function getTable($tableName) |
23 | { | 23 | { |
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | 24 | return $this->container->getParameter('database_table_prefix').$tableName; |
25 | } | 25 | } |
26 | 26 | ||
27 | /** | 27 | /** |
diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php index 5cce55a5..b3d02b40 100644 --- a/app/DoctrineMigrations/Version20161022134138.php +++ b/app/DoctrineMigrations/Version20161022134138.php | |||
@@ -21,7 +21,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI | |||
21 | 21 | ||
22 | private function getTable($tableName) | 22 | private function getTable($tableName) |
23 | { | 23 | { |
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | 24 | return $this->container->getParameter('database_table_prefix').$tableName; |
25 | } | 25 | } |
26 | 26 | ||
27 | /** | 27 | /** |
@@ -72,6 +72,5 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI | |||
72 | $this->addSql('ALTER TABLE '.$this->getTable('tag').' CHANGE `label` `label` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); | 72 | $this->addSql('ALTER TABLE '.$this->getTable('tag').' CHANGE `label` `label` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); |
73 | 73 | ||
74 | $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); | 74 | $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); |
75 | |||
76 | } | 75 | } |
77 | } | 76 | } |
diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php index f8e927e4..75ff86f1 100644 --- a/app/DoctrineMigrations/Version20161024212538.php +++ b/app/DoctrineMigrations/Version20161024212538.php | |||
@@ -21,7 +21,7 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI | |||
21 | 21 | ||
22 | private function getTable($tableName) | 22 | private function getTable($tableName) |
23 | { | 23 | { |
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | 24 | return $this->container->getParameter('database_table_prefix').$tableName; |
25 | } | 25 | } |
26 | 26 | ||
27 | /** | 27 | /** |
@@ -29,10 +29,18 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI | |||
29 | */ | 29 | */ |
30 | public function up(Schema $schema) | 30 | public function up(Schema $schema) |
31 | { | 31 | { |
32 | $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); | 32 | $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); |
33 | 33 | ||
34 | $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD user_id INT(11) DEFAULT NULL'); | 34 | $this->skipIf($clientsTable->hasColumn('user_id'), 'It seems that you already played this migration.'); |
35 | $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD CONSTRAINT FK_clients_user_clients FOREIGN KEY (user_id) REFERENCES '.$this->getTable('user').' (id) ON DELETE CASCADE'); | 35 | |
36 | $clientsTable->addColumn('user_id', 'integer'); | ||
37 | |||
38 | $clientsTable->addForeignKeyConstraint( | ||
39 | $this->getTable('user'), | ||
40 | ['user_id'], | ||
41 | ['id'], | ||
42 | ['onDelete' => 'CASCADE'] | ||
43 | ); | ||
36 | } | 44 | } |
37 | 45 | ||
38 | /** | 46 | /** |
@@ -40,6 +48,5 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI | |||
40 | */ | 48 | */ |
41 | public function down(Schema $schema) | 49 | public function down(Schema $schema) |
42 | { | 50 | { |
43 | |||
44 | } | 51 | } |
45 | } | 52 | } |
diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php index c7364428..39b85ea9 100644 --- a/app/DoctrineMigrations/Version20161031132655.php +++ b/app/DoctrineMigrations/Version20161031132655.php | |||
@@ -21,7 +21,7 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI | |||
21 | 21 | ||
22 | private function getTable($tableName) | 22 | private function getTable($tableName) |
23 | { | 23 | { |
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | 24 | return $this->container->getParameter('database_table_prefix').$tableName; |
25 | } | 25 | } |
26 | 26 | ||
27 | /** | 27 | /** |
@@ -29,7 +29,7 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI | |||
29 | */ | 29 | */ |
30 | public function up(Schema $schema) | 30 | public function up(Schema $schema) |
31 | { | 31 | { |
32 | $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); | 32 | $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); |
33 | } | 33 | } |
34 | 34 | ||
35 | /** | 35 | /** |
@@ -37,8 +37,6 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI | |||
37 | */ | 37 | */ |
38 | public function down(Schema $schema) | 38 | public function down(Schema $schema) |
39 | { | 39 | { |
40 | $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); | 40 | $this->addSql('DELETE FROM "'.$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';"); |
41 | |||
42 | $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';"); | ||
43 | } | 41 | } |
44 | } | 42 | } |
diff --git a/app/DoctrineMigrations/Version20161104073720.php b/app/DoctrineMigrations/Version20161104073720.php index 16503b4b..4721426a 100644 --- a/app/DoctrineMigrations/Version20161104073720.php +++ b/app/DoctrineMigrations/Version20161104073720.php | |||
@@ -14,6 +14,8 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI | |||
14 | */ | 14 | */ |
15 | private $container; | 15 | private $container; |
16 | 16 | ||
17 | private $indexName = 'IDX_entry_created_at'; | ||
18 | |||
17 | public function setContainer(ContainerInterface $container = null) | 19 | public function setContainer(ContainerInterface $container = null) |
18 | { | 20 | { |
19 | $this->container = $container; | 21 | $this->container = $container; |
@@ -21,7 +23,7 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI | |||
21 | 23 | ||
22 | private function getTable($tableName) | 24 | private function getTable($tableName) |
23 | { | 25 | { |
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | 26 | return $this->container->getParameter('database_table_prefix').$tableName; |
25 | } | 27 | } |
26 | 28 | ||
27 | /** | 29 | /** |
@@ -29,18 +31,10 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI | |||
29 | */ | 31 | */ |
30 | public function up(Schema $schema) | 32 | public function up(Schema $schema) |
31 | { | 33 | { |
32 | switch ($this->connection->getDatabasePlatform()->getName()) { | 34 | $entryTable = $schema->getTable($this->getTable('entry')); |
33 | case 'sqlite': | 35 | $this->skipIf($entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.'); |
34 | $this->addSql('CREATE INDEX `created_at` ON `'.$this->getTable('entry').'` (`created_at` DESC)'); | 36 | |
35 | break; | 37 | $entryTable->addIndex(['created_at'], $this->indexName); |
36 | |||
37 | case 'mysql': | ||
38 | $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD INDEX created_at (created_at);'); | ||
39 | break; | ||
40 | |||
41 | case 'postgresql': | ||
42 | $this->addSql('CREATE INDEX created_at ON '.$this->getTable('entry').' (created_at DESC)'); | ||
43 | } | ||
44 | } | 38 | } |
45 | 39 | ||
46 | /** | 40 | /** |
@@ -48,6 +42,9 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI | |||
48 | */ | 42 | */ |
49 | public function down(Schema $schema) | 43 | public function down(Schema $schema) |
50 | { | 44 | { |
45 | $entryTable = $schema->getTable($this->getTable('entry')); | ||
46 | $this->skipIf(false === $entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.'); | ||
51 | 47 | ||
48 | $entryTable->dropIndex($this->indexName); | ||
52 | } | 49 | } |
53 | } | 50 | } |
diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php index edca54f5..5032a8f0 100644 --- a/app/DoctrineMigrations/Version20161106113822.php +++ b/app/DoctrineMigrations/Version20161106113822.php | |||
@@ -21,7 +21,7 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI | |||
21 | 21 | ||
22 | private function getTable($tableName) | 22 | private function getTable($tableName) |
23 | { | 23 | { |
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | 24 | return $this->container->getParameter('database_table_prefix').$tableName; |
25 | } | 25 | } |
26 | 26 | ||
27 | /** | 27 | /** |
@@ -29,7 +29,13 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI | |||
29 | */ | 29 | */ |
30 | public function up(Schema $schema) | 30 | public function up(Schema $schema) |
31 | { | 31 | { |
32 | $this->addSql('ALTER TABLE '.$this->getTable('config').' ADD action_mark_as_read INT DEFAULT 0'); | 32 | $configTable = $schema->getTable($this->getTable('config')); |
33 | |||
34 | $this->skipIf($configTable->hasColumn('action_mark_as_read'), 'It seems that you already played this migration.'); | ||
35 | |||
36 | $configTable->addColumn('action_mark_as_read', 'integer', [ | ||
37 | 'default' => 0, | ||
38 | ]); | ||
33 | } | 39 | } |
34 | 40 | ||
35 | /** | 41 | /** |
@@ -37,8 +43,7 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI | |||
37 | */ | 43 | */ |
38 | public function down(Schema $schema) | 44 | public function down(Schema $schema) |
39 | { | 45 | { |
40 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); | 46 | $configTable = $schema->getTable($this->getTable('config')); |
41 | 47 | $userTable->dropColumn('action_mark_as_read'); | |
42 | $this->addSql('ALTER TABLE '.$this->getTable('config').' DROP action_mark_as_read'); | ||
43 | } | 48 | } |
44 | } | 49 | } |
diff --git a/app/DoctrineMigrations/Version20161117071626.php b/app/DoctrineMigrations/Version20161117071626.php index 9ae55b5f..33f5707e 100644 --- a/app/DoctrineMigrations/Version20161117071626.php +++ b/app/DoctrineMigrations/Version20161117071626.php | |||
@@ -21,7 +21,7 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI | |||
21 | 21 | ||
22 | private function getTable($tableName) | 22 | private function getTable($tableName) |
23 | { | 23 | { |
24 | return $this->container->getParameter('database_table_prefix') . $tableName; | 24 | return $this->container->getParameter('database_table_prefix').$tableName; |
25 | } | 25 | } |
26 | 26 | ||
27 | /** | 27 | /** |
@@ -29,8 +29,8 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI | |||
29 | */ | 29 | */ |
30 | public function up(Schema $schema) | 30 | public function up(Schema $schema) |
31 | { | 31 | { |
32 | $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_unmark', 0, 'entry')"); | 32 | $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_unmark', 0, 'entry')"); |
33 | $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')"); | 33 | $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')"); |
34 | } | 34 | } |
35 | 35 | ||
36 | /** | 36 | /** |
@@ -38,7 +38,7 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI | |||
38 | */ | 38 | */ |
39 | public function down(Schema $schema) | 39 | public function down(Schema $schema) |
40 | { | 40 | { |
41 | $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'share_unmark';"); | 41 | $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'share_unmark';"); |
42 | $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'unmark_url';"); | 42 | $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'unmark_url';"); |
43 | } | 43 | } |
44 | } | 44 | } |
diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php index 390e89ce..f168cb53 100644 --- a/app/DoctrineMigrations/Version20161118134328.php +++ b/app/DoctrineMigrations/Version20161118134328.php | |||
@@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; | |||
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * Add http_status in `entry_table` | 11 | * Add http_status in `entry_table`. |
12 | */ | 12 | */ |
13 | class Version20161118134328 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20161118134328 extends AbstractMigration implements ContainerAwareInterface |
14 | { | 14 | { |
@@ -24,7 +24,7 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI | |||
24 | 24 | ||
25 | private function getTable($tableName) | 25 | private function getTable($tableName) |
26 | { | 26 | { |
27 | return $this->container->getParameter('database_table_prefix') . $tableName; | 27 | return $this->container->getParameter('database_table_prefix').$tableName; |
28 | } | 28 | } |
29 | 29 | ||
30 | /** | 30 | /** |
@@ -32,7 +32,14 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI | |||
32 | */ | 32 | */ |
33 | public function up(Schema $schema) | 33 | public function up(Schema $schema) |
34 | { | 34 | { |
35 | $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD http_status VARCHAR(3) DEFAULT NULL'); | 35 | $entryTable = $schema->getTable($this->getTable('entry')); |
36 | |||
37 | $this->skipIf($entryTable->hasColumn('http_status'), 'It seems that you already played this migration.'); | ||
38 | |||
39 | $entryTable->addColumn('http_status', 'string', [ | ||
40 | 'length' => 3, | ||
41 | 'notnull' => false, | ||
42 | ]); | ||
36 | } | 43 | } |
37 | 44 | ||
38 | /** | 45 | /** |
@@ -40,8 +47,7 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI | |||
40 | */ | 47 | */ |
41 | public function down(Schema $schema) | 48 | public function down(Schema $schema) |
42 | { | 49 | { |
43 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); | 50 | $userTable = $schema->getTable($this->getTable('entry')); |
44 | 51 | $userTable->dropColumn('http_status'); | |
45 | $this->addSql('ALTER TABLE '.$this->getTable('entry').' DROP http_status'); | ||
46 | } | 52 | } |
47 | } | 53 | } |
diff --git a/app/DoctrineMigrations/Version20161122144743.php b/app/DoctrineMigrations/Version20161122144743.php index ec80c48e..536b8339 100644 --- a/app/DoctrineMigrations/Version20161122144743.php +++ b/app/DoctrineMigrations/Version20161122144743.php | |||
@@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; | |||
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * Add the restricted_access internal setting for articles with paywall | 11 | * Add the restricted_access internal setting for articles with paywall. |
12 | */ | 12 | */ |
13 | class Version20161122144743 extends AbstractMigration implements ContainerAwareInterface | 13 | class Version20161122144743 extends AbstractMigration implements ContainerAwareInterface |
14 | { | 14 | { |
@@ -24,7 +24,7 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI | |||
24 | 24 | ||
25 | private function getTable($tableName) | 25 | private function getTable($tableName) |
26 | { | 26 | { |
27 | return $this->container->getParameter('database_table_prefix') . $tableName; | 27 | return $this->container->getParameter('database_table_prefix').$tableName; |
28 | } | 28 | } |
29 | 29 | ||
30 | /** | 30 | /** |
@@ -32,7 +32,7 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI | |||
32 | */ | 32 | */ |
33 | public function up(Schema $schema) | 33 | public function up(Schema $schema) |
34 | { | 34 | { |
35 | $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('restricted_access', 0, 'entry')"); | 35 | $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('restricted_access', 0, 'entry')"); |
36 | } | 36 | } |
37 | 37 | ||
38 | /** | 38 | /** |
@@ -40,6 +40,6 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI | |||
40 | */ | 40 | */ |
41 | public function down(Schema $schema) | 41 | public function down(Schema $schema) |
42 | { | 42 | { |
43 | $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'restricted_access';"); | 43 | $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'restricted_access';"); |
44 | } | 44 | } |
45 | } | 45 | } |
diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php index ea2703b6..94197193 100644 --- a/app/DoctrineMigrations/Version20161122203647.php +++ b/app/DoctrineMigrations/Version20161122203647.php | |||
@@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; | |||
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * Methods and properties removed from `FOS\UserBundle\Model\User` | 11 | * Methods and properties removed from `FOS\UserBundle\Model\User`. |
12 | * | 12 | * |
13 | * - `$expired` | 13 | * - `$expired` |
14 | * - `$credentialsExpired` | 14 | * - `$credentialsExpired` |
@@ -32,7 +32,7 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI | |||
32 | 32 | ||
33 | private function getTable($tableName) | 33 | private function getTable($tableName) |
34 | { | 34 | { |
35 | return $this->container->getParameter('database_table_prefix') . $tableName; | 35 | return $this->container->getParameter('database_table_prefix').$tableName; |
36 | } | 36 | } |
37 | 37 | ||
38 | /** | 38 | /** |
@@ -40,10 +40,12 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI | |||
40 | */ | 40 | */ |
41 | public function up(Schema $schema) | 41 | public function up(Schema $schema) |
42 | { | 42 | { |
43 | $this->abortIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); | 43 | $userTable = $schema->getTable($this->getTable('user')); |
44 | 44 | ||
45 | $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP expired'); | 45 | $this->skipIf(false === $userTable->hasColumn('expired') || false === $userTable->hasColumn('credentials_expired'), 'It seems that you already played this migration.'); |
46 | $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP credentials_expired'); | 46 | |
47 | $userTable->dropColumn('expired'); | ||
48 | $userTable->dropColumn('credentials_expired'); | ||
47 | } | 49 | } |
48 | 50 | ||
49 | /** | 51 | /** |
@@ -51,7 +53,8 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI | |||
51 | */ | 53 | */ |
52 | public function down(Schema $schema) | 54 | public function down(Schema $schema) |
53 | { | 55 | { |
54 | $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD expired tinyint(1) NULL DEFAULT 0'); | 56 | $userTable = $schema->getTable($this->getTable('user')); |
55 | $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD credentials_expired tinyint(1) NULL DEFAULT 0'); | 57 | $userTable->addColumn('expired', 'smallint'); |
58 | $userTable->addColumn('credentials_expired', 'smallint'); | ||
56 | } | 59 | } |
57 | } | 60 | } |
diff --git a/app/DoctrineMigrations/Version20161128084725.php b/app/DoctrineMigrations/Version20161128084725.php index 242d5900..ea370076 100644 --- a/app/DoctrineMigrations/Version20161128084725.php +++ b/app/DoctrineMigrations/Version20161128084725.php | |||
@@ -35,7 +35,7 @@ class Version20161128084725 extends AbstractMigration implements ContainerAwareI | |||
35 | $configTable = $schema->getTable($this->getTable('config')); | 35 | $configTable = $schema->getTable($this->getTable('config')); |
36 | $this->skipIf($configTable->hasColumn('list_mode'), 'It seems that you already played this migration.'); | 36 | $this->skipIf($configTable->hasColumn('list_mode'), 'It seems that you already played this migration.'); |
37 | 37 | ||
38 | $configTable->addColumn('list_mode', 'integer'); | 38 | $configTable->addColumn('list_mode', 'integer', ['notnull' => false]); |
39 | } | 39 | } |
40 | 40 | ||
41 | /** | 41 | /** |
diff --git a/app/config/config.yml b/app/config/config.yml index 6b1ed056..d52f37c8 100644 --- a/app/config/config.yml +++ b/app/config/config.yml | |||
@@ -51,6 +51,8 @@ wallabag_core: | |||
51 | rss_limit: 50 | 51 | rss_limit: 50 |
52 | reading_speed: 1 | 52 | reading_speed: 1 |
53 | cache_lifetime: 10 | 53 | cache_lifetime: 10 |
54 | action_mark_as_read: 1 | ||
55 | list_mode: 1 | ||
54 | fetching_error_message: | | 56 | fetching_error_message: | |
55 | wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/master/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>. | 57 | wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/master/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>. |
56 | 58 | ||
diff --git a/docs/de/developer/asynchronous.rst b/docs/de/developer/asynchronous.rst index 1d241a72..1707f321 100644 --- a/docs/de/developer/asynchronous.rst +++ b/docs/de/developer/asynchronous.rst | |||
@@ -149,10 +149,10 @@ Abhängig davon, über welchen Service du importieren möchtest, musst du den en | |||
149 | bin/console wallabag:import:redis-worker -e=prod firefox -vv >> /path/to/wallabag/var/logs/redis-firefox.log | 149 | bin/console wallabag:import:redis-worker -e=prod firefox -vv >> /path/to/wallabag/var/logs/redis-firefox.log |
150 | 150 | ||
151 | # für den Chrome-Import | 151 | # für den Chrome-Import |
152 | bin/console wallabag:import:redis-worker -e=prod instapaper -vv >> /path/to/wallabag/var/logs/redis-chrome.log | 152 | bin/console wallabag:import:redis-worker -e=prod chrome -vv >> /path/to/wallabag/var/logs/redis-chrome.log |
153 | 153 | ||
154 | Wenn du den Import nur für einige Artikel nutzen willst, kannst du die Nummer festlegen (hier: 12) und der Consumer wird nach dem zwölften Artikel aufhören: | 154 | Wenn du den Import nur für einige Artikel nutzen willst, kannst du die Nummer festlegen (hier: 12) und der Consumer wird nach dem zwölften Artikel aufhören: |
155 | 155 | ||
156 | .. code:: bash | 156 | .. code:: bash |
157 | 157 | ||
158 | bin/console wallabag:import:redis-worker -e=prod pocket -vv --maxIterations=12 \ No newline at end of file | 158 | bin/console wallabag:import:redis-worker -e=prod pocket -vv --maxIterations=12 |
diff --git a/docs/en/developer/asynchronous.rst b/docs/en/developer/asynchronous.rst index 6a991cf6..5cd40231 100644 --- a/docs/en/developer/asynchronous.rst +++ b/docs/en/developer/asynchronous.rst | |||
@@ -150,7 +150,7 @@ Depending on which service you want to import from you need to enable one (or ma | |||
150 | bin/console wallabag:import:redis-worker -e=prod firefox -vv >> /path/to/wallabag/var/logs/redis-firefox.log | 150 | bin/console wallabag:import:redis-worker -e=prod firefox -vv >> /path/to/wallabag/var/logs/redis-firefox.log |
151 | 151 | ||
152 | # for Chrome import | 152 | # for Chrome import |
153 | bin/console wallabag:import:redis-worker -e=prod instapaper -vv >> /path/to/wallabag/var/logs/redis-chrome.log | 153 | bin/console wallabag:import:redis-worker -e=prod chrome -vv >> /path/to/wallabag/var/logs/redis-chrome.log |
154 | 154 | ||
155 | If you want to launch the import only for some messages and not all, you can specify this number (here 12) and the worker will stop right after the 12th message : | 155 | If you want to launch the import only for some messages and not all, you can specify this number (here 12) and the worker will stop right after the 12th message : |
156 | 156 | ||
diff --git a/docs/fr/developer/asynchronous.rst b/docs/fr/developer/asynchronous.rst index c5489228..8a493acf 100644 --- a/docs/fr/developer/asynchronous.rst +++ b/docs/fr/developer/asynchronous.rst | |||
@@ -150,7 +150,7 @@ En fonction du service dont vous souhaitez importer vos données, vous devez act | |||
150 | bin/console wallabag:import:redis-worker -e=prod firefox -vv >> /path/to/wallabag/var/logs/redis-firefox.log | 150 | bin/console wallabag:import:redis-worker -e=prod firefox -vv >> /path/to/wallabag/var/logs/redis-firefox.log |
151 | 151 | ||
152 | # for Chrome import | 152 | # for Chrome import |
153 | bin/console wallabag:import:redis-worker -e=prod instapaper -vv >> /path/to/wallabag/var/logs/redis-chrome.log | 153 | bin/console wallabag:import:redis-worker -e=prod chrome -vv >> /path/to/wallabag/var/logs/redis-chrome.log |
154 | 154 | ||
155 | Si vous souhaitez démarrer l'import pour quelques messages uniquement, vous pouvez spécifier cette valeur en paramètre (ici 12) et le client va s'arrêter après le 12ème message : | 155 | Si vous souhaitez démarrer l'import pour quelques messages uniquement, vous pouvez spécifier cette valeur en paramètre (ici 12) et le client va s'arrêter après le 12ème message : |
156 | 156 | ||
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php index 45358022..3d4d5def 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php | |||
@@ -22,6 +22,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface | |||
22 | $adminConfig->setLanguage('en'); | 22 | $adminConfig->setLanguage('en'); |
23 | $adminConfig->setPocketConsumerKey('xxxxx'); | 23 | $adminConfig->setPocketConsumerKey('xxxxx'); |
24 | $adminConfig->setActionMarkAsRead(0); | 24 | $adminConfig->setActionMarkAsRead(0); |
25 | $adminConfig->setListMode(0); | ||
25 | 26 | ||
26 | $manager->persist($adminConfig); | 27 | $manager->persist($adminConfig); |
27 | 28 | ||
@@ -34,6 +35,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface | |||
34 | $bobConfig->setLanguage('fr'); | 35 | $bobConfig->setLanguage('fr'); |
35 | $bobConfig->setPocketConsumerKey(null); | 36 | $bobConfig->setPocketConsumerKey(null); |
36 | $bobConfig->setActionMarkAsRead(1); | 37 | $bobConfig->setActionMarkAsRead(1); |
38 | $bobConfig->setListMode(1); | ||
37 | 39 | ||
38 | $manager->persist($bobConfig); | 40 | $manager->persist($bobConfig); |
39 | 41 | ||
@@ -46,6 +48,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface | |||
46 | $emptyConfig->setLanguage('en'); | 48 | $emptyConfig->setLanguage('en'); |
47 | $emptyConfig->setPocketConsumerKey(null); | 49 | $emptyConfig->setPocketConsumerKey(null); |
48 | $emptyConfig->setActionMarkAsRead(0); | 50 | $emptyConfig->setActionMarkAsRead(0); |
51 | $emptyConfig->setListMode(0); | ||
49 | 52 | ||
50 | $manager->persist($emptyConfig); | 53 | $manager->persist($emptyConfig); |
51 | 54 | ||
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php index 3a3da024..006a18c3 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php | |||
@@ -41,6 +41,12 @@ class Configuration implements ConfigurationInterface | |||
41 | ->end() | 41 | ->end() |
42 | ->scalarNode('fetching_error_message') | 42 | ->scalarNode('fetching_error_message') |
43 | ->end() | 43 | ->end() |
44 | ->scalarNode('action_mark_as_read') | ||
45 | ->defaultValue(1) | ||
46 | ->end() | ||
47 | ->scalarNode('list_mode') | ||
48 | ->defaultValue(1) | ||
49 | ->end() | ||
44 | ->end() | 50 | ->end() |
45 | ; | 51 | ; |
46 | 52 | ||
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php index b4992d54..aa9ee339 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php | |||
@@ -23,6 +23,8 @@ class WallabagCoreExtension extends Extension | |||
23 | $container->setParameter('wallabag_core.version', $config['version']); | 23 | $container->setParameter('wallabag_core.version', $config['version']); |
24 | $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']); | 24 | $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']); |
25 | $container->setParameter('wallabag_core.cache_lifetime', $config['cache_lifetime']); | 25 | $container->setParameter('wallabag_core.cache_lifetime', $config['cache_lifetime']); |
26 | $container->setParameter('wallabag_core.action_mark_as_read', $config['action_mark_as_read']); | ||
27 | $container->setParameter('wallabag_core.list_mode', $config['list_mode']); | ||
26 | $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']); | 28 | $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']); |
27 | 29 | ||
28 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | 30 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php index 28914cc1..72651b19 100644 --- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php +++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php | |||
@@ -28,6 +28,7 @@ class TaggingRule | |||
28 | * @var string | 28 | * @var string |
29 | * | 29 | * |
30 | * @Assert\NotBlank() | 30 | * @Assert\NotBlank() |
31 | * @Assert\Length(max=255) | ||
31 | * @RulerZAssert\ValidRule( | 32 | * @RulerZAssert\ValidRule( |
32 | * allowed_variables={"title", "url", "isArchived", "isStared", "content", "language", "mimetype", "readingTime", "domainName"}, | 33 | * allowed_variables={"title", "url", "isArchived", "isStared", "content", "language", "mimetype", "readingTime", "domainName"}, |
33 | * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches"} | 34 | * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches"} |
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index fd059325..0130bd2b 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php | |||
@@ -21,14 +21,16 @@ class ContentProxy | |||
21 | protected $logger; | 21 | protected $logger; |
22 | protected $tagRepository; | 22 | protected $tagRepository; |
23 | protected $mimeGuesser; | 23 | protected $mimeGuesser; |
24 | protected $fetchingErrorMessage; | ||
24 | 25 | ||
25 | public function __construct(Graby $graby, RuleBasedTagger $tagger, TagRepository $tagRepository, LoggerInterface $logger) | 26 | public function __construct(Graby $graby, RuleBasedTagger $tagger, TagRepository $tagRepository, LoggerInterface $logger, $fetchingErrorMessage) |
26 | { | 27 | { |
27 | $this->graby = $graby; | 28 | $this->graby = $graby; |
28 | $this->tagger = $tagger; | 29 | $this->tagger = $tagger; |
29 | $this->logger = $logger; | 30 | $this->logger = $logger; |
30 | $this->tagRepository = $tagRepository; | 31 | $this->tagRepository = $tagRepository; |
31 | $this->mimeGuesser = new MimeTypeExtensionGuesser(); | 32 | $this->mimeGuesser = new MimeTypeExtensionGuesser(); |
33 | $this->fetchingErrorMessage = $fetchingErrorMessage; | ||
32 | } | 34 | } |
33 | 35 | ||
34 | /** | 36 | /** |
@@ -48,7 +50,13 @@ class ContentProxy | |||
48 | { | 50 | { |
49 | // do we have to fetch the content or the provided one is ok? | 51 | // do we have to fetch the content or the provided one is ok? |
50 | if (empty($content) || false === $this->validateContent($content)) { | 52 | if (empty($content) || false === $this->validateContent($content)) { |
51 | $content = $this->graby->fetchContent($url); | 53 | $fetchedContent = $this->graby->fetchContent($url); |
54 | |||
55 | // when content is imported, we have information in $content | ||
56 | // in case fetching content goes bad, we'll keep the imported information instead of overriding them | ||
57 | if (empty($content) || $fetchedContent['html'] !== $this->fetchingErrorMessage) { | ||
58 | $content = $fetchedContent; | ||
59 | } | ||
52 | } | 60 | } |
53 | 61 | ||
54 | $title = $content['title']; | 62 | $title = $content['title']; |
@@ -58,7 +66,7 @@ class ContentProxy | |||
58 | 66 | ||
59 | $html = $content['html']; | 67 | $html = $content['html']; |
60 | if (false === $html) { | 68 | if (false === $html) { |
61 | $html = '<p>Unable to retrieve readable content.</p>'; | 69 | $html = $this->fetchingErrorMessage; |
62 | 70 | ||
63 | if (isset($content['open_graph']['og_description'])) { | 71 | if (isset($content['open_graph']['og_description'])) { |
64 | $html .= '<p><i>But we found a short description: </i></p>'; | 72 | $html .= '<p><i>But we found a short description: </i></p>'; |
@@ -71,8 +79,8 @@ class ContentProxy | |||
71 | $entry->setContent($html); | 79 | $entry->setContent($html); |
72 | $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); | 80 | $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); |
73 | 81 | ||
74 | $entry->setLanguage($content['language']); | 82 | $entry->setLanguage(isset($content['language']) ? $content['language'] : ''); |
75 | $entry->setMimetype($content['content_type']); | 83 | $entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : ''); |
76 | $entry->setReadingTime(Utils::getReadingTime($html)); | 84 | $entry->setReadingTime(Utils::getReadingTime($html)); |
77 | 85 | ||
78 | $domainName = parse_url($entry->getUrl(), PHP_URL_HOST); | 86 | $domainName = parse_url($entry->getUrl(), PHP_URL_HOST); |
@@ -85,7 +93,7 @@ class ContentProxy | |||
85 | } | 93 | } |
86 | 94 | ||
87 | // if content is an image define as a preview too | 95 | // if content is an image define as a preview too |
88 | if (in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { | 96 | if (isset($content['content_type']) && in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { |
89 | $entry->setPreviewPicture($content['url']); | 97 | $entry->setPreviewPicture($content['url']); |
90 | } | 98 | } |
91 | 99 | ||
diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index 264bc6a3..c83f9618 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php | |||
@@ -36,7 +36,7 @@ class DownloadImages | |||
36 | { | 36 | { |
37 | // if folder doesn't exist, attempt to create one and store the folder name in property $folder | 37 | // if folder doesn't exist, attempt to create one and store the folder name in property $folder |
38 | if (!file_exists($this->baseFolder)) { | 38 | if (!file_exists($this->baseFolder)) { |
39 | mkdir($this->baseFolder, 0777, true); | 39 | mkdir($this->baseFolder, 0755, true); |
40 | } | 40 | } |
41 | } | 41 | } |
42 | 42 | ||
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 47e24d6b..553ad6ab 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php | |||
@@ -20,8 +20,7 @@ class EntryRepository extends EntityRepository | |||
20 | private function getBuilderByUser($userId) | 20 | private function getBuilderByUser($userId) |
21 | { | 21 | { |
22 | return $this->createQueryBuilder('e') | 22 | return $this->createQueryBuilder('e') |
23 | ->leftJoin('e.user', 'u') | 23 | ->andWhere('e.user = :userId')->setParameter('userId', $userId) |
24 | ->andWhere('u.id = :userId')->setParameter('userId', $userId) | ||
25 | ->orderBy('e.createdAt', 'desc') | 24 | ->orderBy('e.createdAt', 'desc') |
26 | ; | 25 | ; |
27 | } | 26 | } |
diff --git a/src/Wallabag/CoreBundle/Resources/config/parameters.yml b/src/Wallabag/CoreBundle/Resources/config/parameters.yml index 6068e84c..52ac90fd 100644 --- a/src/Wallabag/CoreBundle/Resources/config/parameters.yml +++ b/src/Wallabag/CoreBundle/Resources/config/parameters.yml | |||
@@ -1,8 +1,9 @@ | |||
1 | parameters: | 1 | parameters: |
2 | addons_url: | 2 | addons_url: |
3 | firefox: https://addons.mozilla.org/firefox/addon/wallabag-v2/ | 3 | firefox: https://addons.mozilla.org/firefox/addon/wallabag-v2/ |
4 | chrome: https://chrome.google.com/webstore/detail/wallabagit/peehlcgckcnclnjlndmoddifcicdnabm | 4 | chrome: https://chrome.google.com/webstore/detail/wallabagger/gbmgphmejlcoihgedabhgjdkcahacjlj |
5 | opera: https://addons.opera.com/en/extensions/details/wallabagger/?display=en | ||
5 | f_droid: https://f-droid.org/app/fr.gaulupeau.apps.InThePoche | 6 | f_droid: https://f-droid.org/app/fr.gaulupeau.apps.InThePoche |
6 | google_play: https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche | 7 | google_play: https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche |
7 | ios: https://itunes.apple.com/app/wallabag/id828331015?mt=8 | 8 | ios: https://itunes.apple.com/app/wallabag-2/id1170800946?mt=8 |
8 | windows: https://www.microsoft.com/store/apps/wallabag/9nblggh11646 | 9 | windows: https://www.microsoft.com/store/apps/wallabag/9nblggh11646 |
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index bcf0c9ca..fadd5e49 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml | |||
@@ -86,6 +86,7 @@ services: | |||
86 | - "@wallabag_core.rule_based_tagger" | 86 | - "@wallabag_core.rule_based_tagger" |
87 | - "@wallabag_core.tag_repository" | 87 | - "@wallabag_core.tag_repository" |
88 | - "@logger" | 88 | - "@logger" |
89 | - '%wallabag_core.fetching_error_message%' | ||
89 | 90 | ||
90 | wallabag_core.rule_based_tagger: | 91 | wallabag_core.rule_based_tagger: |
91 | class: Wallabag\CoreBundle\Helper\RuleBasedTagger | 92 | class: Wallabag\CoreBundle\Helper\RuleBasedTagger |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index c9e21959..3380edca 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | |||
@@ -285,6 +285,7 @@ howto: | |||
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: 'Standardudvidelse til Firefox' | 286 | firefox: 'Standardudvidelse til Firefox' |
287 | chrome: 'Chrome-udvidelse' | 287 | chrome: 'Chrome-udvidelse' |
288 | opera: 'Opera-udvidelse' | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | via_f_droid: 'via F-Droid' | 291 | via_f_droid: 'via F-Droid' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index b84bd9d3..cfa11e82 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | |||
@@ -285,6 +285,7 @@ howto: | |||
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: 'Firefox-Erweiterung' | 286 | firefox: 'Firefox-Erweiterung' |
287 | chrome: 'Chrome-Erweiterung' | 287 | chrome: 'Chrome-Erweiterung' |
288 | opera: 'Opera-Erweiterung' | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | via_f_droid: 'via F-Droid' | 291 | via_f_droid: 'via F-Droid' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 4b92fe97..673a0a16 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | |||
@@ -283,8 +283,9 @@ howto: | |||
283 | form: | 283 | form: |
284 | description: 'Thanks to this form' | 284 | description: 'Thanks to this form' |
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: 'Standard Firefox Add-On' | 286 | firefox: 'Firefox addon' |
287 | chrome: 'Chrome Extension' | 287 | chrome: 'Chrome addon' |
288 | opera: 'Opera addon' | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | via_f_droid: 'via F-Droid' | 291 | via_f_droid: 'via F-Droid' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 02ce7e19..d08edd6e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | |||
@@ -285,6 +285,7 @@ howto: | |||
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: 'Extensión Firefox' | 286 | firefox: 'Extensión Firefox' |
287 | chrome: 'Extensión Chrome' | 287 | chrome: 'Extensión Chrome' |
288 | opera: 'Extensión Opera' | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | via_f_droid: 'via F-Droid' | 291 | via_f_droid: 'via F-Droid' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 99c0f71b..ad6144b8 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | |||
@@ -285,6 +285,7 @@ howto: | |||
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: 'افزونهٔ فایرفاکس' | 286 | firefox: 'افزونهٔ فایرفاکس' |
287 | chrome: 'افزونهٔ کروم' | 287 | chrome: 'افزونهٔ کروم' |
288 | # opera: 'Opera addon' | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | via_f_droid: 'از راه F-Droid' | 291 | via_f_droid: 'از راه F-Droid' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 5579bf1f..f7371d3e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | |||
@@ -285,6 +285,7 @@ howto: | |||
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: "Extension Firefox" | 286 | firefox: "Extension Firefox" |
287 | chrome: "Extension Chrome" | 287 | chrome: "Extension Chrome" |
288 | opera: "Extension Opera" | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | via_f_droid: "via F-Droid" | 291 | via_f_droid: "via F-Droid" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 92ccef68..bbb526dc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | |||
@@ -285,6 +285,7 @@ howto: | |||
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: 'Add-On di Firefox' | 286 | firefox: 'Add-On di Firefox' |
287 | chrome: 'Estensione di Chrome' | 287 | chrome: 'Estensione di Chrome' |
288 | opera: 'Estensione di Opera' | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | via_f_droid: 'via F-Droid' | 291 | via_f_droid: 'via F-Droid' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 9ef3b475..33c1a660 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | |||
@@ -285,6 +285,7 @@ howto: | |||
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: 'Extension Firefox' | 286 | firefox: 'Extension Firefox' |
287 | chrome: 'Extension Chrome' | 287 | chrome: 'Extension Chrome' |
288 | opera: 'Extension Opera' | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | via_f_droid: 'via F-Droid' | 291 | via_f_droid: 'via F-Droid' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 9e3726a5..1eb83d53 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | |||
@@ -285,6 +285,7 @@ howto: | |||
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: 'Standardowe rozszerzenie dla Firefox' | 286 | firefox: 'Standardowe rozszerzenie dla Firefox' |
287 | chrome: 'Rozszerzenie dla Chrome' | 287 | chrome: 'Rozszerzenie dla Chrome' |
288 | opera: 'Rozszerzenie dla Opera' | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | via_f_droid: 'w F-Droid' | 291 | via_f_droid: 'w F-Droid' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index abe51305..f58b2115 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | |||
@@ -285,6 +285,7 @@ howto: | |||
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: 'Extensão padrão do Firefox' | 286 | firefox: 'Extensão padrão do Firefox' |
287 | chrome: 'Extensão do Chrome' | 287 | chrome: 'Extensão do Chrome' |
288 | opera: 'Extensão do Opera' | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | via_f_droid: 'via F-Droid' | 291 | via_f_droid: 'via F-Droid' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 88780b54..b9a57e36 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | |||
@@ -285,6 +285,7 @@ howto: | |||
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: 'Add-On standard de Firefox' | 286 | firefox: 'Add-On standard de Firefox' |
287 | chrome: 'Extensie Chrome' | 287 | chrome: 'Extensie Chrome' |
288 | opera: 'Extensie Opera' | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | via_f_droid: 'prin F-Droid' | 291 | via_f_droid: 'prin F-Droid' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index db0a9bbf..ec21c014 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | |||
@@ -285,6 +285,7 @@ howto: | |||
285 | browser_addons: | 285 | browser_addons: |
286 | firefox: 'Standart Firefox Eklentisi' | 286 | firefox: 'Standart Firefox Eklentisi' |
287 | chrome: 'Chrome Eklentisi' | 287 | chrome: 'Chrome Eklentisi' |
288 | opera: 'Opera Eklentisi' | ||
288 | mobile_apps: | 289 | mobile_apps: |
289 | android: | 290 | android: |
290 | # via_f_droid: 'via F-Droid' | 291 | # via_f_droid: 'via F-Droid' |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/howto.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/howto.html.twig index 3b02993e..231f9bdf 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/howto.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/howto.html.twig | |||
@@ -30,6 +30,7 @@ | |||
30 | <ul> | 30 | <ul> |
31 | <li><a href="{{ addonsUrl.firefox }}" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li> | 31 | <li><a href="{{ addonsUrl.firefox }}" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li> |
32 | <li><a href="{{ addonsUrl.chrome }}" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li> | 32 | <li><a href="{{ addonsUrl.chrome }}" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li> |
33 | <li><a href="{{ addonsUrl.opera }}" target="_blank">{{ 'howto.browser_addons.opera'|trans }}</a></li> | ||
33 | </ul> | 34 | </ul> |
34 | </div> | 35 | </div> |
35 | 36 | ||
@@ -186,7 +187,7 @@ | |||
186 | </tbody> | 187 | </tbody> |
187 | </table> | 188 | </table> |
188 | </div> | 189 | </div> |
189 | 190 | ||
190 | </div> | 191 | </div> |
191 | </div> | 192 | </div> |
192 | </div> | 193 | </div> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig index bed0fdec..0cbf1999 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig | |||
@@ -257,6 +257,17 @@ | |||
257 | <article> | 257 | <article> |
258 | {{ entry.content | raw }} | 258 | {{ entry.content | raw }} |
259 | </article> | 259 | </article> |
260 | |||
261 | <div class="fixed-action-btn horizontal click-to-toggle hide-on-large-only"> | ||
262 | <a class="btn-floating btn-large"> | ||
263 | <i class="material-icons">menu</i> | ||
264 | </a> | ||
265 | <ul> | ||
266 | <li><a class="btn-floating" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons">done</i></a></li> | ||
267 | <li><a class="btn-floating" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons">star_outline</i></a></li> | ||
268 | <li><a class="btn-floating" href="{{ path('delete_entry', { 'id': entry.id }) }}"><i class="material-icons">delete</i></a></li> | ||
269 | </ul> | ||
270 | </div> | ||
260 | </div> | 271 | </div> |
261 | 272 | ||
262 | <script id="annotationroutes" type="application/json"> | 273 | <script id="annotationroutes" type="application/json"> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index e5bfc62c..131fbf26 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig | |||
@@ -19,8 +19,6 @@ | |||
19 | Materialize.toast('{{ flashMessage|trans }}', 4000); | 19 | Materialize.toast('{{ flashMessage|trans }}', 4000); |
20 | </script> | 20 | </script> |
21 | {% endfor %} | 21 | {% endfor %} |
22 | |||
23 | {{ render(controller("WallabagImportBundle:Import:checkQueue")) }} | ||
24 | {% endblock %} | 22 | {% endblock %} |
25 | 23 | ||
26 | {% block menu %} | 24 | {% block menu %} |
diff --git a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php index f793a314..2d06af44 100644 --- a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php +++ b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php | |||
@@ -36,7 +36,7 @@ class RedisWorkerCommand extends ContainerAwareCommand | |||
36 | $worker = new QueueWorker( | 36 | $worker = new QueueWorker( |
37 | $this->getContainer()->get('wallabag_import.queue.redis.'.$serviceName), | 37 | $this->getContainer()->get('wallabag_import.queue.redis.'.$serviceName), |
38 | $this->getContainer()->get('wallabag_import.consumer.redis.'.$serviceName), | 38 | $this->getContainer()->get('wallabag_import.consumer.redis.'.$serviceName), |
39 | $input->getOption('maxIterations') | 39 | (int) $input->getOption('maxIterations') |
40 | ); | 40 | ); |
41 | 41 | ||
42 | $worker->start(); | 42 | $worker->start(); |
diff --git a/src/Wallabag/ImportBundle/Import/ChromeImport.php b/src/Wallabag/ImportBundle/Import/ChromeImport.php index d7620bcb..2667890f 100644 --- a/src/Wallabag/ImportBundle/Import/ChromeImport.php +++ b/src/Wallabag/ImportBundle/Import/ChromeImport.php | |||
@@ -37,9 +37,10 @@ class ChromeImport extends BrowserImport | |||
37 | { | 37 | { |
38 | $data = [ | 38 | $data = [ |
39 | 'title' => $entry['name'], | 39 | 'title' => $entry['name'], |
40 | 'html' => '', | 40 | 'html' => false, |
41 | 'url' => $entry['url'], | 41 | 'url' => $entry['url'], |
42 | 'is_archived' => $this->markAsRead, | 42 | 'is_archived' => (int) $this->markAsRead, |
43 | 'is_starred' => false, | ||
43 | 'tags' => '', | 44 | 'tags' => '', |
44 | 'created_at' => substr($entry['date_added'], 0, 10), | 45 | 'created_at' => substr($entry['date_added'], 0, 10), |
45 | ]; | 46 | ]; |
diff --git a/src/Wallabag/ImportBundle/Import/FirefoxImport.php b/src/Wallabag/ImportBundle/Import/FirefoxImport.php index e010f5a4..c50c69b3 100644 --- a/src/Wallabag/ImportBundle/Import/FirefoxImport.php +++ b/src/Wallabag/ImportBundle/Import/FirefoxImport.php | |||
@@ -37,9 +37,10 @@ class FirefoxImport extends BrowserImport | |||
37 | { | 37 | { |
38 | $data = [ | 38 | $data = [ |
39 | 'title' => $entry['title'], | 39 | 'title' => $entry['title'], |
40 | 'html' => '', | 40 | 'html' => false, |
41 | 'url' => $entry['uri'], | 41 | 'url' => $entry['uri'], |
42 | 'is_archived' => $this->markAsRead, | 42 | 'is_archived' => (int) $this->markAsRead, |
43 | 'is_starred' => false, | ||
43 | 'tags' => '', | 44 | 'tags' => '', |
44 | 'created_at' => substr($entry['dateAdded'], 0, 10), | 45 | 'created_at' => substr($entry['dateAdded'], 0, 10), |
45 | ]; | 46 | ]; |
diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index cf4c785c..70a53f1a 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php | |||
@@ -74,8 +74,7 @@ class InstapaperImport extends AbstractImport | |||
74 | 'status' => $data[3], | 74 | 'status' => $data[3], |
75 | 'is_archived' => $data[3] === 'Archive' || $data[3] === 'Starred', | 75 | 'is_archived' => $data[3] === 'Archive' || $data[3] === 'Starred', |
76 | 'is_starred' => $data[3] === 'Starred', | 76 | 'is_starred' => $data[3] === 'Starred', |
77 | 'content_type' => '', | 77 | 'html' => false, |
78 | 'language' => '', | ||
79 | ]; | 78 | ]; |
80 | } | 79 | } |
81 | fclose($handle); | 80 | fclose($handle); |
diff --git a/src/Wallabag/ImportBundle/Import/PinboardImport.php b/src/Wallabag/ImportBundle/Import/PinboardImport.php index 9bcfbc36..d9865534 100644 --- a/src/Wallabag/ImportBundle/Import/PinboardImport.php +++ b/src/Wallabag/ImportBundle/Import/PinboardImport.php | |||
@@ -98,8 +98,6 @@ class PinboardImport extends AbstractImport | |||
98 | $data = [ | 98 | $data = [ |
99 | 'title' => $importedEntry['description'], | 99 | 'title' => $importedEntry['description'], |
100 | 'url' => $importedEntry['href'], | 100 | 'url' => $importedEntry['href'], |
101 | 'content_type' => '', | ||
102 | 'language' => '', | ||
103 | 'is_archived' => ('no' === $importedEntry['toread']) || $this->markAsRead, | 101 | 'is_archived' => ('no' === $importedEntry['toread']) || $this->markAsRead, |
104 | 'is_starred' => false, | 102 | 'is_starred' => false, |
105 | 'created_at' => $importedEntry['time'], | 103 | 'created_at' => $importedEntry['time'], |
diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php index b8c0f777..de320d23 100644 --- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php +++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php | |||
@@ -98,11 +98,10 @@ class ReadabilityImport extends AbstractImport | |||
98 | $data = [ | 98 | $data = [ |
99 | 'title' => $importedEntry['article__title'], | 99 | 'title' => $importedEntry['article__title'], |
100 | 'url' => $importedEntry['article__url'], | 100 | 'url' => $importedEntry['article__url'], |
101 | 'content_type' => '', | ||
102 | 'language' => '', | ||
103 | 'is_archived' => $importedEntry['archive'] || $this->markAsRead, | 101 | 'is_archived' => $importedEntry['archive'] || $this->markAsRead, |
104 | 'is_starred' => $importedEntry['favorite'], | 102 | 'is_starred' => $importedEntry['favorite'], |
105 | 'created_at' => $importedEntry['date_added'], | 103 | 'created_at' => $importedEntry['date_added'], |
104 | 'html' => false, | ||
106 | ]; | 105 | ]; |
107 | 106 | ||
108 | $entry = new Entry($this->user); | 107 | $entry = new Entry($this->user); |
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index 4f001062..59e3ce02 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php | |||
@@ -37,8 +37,6 @@ class WallabagV1Import extends WallabagImport | |||
37 | 'title' => $entry['title'], | 37 | 'title' => $entry['title'], |
38 | 'html' => $entry['content'], | 38 | 'html' => $entry['content'], |
39 | 'url' => $entry['url'], | 39 | 'url' => $entry['url'], |
40 | 'content_type' => '', | ||
41 | 'language' => '', | ||
42 | 'is_archived' => $entry['is_read'] || $this->markAsRead, | 40 | 'is_archived' => $entry['is_read'] || $this->markAsRead, |
43 | 'is_starred' => $entry['is_fav'], | 41 | 'is_starred' => $entry['is_fav'], |
44 | 'tags' => '', | 42 | 'tags' => '', |
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php index 37c8ca14..d2a89d79 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php | |||
@@ -36,7 +36,8 @@ class WallabagV2Import extends WallabagImport | |||
36 | return [ | 36 | return [ |
37 | 'html' => $entry['content'], | 37 | 'html' => $entry['content'], |
38 | 'content_type' => $entry['mimetype'], | 38 | 'content_type' => $entry['mimetype'], |
39 | 'is_archived' => ($entry['is_archived'] || $this->markAsRead), | 39 | 'is_archived' => (int) ($entry['is_archived'] || $this->markAsRead), |
40 | 'is_starred' => false, | ||
40 | ] + $entry; | 41 | ] + $entry; |
41 | } | 42 | } |
42 | 43 | ||
diff --git a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig index b1ec40a6..b79a1470 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig | |||
@@ -2,6 +2,12 @@ | |||
2 | 2 | ||
3 | {% block title %}{{ 'import.page_title'|trans }}{% endblock %} | 3 | {% block title %}{{ 'import.page_title'|trans }}{% endblock %} |
4 | 4 | ||
5 | {% block messages %} | ||
6 | {{ render(controller("WallabagImportBundle:Import:checkQueue")) }} | ||
7 | |||
8 | {{ parent() }} | ||
9 | {% endblock %} | ||
10 | |||
5 | {% block content %} | 11 | {% block content %} |
6 | <div class="row"> | 12 | <div class="row"> |
7 | <div class="col s12"> | 13 | <div class="col s12"> |
diff --git a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php index 8e2f04e9..0bdd1cae 100644 --- a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php +++ b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php | |||
@@ -21,8 +21,10 @@ class CreateConfigListener implements EventSubscriberInterface | |||
21 | private $rssLimit; | 21 | private $rssLimit; |
22 | private $language; | 22 | private $language; |
23 | private $readingSpeed; | 23 | private $readingSpeed; |
24 | private $actionMarkAsRead; | ||
25 | private $listMode; | ||
24 | 26 | ||
25 | public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed) | 27 | public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed, $actionMarkAsRead, $listMode) |
26 | { | 28 | { |
27 | $this->em = $em; | 29 | $this->em = $em; |
28 | $this->theme = $theme; | 30 | $this->theme = $theme; |
@@ -30,6 +32,8 @@ class CreateConfigListener implements EventSubscriberInterface | |||
30 | $this->rssLimit = $rssLimit; | 32 | $this->rssLimit = $rssLimit; |
31 | $this->language = $language; | 33 | $this->language = $language; |
32 | $this->readingSpeed = $readingSpeed; | 34 | $this->readingSpeed = $readingSpeed; |
35 | $this->actionMarkAsRead = $actionMarkAsRead; | ||
36 | $this->listMode = $listMode; | ||
33 | } | 37 | } |
34 | 38 | ||
35 | public static function getSubscribedEvents() | 39 | public static function getSubscribedEvents() |
@@ -51,6 +55,8 @@ class CreateConfigListener implements EventSubscriberInterface | |||
51 | $config->setRssLimit($this->rssLimit); | 55 | $config->setRssLimit($this->rssLimit); |
52 | $config->setLanguage($this->language); | 56 | $config->setLanguage($this->language); |
53 | $config->setReadingSpeed($this->readingSpeed); | 57 | $config->setReadingSpeed($this->readingSpeed); |
58 | $config->setActionMarkAsRead($this->actionMarkAsRead); | ||
59 | $config->setListMode($this->listMode); | ||
54 | 60 | ||
55 | $this->em->persist($config); | 61 | $this->em->persist($config); |
56 | $this->em->flush(); | 62 | $this->em->flush(); |
diff --git a/src/Wallabag/UserBundle/Resources/config/services.yml b/src/Wallabag/UserBundle/Resources/config/services.yml index 164a25ec..72f6f12c 100644 --- a/src/Wallabag/UserBundle/Resources/config/services.yml +++ b/src/Wallabag/UserBundle/Resources/config/services.yml | |||
@@ -31,5 +31,7 @@ services: | |||
31 | - "%wallabag_core.rss_limit%" | 31 | - "%wallabag_core.rss_limit%" |
32 | - "%wallabag_core.language%" | 32 | - "%wallabag_core.language%" |
33 | - "%wallabag_core.reading_speed%" | 33 | - "%wallabag_core.reading_speed%" |
34 | - "%wallabag_core.action_mark_as_read%" | ||
35 | - "%wallabag_core.list_mode%" | ||
34 | tags: | 36 | tags: |
35 | - { name: kernel.event_subscriber } | 37 | - { name: kernel.event_subscriber } |
diff --git a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.de.yml b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.de.yml new file mode 100644 index 00000000..4efaaab4 --- /dev/null +++ b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.de.yml | |||
@@ -0,0 +1,11 @@ | |||
1 | # Two factor mail | ||
2 | auth_code: | ||
3 | on: 'an' | ||
4 | mailer: | ||
5 | subject: 'wallabag Authentifizierungcode' | ||
6 | body: | ||
7 | hello: "Hi %user%," | ||
8 | first_para: "da du die Zwei-Faktor-Authentifizierung in deinem wallabag Konto aktiviert hast, und du dich gerade von einem neuen Gerät (Computer, Handy, etc.) anmeldest, senden wir dir einen Code, um deinen Zugriff zu prüfen." | ||
9 | second_para: "Hier ist der Code:" | ||
10 | support: "Bitte zögere nicht, Kontakt mit uns aufzunehmen falls du ein Problem hast:" | ||
11 | signature: "Das wallabag Team" | ||
diff --git a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml index 85f2ea9c..ee0a27d5 100644 --- a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml +++ b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml | |||
@@ -2,7 +2,7 @@ | |||
2 | auth_code: | 2 | auth_code: |
3 | on: 'on' | 3 | on: 'on' |
4 | mailer: | 4 | mailer: |
5 | subject: 'Wallabag authentication Code' | 5 | subject: 'wallabag authentication code' |
6 | body: | 6 | body: |
7 | hello: "Hi %user%," | 7 | hello: "Hi %user%," |
8 | first_para: "Since you enable two factor authentication on your wallabag account and you just logged in from a new device (computer, phone, etc.), we send you a code to validate your connection." | 8 | first_para: "Since you 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." |
diff --git a/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig b/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig index 3731f13b..5d1f22b7 100644 --- a/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig | |||
@@ -74,7 +74,7 @@ | |||
74 | 74 | ||
75 | <table cellpadding="0" cellspacing="0" border="0" align="center" id="card"> | 75 | <table cellpadding="0" cellspacing="0" border="0" align="center" id="card"> |
76 | <tr> | 76 | <tr> |
77 | <td style="padding: 20px;" width="96px" valign="top"><img class="image_fix" src="{{ asset('bundles/wallabagcore/themes/material/img/logo-other_themes.png') }}" alt="logo" title="{{ wallabag_url }}" style="width: 96px; height: 96px;" /></td> | 77 | <td style="padding: 20px;" width="96px" valign="top"><img class="image_fix" src="{{ absolute_url(asset('bundles/wallabagcore/themes/_global/img/logo-other_themes.png')) }}" alt="logo" title="{{ wallabag_url }}" style="width: 96px; height: 96px;" /></td> |
78 | <td style="padding: 20px; padding-left: 0;" valign="top" id="cell_desc"> | 78 | <td style="padding: 20px; padding-left: 0;" valign="top" id="cell_desc"> |
79 | <h1>wallabag</h1> | 79 | <h1>wallabag</h1> |
80 | <h5>{{ "auth_code.on"|trans({}, 'wallabag_user') }} {{ wallabag_url }}</h5> | 80 | <h5>{{ "auth_code.on"|trans({}, 'wallabag_user') }} {{ wallabag_url }}</h5> |
diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php index 447feb4f..beb0598a 100644 --- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php | |||
@@ -515,6 +515,29 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
515 | } | 515 | } |
516 | } | 516 | } |
517 | 517 | ||
518 | public function testTaggingRuleTooLong() | ||
519 | { | ||
520 | $this->logInAs('admin'); | ||
521 | $client = $this->getClient(); | ||
522 | |||
523 | $crawler = $client->request('GET', '/config'); | ||
524 | |||
525 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
526 | |||
527 | $form = $crawler->filter('button[id=tagging_rule_save]')->form(); | ||
528 | |||
529 | $crawler = $client->submit($form, [ | ||
530 | 'tagging_rule[rule]' => str_repeat('title', 60), | ||
531 | 'tagging_rule[tags]' => 'cool tag', | ||
532 | ]); | ||
533 | |||
534 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
535 | |||
536 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | ||
537 | |||
538 | $this->assertContains('255 characters', $body[0]); | ||
539 | } | ||
540 | |||
518 | public function testDeletingTaggingRuleFromAnOtherUser() | 541 | public function testDeletingTaggingRuleFromAnOtherUser() |
519 | { | 542 | { |
520 | $this->logInAs('bob'); | 543 | $this->logInAs('bob'); |
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php index 33b3ff2a..2ca13b91 100644 --- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php +++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php | |||
@@ -10,6 +10,8 @@ use Wallabag\UserBundle\Entity\User; | |||
10 | 10 | ||
11 | class ContentProxyTest extends \PHPUnit_Framework_TestCase | 11 | class ContentProxyTest extends \PHPUnit_Framework_TestCase |
12 | { | 12 | { |
13 | private $fetchingErrorMessage = 'wallabag can\'t retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/master/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>.'; | ||
14 | |||
13 | public function testWithBadUrl() | 15 | public function testWithBadUrl() |
14 | { | 16 | { |
15 | $tagger = $this->getTaggerMock(); | 17 | $tagger = $this->getTaggerMock(); |
@@ -31,12 +33,12 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
31 | 'language' => '', | 33 | 'language' => '', |
32 | ]); | 34 | ]); |
33 | 35 | ||
34 | $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger()); | 36 | $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger(), $this->fetchingErrorMessage); |
35 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://user@:80'); | 37 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://user@:80'); |
36 | 38 | ||
37 | $this->assertEquals('http://user@:80', $entry->getUrl()); | 39 | $this->assertEquals('http://user@:80', $entry->getUrl()); |
38 | $this->assertEmpty($entry->getTitle()); | 40 | $this->assertEmpty($entry->getTitle()); |
39 | $this->assertEquals('<p>Unable to retrieve readable content.</p>', $entry->getContent()); | 41 | $this->assertEquals($this->fetchingErrorMessage, $entry->getContent()); |
40 | $this->assertEmpty($entry->getPreviewPicture()); | 42 | $this->assertEmpty($entry->getPreviewPicture()); |
41 | $this->assertEmpty($entry->getMimetype()); | 43 | $this->assertEmpty($entry->getMimetype()); |
42 | $this->assertEmpty($entry->getLanguage()); | 44 | $this->assertEmpty($entry->getLanguage()); |
@@ -65,12 +67,12 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
65 | 'language' => '', | 67 | 'language' => '', |
66 | ]); | 68 | ]); |
67 | 69 | ||
68 | $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger()); | 70 | $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger(), $this->fetchingErrorMessage); |
69 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); | 71 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); |
70 | 72 | ||
71 | $this->assertEquals('http://0.0.0.0', $entry->getUrl()); | 73 | $this->assertEquals('http://0.0.0.0', $entry->getUrl()); |
72 | $this->assertEmpty($entry->getTitle()); | 74 | $this->assertEmpty($entry->getTitle()); |
73 | $this->assertEquals('<p>Unable to retrieve readable content.</p>', $entry->getContent()); | 75 | $this->assertEquals($this->fetchingErrorMessage, $entry->getContent()); |
74 | $this->assertEmpty($entry->getPreviewPicture()); | 76 | $this->assertEmpty($entry->getPreviewPicture()); |
75 | $this->assertEmpty($entry->getMimetype()); | 77 | $this->assertEmpty($entry->getMimetype()); |
76 | $this->assertEmpty($entry->getLanguage()); | 78 | $this->assertEmpty($entry->getLanguage()); |
@@ -104,12 +106,12 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
104 | ], | 106 | ], |
105 | ]); | 107 | ]); |
106 | 108 | ||
107 | $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger()); | 109 | $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger(), $this->fetchingErrorMessage); |
108 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://domain.io'); | 110 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://domain.io'); |
109 | 111 | ||
110 | $this->assertEquals('http://domain.io', $entry->getUrl()); | 112 | $this->assertEquals('http://domain.io', $entry->getUrl()); |
111 | $this->assertEquals('my title', $entry->getTitle()); | 113 | $this->assertEquals('my title', $entry->getTitle()); |
112 | $this->assertEquals('<p>Unable to retrieve readable content.</p><p><i>But we found a short description: </i></p>desc', $entry->getContent()); | 114 | $this->assertEquals($this->fetchingErrorMessage . '<p><i>But we found a short description: </i></p>desc', $entry->getContent()); |
113 | $this->assertEmpty($entry->getPreviewPicture()); | 115 | $this->assertEmpty($entry->getPreviewPicture()); |
114 | $this->assertEmpty($entry->getLanguage()); | 116 | $this->assertEmpty($entry->getLanguage()); |
115 | $this->assertEmpty($entry->getHttpStatus()); | 117 | $this->assertEmpty($entry->getHttpStatus()); |
@@ -145,7 +147,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
145 | ], | 147 | ], |
146 | ]); | 148 | ]); |
147 | 149 | ||
148 | $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger()); | 150 | $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger(), $this->fetchingErrorMessage); |
149 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); | 151 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); |
150 | 152 | ||
151 | $this->assertEquals('http://1.1.1.1', $entry->getUrl()); | 153 | $this->assertEquals('http://1.1.1.1', $entry->getUrl()); |
@@ -167,7 +169,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
167 | 169 | ||
168 | $graby = $this->getMockBuilder('Graby\Graby')->getMock(); | 170 | $graby = $this->getMockBuilder('Graby\Graby')->getMock(); |
169 | 171 | ||
170 | $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger()); | 172 | $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger(), $this->fetchingErrorMessage); |
171 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0', [ | 173 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0', [ |
172 | 'html' => str_repeat('this is my content', 325), | 174 | 'html' => str_repeat('this is my content', 325), |
173 | 'title' => 'this is my title', | 175 | 'title' => 'this is my title', |
@@ -197,7 +199,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
197 | ->will($this->throwException(new \Exception())); | 199 | ->will($this->throwException(new \Exception())); |
198 | 200 | ||
199 | $tagRepo = $this->getTagRepositoryMock(); | 201 | $tagRepo = $this->getTagRepositoryMock(); |
200 | $proxy = new ContentProxy($graby, $tagger, $tagRepo, $this->getLogger()); | 202 | $proxy = new ContentProxy($graby, $tagger, $tagRepo, $this->getLogger(), $this->fetchingErrorMessage); |
201 | 203 | ||
202 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0', [ | 204 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0', [ |
203 | 'html' => str_repeat('this is my content', 325), | 205 | 'html' => str_repeat('this is my content', 325), |
@@ -217,7 +219,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
217 | ->getMock(); | 219 | ->getMock(); |
218 | 220 | ||
219 | $tagRepo = $this->getTagRepositoryMock(); | 221 | $tagRepo = $this->getTagRepositoryMock(); |
220 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger()); | 222 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger(), $this->fetchingErrorMessage); |
221 | 223 | ||
222 | $entry = new Entry(new User()); | 224 | $entry = new Entry(new User()); |
223 | 225 | ||
@@ -235,7 +237,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
235 | ->getMock(); | 237 | ->getMock(); |
236 | 238 | ||
237 | $tagRepo = $this->getTagRepositoryMock(); | 239 | $tagRepo = $this->getTagRepositoryMock(); |
238 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger()); | 240 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger(), $this->fetchingErrorMessage); |
239 | 241 | ||
240 | $entry = new Entry(new User()); | 242 | $entry = new Entry(new User()); |
241 | 243 | ||
@@ -253,7 +255,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
253 | ->getMock(); | 255 | ->getMock(); |
254 | 256 | ||
255 | $tagRepo = $this->getTagRepositoryMock(); | 257 | $tagRepo = $this->getTagRepositoryMock(); |
256 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger()); | 258 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger(), $this->fetchingErrorMessage); |
257 | 259 | ||
258 | $entry = new Entry(new User()); | 260 | $entry = new Entry(new User()); |
259 | 261 | ||
@@ -269,7 +271,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
269 | ->getMock(); | 271 | ->getMock(); |
270 | 272 | ||
271 | $tagRepo = $this->getTagRepositoryMock(); | 273 | $tagRepo = $this->getTagRepositoryMock(); |
272 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger()); | 274 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger(), $this->fetchingErrorMessage); |
273 | 275 | ||
274 | $entry = new Entry(new User()); | 276 | $entry = new Entry(new User()); |
275 | 277 | ||
@@ -285,7 +287,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
285 | ->getMock(); | 287 | ->getMock(); |
286 | 288 | ||
287 | $tagRepo = $this->getTagRepositoryMock(); | 289 | $tagRepo = $this->getTagRepositoryMock(); |
288 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger()); | 290 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger(), $this->fetchingErrorMessage); |
289 | 291 | ||
290 | $tagEntity = new Tag(); | 292 | $tagEntity = new Tag(); |
291 | $tagEntity->setLabel('tag1'); | 293 | $tagEntity->setLabel('tag1'); |
@@ -310,7 +312,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
310 | $tagRepo->expects($this->never()) | 312 | $tagRepo->expects($this->never()) |
311 | ->method('__call'); | 313 | ->method('__call'); |
312 | 314 | ||
313 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger()); | 315 | $proxy = new ContentProxy($graby, $this->getTaggerMock(), $tagRepo, $this->getLogger(), $this->fetchingErrorMessage); |
314 | 316 | ||
315 | $tagEntity = new Tag(); | 317 | $tagEntity = new Tag(); |
316 | $tagEntity->setLabel('tag1'); | 318 | $tagEntity->setLabel('tag1'); |
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php index 2c370ed9..acc39997 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php | |||
@@ -112,7 +112,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
112 | ->get('doctrine.orm.entity_manager') | 112 | ->get('doctrine.orm.entity_manager') |
113 | ->getRepository('WallabagCoreBundle:Entry') | 113 | ->getRepository('WallabagCoreBundle:Entry') |
114 | ->findByUrlAndUserId( | 114 | ->findByUrlAndUserId( |
115 | 'http://www.framablog.org/index.php/post/2014/02/05/Framabag-service-libre-gratuit-interview-developpeur', | 115 | 'https://framablog.org/2014/02/05/framabag-service-libre-gratuit-interview-developpeur/', |
116 | $this->getLoggedInUserId() | 116 | $this->getLoggedInUserId() |
117 | ); | 117 | ); |
118 | 118 | ||
@@ -126,9 +126,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
126 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | 126 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
127 | $this->assertContains('flashes.import.notice.summary', $body[0]); | 127 | $this->assertContains('flashes.import.notice.summary', $body[0]); |
128 | 128 | ||
129 | $this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is ok'); | 129 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is ok'); |
130 | $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is ok'); | 130 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is ok'); |
131 | $this->assertEmpty($content->getLanguage(), 'Language for http://www.framablog.org is ok'); | 131 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.framablog.org is ok'); |
132 | $this->assertEquals(1, count($content->getTags())); | 132 | $this->assertEquals(1, count($content->getTags())); |
133 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); | 133 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); |
134 | } | 134 | } |
diff --git a/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php index a78b77bc..01796ded 100644 --- a/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php +++ b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php | |||
@@ -31,6 +31,8 @@ class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase | |||
31 | 20, | 31 | 20, |
32 | 50, | 32 | 50, |
33 | 'fr', | 33 | 'fr', |
34 | 1, | ||
35 | 1, | ||
34 | 1 | 36 | 1 |
35 | ); | 37 | ); |
36 | 38 | ||