Merge remote-tracking branch 'origin/master' into 2.4

This commit is contained in:
Jeremy Benoist 2018-07-03 13:55:25 +02:00
commit 44043ebe82
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
64 changed files with 298 additions and 764 deletions

View file

@ -1,5 +1,29 @@
# Changelog # Changelog
## [2.3.3](https://github.com/wallabag/wallabag/tree/2.3.3)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.2...2.3.3)
### Fixes
- Fix error when withRemove variable is not defined. [#3573](https://github.com/wallabag/wallabag/pull/3573)
- Fix title card HTML parsing [#3592](https://github.com/wallabag/wallabag/pull/3592)
- Fix tests [#3597](https://github.com/wallabag/wallabag/pull/3597)
- Fix tests [#3619](https://github.com/wallabag/wallabag/pull/3619)
- Better encoding of the URI for the bookmarklet [#3616](https://github.com/wallabag/wallabag/pull/3616)
- Fix overflow wrap issue [#3652](https://github.com/wallabag/wallabag/pull/3652)
- Fix/firefox mobile unneeded resize [#3653](https://github.com/wallabag/wallabag/pull/3653)
- Fix srcset attribute on images downloaded [#3661](https://github.com/wallabag/wallabag/pull/3661)
- Fix authors and preview alt encoding display [#3664](https://github.com/wallabag/wallabag/pull/3664)
- Spelling: GitHub, Log out, of the dev [#3614](https://github.com/wallabag/wallabag/pull/3614)
- Fix tests [#3668](https://github.com/wallabag/wallabag/pull/3668)
- Fixed migrations with dash into db names [#3538](https://github.com/wallabag/wallabag/pull/3538)
### Changes
- Allow login by email [#3615](https://github.com/wallabag/wallabag/pull/3615)
- Occitan update [#3646](https://github.com/wallabag/wallabag/pull/3646)
- Highlight code in articles using highlight.js [#3636](https://github.com/wallabag/wallabag/pull/3636)
## [2.3.2](https://github.com/wallabag/wallabag/tree/2.3.2) ## [2.3.2](https://github.com/wallabag/wallabag/tree/2.3.2)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.1...2.3.2) [Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.1...2.3.2)

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Initial database structure. * Initial database structure.
*/ */
class Version20160401000000 extends AbstractMigration implements ContainerAwareInterface class Version20160401000000 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -76,30 +64,30 @@ SQL
case 'mysql': case 'mysql':
$sql = <<<SQL $sql = <<<SQL
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE `{$this->getTable('entry')}` (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('entry')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('entry_tag')} (entry_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_C9F0DD7CBA364942 (entry_id), INDEX IDX_C9F0DD7CBAD26311 (tag_id), PRIMARY KEY(entry_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('entry_tag')} (entry_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_C9F0DD7CBA364942 (entry_id), INDEX IDX_C9F0DD7CBAD26311 (tag_id), PRIMARY KEY(entry_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE `{$this->getTable('config')}` (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('config')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE `{$this->getTable('tagging_rule')}` (id INT AUTO_INCREMENT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)', INDEX IDX_2D9B3C5424DB0683 (config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('tagging_rule')} (id INT AUTO_INCREMENT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)', INDEX IDX_2D9B3C5424DB0683 (config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE `{$this->getTable('tag')}` (id INT AUTO_INCREMENT NOT NULL, `label` LONGTEXT NOT NULL, slug VARCHAR(128) NOT NULL, UNIQUE INDEX UNIQ_4CA58A8C989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('tag')} (id INT AUTO_INCREMENT NOT NULL, `label` LONGTEXT NOT NULL, slug VARCHAR(128) NOT NULL, UNIQUE INDEX UNIQ_4CA58A8C989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('oauth2_clients')} (id INT AUTO_INCREMENT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris LONGTEXT NOT NULL COMMENT '(DC2Type:array)', secret VARCHAR(255) NOT NULL, allowed_grant_types LONGTEXT NOT NULL COMMENT '(DC2Type:array)', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('oauth2_clients')} (id INT AUTO_INCREMENT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris LONGTEXT NOT NULL COMMENT '(DC2Type:array)', secret VARCHAR(255) NOT NULL, allowed_grant_types LONGTEXT NOT NULL COMMENT '(DC2Type:array)', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('oauth2_access_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_368A42095F37A13B (token), INDEX IDX_368A420919EB6921 (client_id), INDEX IDX_368A4209A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('oauth2_access_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_368A42095F37A13B (token), INDEX IDX_368A420919EB6921 (client_id), INDEX IDX_368A4209A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('oauth2_refresh_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_20C9FB245F37A13B (token), INDEX IDX_20C9FB2419EB6921 (client_id), INDEX IDX_20C9FB24A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('oauth2_refresh_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_20C9FB245F37A13B (token), INDEX IDX_20C9FB2419EB6921 (client_id), INDEX IDX_20C9FB24A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('oauth2_auth_codes')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri LONGTEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_EE52E3FA5F37A13B (token), INDEX IDX_EE52E3FA19EB6921 (client_id), INDEX IDX_EE52E3FAA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('oauth2_auth_codes')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri LONGTEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_EE52E3FA5F37A13B (token), INDEX IDX_EE52E3FA19EB6921 (client_id), INDEX IDX_EE52E3FAA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE `{$this->getTable('user')}` (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json_array)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('user')} (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json_array)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('annotation')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges LONGTEXT NOT NULL COMMENT '(DC2Type:array)', INDEX IDX_A7AED006A76ED395 (user_id), INDEX IDX_A7AED006BA364942 (entry_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('annotation')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges LONGTEXT NOT NULL COMMENT '(DC2Type:array)', INDEX IDX_A7AED006A76ED395 (user_id), INDEX IDX_A7AED006BA364942 (entry_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
ALTER TABLE `{$this->getTable('entry')}` ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); ALTER TABLE {$this->getTable('entry')} ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES `{$this->getTable('entry')}` (id); ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id);
ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES `{$this->getTable('tag')}` (id); ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES {$this->getTable('tag')} (id);
ALTER TABLE `{$this->getTable('config')}` ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); ALTER TABLE {$this->getTable('config')} ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE `{$this->getTable('tagging_rule')}` ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES `{$this->getTable('config')}` (id); ALTER TABLE {$this->getTable('tagging_rule')} ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES {$this->getTable('config')} (id);
ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id); ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id);
ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id); ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id);
ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id); ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id);
ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES `{$this->getTable('entry')}` (id); ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id);
SQL SQL
; ;
foreach (explode("\n", $sql) as $query) { foreach (explode("\n", $sql) as $query) {
@ -197,9 +185,4 @@ SQL
$this->addSql("DROP TABLE {$this->getTable('user')}"); $this->addSql("DROP TABLE {$this->getTable('user')}");
$this->addSql("DROP TABLE {$this->getTable('annotation')}"); $this->addSql("DROP TABLE {$this->getTable('annotation')}");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added foreign keys for account resetting. * Added foreign keys for account resetting.
*/ */
class Version20160410190541 extends AbstractMigration implements ContainerAwareInterface class Version20160410190541 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -56,9 +44,4 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_public'"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_public'");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added name field on wallabag_oauth2_clients. * Added name field on wallabag_oauth2_clients.
*/ */
class Version20160812120952 extends AbstractMigration implements ContainerAwareInterface class Version20160812120952 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -65,9 +53,4 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI
$clientsTable->dropColumn('name'); $clientsTable->dropColumn('name');
} }
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added settings for RabbitMQ and Redis imports. * Added settings for RabbitMQ and Redis imports.
*/ */
class Version20160911214952 extends AbstractMigration implements ContainerAwareInterface class Version20160911214952 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -56,9 +44,4 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_redis';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_redis';");
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_rabbitmq';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_rabbitmq';");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added pocket_consumer_key field on wallabag_config. * Added pocket_consumer_key field on wallabag_config.
*/ */
class Version20160916201049 extends AbstractMigration implements ContainerAwareInterface class Version20160916201049 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -44,9 +32,4 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI
$configTable->dropColumn('pocket_consumer_key'); $configTable->dropColumn('pocket_consumer_key');
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')"); $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,27 +2,15 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Migrations\SkipMigrationException; use Doctrine\DBAL\Migrations\SkipMigrationException;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added pocket_consumer_key field on wallabag_config. * Added pocket_consumer_key field on wallabag_config.
*/ */
class Version20161001072726 extends AbstractMigration implements ContainerAwareInterface class Version20161001072726 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -36,7 +24,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
$query = $this->connection->query(" $query = $this->connection->query("
SELECT CONSTRAINT_NAME SELECT CONSTRAINT_NAME
FROM information_schema.key_column_usage FROM information_schema.key_column_usage
WHERE TABLE_NAME = '" . $this->getTable('entry_tag') . "' AND CONSTRAINT_NAME LIKE 'FK_%' WHERE TABLE_NAME = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "' AND CONSTRAINT_NAME LIKE 'FK_%'
AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'" AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'"
); );
$query->execute(); $query->execute();
@ -54,7 +42,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
FROM pg_constraint c FROM pg_constraint c
JOIN pg_namespace n ON n.oid = c.connamespace JOIN pg_namespace n ON n.oid = c.connamespace
WHERE contype = 'f' WHERE contype = 'f'
AND conrelid::regclass::text = '" . $this->getTable('entry_tag') . "' AND conrelid::regclass::text = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "'
AND n.nspname = 'public';" AND n.nspname = 'public';"
); );
$query->execute(); $query->execute();
@ -75,7 +63,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
$query = $this->connection->query(" $query = $this->connection->query("
SELECT CONSTRAINT_NAME SELECT CONSTRAINT_NAME
FROM information_schema.key_column_usage FROM information_schema.key_column_usage
WHERE TABLE_NAME = '" . $this->getTable('annotation') . "' WHERE TABLE_NAME = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "'
AND CONSTRAINT_NAME LIKE 'FK_%' AND CONSTRAINT_NAME LIKE 'FK_%'
AND COLUMN_NAME = 'entry_id' AND COLUMN_NAME = 'entry_id'
AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'" AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'"
@ -95,7 +83,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
FROM pg_constraint c FROM pg_constraint c
JOIN pg_namespace n ON n.oid = c.connamespace JOIN pg_namespace n ON n.oid = c.connamespace
WHERE contype = 'f' WHERE contype = 'f'
AND conrelid::regclass::text = '" . $this->getTable('annotation') . "' AND conrelid::regclass::text = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "'
AND n.nspname = 'public' AND n.nspname = 'public'
AND pg_get_constraintdef(c.oid) LIKE '%entry_id%';" AND pg_get_constraintdef(c.oid) LIKE '%entry_id%';"
); );
@ -117,9 +105,4 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
{ {
throw new SkipMigrationException('Too complex ...'); throw new SkipMigrationException('Too complex ...');
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Converted database to utf8mb4 encoding (for MySQL only). * Converted database to utf8mb4 encoding (for MySQL only).
*/ */
class Version20161022134138 extends AbstractMigration implements ContainerAwareInterface class Version20161022134138 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -29,7 +17,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
{ {
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
$this->addSql('ALTER DATABASE ' . $this->connection->getParams()['dbname'] . ' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'); $this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;');
// convert field length for utf8mb4 // convert field length for utf8mb4
// http://stackoverflow.com/a/31474509/569101 // http://stackoverflow.com/a/31474509/569101
@ -60,7 +48,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
{ {
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
$this->addSql('ALTER DATABASE ' . $this->connection->getParams()['dbname'] . ' CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;'); $this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;');
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); $this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
@ -77,9 +65,4 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,28 +2,16 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added user_id column on oauth2_clients to prevent users to delete API clients from other users. * Added user_id column on oauth2_clients to prevent users to delete API clients from other users.
*/ */
class Version20161024212538 extends AbstractMigration implements ContainerAwareInterface class Version20161024212538 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
private $constraintName = 'IDX_user_oauth_client'; private $constraintName = 'IDX_user_oauth_client';
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -59,9 +47,4 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI
$clientsTable->removeForeignKey($this->constraintName); $clientsTable->removeForeignKey($this->constraintName);
} }
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added the internal setting to enable/disable downloading pictures. * Added the internal setting to enable/disable downloading pictures.
*/ */
class Version20161031132655 extends AbstractMigration implements ContainerAwareInterface class Version20161031132655 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -44,9 +32,4 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI
{ {
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_images_enabled';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_images_enabled';");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,28 +2,16 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added created_at index on entry table. * Added created_at index on entry table.
*/ */
class Version20161104073720 extends AbstractMigration implements ContainerAwareInterface class Version20161104073720 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
private $indexName = 'IDX_entry_created_at'; private $indexName = 'IDX_entry_created_at';
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -45,9 +33,4 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI
$entryTable->dropIndex($this->indexName); $entryTable->dropIndex($this->indexName);
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added action_mark_as_read field on config table. * Added action_mark_as_read field on config table.
*/ */
class Version20161106113822 extends AbstractMigration implements ContainerAwareInterface class Version20161106113822 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -48,9 +36,4 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI
$configTable->dropColumn('action_mark_as_read'); $configTable->dropColumn('action_mark_as_read');
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added the internal setting to share articles to unmark.it. * Added the internal setting to share articles to unmark.it.
*/ */
class Version20161117071626 extends AbstractMigration implements ContainerAwareInterface class Version20161117071626 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -56,9 +44,4 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_unmark';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_unmark';");
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'unmark_url';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'unmark_url';");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Add http_status in `entry_table`. * Add http_status in `entry_table`.
*/ */
class Version20161118134328 extends AbstractMigration implements ContainerAwareInterface class Version20161118134328 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -48,9 +36,4 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI
$entryTable->dropColumn('http_status'); $entryTable->dropColumn('http_status');
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Add the restricted_access internal setting for articles with paywall. * Add the restricted_access internal setting for articles with paywall.
*/ */
class Version20161122144743 extends AbstractMigration implements ContainerAwareInterface class Version20161122144743 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -44,9 +32,4 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI
{ {
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'restricted_access';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'restricted_access';");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,10 +2,8 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Methods and properties removed from `FOS\UserBundle\Model\User`. * Methods and properties removed from `FOS\UserBundle\Model\User`.
@ -18,18 +16,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* You need to drop the fields `expired` and `credentials_expired` from your database * You need to drop the fields `expired` and `credentials_expired` from your database
* schema, because they aren't mapped anymore. * schema, because they aren't mapped anymore.
*/ */
class Version20161122203647 extends AbstractMigration implements ContainerAwareInterface class Version20161122203647 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -55,9 +43,4 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI
$userTable->addColumn('expired', 'smallint', ['notnull' => false]); $userTable->addColumn('expired', 'smallint', ['notnull' => false]);
$userTable->addColumn('credentials_expired', 'smallint', ['notnull' => false]); $userTable->addColumn('credentials_expired', 'smallint', ['notnull' => false]);
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added list_mode in user config. * Added list_mode in user config.
*/ */
class Version20161128084725 extends AbstractMigration implements ContainerAwareInterface class Version20161128084725 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -41,9 +29,4 @@ class Version20161128084725 extends AbstractMigration implements ContainerAwareI
$configTable = $schema->getTable($this->getTable('config')); $configTable = $schema->getTable($this->getTable('config'));
$configTable->dropColumn('list_mode'); $configTable->dropColumn('list_mode');
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,15 +2,13 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Removed locked, credentials_expire_at and expires_at. * Removed locked, credentials_expire_at and expires_at.
*/ */
class Version20161128131503 extends AbstractMigration implements ContainerAwareInterface class Version20161128131503 extends WallabagMigration
{ {
private $fields = [ private $fields = [
'locked' => 'smallint', 'locked' => 'smallint',
@ -18,16 +16,6 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI
'expires_at' => 'datetime', 'expires_at' => 'datetime',
]; ];
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -53,9 +41,4 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI
$userTable->addColumn($field, $type, ['notnull' => false]); $userTable->addColumn($field, $type, ['notnull' => false]);
} }
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Renamed uuid to uid in entry table. * Renamed uuid to uid in entry table.
*/ */
class Version20161214094402 extends AbstractMigration implements ContainerAwareInterface class Version20161214094402 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -67,9 +55,4 @@ class Version20161214094402 extends AbstractMigration implements ContainerAwareI
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid'); $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid');
} }
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,28 +2,16 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added index on wallabag_entry.uid. * Added index on wallabag_entry.uid.
*/ */
class Version20161214094403 extends AbstractMigration implements ContainerAwareInterface class Version20161214094403 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
private $indexName = 'IDX_entry_uid'; private $indexName = 'IDX_entry_uid';
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -45,9 +33,4 @@ class Version20161214094403 extends AbstractMigration implements ContainerAwareI
$entryTable->dropIndex($this->indexName); $entryTable->dropIndex($this->indexName);
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,29 +2,17 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added indexes on wallabag_entry.is_starred and wallabag_entry.is_archived. * Added indexes on wallabag_entry.is_starred and wallabag_entry.is_archived.
*/ */
class Version20170127093841 extends AbstractMigration implements ContainerAwareInterface class Version20170127093841 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
private $indexStarredName = 'IDX_entry_starred'; private $indexStarredName = 'IDX_entry_starred';
private $indexArchivedName = 'IDX_entry_archived'; private $indexArchivedName = 'IDX_entry_archived';
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -48,9 +36,4 @@ class Version20170127093841 extends AbstractMigration implements ContainerAwareI
$entryTable->dropIndex($this->indexStarredName); $entryTable->dropIndex($this->indexStarredName);
$entryTable->dropIndex($this->indexArchivedName); $entryTable->dropIndex($this->indexArchivedName);
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Add the share_scuttle internal setting. * Add the share_scuttle internal setting.
*/ */
class Version20170327194233 extends AbstractMigration implements ContainerAwareInterface class Version20170327194233 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -46,9 +34,4 @@ class Version20170327194233 extends AbstractMigration implements ContainerAwareI
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_scuttle';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_scuttle';");
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'scuttle_url';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'scuttle_url';");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Add published_at and published_by in `entry` table. * Add published_at and published_by in `entry` table.
*/ */
class Version20170405182620 extends AbstractMigration implements ContainerAwareInterface class Version20170405182620 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -57,9 +45,4 @@ class Version20170405182620 extends AbstractMigration implements ContainerAwareI
$entryTable->dropColumn('published_by'); $entryTable->dropColumn('published_by');
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Remove isPublic in Entry Table. * Remove isPublic in Entry Table.
*/ */
class Version20170407200919 extends AbstractMigration implements ContainerAwareInterface class Version20170407200919 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -43,9 +31,4 @@ class Version20170407200919 extends AbstractMigration implements ContainerAwareI
$entryTable->addColumn('is_public', 'boolean', ['notnull' => false, 'default' => 0]); $entryTable->addColumn('is_public', 'boolean', ['notnull' => false, 'default' => 0]);
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Remove download_pictures in craue_config_setting. * Remove download_pictures in craue_config_setting.
*/ */
class Version20170420134133 extends AbstractMigration implements ContainerAwareInterface class Version20170420134133 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -44,9 +32,4 @@ class Version20170420134133 extends AbstractMigration implements ContainerAwareI
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('download_pictures', '1', 'entry')"); $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('download_pictures', '1', 'entry')");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Add site credential table to store username & password for some website (behind authentication or paywall). * Add site credential table to store username & password for some website (behind authentication or paywall).
*/ */
class Version20170501115751 extends AbstractMigration implements ContainerAwareInterface class Version20170501115751 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -53,9 +41,4 @@ class Version20170501115751 extends AbstractMigration implements ContainerAwareI
{ {
$schema->dropTable($this->getTable('site_credential')); $schema->dropTable($this->getTable('site_credential'));
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,15 +2,13 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Changed length for username, username_canonical, email and email_canonical fields in wallabag_user table. * Changed length for username, username_canonical, email and email_canonical fields in wallabag_user table.
*/ */
class Version20170510082609 extends AbstractMigration implements ContainerAwareInterface class Version20170510082609 extends WallabagMigration
{ {
private $fields = [ private $fields = [
'username', 'username',
@ -19,16 +17,6 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI
'email_canonical', 'email_canonical',
]; ];
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -52,9 +40,4 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;'); $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;');
} }
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Added `headers` field in entry table. * Added `headers` field in entry table.
*/ */
class Version20170511115400 extends AbstractMigration implements ContainerAwareInterface class Version20170511115400 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -47,9 +35,4 @@ class Version20170511115400 extends AbstractMigration implements ContainerAwareI
$entryTable->dropColumn('headers'); $entryTable->dropColumn('headers');
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,27 +2,15 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Migrations\SkipMigrationException; use Doctrine\DBAL\Migrations\SkipMigrationException;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Increase the length of the "quote" column of "annotation" table. * Increase the length of the "quote" column of "annotation" table.
*/ */
class Version20170511211659 extends AbstractMigration implements ContainerAwareInterface class Version20170511211659 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
public function up(Schema $schema) public function up(Schema $schema)
{ {
$tableName = $this->getTable('annotation'); $tableName = $this->getTable('annotation');
@ -30,8 +18,8 @@ class Version20170511211659 extends AbstractMigration implements ContainerAwareI
switch ($this->connection->getDatabasePlatform()->getName()) { switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite': case 'sqlite':
$this->addSql(<<<EOD $this->addSql(<<<EOD
CREATE TEMPORARY TABLE __temp__wallabag_annotation AS CREATE TEMPORARY TABLE __temp__wallabag_annotation AS
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
FROM ${tableName} FROM ${tableName}
EOD EOD
); );
@ -56,8 +44,8 @@ EOD
); );
$this->addSql(<<<EOD $this->addSql(<<<EOD
INSERT INTO ${tableName} (id, user_id, entry_id, text, created_at, updated_at, quote, ranges) INSERT INTO ${tableName} (id, user_id, entry_id, text, created_at, updated_at, quote, ranges)
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
FROM __temp__wallabag_annotation; FROM __temp__wallabag_annotation;
EOD EOD
); );
@ -88,9 +76,4 @@ EOD
break; break;
} }
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Add api_user_registration in craue_config_setting. * Add api_user_registration in craue_config_setting.
*/ */
class Version20170602075214 extends AbstractMigration implements ContainerAwareInterface class Version20170602075214 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -44,9 +32,4 @@ class Version20170602075214 extends AbstractMigration implements ContainerAwareI
{ {
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'api_user_registration';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'api_user_registration';");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,27 +2,15 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Remove wallabag_url from craue_config_setting. * Remove wallabag_url from craue_config_setting.
* It has been moved into the parameters.yml. * It has been moved into the parameters.yml.
*/ */
class Version20170606155640 extends AbstractMigration implements ContainerAwareInterface class Version20170606155640 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -45,9 +33,4 @@ class Version20170606155640 extends AbstractMigration implements ContainerAwareI
{ {
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')"); $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Changed tags to lowercase. * Changed tags to lowercase.
*/ */
class Version20170719231144 extends AbstractMigration implements ContainerAwareInterface class Version20170719231144 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -108,9 +96,4 @@ class Version20170719231144 extends AbstractMigration implements ContainerAwareI
{ {
throw new SkipMigrationException('Too complex ...'); throw new SkipMigrationException('Too complex ...');
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Add starred_at column and set its value to updated_at for is_starred entries. * Add starred_at column and set its value to updated_at for is_starred entries.
*/ */
class Version20170824113337 extends AbstractMigration implements ContainerAwareInterface class Version20170824113337 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -60,9 +48,4 @@ class Version20170824113337 extends AbstractMigration implements ContainerAwareI
$entryTable->dropColumn('starred_at'); $entryTable->dropColumn('starred_at');
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Changed reading_time field to prevent null value. * Changed reading_time field to prevent null value.
*/ */
class Version20171008195606 extends AbstractMigration implements ContainerAwareInterface class Version20171008195606 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -57,9 +45,4 @@ class Version20171008195606 extends AbstractMigration implements ContainerAwareI
break; break;
} }
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Add origin_url column. * Add origin_url column.
*/ */
class Version20171105202000 extends AbstractMigration implements ContainerAwareInterface class Version20171105202000 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -47,9 +35,4 @@ class Version20171105202000 extends AbstractMigration implements ContainerAwareI
$entryTable->dropColumn('origin_url'); $entryTable->dropColumn('origin_url');
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Add store_article_headers in craue_config_setting. * Add store_article_headers in craue_config_setting.
*/ */
class Version20171120163128 extends AbstractMigration implements ContainerAwareInterface class Version20171120163128 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -44,9 +32,4 @@ class Version20171120163128 extends AbstractMigration implements ContainerAwareI
{ {
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers';");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -2,26 +2,14 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Wallabag\CoreBundle\Doctrine\WallabagMigration;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Add shaarli_share_origin_url in craue_config_setting. * Add shaarli_share_origin_url in craue_config_setting.
*/ */
class Version20171125164500 extends AbstractMigration implements ContainerAwareInterface class Version20171125164500 extends WallabagMigration
{ {
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
@ -44,9 +32,4 @@ class Version20171125164500 extends AbstractMigration implements ContainerAwareI
{ {
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url';");
} }
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
} }

View file

@ -36,5 +36,5 @@ share_public: Autorizar una URL publica pels articles
download_images_enabled: Telecargar los imatges en local download_images_enabled: Telecargar los imatges en local
restricted_access: Activar l'autenticacion pels sites amb peatge restricted_access: Activar l'autenticacion pels sites amb peatge
api_user_registration: Autorizar los utilizaires a se marcar amb l'API api_user_registration: Autorizar los utilizaires a se marcar amb l'API
# store_article_headers: Enable if wallabag stores HTTP headers for each article store_article_headers: Activar se wallabag garda las entèstas HTTP per cada article
# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled shaarli_share_origin_url: Activar lo partatge de lurl amb Shaarli, se lo servici es activat

View file

@ -13,8 +13,10 @@ import './global.scss';
import './js/shortcuts/entry'; import './js/shortcuts/entry';
import './js/shortcuts/main'; import './js/shortcuts/main';
import { savePercent, retrievePercent } from './js/tools'; /* Hightlight */
import './js/highlight';
import { savePercent, retrievePercent } from './js/tools';
/* ========================================================================== /* ==========================================================================
Annotations & Remember position Annotations & Remember position
@ -65,7 +67,7 @@ $(document).ready(() => {
retrievePercent(x.entryId); retrievePercent(x.entryId);
$(window).resize(() => { $(window).resize(() => {
retrievePercent(x.entryId); retrievePercent(x.entryId, true);
}); });
} }
}); });

View file

@ -0,0 +1,8 @@
import 'highlight.js/styles/atom-one-light.css';
import * as hljs from 'highlight.js';
window.addEventListener('load', () => {
document.querySelectorAll('pre').forEach((node) => {
hljs.highlightBlock(node);
});
});

View file

@ -19,14 +19,16 @@ function savePercent(id, percent) {
return true; return true;
} }
function retrievePercent(id) { function retrievePercent(id, resized) {
if (!supportsLocalStorage()) { return false; } if (!supportsLocalStorage()) { return false; }
const bheight = $(document).height(); const bheight = $(document).height();
const percent = localStorage[`wallabag.article.${id}.percent`]; const percent = localStorage[`wallabag.article.${id}.percent`];
const scroll = bheight * percent; const scroll = bheight * percent;
$('html,body').animate({ scrollTop: scroll }, 'fast'); if (!resized) {
$('html,body').animate({ scrollTop: scroll }, 'fast');
}
return true; return true;
} }

View file

@ -11,6 +11,7 @@
color: #424242; color: #424242;
font-size: 18px; font-size: 18px;
line-height: 1.7em; line-height: 1.7em;
overflow-wrap: break-word;
h1, h1,
h2, h2,

View file

@ -22,6 +22,16 @@
padding-left: 0; padding-left: 0;
} }
table {
display: block;
overflow: auto;
}
iframe {
max-width: 100%;
height: auto;
}
.nav-panels .action { .nav-panels .action {
padding-right: 0.75rem; padding-right: 0.75rem;
} }

View file

@ -1,5 +1,5 @@
wallabag_core: wallabag_core:
version: 2.3.2 version: 2.3.3
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb" paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
languages: languages:
en: 'English' en: 'English'

View file

@ -65,6 +65,7 @@
"dependencies": { "dependencies": {
"annotator": "git://github.com/wallabag/annotator.git#0f076c7d371ed25eb0793346f46982d90f2c4c85", "annotator": "git://github.com/wallabag/annotator.git#0f076c7d371ed25eb0793346f46982d90f2c4c85",
"hammerjs": "^2.0.8", "hammerjs": "^2.0.8",
"highlight.js": "^9.12.0",
"icomoon-free-npm": "^0.0.0", "icomoon-free-npm": "^0.0.0",
"jquery": "^2.1.4", "jquery": "^2.1.4",
"jquery.cookie": "^1.4.1", "jquery.cookie": "^1.4.1",

View file

@ -12,7 +12,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;

View file

@ -0,0 +1,49 @@
<?php
namespace Wallabag\CoreBundle\Doctrine;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class WallabagMigration extends AbstractMigration implements ContainerAwareInterface
{
const UN_ESCAPED_TABLE = true;
/**
* @var ContainerInterface
*/
protected $container;
// because there are declared as abstract in `AbstractMigration` we need to delarer here too
public function up(Schema $schema)
{
}
public function down(Schema $schema)
{
}
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
protected function getTable($tableName, $unEscaped = false)
{
$table = $this->container->getParameter('database_table_prefix') . $tableName;
if (self::UN_ESCAPED_TABLE === $unEscaped) {
return $table;
}
// escape table name is handled using " on postgresql
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
return '"' . $table . '"';
}
// return escaped table
return '`' . $table . '`';
}
}

View file

@ -42,14 +42,17 @@ class DownloadImages
public function processHtml($entryId, $html, $url) public function processHtml($entryId, $html, $url)
{ {
$crawler = new Crawler($html); $crawler = new Crawler($html);
$result = $crawler $imagesCrawler = $crawler
->filterXpath('//img') ->filterXpath('//img');
$imagesUrls = $imagesCrawler
->extract(['src']); ->extract(['src']);
$imagesSrcsetUrls = $this->getSrcsetUrls($imagesCrawler);
$imagesUrls = array_unique(array_merge($imagesUrls, $imagesSrcsetUrls));
$relativePath = $this->getRelativePath($entryId); $relativePath = $this->getRelativePath($entryId);
// download and save the image to the folder // download and save the image to the folder
foreach ($result as $image) { foreach ($imagesUrls as $image) {
$imagePath = $this->processSingleImage($entryId, $image, $url, $relativePath); $imagePath = $this->processSingleImage($entryId, $image, $url, $relativePath);
if (false === $imagePath) { if (false === $imagePath) {
@ -171,6 +174,33 @@ class DownloadImages
@rmdir($folderPath); @rmdir($folderPath);
} }
/**
* Get images urls from the srcset image attribute.
*
* @param Crawler $imagesCrawler
*
* @return array An array of urls
*/
protected function getSrcsetUrls(Crawler $imagesCrawler)
{
$urls = [];
$iterator = $imagesCrawler
->getIterator();
while ($iterator->valid()) {
$srcsetAttribute = $iterator->current()->getAttribute('srcset');
if ('' !== $srcsetAttribute) {
$srcset = array_map('trim', explode(',', $srcsetAttribute));
$srcsetUrls = array_map(function ($src) {
return explode(' ', $src)[0];
}, $srcset);
$urls = array_merge($srcsetUrls, $urls);
}
$iterator->next();
}
return $urls;
}
/** /**
* Setup base folder where all images are going to be saved. * Setup base folder where all images are going to be saved.
*/ */

View file

@ -265,7 +265,7 @@ about:
who_behind_wallabag: who_behind_wallabag:
developped_by: 'Developed by' developped_by: 'Developed by'
website: 'website' website: 'website'
many_contributors: 'And many others contributors ♥ <a href="https://github.com/wallabag/wallabag/graphs/contributors">on Github</a>' many_contributors: 'And many others contributors ♥ <a href="https://github.com/wallabag/wallabag/graphs/contributors">on GitHub</a>'
project_website: 'Project website' project_website: 'Project website'
license: 'License' license: 'License'
version: 'Version' version: 'Version'
@ -323,7 +323,7 @@ howto:
go_import: Go to import go_import: Go to import
go_developers: Go to developers go_developers: Go to developers
go_howto: Go to howto (this page!) go_howto: Go to howto (this page!)
go_logout: Logout go_logout: Log out
list_title: Shortcuts available in listing pages list_title: Shortcuts available in listing pages
search: Display the search form search: Display the search form
article_title: Shortcuts available in entry view article_title: Shortcuts available in entry view
@ -373,7 +373,7 @@ quickstart:
instapaper: 'Migrate from Instapaper' instapaper: 'Migrate from Instapaper'
developer: developer:
title: 'Developers' title: 'Developers'
description: 'We also thought to the developers: Docker, API, translations, etc.' description: 'We also thought of the developers: Docker, API, translations, etc.'
create_application: 'Create your third-party application' create_application: 'Create your third-party application'
use_docker: 'Use Docker to install wallabag' use_docker: 'Use Docker to install wallabag'
docs: docs:

View file

@ -234,7 +234,7 @@ entry:
created_at: 'Data de creacion' created_at: 'Data de creacion'
published_at: 'Data de publicacion' published_at: 'Data de publicacion'
published_by: 'Publicat per' published_by: 'Publicat per'
# provided_by: 'Provided by' provided_by: 'Provesit per'
new: new:
page_title: 'Enregistrar un novèl article' page_title: 'Enregistrar un novèl article'
placeholder: 'http://website.com' placeholder: 'http://website.com'
@ -246,7 +246,7 @@ entry:
page_title: 'Modificar un article' page_title: 'Modificar un article'
title_label: 'Títol' title_label: 'Títol'
url_label: 'Url' url_label: 'Url'
# origin_url_label: 'Origin url (from where you found that entry)' origin_url_label: 'Url dorigina (ont avètz trobat aqueste article)'
save_label: 'Enregistrar' save_label: 'Enregistrar'
public: public:
shared_by_wallabag: "Aqueste article es estat partejat per <a href='%wallabag_instance%'>wallabag</a>" shared_by_wallabag: "Aqueste article es estat partejat per <a href='%wallabag_instance%'>wallabag</a>"
@ -400,8 +400,8 @@ tag:
add: 'Ajustar' add: 'Ajustar'
placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula." placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula."
# export: export:
# footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' footer_template: '<div style="text-align:center;"><p>Produch per wallabag amb %method%</p><p>Mercés de dobrir <a href="https://github.com/wallabag/wallabag/issues">una sollicitacion</a> savètz de problèmas amb lafichatge daqueste E-Book sus vòstre periferic.</p></div>'
import: import:
page_title: 'Importar' page_title: 'Importar'

View file

@ -245,7 +245,7 @@
<li> <li>
<i class="material-icons" title="{{ 'entry.view.published_by'|trans }}">person</i> <i class="material-icons" title="{{ 'entry.view.published_by'|trans }}">person</i>
{% for author in entry.publishedBy %} {% for author in entry.publishedBy %}
{{ author }}{% if not loop.last %}, {% endif %} {{ author|raw }}{% if not loop.last %}, {% endif %}
{% endfor %} {% endfor %}
</li> </li>
{% endif %} {% endif %}
@ -276,7 +276,7 @@
</div> </div>
{% if entry.previewPicture is not null %} {% if entry.previewPicture is not null %}
<div><img class="preview" src="{{ entry.previewPicture }}" alt="{{ entry.title|striptags|e('html_attr') }}" /></div> <div><img class="preview" src="{{ entry.previewPicture }}" alt="{{ entry.title|striptags|default('entry.default_title'|trans)|raw }}" /></div>
{% endif %} {% endif %}
</aside> </aside>

View file

@ -5,7 +5,7 @@ auth_code:
subject: "Còdi d'autentificacion wallabag" subject: "Còdi d'autentificacion wallabag"
body: body:
hello: "Bonjorn %user%," hello: "Bonjorn %user%,"
first_para: "Estant qu'avètz activat l'autentificacion en dos temps sus vòstre compte wallabag e que venètz de vos connectar dempuèi un novèl periferic (ordinador, mobil, etc.) vos mandem un còdi per validar la connexion." first_para: "Estant qu'avètz activat l'autentificacion en dos temps sus vòstre compte wallabag e que venètz de vos connectar d'un novèl periferic (ordinador, mobil, etc.) vos mandem un còdi per validar la connexion."
second_para: "Vaquí lo còdi per dintrar:" second_para: "Vaquí lo còdi per dintrar:"
support: "S'avètz un problèma de connexion, dobtetz pas a contactar l'assisténcia:" support: "S'avètz un problèma de connexion, dobtetz pas a contactar l'assisténcia:"
signature: "La còla de wallabag" signature: "La còla de wallabag"

View file

@ -419,7 +419,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
public function testPostEntry() public function testPostEntry()
{ {
$this->client->request('POST', '/api/entries.json', [ $this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', 'url' => 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html',
'tags' => 'google', 'tags' => 'google',
'title' => 'New title for my article', 'title' => 'New title for my article',
'content' => 'my content', 'content' => 'my content',
@ -434,7 +434,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true); $content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThan(0, $content['id']); $this->assertGreaterThan(0, $content['id']);
$this->assertSame('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']); $this->assertSame('https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']);
$this->assertSame(0, $content['is_archived']); $this->assertSame(0, $content['is_archived']);
$this->assertSame(0, $content['is_starred']); $this->assertSame(0, $content['is_starred']);
$this->assertNull($content['starred_at']); $this->assertNull($content['starred_at']);
@ -455,7 +455,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{ {
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager'); $em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
$entry = new Entry($em->getReference(User::class, 1)); $entry = new Entry($em->getReference(User::class, 1));
$entry->setUrl('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html'); $entry->setUrl('https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html');
$entry->setArchived(true); $entry->setArchived(true);
$entry->addTag((new Tag())->setLabel('google')); $entry->addTag((new Tag())->setLabel('google'));
$entry->addTag((new Tag())->setLabel('apple')); $entry->addTag((new Tag())->setLabel('apple'));
@ -464,7 +464,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$em->clear(); $em->clear();
$this->client->request('POST', '/api/entries.json', [ $this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', 'url' => 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html',
'archive' => '1', 'archive' => '1',
'tags' => 'google, apple', 'tags' => 'google, apple',
]); ]);
@ -474,7 +474,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true); $content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThan(0, $content['id']); $this->assertGreaterThan(0, $content['id']);
$this->assertSame('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']); $this->assertSame('https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']);
$this->assertSame(1, $content['is_archived']); $this->assertSame(1, $content['is_archived']);
$this->assertSame(0, $content['is_starred']); $this->assertSame(0, $content['is_starred']);
$this->assertCount(3, $content['tags']); $this->assertCount(3, $content['tags']);
@ -519,7 +519,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{ {
$now = new \DateTime(); $now = new \DateTime();
$this->client->request('POST', '/api/entries.json', [ $this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', 'url' => 'https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
'archive' => '1', 'archive' => '1',
'starred' => '1', 'starred' => '1',
]); ]);
@ -529,7 +529,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true); $content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThan(0, $content['id']); $this->assertGreaterThan(0, $content['id']);
$this->assertSame('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']); $this->assertSame('https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']);
$this->assertSame(1, $content['is_archived']); $this->assertSame(1, $content['is_archived']);
$this->assertSame(1, $content['is_starred']); $this->assertSame(1, $content['is_starred']);
$this->assertGreaterThanOrEqual($now->getTimestamp(), (new \DateTime($content['starred_at']))->getTimestamp()); $this->assertGreaterThanOrEqual($now->getTimestamp(), (new \DateTime($content['starred_at']))->getTimestamp());
@ -539,7 +539,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
public function testPostArchivedAndStarredEntryWithoutQuotes() public function testPostArchivedAndStarredEntryWithoutQuotes()
{ {
$this->client->request('POST', '/api/entries.json', [ $this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', 'url' => 'https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
'archive' => 0, 'archive' => 0,
'starred' => 1, 'starred' => 1,
]); ]);
@ -549,7 +549,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true); $content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThan(0, $content['id']); $this->assertGreaterThan(0, $content['id']);
$this->assertSame('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']); $this->assertSame('https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']);
$this->assertSame(0, $content['is_archived']); $this->assertSame(0, $content['is_archived']);
$this->assertSame(1, $content['is_starred']); $this->assertSame(1, $content['is_starred']);
} }
@ -557,7 +557,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
public function testPostEntryWithOriginUrl() public function testPostEntryWithOriginUrl()
{ {
$this->client->request('POST', '/api/entries.json', [ $this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', 'url' => 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html',
'tags' => 'google', 'tags' => 'google',
'title' => 'New title for my article', 'title' => 'New title for my article',
'content' => 'my content', 'content' => 'my content',
@ -573,7 +573,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true); $content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThan(0, $content['id']); $this->assertGreaterThan(0, $content['id']);
$this->assertSame('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']); $this->assertSame('https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']);
$this->assertSame('http://mysource.tld', $content['origin_url']); $this->assertSame('http://mysource.tld', $content['origin_url']);
} }
@ -1013,7 +1013,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
public function testReloadEntry() public function testReloadEntry()
{ {
$this->client->request('POST', '/api/entries.json', [ $this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', 'url' => 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html',
'archive' => '1', 'archive' => '1',
'tags' => 'google, apple', 'tags' => 'google, apple',
]); ]);
@ -1117,7 +1117,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
public function testPostEntriesListAction() public function testPostEntriesListAction()
{ {
$list = [ $list = [
'http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', 'https://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html',
'http://0.0.0.0/entry2', 'http://0.0.0.0/entry2',
]; ];
@ -1128,7 +1128,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true); $content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertInternalType('int', $content[0]['entry']); $this->assertInternalType('int', $content[0]['entry']);
$this->assertSame('http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', $content[0]['url']); $this->assertSame('https://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', $content[0]['url']);
$this->assertInternalType('int', $content[1]['entry']); $this->assertInternalType('int', $content[1]['entry']);
$this->assertSame('http://0.0.0.0/entry2', $content[1]['url']); $this->assertSame('http://0.0.0.0/entry2', $content[1]['url']);
@ -1209,14 +1209,14 @@ class EntryRestControllerTest extends WallabagApiTestCase
$entry = new Entry($em->getReference(User::class, 1)); $entry = new Entry($em->getReference(User::class, 1));
$entry->setTitle('Antoine de Caunes : « Je veux avoir le droit de tâtonner »'); $entry->setTitle('Antoine de Caunes : « Je veux avoir le droit de tâtonner »');
$entry->setContent('hihi'); $entry->setContent('hihi');
$entry->setUrl('http://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html'); $entry->setUrl('https://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html');
$entry->setPublishedAt(new \DateTime('2017-06-26T07:46:02+0200')); $entry->setPublishedAt(new \DateTime('2017-06-26T07:46:02+0200'));
$em->persist($entry); $em->persist($entry);
$em->flush(); $em->flush();
$em->clear(); $em->clear();
$this->client->request('POST', '/api/entries.json', [ $this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html', 'url' => 'https://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html',
]); ]);
$this->assertSame(200, $this->client->getResponse()->getStatusCode()); $this->assertSame(200, $this->client->getResponse()->getStatusCode());
@ -1224,6 +1224,6 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true); $content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThan(0, $content['id']); $this->assertGreaterThan(0, $content['id']);
$this->assertSame('http://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html', $content['url']); $this->assertSame('https://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html', $content['url']);
} }
} }

View file

@ -60,7 +60,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
public function testDuplicate() public function testDuplicate()
{ {
$url = 'http://www.lemonde.fr/sport/visuel/2017/05/05/rondelle-prison-blanchissage-comprendre-le-hockey-sur-glace_5122587_3242.html'; $url = 'https://www.lemonde.fr/sport/visuel/2017/05/05/rondelle-prison-blanchissage-comprendre-le-hockey-sur-glace_5122587_3242.html';
$client = $this->getClient(); $client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager'); $em = $client->getContainer()->get('doctrine.orm.entity_manager');

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Entity\Entry;
class ReloadEntryCommandTest extends WallabagCoreTestCase class ReloadEntryCommandTest extends WallabagCoreTestCase
{ {
public $url = 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html'; public $url = 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html';
/** /**
* @var entry * @var entry

View file

@ -742,7 +742,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$em->persist($tag); $em->persist($tag);
$entry = new Entry($user); $entry = new Entry($user);
$entry->setUrl('http://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html'); $entry->setUrl('https://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html');
$entry->setContent('Youhou'); $entry->setContent('Youhou');
$entry->setTitle('Youhou'); $entry->setTitle('Youhou');
$entry->addTag($tag); $entry->addTag($tag);
@ -827,7 +827,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$em->persist($tag); $em->persist($tag);
$entry = new Entry($user); $entry = new Entry($user);
$entry->setUrl('http://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html'); $entry->setUrl('https://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html');
$entry->setContent('Youhou'); $entry->setContent('Youhou');
$entry->setTitle('Youhou'); $entry->setTitle('Youhou');
$entry->addTag($tag); $entry->addTag($tag);
@ -845,7 +845,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$em->persist($tagArchived); $em->persist($tagArchived);
$entryArchived = new Entry($user); $entryArchived = new Entry($user);
$entryArchived->setUrl('http://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html'); $entryArchived->setUrl('https://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html');
$entryArchived->setContent('Youhou'); $entryArchived->setContent('Youhou');
$entryArchived->setTitle('Youhou'); $entryArchived->setTitle('Youhou');
$entryArchived->addTag($tagArchived); $entryArchived->addTag($tagArchived);
@ -903,7 +903,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$em->persist($tag); $em->persist($tag);
$entry = new Entry($user); $entry = new Entry($user);
$entry->setUrl('http://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html'); $entry->setUrl('https://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html');
$entry->setContent('Youhou'); $entry->setContent('Youhou');
$entry->setTitle('Youhou'); $entry->setTitle('Youhou');
$entry->addTag($tag); $entry->addTag($tag);

View file

@ -11,9 +11,9 @@ use Wallabag\CoreBundle\Helper\ContentProxy;
class EntryControllerTest extends WallabagCoreTestCase class EntryControllerTest extends WallabagCoreTestCase
{ {
const AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE = 'http://www.lemonde.fr/judo/article/2017/11/11/judo-la-decima-de-teddy-riner_5213605_1556020.html'; const AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE = 'https://www.lemonde.fr/judo/article/2017/11/11/judo-la-decima-de-teddy-riner_5213605_1556020.html';
public $downloadImagesEnabled = false; public $downloadImagesEnabled = false;
public $url = 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html'; public $url = 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html';
/** /**
* @after * @after
@ -1143,7 +1143,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$client = $this->getClient(); $client = $this->getClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://www.lemonde.fr/incorrect-url/'); $entry->setUrl('https://www.lemonde.fr/incorrect-url/');
$entry->setHttpStatus(404); $entry->setHttpStatus(404);
$this->getEntityManager()->persist($entry); $this->getEntityManager()->persist($entry);
@ -1342,8 +1342,8 @@ class EntryControllerTest extends WallabagCoreTestCase
null, null,
], ],
'es-ES' => [ 'es-ES' => [
'https://www.muylinux.com/2015/04/17/odf-reino-unido-microsoft-google/', 'https://www.20minutos.es/noticia/3360685/0/gobierno-sanchez-primero-historia-mas-mujeres-que-hombres/',
'es_ES', 'es',
], ],
]; ];
} }

View file

@ -11,7 +11,6 @@ use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\ConstraintViolationList;
use Symfony\Component\Validator\Validator\RecursiveValidator; use Symfony\Component\Validator\Validator\RecursiveValidator;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Helper\ContentProxy; use Wallabag\CoreBundle\Helper\ContentProxy;
use Wallabag\CoreBundle\Helper\RuleBasedTagger; use Wallabag\CoreBundle\Helper\RuleBasedTagger;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;

View file

@ -183,4 +183,25 @@ class DownloadImagesTest extends TestCase
$this->assertContains('http://wallabag.io/assets/images/9/b/9b0ead26/', $res, 'Content-Type was empty but data is ok for an image'); $this->assertContains('http://wallabag.io/assets/images/9/b/9b0ead26/', $res, 'Content-Type was empty but data is ok for an image');
$this->assertContains('DownloadImages: Checking extension (alternative)', $logHandler->getRecords()[3]['message']); $this->assertContains('DownloadImages: Checking extension (alternative)', $logHandler->getRecords()[3]['message']);
} }
public function testProcessImageWithSrcset()
{
$client = new Client();
$mock = new Mock([
new Response(200, ['content-type' => 'image/jpeg'], Stream::factory(file_get_contents(__DIR__ . '/../fixtures/image-no-content-type.jpg'))),
new Response(200, ['content-type' => 'image/jpeg'], Stream::factory(file_get_contents(__DIR__ . '/../fixtures/image-no-content-type.jpg'))),
new Response(200, ['content-type' => 'image/jpeg'], Stream::factory(file_get_contents(__DIR__ . '/../fixtures/image-no-content-type.jpg'))),
]);
$client->getEmitter()->attach($mock);
$logHandler = new TestHandler();
$logger = new Logger('test', [$logHandler]);
$download = new DownloadImages($client, sys_get_temp_dir() . '/wallabag_test', 'http://wallabag.io/', $logger);
$res = $download->processHtml(123, '<p><img class="alignnone wp-image-1153" src="http://piketty.blog.lemonde.fr/files/2017/10/F1FR-530x375.jpg" alt="" width="628" height="444" srcset="http://piketty.blog.lemonde.fr/files/2017/10/F1FR-530x375.jpg 530w, http://piketty.blog.lemonde.fr/files/2017/10/F1FR-768x543.jpg 768w, http://piketty.blog.lemonde.fr/files/2017/10/F1FR-900x636.jpg 900w" sizes="(max-width: 628px) 100vw, 628px" /></p>', 'http://piketty.blog.lemonde.fr/2017/10/12/budget-2018-la-jeunesse-sacrifiee/');
$this->assertNotContains('http://piketty.blog.lemonde.fr/', $res, 'Image srcset attribute were not replaced');
}
} }

View file

@ -129,7 +129,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry') ->getRepository('WallabagCoreBundle:Entry')
->findByUrlAndUserId( ->findByUrlAndUserId(
'https://www.20minutes.fr/high-tech/2077615-20170531-dis-donc-donald-trump-quoi-exactement-covfefe', 'https://www.20minutes.fr/high-tech/2077615-20170531-quoi-exactement-tweet-covfefe-donald-trump-persiste-signe',
$this->getLoggedInUserId() $this->getLoggedInUserId()
); );

View file

@ -2,4 +2,4 @@ URL,Title,Selection,Folder
http://www.liberation.fr/societe/2012/12/06/baumettes-un-tour-en-cellule_865551,Baumettes : un tour en cellule,,Unread http://www.liberation.fr/societe/2012/12/06/baumettes-un-tour-en-cellule_865551,Baumettes : un tour en cellule,,Unread
https://redditblog.com/2016/09/20/amp-and-reactredux/,AMP and React+Redux: Why Not?,,Archive https://redditblog.com/2016/09/20/amp-and-reactredux/,AMP and React+Redux: Why Not?,,Archive
https://medium.com/@the_minh/why-foursquare-swarm-is-still-my-favourite-social-network-e38228493e6c,Why Foursquare / Swarm is still my favourite social network,,Starred https://medium.com/@the_minh/why-foursquare-swarm-is-still-my-favourite-social-network-e38228493e6c,Why Foursquare / Swarm is still my favourite social network,,Starred
https://www.20minutes.fr/high-tech/2077615-20170531-dis-donc-donald-trump-quoi-exactement-covfefe,"Dis donc Donald Trump, c'est quoi exactement «covfefe»?",,test_tag https://www.20minutes.fr/high-tech/2077615-20170531-quoi-exactement-tweet-covfefe-donald-trump-persiste-signe,"Dis donc Donald Trump, c'est quoi exactement «covfefe»?",,test_tag

1 URL Title Selection Folder
2 http://www.liberation.fr/societe/2012/12/06/baumettes-un-tour-en-cellule_865551 Baumettes : un tour en cellule Unread
3 https://redditblog.com/2016/09/20/amp-and-reactredux/ AMP and React+Redux: Why Not? Archive
4 https://medium.com/@the_minh/why-foursquare-swarm-is-still-my-favourite-social-network-e38228493e6c Why Foursquare / Swarm is still my favourite social network Starred
5 https://www.20minutes.fr/high-tech/2077615-20170531-dis-donc-donald-trump-quoi-exactement-covfefe https://www.20minutes.fr/high-tech/2077615-20170531-quoi-exactement-tweet-covfefe-donald-trump-persiste-signe Dis donc Donald Trump, c'est quoi exactement «covfefe»? test_tag

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long