mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Added internal setting to enable/disable articles with paywall
This commit is contained in:
parent
40f3ea57fb
commit
d64bf7953b
6 changed files with 67 additions and 2 deletions
45
app/DoctrineMigrations/Version20161122144743.php
Normal file
45
app/DoctrineMigrations/Version20161122144743.php
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Add the restricted_access internal setting for articles with paywall
|
||||
*/
|
||||
class Version20161122144743 extends AbstractMigration implements ContainerAwareInterface
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
private function getTable($tableName)
|
||||
{
|
||||
return $this->container->getParameter('database_table_prefix') . $tableName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('restricted_access', 0, 'entry')");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'restricted_access';");
|
||||
}
|
||||
}
|
|
@ -32,3 +32,4 @@ demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)"
|
|||
demo_mode_username: "Demo user"
|
||||
share_public: Allow public url for entries
|
||||
download_images_enabled: Download images locally
|
||||
restricted_access: Enable authentication for websites with paywall
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue