diff --git a/app/Resources/FOSUserBundle/views/layout.html.twig b/app/Resources/FOSUserBundle/views/layout.html.twig
index 71df1efec..937fd5cb0 100644
--- a/app/Resources/FOSUserBundle/views/layout.html.twig
+++ b/app/Resources/FOSUserBundle/views/layout.html.twig
@@ -1,4 +1,4 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
+{% extends "@WallabagCore/layout.html.twig" %}
{% block title %}{{ 'security.login.page_title'|trans }}{% endblock %}
diff --git a/app/Resources/static/themes/_global/img/icons/carrot-icon--black.png b/app/Resources/static/themes/_global/img/icons/carrot-icon--black.png
deleted file mode 100644
index 3a5ef1d3a..000000000
Binary files a/app/Resources/static/themes/_global/img/icons/carrot-icon--black.png and /dev/null differ
diff --git a/app/Resources/static/themes/_global/img/icons/carrot-icon--white.png b/app/Resources/static/themes/_global/img/icons/carrot-icon--white.png
deleted file mode 100644
index 48bcd68a9..000000000
Binary files a/app/Resources/static/themes/_global/img/icons/carrot-icon--white.png and /dev/null differ
diff --git a/app/Resources/static/themes/baggy/css/article.scss b/app/Resources/static/themes/baggy/css/article.scss
deleted file mode 100644
index 9d0a0568b..000000000
--- a/app/Resources/static/themes/baggy/css/article.scss
+++ /dev/null
@@ -1,164 +0,0 @@
-#article {
- width: 70%;
- margin-bottom: 3em;
- text-align: justify;
-
- .tags {
- margin-bottom: 1em;
- }
-
- i {
- font-style: normal;
- }
-
- h1 {
- text-align: left;
- }
-
- h2::after {
- content: none;
- }
-
- h2,
- h3,
- h4 {
- text-transform: none;
- }
-}
-
-blockquote {
- border: 1px solid #999;
- background-color: #fff;
- padding: 1em;
- margin: 0;
-}
-
-.topPosF {
- position: fixed;
- right: 20%;
- bottom: 2em;
- font-size: 1.5em;
-}
-
-#article_toolbar {
- margin-bottom: 1em;
-
- li {
- display: inline-block;
- margin: 3px auto;
- }
-
- a {
- background-color: #000;
- padding: 0.3em 0.5em 0.2em;
- color: #fff;
- text-decoration: none;
-
- &:hover,
- &:focus {
- background-color: #999;
- }
- }
-}
-
-#nav-btn-add-tag {
- cursor: pointer;
-}
-
-.shaarli::before {
- content: "*";
-}
-
-.return {
- text-decoration: none;
- margin-top: 1em;
- display: block;
-}
-
-.return::before {
- margin-right: 0.5em;
-}
-
-.notags {
- font-style: italic;
- color: #999;
-}
-
-.icon-feed {
- background-color: #000;
- color: #fff;
- padding: 0.2em 0.5em;
-
- &::before {
- position: relative;
- top: 2px;
- }
-}
-
-.list-tags {
- li {
- margin-bottom: 0.5em;
- }
-
- .icon-feed:hover,
- .icon-feed:focus {
- background-color: #fff;
- color: #000;
- text-decoration: none;
- }
-
- a {
- text-decoration: none;
-
- &:hover,
- &:focus {
- text-decoration: underline;
- }
- }
-}
-
-pre code {
- font-family: "Courier New", Courier, monospace;
-}
-
-#filters {
- position: fixed;
- width: 20%;
- height: 100%;
- top: 0;
- right: 0;
- background-color: #fff;
- padding: 30px 30px 15px 15px;
- border-left: 1px #333 solid;
- z-index: 12;
- min-width: 300px;
-
- form .filter-group {
- margin: 5px;
- }
-}
-
-#download-form {
- position: fixed;
- width: 10%;
- height: 100%;
- top: 0;
- right: 0;
- background-color: #fff;
- padding: 30px 30px 15px 15px;
- border-left: 1px #333 solid;
- z-index: 12;
- min-width: 200px;
-
- li {
- display: block;
- padding: 0.5em 2em 0.5em 1em;
- color: #fff;
- position: relative;
- text-transform: uppercase;
- text-decoration: none;
- font-weight: 400;
- font-family: "PT Sans", sans-serif;
- transition: all 0.5s ease;
- }
-}
diff --git a/app/Resources/static/themes/baggy/css/guide.scss b/app/Resources/static/themes/baggy/css/guide.scss
deleted file mode 100644
index 6f050e231..000000000
--- a/app/Resources/static/themes/baggy/css/guide.scss
+++ /dev/null
@@ -1,258 +0,0 @@
-::selection {
- color: #fff;
- background-color: #000;
-}
-
-.desktopHide {
- display: none;
-}
-
-.logo {
- position: fixed;
- z-index: 20;
- top: 0.4em;
- left: 0.6em;
-}
-
-h2,
-h3,
-h4 {
- font-family: "PT Sans", sans-serif;
- text-transform: uppercase;
-}
-
-p,
-li,
-label {
- color: #666;
-}
-
-a {
- color: #000;
- font-weight: bold;
-
- &.nostyle {
- text-decoration: none;
- }
-
- &:hover,
- &:focus {
- text-decoration: none;
- }
-}
-
-form fieldset {
- border: 0;
- padding: 0;
- margin: 0;
-}
-
-form input[type="text"],
-form input[type="number"],
-select,
-form input[type="password"],
-form input[type="url"],
-form input[type="email"] {
- border: 1px solid #999;
- padding: 0.5em 1em;
- min-width: 12em;
- color: #666;
-}
-
-@media screen {
- select {
- appearance: none;
- border-radius: 0;
- background: #fff url("../../_global/img/bg-select.png") no-repeat right center;
- }
-}
-
-.inline {
- .row {
- display: inline-block;
- margin-right: 0.5em;
- }
-
- label {
- min-width: 6em;
- }
-}
-
-fieldset label {
- display: inline-block;
- min-width: 12.5em;
- color: #666;
-}
-
-label {
- margin-right: 0.5em;
-}
-
-form .row {
- margin-bottom: 0.5em;
-}
-
-form button,
-input[type="submit"] {
- cursor: pointer;
- background-color: #000;
- color: #fff;
- padding: 0.5em 1em;
- display: inline-block;
- border: 1px solid #000;
-}
-
-form button:hover,
-form button:focus,
-input[type="submit"]:hover,
-input[type="submit"]:focus {
- background-color: #fff;
- color: #000;
- transition: all 0.5s ease;
-}
-
-#bookmarklet {
- cursor: move;
-}
-
-h2::after {
- content: "";
- height: 4px;
- width: 20%;
- background-color: #000;
- display: block;
-}
-
-.links {
- padding: 0;
- margin: 0;
-
- li {
- list-style: none;
- margin: 0;
- padding: 0;
- }
-}
-
-#links {
- position: fixed;
- top: 0;
- width: 10em;
- left: 0;
- text-align: right;
- background-color: #333;
- padding-top: 9.5em;
- height: 100%;
- box-shadow: inset -4px 0 20px rgb(0 0 0 / 60%);
- z-index: 15;
-
- > li > a {
- display: block;
- padding: 0.5em 2em 0.5em 1em;
- color: #fff;
- position: relative;
- text-transform: uppercase;
- text-decoration: none;
- font-weight: normal;
- font-family: "PT Sans", sans-serif;
- transition: all 0.5s ease;
-
- &:hover,
- &:focus {
- background-color: #999;
- color: #000;
- }
- }
-
- .current::after {
- content: "";
- width: 0;
- height: 0;
- position: absolute;
- border: 10px solid transparent;
- border-right-color: #eee;
- right: 0;
- top: 50%;
- margin-top: -10px;
- }
-
- li:last-child {
- position: fixed;
- bottom: 1em;
- width: 10em;
-
- a::before {
- font-size: 1.2em;
- position: relative;
- top: 2px;
- }
- }
-}
-
-#main {
- margin-left: 12em;
- position: relative;
- z-index: 10;
- padding-right: 5%;
- padding-bottom: 1em;
-}
-
-#sort {
- padding: 0;
- list-style-type: none;
- opacity: 0.5;
- display: inline-block;
-
- li {
- display: inline;
- font-size: 0.9em;
-
- & + li {
- margin-left: 10px;
- }
- }
-
- a {
- padding: 2px 2px 0;
- vertical-align: middle;
- }
-
- img {
- vertical-align: baseline;
-
- :hover {
- cursor: pointer;
- }
- }
-}
-
-#display-mode {
- float: right;
- margin-top: 10px;
- margin-bottom: 10px;
- opacity: 0.5;
-}
-
-#listmode {
- width: 16px;
- display: inline-block;
- text-decoration: none;
-
- &.tablemode {
- background: url("../../_global/img/table.png") no-repeat bottom;
- }
-
- .listmode {
- background: url("../../_global/img/list.png") no-repeat bottom;
- }
-}
-
-#warning_message {
- position: fixed;
- background-color: #ff6347;
- z-index: 1000;
- bottom: 0;
- left: 0;
- width: 100%;
- color: #000;
-}
diff --git a/app/Resources/static/themes/baggy/css/index.scss b/app/Resources/static/themes/baggy/css/index.scss
deleted file mode 100644
index 2dc6638e6..000000000
--- a/app/Resources/static/themes/baggy/css/index.scss
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Style */
-@import "guide";
-@import "layout";
-@import "article";
-@import "pictos";
-@import "login";
-@import "save";
-@import "messages";
-
-/* Tools */
-@import "media_queries";
-@import "print";
-@import "ratatouille";
diff --git a/app/Resources/static/themes/baggy/css/layout.scss b/app/Resources/static/themes/baggy/css/layout.scss
deleted file mode 100644
index 493924ca8..000000000
--- a/app/Resources/static/themes/baggy/css/layout.scss
+++ /dev/null
@@ -1,309 +0,0 @@
-#content {
- margin-top: 2em;
- min-height: 30em;
-}
-
-footer {
- text-align: right;
- position: relative;
- bottom: 0;
- right: 5em;
- color: #999;
- font-size: 0.8em;
- font-style: italic;
- z-index: 20;
-
- a {
- color: #999;
- font-weight: normal;
- }
-}
-
-.list-entries {
- letter-spacing: -5px;
-}
-
-.listmode.entry {
- width: 100%;
- height: inherit;
-}
-
-.card-entry-tags {
- max-height: 2em;
- overflow-y: hidden;
- padding: 0;
- margin: 0;
-}
-
-.card-entry-tags li,
-.card-entry-tags span {
- display: inline-block;
- margin: 0 5px;
- padding: 5px 12px;
- background-color: rgb(0 0 0 / 60%);
- border-radius: 3px;
- max-height: 2em;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.card-entry-tags a,
-.card-entry-labels a {
- text-decoration: none;
- font-weight: normal;
- color: #fff;
-}
-
-.nav-panel-add-tag {
- margin-top: 10px;
-}
-
-.list-entries + .results {
- margin-bottom: 2em;
-}
-
-.reading-time,
-.created-at {
- color: #999;
- font-style: italic;
- font-weight: normal;
- font-size: 0.9em;
-}
-
-.estimatedTime small {
- position: relative;
- top: -1px;
-}
-
-.entry {
- background-color: #fff;
- letter-spacing: normal;
- box-shadow: 0 3px 7px rgb(0 0 0 / 30%);
- display: inline-block;
- width: 32%;
- margin-bottom: 1.5em;
- vertical-align: top;
- margin-right: 1%;
- position: relative;
- overflow: hidden;
- padding: 1.5em 0 3em;
- height: 440px;
-
- img.preview {
- width: 100%;
- object-fit: cover;
- height: 100%;
- }
-
- &::before {
- content: "";
- width: 0;
- height: 0;
- border: 10px solid transparent;
- border-bottom-color: #000;
- position: absolute;
- bottom: 0.7em;
- z-index: 10;
- right: 1.5em;
- transition: all 0.5s ease;
- }
-
- &::after {
- content: "";
- position: absolute;
- height: 7px;
- width: 100%;
- bottom: 0;
- left: 0;
- background-color: #000;
- transition: all 0.5s ease;
- }
-
- &:hover {
- box-shadow: 0 3px 10px rgb(0 0 0 / 100%);
-
- &::after {
- height: 40px;
- }
-
- &::before {
- bottom: 2.3em;
- }
-
- h2 a {
- color: #666;
- }
-
- .tools {
- bottom: 0;
- }
- }
-
- h2 {
- text-transform: none;
- margin-bottom: 0;
- line-height: 1.2;
- margin-left: 5px;
- }
-
- &::after {
- content: none;
- }
-
- a {
- display: block;
- text-decoration: none;
- color: #000;
- word-wrap: break-word;
- transition: all 0.5s ease;
- }
-
- p {
- color: #666;
- font-size: 0.9em;
- line-height: 1.7;
- margin: 5px 5px auto;
- }
-
- h2 a::first-letter {
- text-transform: uppercase;
- }
-
- .tools {
- position: absolute;
- bottom: -40px;
- left: 0;
- background: #000;
- width: 100%;
- z-index: 10;
- padding-right: 0.5em;
- text-align: right;
- transition: all 0.5s ease;
-
- a {
- color: #666;
- text-decoration: none;
- display: block;
- padding: 0.4em;
-
- &:hover {
- color: #fff;
- }
- }
-
- li {
- display: inline-block;
- margin-top: 10px;
- }
-
- li:first-child {
- float: left;
- font-size: 0.9em;
- max-width: calc(100% - 40px * 4);
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- max-height: 2em;
- margin-left: 10px;
- }
- }
-
- .card-entry-labels {
- position: absolute;
- top: 100px;
- left: -1em;
- z-index: 90;
- max-width: 50%;
- padding-left: 0;
-
- li {
- margin: 10px 10px 10px auto;
- padding: 5px 12px 5px 25px;
- background-color: rgb(0 0 0 / 60%);
- border-radius: 0 3px 3px 0;
- color: #fff;
- cursor: default;
- max-height: 2em;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-
- a {
- color: #fff;
- }
- }
- }
-}
-
-.entry:nth-child(3n+1) {
- margin-left: 0;
-}
-
-.results {
- letter-spacing: -5px;
- padding: 0 0 0.5em;
-
- > * {
- display: inline-block;
- vertical-align: top;
- letter-spacing: normal;
- width: 50%;
- text-align: right;
- }
-}
-
-div.pagination ul {
- text-align: right;
-}
-
-.nb-results {
- text-align: left;
- font-style: italic;
- color: #999;
- display: inline-flex;
-}
-
-div.pagination ul {
- a {
- color: #999;
- text-decoration: none;
-
- &:hover,
- &:focus {
- text-decoration: underline;
- }
- }
-
- > * {
- display: inline-block;
- margin-left: 0.5em;
- }
-
- .prev.disabled,
- .next.disabled {
- display: none;
- }
-
- .current {
- height: 25px;
- padding: 4px 8px;
- border: 1px solid #d5d5d5;
- text-decoration: none;
- font-weight: bold;
- color: #000;
- background-color: #ccc;
- }
-}
-
-.card-tag-form {
- display: inline-block;
-}
-
-.card-tag-form input[type="text"] {
- min-width: 20em;
-}
-
-.hide,
-.hidden {
- display: none;
-}
diff --git a/app/Resources/static/themes/baggy/css/login.scss b/app/Resources/static/themes/baggy/css/login.scss
deleted file mode 100644
index 3e0ea73dc..000000000
--- a/app/Resources/static/themes/baggy/css/login.scss
+++ /dev/null
@@ -1,26 +0,0 @@
-.login {
- background-color: #333;
-
- #main {
- padding: 0;
- margin: 0;
- }
-
- form {
- background-color: #fff;
- padding: 1.5em;
- box-shadow: 0 1px 8px rgb(0 0 0 / 90%);
- width: 20em;
- position: absolute;
- top: 8em;
- left: 50%;
- margin-left: -10em;
- }
-
- .logo {
- position: absolute;
- top: 2em;
- left: 50%;
- margin-left: -55px;
- }
-}
diff --git a/app/Resources/static/themes/baggy/css/main.css b/app/Resources/static/themes/baggy/css/main.css
deleted file mode 100755
index 0d69e45cf..000000000
--- a/app/Resources/static/themes/baggy/css/main.css
+++ /dev/null
@@ -1,1320 +0,0 @@
-/* ==========================================================================
- Sommaire
-
- 1 = Style Guide
- 2 = Layout
- 3 = Pictos
- 4 = Messages
- 5 = Article
- 6 = Media queries
-
- ========================================================================== */
-
-html {
- min-height: 100%;
-}
-
-body {
- background-color: #eee;
-}
-
-.login {
- background-color: #333;
-}
-
-.login #main {
- padding: 0;
- margin: 0;
-}
-
-.login form {
- background-color: #fff;
- padding: 1.5em;
- box-shadow: 0 1px 8px rgb(0 0 0 / 90%);
- width: 20em;
- position: absolute;
- top: 8em;
- left: 50%;
- margin-left: -10em;
-}
-
-.login .logo {
- position: absolute;
- top: 2em;
- left: 50%;
- margin-left: -55px;
-}
-
-/* ==========================================================================
- 1 = Style Guide
- ========================================================================== */
-
-::selection {
- color: #fff;
- background-color: #000;
-}
-
-.desktopHide {
- display: none;
-}
-
-.logo {
- position: fixed;
- z-index: 20;
- top: 0.4em;
- left: 0.6em;
-}
-
-h2,
-h3,
-h4 {
- font-family: "PT Sans", sans-serif;
- text-transform: uppercase;
-}
-
-p,
-li,
-label {
- color: #666;
-}
-
-a {
- color: #000;
- font-weight: bold;
-}
-
-a.nostyle {
- text-decoration: none;
-}
-
-a:hover,
-a:focus {
- text-decoration: none;
-}
-
-form fieldset {
- border: 0;
- padding: 0;
- margin: 0;
-}
-
-form input[type="text"],
-form input[type="number"],
-select,
-form input[type="password"],
-form input[type="url"],
-form input[type="email"] {
- border: 1px solid #999;
- padding: 0.5em 1em;
- min-width: 12em;
- color: #666;
-}
-
-@media screen and (min-device-pixel-ratio: 0) {
- select {
- appearance: none;
- border-radius: 0;
- background: #fff url("../../_global/img/bg-select.png") no-repeat right center;
- }
-}
-
-.inline .row {
- display: inline-block;
- margin-right: 0.5em;
-}
-
-.inline label {
- min-width: 6em;
-}
-
-fieldset label {
- display: inline-block;
- min-width: 12.5em;
- color: #666;
-}
-
-label {
- margin-right: 0.5em;
-}
-
-form .row {
- margin-bottom: 0.5em;
-}
-
-form button,
-input[type="submit"] {
- cursor: pointer;
- background-color: #000;
- color: #fff;
- padding: 0.5em 1em;
- display: inline-block;
- border: 1px solid #000;
-}
-
-form button:hover,
-form button:focus,
-input[type="submit"]:hover,
-input[type="submit"]:focus {
- background-color: #fff;
- color: #000;
- transition: all 0.5s ease;
-}
-
-#bookmarklet {
- cursor: move;
-}
-
-h2::after {
- content: "";
- height: 4px;
- width: 70px;
- background-color: #000;
- display: block;
-}
-
-.links {
- padding: 0;
- margin: 0;
-}
-
-.links li {
- list-style: none;
- margin: 0;
- padding: 0;
-}
-
-#links {
- position: fixed;
- top: 0;
- width: 10em;
- left: 0;
- text-align: right;
- background-color: #333;
- padding-top: 9.5em;
- height: 100%;
- box-shadow: inset -4px 0 20px rgb(0 0 0 / 60%);
- z-index: 15;
-}
-
-#main {
- margin-left: 12em;
- position: relative;
- z-index: 10;
- padding-right: 5%;
- padding-bottom: 1em;
-}
-
-#links > li > a {
- display: block;
- padding: 0.5em 2em 0.5em 1em;
- color: #fff;
- position: relative;
- text-transform: uppercase;
- text-decoration: none;
- font-weight: normal;
- font-family: "PT Sans", sans-serif;
- transition: all 0.5s ease;
-}
-
-#links > li > a:hover,
-#links > li > a:focus {
- background-color: #999;
- color: #000;
-}
-
-#links .current::after {
- content: "";
- width: 0;
- height: 0;
- position: absolute;
- border-style: solid;
- border-width: 10px;
- border-color: transparent #eee transparent transparent;
- right: 0;
- top: 50%;
- margin-top: -10px;
-}
-
-#links li:last-child {
- position: fixed;
- bottom: 1em;
- width: 10em;
-}
-
-#links li:last-child a::before {
- font-size: 1.2em;
- position: relative;
- top: 2px;
-}
-
-#sort {
- padding: 0;
- list-style-type: none;
- opacity: 0.5;
- display: inline-block;
-}
-
-#sort li {
- display: inline;
- font-size: 0.9em;
-}
-
-#sort li + li {
- margin-left: 10px;
-}
-
-#sort a {
- padding: 2px 2px 0;
- vertical-align: middle;
-}
-
-#sort img {
- vertical-align: baseline;
-}
-
-#sort img:hover {
- cursor: pointer;
-}
-
-#display-mode {
- float: right;
- margin-top: 10px;
- margin-bottom: 10px;
- opacity: 0.5;
-}
-
-#listmode {
- width: 16px;
- display: inline-block;
- text-decoration: none;
-}
-
-#listmode.tablemode {
- background-image: url("../../_global/img/table.png");
- background-repeat: no-repeat;
- background-position: bottom;
-}
-
-#listmode.listmode {
- background-image: url("../../_global/img/list.png");
- background-repeat: no-repeat;
- background-position: bottom;
-}
-
-#warning_message {
- position: fixed;
- background-color: #ff6347;
- z-index: 1000;
- bottom: 0;
- left: 0;
- width: 100%;
- color: #000;
-}
-
-/* ==========================================================================
- 2 = Layout
- ========================================================================== */
-
-#content {
- margin-top: 2em;
- min-height: 30em;
-}
-
-footer {
- text-align: right;
- position: relative;
- bottom: 0;
- right: 5em;
- color: #999;
- font-size: 0.8em;
- font-style: italic;
- z-index: 20;
-}
-
-footer a {
- color: #999;
- font-weight: normal;
-}
-
-.list-entries {
- letter-spacing: -5px;
-}
-
-.listmode.entry {
- width: 100%;
- height: inherit;
-}
-
-.card-entry-labels {
- position: absolute;
- top: 100px;
- left: -1em;
- z-index: 90;
- max-width: 50%;
- padding-left: 0;
-}
-
-.card-entry-labels li {
- margin: 10px 10px 10px auto;
- padding: 5px 12px 5px 25px;
- background-color: rgb(0 0 0 / 60%);
- border-radius: 0 3px 3px 0;
- color: #fff;
- cursor: default;
- max-height: 2em;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.card-entry-tags {
- max-height: 2em;
- overflow-y: hidden;
- padding: 0;
- margin: 0;
-}
-
-.card-entry-tags li,
-.card-entry-tags span {
- display: inline-block;
- margin: 0 5px;
- padding: 5px 12px;
- background-color: rgb(0 0 0 / 60%);
- border-radius: 3px;
- max-height: 2em;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.card-entry-tags a,
-.card-entry-labels a {
- text-decoration: none;
- font-weight: normal;
- color: #fff;
-}
-
-.nav-panel-add-tag {
- margin-top: 10px;
-}
-
-.list-entries + .results {
- margin-bottom: 2em;
-}
-
-.reading-time,
-.created-at {
- color: #999;
- font-style: italic;
- font-weight: normal;
- font-size: 0.9em;
-}
-
-.estimatedTime small {
- position: relative;
- top: -1px;
-}
-
-.entry {
- background-color: #fff;
- letter-spacing: normal;
- box-shadow: 0 3px 7px rgb(0 0 0 / 30%);
- display: inline-block;
- width: 32%;
- margin-bottom: 1.5em;
- vertical-align: top;
- margin-right: 1%;
- position: relative;
- overflow: hidden;
- padding: 1.5em 1.5em 3em;
- height: 440px;
-}
-
-.entry::before {
- content: "";
- width: 0;
- height: 0;
- border-style: solid;
- border-color: transparent transparent #000;
- border-width: 10px;
- position: absolute;
- bottom: 0.3em;
- z-index: 10;
- right: 1.5em;
- transition: all 0.5s ease;
-}
-
-.entry::after {
- content: "";
- position: absolute;
- height: 7px;
- width: 100%;
- bottom: 0;
- left: 0;
- background-color: #000;
- transition: all 0.5s ease;
-}
-
-.entry:hover {
- box-shadow: 0 3px 10px rgb(0 0 0 / 100%);
-}
-
-.entry:hover::after {
- height: 40px;
-}
-
-.entry:hover::before {
- bottom: 2.4em;
-}
-
-.entry:hover h2 a {
- color: #666;
-}
-
-.entry h2 {
- text-transform: none;
- margin-bottom: 0;
- line-height: 1.2;
-}
-
-.entry h2::after {
- content: none;
-}
-
-.entry h2 a {
- display: block;
- text-decoration: none;
- color: #000;
- word-wrap: break-word;
- transition: all 0.5s ease;
-}
-
-img.preview {
- max-width: calc(100% + 3em);
- left: -1.5em;
- position: relative;
-}
-
-.entry p {
- color: #666;
- font-size: 0.9em;
- line-height: 1.7;
- margin-top: 5px;
-}
-
-.entry h2 a::first-letter {
- text-transform: uppercase;
-}
-
-.entry:hover .tools {
- bottom: 0;
-}
-
-.entry .tools {
- position: absolute;
- bottom: -50px;
- left: 0;
- width: 100%;
- z-index: 10;
- padding-right: 0.5em;
- text-align: right;
- transition: all 0.5s ease;
-}
-
-.entry .tools a {
- color: #666;
- text-decoration: none;
- display: block;
- padding: 0.4em;
-}
-
-.entry .tools a:hover {
- color: #fff;
-}
-
-.entry .tools li {
- display: inline-block;
-}
-
-.entry:nth-child(3n+1) {
- margin-left: 0;
-}
-
-.results {
- letter-spacing: -5px;
- padding: 0 0 0.5em;
-}
-
-.results > * {
- display: inline-block;
- vertical-align: top;
- letter-spacing: normal;
- width: 50%;
- text-align: right;
-}
-
-div.pagination ul {
- text-align: right;
-}
-
-.nb-results {
- text-align: left;
- font-style: italic;
- color: #999;
- display: inline-flex;
-}
-
-div.pagination ul > * {
- display: inline-block;
- margin-left: 0.5em;
-}
-
-div.pagination ul a {
- color: #999;
- text-decoration: none;
-}
-
-div.pagination ul a:hover,
-div.pagination ul a:focus {
- text-decoration: underline;
-}
-
-div.pagination ul .prev.disabled,
-div.pagination ul .next.disabled {
- display: none;
-}
-
-div.pagination ul .current {
- height: 25px;
- padding: 4px 8px;
- border: 1px solid #d5d5d5;
- text-decoration: none;
- font-weight: bold;
- color: #000;
- background-color: #ccc;
-}
-
-.hide {
- display: none;
-}
-
-/* ==========================================================================
- 2.1 = "save a link" related styles
- ========================================================================== */
-
-.popup-form {
- background: rgb(0 0 0 / 50%);
- position: absolute;
- top: 0;
- left: 10em;
- z-index: 20;
- height: 100%;
- width: 100%;
- margin: 0;
- margin-top: -30% !important;
- padding: 2em;
- display: none;
- border-left: 1px #eee solid;
-}
-
-.popup-form form {
- background-color: #fff;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 20;
- border: 10px solid #000;
- width: 400px;
- height: 200px;
- padding: 2em;
-}
-
-#bagit-form-form .addurl {
- margin-left: 0;
-}
-
-.closeMessage,
-.close-button {
- background-color: #000;
- color: #fff;
- font-size: 1.2em;
- line-height: 1.6;
- width: 1.6em;
- height: 1.6em;
- text-align: center;
- text-decoration: none;
-}
-
-.closeMessage:hover,
-.closeMessage:focus,
-.close-button:hover,
-.close-button:focus {
- background-color: #999;
- color: #000;
-}
-
-.close-button--popup {
- display: inline-block;
- position: absolute;
- top: 0;
- right: 0;
- font-size: 1.4em;
-}
-
-.active-current {
- background-color: #999;
-}
-
-.active-current::after {
- content: "";
- width: 0;
- height: 0;
- position: absolute;
- border-style: solid;
- border-width: 10px;
- border-color: transparent #eee transparent transparent;
- right: 0;
- top: 50%;
- margin-top: -10px;
-}
-
-.opacity03 {
- opacity: 0.3;
-}
-
-.add-to-wallabag-link-after {
- background-color: #000;
- color: #fff;
- padding: 0 3px 2px;
-}
-
-a.add-to-wallabag-link-after {
- visibility: hidden;
- position: absolute;
- opacity: 0;
- transition-duration: 2s;
- transition-timing-function: ease-out;
-}
-
-#article article a:hover + a.add-to-wallabag-link-after,
-a.add-to-wallabag-link-after:hover {
- opacity: 1;
- visibility: visible;
- transition-duration: 0.3s;
- transition-timing-function: ease-in;
-}
-
-a.add-to-wallabag-link-after::after {
- content: "w";
-}
-
-#add-link-result {
- font-weight: bold;
- font-size: 0.9em;
-}
-
-.btn-clickable {
- cursor: pointer;
-}
-
-/* ==========================================================================
- 3 = Pictos
- ========================================================================== */
-
-@font-face {
- font-family: icomoon;
- src: url("../fonts/IcoMoon-Free.ttf");
- font-weight: normal;
- font-style: normal;
-}
-
-@font-face {
- font-family: "Material Icons";
- font-style: normal;
- font-weight: 400;
- src: url(../fonts/MaterialIcons-Regular.eot);
-
- /* For IE6-8 */
- src: local("Material Icons"), local("MaterialIcons-Regular"), url(../fonts/MaterialIcons-Regular.woff2) format("woff2"), url(../fonts/MaterialIcons-Regular.woff) format("woff"), url(../fonts/MaterialIcons-Regular.ttf) format("truetype");
-}
-
-.material-icons {
- font-family: "Material Icons";
- font-weight: normal;
- font-style: normal;
- font-size: 1em; /* Preferred icon size */
- width: 1em;
- height: 1em;
- display: inline-block;
- line-height: 1;
- text-transform: none;
- letter-spacing: normal;
- word-wrap: normal;
- white-space: nowrap;
- direction: ltr;
-
- /* Support for all WebKit browsers. */
- -webkit-font-smoothing: antialiased;
-
- /* Support for Safari and Chrome. */
- text-rendering: optimizeLegibility;
-
- /* Support for Firefox. */
- -moz-osx-font-smoothing: grayscale;
-
- /* Support for IE. */
- font-feature-settings: "liga";
-}
-
-.material-icons.md-18 { font-size: 18px; }
-.material-icons.md-24 { font-size: 24px; }
-.material-icons.md-36 { font-size: 36px; }
-.material-icons.md-48 { font-size: 48px; }
-
-.icon span,
-.icon-image span {
- position: absolute;
- top: -9999px;
-}
-
-[class^="icon-"]::before,
-[class*=" icon-"]::before {
- font-family: icomoon;
- speak: none;
- font-style: normal;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
- line-height: 1;
-
- /* Enable Ligatures ================ */
- letter-spacing: 0;
- font-feature-settings: "liga";
-
- /* Better Font Rendering =========== */
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-.icon-flattr::before {
- content: "\ead4";
-}
-
-.icon-mail::before {
- content: "\ea86";
-}
-
-.icon-up-open::before {
- content: "\e80b";
-}
-
-.icon-star::before {
- content: "\e9d9";
-}
-
-.icon-check::before {
- content: "\ea10";
-}
-
-.icon-link::before {
- content: "\e9cb";
-}
-
-.icon-reply::before {
- content: "\e806";
-}
-
-.icon-menu::before {
- content: "\e9bd";
-}
-
-.icon-clock::before {
- content: "\e803";
-}
-
-.icon-twitter::before {
- content: "\ea96";
-}
-
-.icon-down-open::before {
- content: "\e809";
-}
-
-.icon-trash::before {
- content: "\e9ac";
-}
-
-.icon-delete::before {
- content: "\ea0d";
-}
-
-.icon-power::before {
- content: "\ea14";
-}
-
-.icon-arrow-up-thick::before {
- content: "\ea3a";
-}
-
-.icon-rss::before {
- content: "\e808";
-}
-
-.icon-print::before {
- content: "\e954";
-}
-
-.icon-reload::before {
- content: "\ea2e";
-}
-
-.icon-price-tags::before {
- content: "\e936";
-}
-
-.icon-eye::before {
- content: "\e9ce";
-}
-
-.icon-no-eye::before {
- content: "\e9d1";
-}
-
-.icon-calendar::before {
- content: "\e953";
-}
-
-.icon-pencil2::before {
- content: "\e906";
-}
-
-.icon-users::before {
- content: "\e972";
-}
-
-.icon-time::before {
- content: "\e952";
-}
-
-/* .icon-image class, for image-based icons
- ========================================================================== */
-
-.icon-image {
- background-size: 16px 16px;
- background-repeat: no-repeat;
- background-position: center;
- padding-right: 1em !important;
- padding-left: 1em !important;
-}
-
-/* Carrot (http://carrot.org) */
-.icon-image--carrot {
- background-image: url("../../_global/img/icons/carrot-icon--white.png");
-}
-
-/* Diaspora */
-.icon-image--diaspora {
- background-image: url("../../_global/img/icons/diaspora-icon--black.png");
-}
-
-/* Unmark.it */
-.icon-image--unmark {
- background-image: url("../../_global/img/icons/unmark-icon--black.png");
-}
-
-/* shaarli */
-.icon-image--shaarli {
- background-image: url("../../_global/img/icons/shaarli.png");
-}
-
-/* scuttle */
-.icon-image--scuttle {
- background-image: url("../../_global/img/icons/scuttle.png");
-}
-
-/* ==========================================================================
- Icon selected
- ========================================================================== */
-
-.icon-star.fav::before {
- color: #fff;
-}
-
-.icon-check.archive::before {
- color: #fff;
-}
-
-/* ==========================================================================
- 4 = Messages
- ========================================================================== */
-
-.messages {
- text-align: left;
- margin-top: 1em;
-}
-
-.messages > * {
- display: inline-block;
-}
-
-.warning {
- font-weight: bold;
- display: block;
- width: 100%;
-}
-
-.more-info {
- font-size: 0.85em;
- line-height: 1.5;
- color: #aaa;
-}
-
-.more-info a {
- color: #aaa;
-}
-
-/* ==========================================================================
- 5 = Article
- ========================================================================== */
-
-#article {
- width: 70%;
- margin-bottom: 3em;
- text-align: justify;
-}
-
-#article .tags {
- margin-bottom: 1em;
-}
-
-#article i {
- font-style: normal;
-}
-
-blockquote {
- border: 1px solid #999;
- background-color: #fff;
- padding: 1em;
- margin: 0;
-}
-
-#article h2,
-#article h3,
-#article h4 {
- text-transform: none;
-}
-
-#article h2::after {
- content: none;
-}
-
-.topPosF {
- position: fixed;
- right: 20%;
- bottom: 2em;
- font-size: 1.5em;
-}
-
-#article_toolbar {
- margin-bottom: 1em;
-}
-
-#article_toolbar li {
- display: inline-block;
- margin: 3px auto;
-}
-
-#article_toolbar a {
- background-color: #000;
- padding: 0.3em 0.5em 0.2em;
- color: #fff;
- text-decoration: none;
-}
-
-#article_toolbar a:hover,
-#article_toolbar a:focus {
- background-color: #999;
-}
-
-#nav-btn-add-tag {
- cursor: pointer;
-}
-
-.shaarli::before {
- content: "*";
-}
-
-.scuttle::before {
- content: "*";
-}
-
-.return {
- text-decoration: none;
- margin-top: 1em;
- display: block;
-}
-
-.return::before {
- margin-right: 0.5em;
-}
-
-.notags {
- font-style: italic;
- color: #999;
-}
-
-.icon-rss {
- background-color: #000;
- color: #fff;
- padding: 0.2em 0.5em;
-}
-
-.icon-rss::before {
- position: relative;
- top: 2px;
-}
-
-.list-tags li {
- margin-bottom: 0.5em;
-}
-
-.list-tags .icon-rss:hover,
-.list-tags .icon-rss:focus {
- background-color: #fff;
- color: #000;
- text-decoration: none;
-}
-
-.list-tags a {
- text-decoration: none;
-}
-
-.list-tags a:hover,
-.list-tags a:focus {
- text-decoration: underline;
-}
-
-pre code {
- font-family: "Courier New", Courier, monospace;
-}
-
-#filters {
- position: fixed;
- width: 20%;
- height: 100%;
- top: 0;
- right: 0;
- background-color: #fff;
- padding: 15px;
- padding-right: 30px;
- padding-top: 30px;
- border-left: 1px #333 solid;
- z-index: 12;
- min-width: 300px;
-}
-
-#filters form .filter-group {
- margin: 5px;
-}
-
-#download-form {
- position: fixed;
- width: 10%;
- height: 100%;
- top: 0;
- right: 0;
- background-color: #fff;
- padding: 15px;
- padding-right: 30px;
- padding-top: 30px;
- border-left: 1px #333 solid;
- z-index: 12;
- min-width: 200px;
-}
-
-#download-form li {
- display: block;
- padding: 0.5em 2em 0.5em 1em;
- color: #fff;
- position: relative;
- text-transform: uppercase;
- text-decoration: none;
- font-weight: 400;
- font-family: PT Sans, sans-serif;
- transition: all 0.5s ease;
-}
-
-/* ==========================================================================
- 6 = Media Queries
- ========================================================================== */
-
-@media screen and (max-width: 1050px) {
- .entry {
- width: 49%;
- }
-
- .entry:nth-child(3n+1) {
- margin-left: 1.5%;
- }
-
- .entry:nth-child(2n+1) {
- margin-left: 0;
- }
-}
-
-@media screen and (max-width: 900px) {
- #article {
- width: 80%;
- }
-
- .topPosF {
- right: 2.5em;
- }
-}
-
-@media screen and (max-width: 700px) {
- .entry {
- width: 100%;
- margin-left: 0;
- }
-
- #display-mode {
- display: none;
- }
-}
-
-@media screen and (max-height: 770px) {
- .menu.users,
- .menu.internal,
- .menu.developer {
- display: none;
- }
-}
-
-@media screen and (max-width: 500px) {
- .entry {
- width: 100%;
- margin-left: 0;
- }
-
- body > header {
- background-color: #333;
- position: fixed;
- top: 0;
- width: 100%;
- height: 3em;
- z-index: 11;
- }
-
- #links li:last-child {
- position: static;
- width: auto;
- }
-
- #links li:last-child a::before {
- content: none;
- }
-
- .logo {
- width: 1.25em;
- height: 1.25em;
- left: 0;
- top: 0;
- }
-
- .login > header {
- position: static;
- }
-
- .login form {
- width: 100%;
- position: static;
- margin-left: 0;
- }
-
- .login .logo {
- height: auto;
- top: 0.5em;
- width: 75px;
- margin-left: -37.5px;
- }
-
- .desktopHide {
- display: block;
- position: fixed;
- z-index: 20;
- top: 0;
- right: 0;
- border: 0;
- width: 2.5em;
- height: 2.5em;
- cursor: pointer;
- background-color: #999;
- font-size: 1.2em;
- }
-
- .desktopHide:hover,
- .desktopHide:focus {
- background-color: #fff;
- }
-
- #links {
- display: none;
- width: 100%;
- height: auto;
- padding-top: 3em;
- }
-
- #links.menu--open {
- display: block;
- }
-
- footer {
- position: static;
- margin-right: 3em;
- }
-
- #main {
- margin-left: 1.5em;
- padding-right: 1.5em;
- position: static;
- margin-top: 3em;
- }
-
- .card-entry-labels {
- display: none;
- }
-
- #article_toolbar .topPosF {
- display: none;
- }
-
- #article {
- width: 100%;
- }
-
- #article h1 {
- font-size: 1.5em;
- }
-
- #article_toolbar a {
- padding: 0.3em 0.4em 0.2em;
- }
-
- #display-mode {
- display: none;
- }
-
- .popup-form,
- #bagit-form,
- #search-form {
- left: 0;
- width: 100%;
- border-left: none;
- }
-
- .popup-form form,
- #bagit-form form,
- #search-form form {
- width: 100%;
- }
-}
diff --git a/app/Resources/static/themes/baggy/css/media_queries.scss b/app/Resources/static/themes/baggy/css/media_queries.scss
deleted file mode 100755
index d8014ca65..000000000
--- a/app/Resources/static/themes/baggy/css/media_queries.scss
+++ /dev/null
@@ -1,177 +0,0 @@
-@media screen and (max-width: 1050px) {
- .entry {
- width: 49%;
- }
-
- .entry:nth-child(3n+1) {
- margin-left: 1.5%;
- }
-
- .entry:nth-child(2n+1) {
- margin-left: 0;
- }
-}
-
-@media screen and (max-width: 900px) {
- #article {
- width: 80%;
- }
-
- .topPosF {
- right: 2.5em;
- }
-}
-
-@media screen and (max-width: 700px) {
- .entry {
- width: 100%;
- margin-left: 0;
- }
-
- #display-mode {
- display: none;
- }
-}
-
-@media screen and (max-height: 770px) {
- .menu.users,
- .menu.internal,
- .menu.developer {
- display: none;
- }
-}
-
-@media screen and (max-width: 500px) {
- .entry {
- width: 100%;
- margin-left: 0;
- }
-
- body > header {
- background-color: #333;
- position: fixed;
- top: 0;
- width: 100%;
- height: 3em;
- z-index: 11;
- }
-
- #links li:last-child {
- position: static;
- width: auto;
- }
-
- #links li:last-child a::before {
- content: none;
- }
-
- .logo {
- width: 1.25em;
- height: 1.25em;
- left: 0;
- top: 0;
- }
-
- .login > header {
- position: static;
- }
-
- .login form {
- width: 100%;
- position: static;
- margin-left: 0;
- }
-
- .login .logo {
- height: auto;
- top: 0.5em;
- width: 75px;
- margin-left: -37.5px;
- }
-
- .desktopHide {
- display: block;
- position: fixed;
- z-index: 20;
- top: 0;
- right: 0;
- border: 0;
- width: 2.5em;
- height: 2.5em;
- cursor: pointer;
- background-color: #999;
- font-size: 1.2em;
- }
-
- .desktopHide:hover,
- .desktopHide:focus {
- background-color: #fff;
- }
-
- #links {
- display: none;
- width: 100%;
- height: auto;
- padding-top: 3em;
- }
-
- #links.menu--open {
- display: block;
- }
-
- footer {
- position: static;
- margin-right: 3em;
- }
-
- #main {
- margin-left: 1.5em;
- padding-right: 1.5em;
- position: static;
- margin-top: 3em;
- }
-
- .card-entry-labels {
- display: none;
- }
-
- #article_toolbar .topPosF {
- display: none;
- }
-
- #article {
- width: 100%;
- }
-
- #article h1 {
- font-size: 1.5em;
- }
-
- #article_toolbar a {
- padding: 0.3em 0.4em 0.2em;
- }
-
- #display-mode {
- display: none;
- }
-
- .popup-form,
- #bagit-form,
- #search-form {
- left: 0;
- width: 100%;
- border-left: none;
- }
-
- .popup-form form,
- #bagit-form form,
- #search-form form {
- width: 100%;
- }
-}
-
-@media only print {
- header h1.logo {
- display: none;
- }
-}
diff --git a/app/Resources/static/themes/baggy/css/messages.scss b/app/Resources/static/themes/baggy/css/messages.scss
deleted file mode 100755
index a388419eb..000000000
--- a/app/Resources/static/themes/baggy/css/messages.scss
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ==========================================================================
- Messages
- ========================================================================== */
-
-.messages {
- text-align: left;
- width: 60%;
- margin: auto 17%;
-
- > * {
- display: inline-block;
- }
-
- .install {
- text-align: left;
-
- &.error {
- border: 1px solid #c42608;
- color: #c00 !important;
- background: #fff0ef;
- }
-
- &.notice {
- border: 1px solid #ebcd41;
- color: #000;
- background: #fffcd3;
- }
-
- &.success {
- border: 1px solid #6dc70c;
- background: #e0fbcc !important;
- }
- }
-}
-
-.warning {
- font-weight: bold;
- display: block;
- width: 100%;
-}
-
-.more-info {
- font-size: 0.85em;
- line-height: 1.5;
- color: #aaa;
-
- a {
- color: #aaa;
- }
-}
diff --git a/app/Resources/static/themes/baggy/css/pictos.scss b/app/Resources/static/themes/baggy/css/pictos.scss
deleted file mode 100644
index bdd39dc1e..000000000
--- a/app/Resources/static/themes/baggy/css/pictos.scss
+++ /dev/null
@@ -1,205 +0,0 @@
-/* ==========================================================================
- Pictos
- ========================================================================== */
-
-@font-face {
- font-family: icomoon;
- src: url("~icomoon-free-npm/Font/IcoMoon-Free.ttf");
- font-weight: normal;
- font-style: normal;
-}
-
-.material-icons {
- font-family: "Material Icons";
- font-weight: normal;
- font-style: normal;
- font-size: 1em; /* Preferred icon size */
- width: 1em;
- height: 1em;
- display: inline-block;
- line-height: 1;
- text-transform: none;
- letter-spacing: normal;
- word-wrap: normal;
- white-space: nowrap;
- direction: ltr;
-
- /* Support for all WebKit browsers. */
- -webkit-font-smoothing: antialiased;
-
- /* Support for Safari and Chrome. */
- text-rendering: optimizeLegibility;
-
- /* Support for Firefox. */
- -moz-osx-font-smoothing: grayscale;
-
- /* Support for IE. */
- font-feature-settings: "liga";
-
- .md-18 { font-size: 18px; }
- .md-24 { font-size: 24px; }
- .md-36 { font-size: 36px; }
- .md-48 { font-size: 48px; }
-
- .vertical-align-middle {
- vertical-align: middle !important;
- }
-}
-
-.icon span,
-.icon-image span {
- position: absolute;
- top: -9999px;
-}
-
-[class^="icon-"]::before,
-[class*=" icon-"]::before {
- font-family: icomoon;
- speak: none;
- font-style: normal;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
- line-height: 1;
-
- /* Enable Ligatures ================ */
- letter-spacing: 0;
- font-feature-settings: "liga";
-
- /* Better Font Rendering =========== */
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-.icon-flattr::before {
- content: "\ead4";
-}
-
-.icon-mail::before {
- content: "\ea86";
-}
-
-.icon-up-open::before {
- content: "\e80b";
-}
-
-.icon-star::before {
- content: "\e9d9";
-}
-
-.icon-check::before {
- content: "\ea10";
-}
-
-.icon-link::before {
- content: "\e9cb";
-}
-
-.icon-reply::before {
- content: "\e806";
-}
-
-.icon-menu::before {
- content: "\e9bd";
-}
-
-.icon-clock::before {
- content: "\e803";
-}
-
-.icon-twitter::before {
- content: "\ea96";
-}
-
-.icon-down-open::before {
- content: "\e809";
-}
-
-.icon-trash::before {
- content: "\e9ac";
-}
-
-.icon-delete::before {
- content: "\ea0d";
-}
-
-.icon-power::before {
- content: "\ea14";
-}
-
-.icon-arrow-up-thick::before {
- content: "\ea3a";
-}
-
-.icon-feed::before {
- content: "\e808";
-}
-
-.icon-print::before {
- content: "\e954";
-}
-
-.icon-reload::before {
- content: "\ea2e";
-}
-
-.icon-price-tags::before {
- content: "\e936";
-}
-
-.icon-eye::before {
- content: "\e9ce";
-}
-
-.icon-no-eye::before {
- content: "\e9d1";
-}
-
-.icon-calendar::before {
- content: "\e953";
-}
-
-.icon-time::before {
- content: "\e952";
-}
-
-/* .icon-image class, for image-based icons
- ========================================================================== */
-
-.icon-image {
- background: no-repeat center/80%;
- padding-right: 1em !important;
- padding-left: 1em !important;
-}
-
-/* Carrot (http://carrot.org) */
-.icon-image--carrot {
- background-image: url("../../_global/img/icons/carrot-icon--white.png");
-}
-
-/* Diaspora */
-.icon-image--diaspora {
- background-image: url("../../_global/img/icons/Diaspora-asterisk.svg");
-}
-
-/* Unmark.it */
-.icon-image--unmark {
- background-image: url("../../_global/img/icons/unmark-icon--black.png");
-}
-
-/* shaarli */
-.icon-image--shaarli {
- background-image: url("../../_global/img/icons/shaarli.png");
-}
-
-/* ==========================================================================
- Icon selected
- ========================================================================== */
-
-.icon-star.fav::before {
- color: #fff;
-}
-
-.icon-check.archive::before {
- color: #fff;
-}
diff --git a/app/Resources/static/themes/baggy/css/print.scss b/app/Resources/static/themes/baggy/css/print.scss
deleted file mode 100755
index 6f1c442e6..000000000
--- a/app/Resources/static/themes/baggy/css/print.scss
+++ /dev/null
@@ -1,63 +0,0 @@
-@media print {
- /* ### Layout ### */
-
- body {
- font-family: serif;
- background-color: #fff;
- }
-
- @page {
- margin: 1cm;
- }
-
- img {
- max-width: 100% !important;
- }
-
- /* ### Content ### */
-
- /* Hide useless blocks */
- body > .logo,
- #article_toolbar,
- #links,
- #sort,
- body > footer,
- .top_link,
- div.tools,
- header div,
- .messages,
- .entrie + .results,
- #article .mbm a,
- #article-informations {
- display: none !important;
- }
-
- article {
- border: none !important;
- }
-
- /* Add URL after links */
- .vieworiginal a::after {
- content: " (" attr(href) ")";
- }
-
- /* Add explanation after abbr */
- abbr[title]::after {
- content: " (" attr(title) ")";
- }
-
- /* Change border on current pager item */
- .pagination span.current {
- border-style: dashed;
- }
-
- #main {
- width: 100%;
- margin: 0;
- padding: 0;
- }
-
- #article {
- width: 100%;
- }
-}
diff --git a/app/Resources/static/themes/baggy/css/ratatouille.scss b/app/Resources/static/themes/baggy/css/ratatouille.scss
deleted file mode 100644
index c54667706..000000000
--- a/app/Resources/static/themes/baggy/css/ratatouille.scss
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- Ratatouille mini Framework css by Thomas LEBEAU
- Base on KNACSS => www.KNACSS.com (2013-10) @author: Raphael Goetter, Alsacreations
- and normalize.css
-*/
-
-* {
- box-sizing: border-box;
-}
-
-html {
- font-family: sans-serif; /* 1 */
- text-size-adjust: 100%; /* 2 */
-}
-
-body {
- font-size: 1em;
- line-height: 1.5;
- margin: 0;
-}
-
-/* ==========================================================================
- Mise en forme
- ========================================================================== */
-
-h1:first-child,
-h2:first-child,
-h3:first-child,
-h4:first-child,
-h5:first-child,
-h6:first-child,
-p:first-child,
-ul:first-child,
-ol:first-child,
-dl:first-child {
- margin-top: 0;
-}
-
-code,
-kbd,
-pre,
-samp {
- font-family: monospace, serif;
-}
-
-pre {
- white-space: pre-wrap;
-}
-
-.upper {
- text-transform: uppercase;
-}
-
-.bold {
- font-weight: bold;
-}
-
-.inner {
- margin: 0 auto;
- max-width: 61.25em; /* 980px */
-}
-
-table,
-img,
-figure {
- max-width: 100%;
- height: auto;
-}
-
-iframe {
- max-width: 100%;
-}
-
-.fl {
- float: left;
-}
-
-.fr {
- float: right;
-}
-
-table {
- border-collapse: collapse;
-}
-
-figure {
- margin: 0;
-}
-
-button,
-input,
-select,
-textarea {
- font-family: inherit;
- font-size: 100%;
- margin: 0;
-}
-
-input[type="search"] {
- appearance: textfield;
-}
-
-/* ==========================================================================
- Mise en page
- ========================================================================== */
-
-.dib {
- display: inline-block;
- vertical-align: middle;
-}
-
-.dnone {
- display: none;
-}
-
-.dtable {
- display: table;
-}
-
-.dtable > * {
- display: table-row;
-}
-
-.dtable > * > * {
- display: table-cell;
-}
-
-.element-invisible {
- border: 0;
- clip: rect(0 0 0 0);
- height: 1px;
- margin: -1px;
- overflow: hidden;
- padding: 0;
- position: absolute;
- width: 1px;
-}
-
-.small {
- font-size: 0.8em;
-}
-
-.big {
- font-size: 1.2em;
-}
-
-/* Width */
-
-.w100 {
- width: 100%;
-}
-
-.w90 {
- width: 90%;
-}
-
-.w80 {
- width: 80%;
-}
-
-.w70 {
- width: 70%;
-}
-
-.w60 {
- width: 60%;
-}
-
-.w50 {
- width: 50%;
-}
-
-.w40 {
- width: 40%;
-}
-
-.w30 {
- width: 30%;
-}
-
-.w20 {
- width: 20%;
-}
-
-.w10 {
- width: 10%;
-}
-
-/* ==========================================================================
- Internet Explorer
- ========================================================================== */
-
-/* IE8 and IE9 */
-
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-main,
-nav,
-section,
-summary {
- display: block;
-}
-
-/* IE8 and IE9 */
-
-audio,
-canvas,
-video {
- display: inline-block;
-}
-
-@media screen {
- select {
- appearance: none;
- border-radius: 0;
- }
-}
diff --git a/app/Resources/static/themes/baggy/css/save.scss b/app/Resources/static/themes/baggy/css/save.scss
deleted file mode 100644
index 4a7b0b4b6..000000000
--- a/app/Resources/static/themes/baggy/css/save.scss
+++ /dev/null
@@ -1,115 +0,0 @@
-/* ==========================================================================
- "save a link" related styles
- ========================================================================== */
-
-.popup-form {
- background: rgb(0 0 0 / 50%);
- position: absolute;
- top: 0;
- left: 10em;
- z-index: 20;
- height: 100%;
- width: 100%;
- margin: 0;
- margin-top: -30% !important;
- padding: 2em;
- display: none;
- border-left: 1px #eee solid;
-
- form {
- background-color: #fff;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 20;
- border: 10px solid #000;
- width: 400px;
- height: 200px;
- padding: 2em;
- }
-}
-
-#bagit-form-form .addurl {
- margin-left: 0;
-}
-
-.closeMessage,
-.close-button {
- background-color: #000;
- color: #fff;
- font-size: 1.2em;
- line-height: 1.6;
- width: 1.6em;
- height: 1.6em;
- text-align: center;
- text-decoration: none;
-
- &:hover,
- &:focus {
- background-color: #999;
- color: #000;
- }
-}
-
-.close-button--popup {
- display: inline-block;
- position: absolute;
- top: 0;
- right: 0;
- font-size: 1.4em;
-}
-
-.active-current {
- background-color: #999;
-
- &::after {
- content: "";
- width: 0;
- height: 0;
- position: absolute;
- border: 10px solid transparent;
- border-right-color: #eee;
- right: 0;
- top: 50%;
- margin-top: -10px;
- }
-}
-
-.opacity03 {
- opacity: 0.3;
-}
-
-.add-to-wallabag-link-after {
- background-color: #000;
- color: #fff;
- padding: 0 3px 2px;
-}
-
-a.add-to-wallabag-link-after {
- visibility: hidden;
- position: absolute;
- opacity: 0;
- transition-duration: 2s;
- transition-timing-function: ease-out;
-}
-
-#article article a:hover + a.add-to-wallabag-link-after,
-a.add-to-wallabag-link-after:hover {
- opacity: 1;
- visibility: visible;
- transition-duration: 0.3s;
- transition-timing-function: ease-in;
-}
-
-a.add-to-wallabag-link-after::after {
- content: "w";
-}
-
-#add-link-result {
- font-weight: bold;
- font-size: 0.9em;
-}
-
-.btn-clickable {
- cursor: pointer;
-}
diff --git a/app/Resources/static/themes/baggy/img/blank.png b/app/Resources/static/themes/baggy/img/blank.png
deleted file mode 100755
index 113f5d56e..000000000
Binary files a/app/Resources/static/themes/baggy/img/blank.png and /dev/null differ
diff --git a/app/Resources/static/themes/baggy/img/down.png b/app/Resources/static/themes/baggy/img/down.png
deleted file mode 100644
index d048e4cbc..000000000
Binary files a/app/Resources/static/themes/baggy/img/down.png and /dev/null differ
diff --git a/app/Resources/static/themes/baggy/img/list.png b/app/Resources/static/themes/baggy/img/list.png
deleted file mode 100755
index 3ee98c212..000000000
Binary files a/app/Resources/static/themes/baggy/img/list.png and /dev/null differ
diff --git a/app/Resources/static/themes/baggy/img/table.png b/app/Resources/static/themes/baggy/img/table.png
deleted file mode 100755
index 24e7b6fa2..000000000
Binary files a/app/Resources/static/themes/baggy/img/table.png and /dev/null differ
diff --git a/app/Resources/static/themes/baggy/img/top.png b/app/Resources/static/themes/baggy/img/top.png
deleted file mode 100644
index 782acc095..000000000
Binary files a/app/Resources/static/themes/baggy/img/top.png and /dev/null differ
diff --git a/app/Resources/static/themes/baggy/index.js b/app/Resources/static/themes/baggy/index.js
deleted file mode 100755
index 39ad49aa6..000000000
--- a/app/Resources/static/themes/baggy/index.js
+++ /dev/null
@@ -1,266 +0,0 @@
-import $ from 'jquery';
-
-/* Global imports */
-import '../_global/index';
-
-/* Shortcuts */
-import './js/shortcuts/main';
-import './js/shortcuts/entry';
-
-/* Tools */
-import toggleSaveLinkForm from './js/uiTools';
-
-/* Theme style */
-import './css/index.scss';
-
-$(document).ready(() => {
- /* ==========================================================================
- Menu
- ========================================================================== */
-
- $('#menu').click(() => {
- $('#links').toggleClass('menu--open');
- const content = $('#content');
- if (content.hasClass('opacity03')) {
- content.removeClass('opacity03');
- }
- });
-
- /* ==========================================================================
- Add tag panel
- ========================================================================== */
-
- $('#nav-btn-add-tag').on('click', () => {
- $('.baggy-add-tag').toggle(100);
- $('.nav-panel-menu').addClass('hidden');
- $('#tag_label').focus();
- return false;
- });
-
- /**
- * Filters & Export
- */
- // no display if filters not available
- if ($('div').is('#filters')) {
- $('#button_filters').show();
- $('#clear_form_filters').on('click', () => {
- $('#filters input').val('');
- $('#filters :checked').removeAttr('checked');
- return false;
- });
- }
-
- /**
- * Close window after adding entry if popup
- */
- const currentUrl = window.location.href;
- if (currentUrl.match('&closewin=true')) {
- window.close();
- }
-
- /**
- if ($('article').size() > 0) {
- const waypoint = new Waypoint({
- element: $('.wallabag-title').get(0),
- handler: (direction) => {
- console.log(direction);
- if (direction === 'down') {
- $('aside.tags').fadeIn('slow');
- } else {
- $('aside.tags').fadeOut('slow');
- }
- },
- offset: 250,
- });
- }
- */
-
- /**
- * Tags autocomplete
- */
- /**
- * Not working on v2
- *
-
- $('#value').bind('keydown', (event) => {
- if (event.keyCode === $.ui.keyCode.TAB && $(this).data('ui-autocomplete').menu.active) {
- event.preventDefault();
- }
- }).autocomplete({
- source: function source(request, response) {
- $.getJSON('./?view=tags', {
- term: extractLast(request.term),
- //id: $(':hidden#entry_id').val()
- }, response);
- },
- search: function search() {
- // custom minLength
- const term = extractLast(this.value);
- return term.length >= 1;
- },
- focus: function focus() {
- // prevent value inserted on focus
- return false;
- },
- select: function select(event, ui) {
- const terms = split(this.value);
- // remove the current input
- terms.pop();
- // add the selected item
- terms.push(ui.item.value);
- // add placeholder to get the comma-and-space at the end
- terms.push('');
- this.value = terms.join(', ');
- return false;
- },
- });
- */
-
- //---------------------------------------------------------------------------
- // Close the message box when the user clicks the close icon
- //---------------------------------------------------------------------------
- $('a.closeMessage').on('click', () => {
- $(this).parents('div.messages').slideUp(300, () => { $(this).remove(); });
- return false;
- });
-
- $('#search-form').hide();
- $('#bagit-form').hide();
- $('#filters').hide();
- $('#download-form').hide();
-
- //---------------------------------------------------------------------------
- // Toggle the 'Search' popup in the sidebar
- //---------------------------------------------------------------------------
- function toggleSearch() {
- $('#search-form').toggle();
- $('#search').toggleClass('current');
- $('#search').toggleClass('active-current');
- $('#search-arrow').toggleClass('arrow-down');
- if ($('#search').hasClass('current')) {
- $('#content').addClass('opacity03');
- } else {
- $('#content').removeClass('opacity03');
- }
- }
-
- //---------------------------------------------------------------------------
- // Toggle the 'Filter' popup on entries list
- //---------------------------------------------------------------------------
- function toggleFilter() {
- $('#filters').toggle();
- }
-
- //---------------------------------------------------------------------------
- // Toggle the 'Download' popup on entries list
- //---------------------------------------------------------------------------
- function toggleDownload() {
- $('#download-form').toggle();
- }
-
- //---------------------------------------------------------------------------
- // Toggle the 'Save a Link' popup in the sidebar
- //---------------------------------------------------------------------------
- function toggleBagit() {
- $('#bagit-form').toggle();
- $('#bagit').toggleClass('current');
- $('#bagit').toggleClass('active-current');
- $('#bagit-arrow').toggleClass('arrow-down');
- if ($('#bagit').hasClass('current')) {
- $('#content').addClass('opacity03');
- } else {
- $('#content').removeClass('opacity03');
- }
- }
-
- //---------------------------------------------------------------------------
- // Close all #links popups in the sidebar
- //---------------------------------------------------------------------------
- function closePopups() {
- $('#links .messages').hide();
- $('#links > li > a').removeClass('active-current');
- $('#links > li > a').removeClass('current');
- $('[id$=-arrow]').removeClass('arrow-down');
- $('#content').removeClass('opacity03');
- }
-
- $('#search').click(() => {
- closePopups();
- toggleSearch();
- $('#searchfield').focus();
- });
-
- $('.filter-btn').click(() => {
- closePopups();
- toggleFilter();
- });
-
- $('.download-btn').click(() => {
- closePopups();
- toggleDownload();
- });
-
- $('#bagit').click(() => {
- closePopups();
- toggleBagit();
- $('#plainurl').focus();
- });
-
- $('#search-form-close').click(() => {
- toggleSearch();
- });
-
- $('#filter-form-close').click(() => {
- toggleFilter();
- });
-
- $('#download-form-close').click(() => {
- toggleDownload();
- });
-
- $('#bagit-form-close').click(() => {
- toggleBagit();
- });
-
- const bagitFormForm = $('#bagit-form-form');
-
- /* ==========================================================================
- bag it link and close button
- ========================================================================== */
-
- // send 'bag it link' form request via ajax
- bagitFormForm.submit((event) => {
- $('body').css('cursor', 'wait');
- $('#add-link-result').empty();
-
- $.ajax({
- type: bagitFormForm.attr('method'),
- url: bagitFormForm.attr('action'),
- data: bagitFormForm.serialize(),
- success: function success() {
- $('#add-link-result').html('Done!');
- $('#plainurl').val('').blur('');
- $('body').css('cursor', 'auto');
- },
- error: function error() {
- $('#add-link-result').html('Failed!');
- $('body').css('cursor', 'auto');
- },
- });
-
- event.preventDefault();
- });
-
- /* ==========================================================================
- Process all links inside an article
- ========================================================================== */
-
- $('article a[href^="http"]').after(
- () => `
`,
- );
-
- $('.add-to-wallabag-link-after').click((event) => {
- toggleSaveLinkForm($(this).attr('href'), event);
- event.preventDefault();
- });
-});
diff --git a/app/Resources/static/themes/baggy/js/autoCompleteTags.js b/app/Resources/static/themes/baggy/js/autoCompleteTags.js
deleted file mode 100755
index 64fdaa927..000000000
--- a/app/Resources/static/themes/baggy/js/autoCompleteTags.js
+++ /dev/null
@@ -1,8 +0,0 @@
-function split(val) {
- return val.split(/,\s*/);
-}
-function extractLast(term) {
- return split(term).pop();
-}
-
-export default { split, extractLast };
diff --git a/app/Resources/static/themes/baggy/js/shortcuts/entry.js b/app/Resources/static/themes/baggy/js/shortcuts/entry.js
deleted file mode 100644
index c87408b92..000000000
--- a/app/Resources/static/themes/baggy/js/shortcuts/entry.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import Mousetrap from 'mousetrap';
-import $ from 'jquery';
-
-$(document).ready(() => {
- if ($('#article').length > 0) {
- /* Article view */
- Mousetrap.bind('o', () => {
- $('div#article_toolbar ul.links a.original')[0].click();
- });
-
- /* mark as favorite */
- Mousetrap.bind('f', () => {
- $('div#article_toolbar ul.links a.favorite')[0].click();
- });
-
- /* mark as read */
- Mousetrap.bind('a', () => {
- $('div#article_toolbar ul.links a.markasread')[0].click();
- });
-
- /* delete */
- Mousetrap.bind('del', () => {
- $('div#article_toolbar ul.links a.delete')[0].click();
- });
- }
-});
diff --git a/app/Resources/static/themes/baggy/js/shortcuts/main.js b/app/Resources/static/themes/baggy/js/shortcuts/main.js
deleted file mode 100644
index 43ebf3be8..000000000
--- a/app/Resources/static/themes/baggy/js/shortcuts/main.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import $ from 'jquery';
-import Mousetrap from 'mousetrap';
-
-$(document).ready(() => {
- Mousetrap.bind('s', () => {
- $('#search').trigger('click');
- $('#search_entry_term').focus();
- return false;
- });
-});
diff --git a/app/Resources/static/themes/baggy/js/uiTools.js b/app/Resources/static/themes/baggy/js/uiTools.js
deleted file mode 100644
index 713c53f76..000000000
--- a/app/Resources/static/themes/baggy/js/uiTools.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import $ from 'jquery';
-
-function toggleSaveLinkForm(url, event) {
- $('#add-link-result').empty();
-
- const $bagit = $('#bagit');
- const $bagitForm = $('#bagit-form');
-
- $bagit.toggleClass('active-current');
-
- // only if bag-it link is not presented on page
- if ($bagit.length === 0) {
- if (event !== 'undefined' && event) {
- $bagitForm.css({ position: 'absolute', top: event.pageY, left: event.pageX - 200 });
- } else {
- $bagitForm.css({ position: 'relative', top: 'auto', left: 'auto' });
- }
- }
-
- const searchForm = $('#search-form');
- const plainUrl = $('#plainurl');
- if (searchForm.length !== 0) {
- $('#search').removeClass('current');
- $('#search-arrow').removeClass('arrow-down');
- searchForm.hide();
- }
- $bagitForm.toggle();
- $('#content').toggleClass('opacity03');
- if (url !== 'undefined' && url) {
- plainUrl.val(url);
- }
- plainUrl.focus();
-}
-
-export default toggleSaveLinkForm;
diff --git a/app/Resources/static/themes/material/css/cards.scss b/app/Resources/static/themes/material/css/cards.scss
index a648c3887..f46971781 100644
--- a/app/Resources/static/themes/material/css/cards.scss
+++ b/app/Resources/static/themes/material/css/cards.scss
@@ -211,6 +211,10 @@ a.original:not(.waves-effect) {
display: flex;
}
+.card-tag-delete {
+ margin-left: 10px;
+}
+
.card-tag-labels {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
diff --git a/app/Resources/static/themes/material/css/icons.scss b/app/Resources/static/themes/material/css/icons.scss
index 4a698e3be..5f60d20fd 100644
--- a/app/Resources/static/themes/material/css/icons.scss
+++ b/app/Resources/static/themes/material/css/icons.scss
@@ -123,10 +123,6 @@ a.icon-image {
margin: 7px 1.5px 0 0;
}
- &.carrot::before {
- background: url("../../_global/img/icons/carrot-icon--black.png") no-repeat center/90%;
- }
-
&.diaspora::before {
background: url("../../_global/img/icons/diaspora-icon--black.png") no-repeat center/80%;
}
diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js
index 2eff59c38..c13a564ab 100755
--- a/app/Resources/static/themes/material/index.js
+++ b/app/Resources/static/themes/material/index.js
@@ -222,4 +222,10 @@ $(document).ready(() => {
});
});
}
+ $('form[name="form_mass_action"] input[name="tags"]').on('keydown', (e) => {
+ if (e.key === 'Enter') {
+ e.preventDefault();
+ $('form[name="form_mass_action"] button[name="tag"]').trigger('click');
+ }
+ });
});
diff --git a/app/config/config.yml b/app/config/config.yml
index 254344e7c..cced41f53 100644
--- a/app/config/config.yml
+++ b/app/config/config.yml
@@ -39,8 +39,10 @@ twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
form_themes:
- - "LexikFormFilterBundle:Form:form_div_layout.html.twig"
- exception_controller: wallabag_core.exception_controller:showAction
+ - "@LexikFormFilter/Form/form_div_layout.html.twig"
+ exception_controller: Wallabag\CoreBundle\Controller\ExceptionController:showAction
+ globals:
+ registration_enabled: '%fosuser_registration%'
# Doctrine Configuration
doctrine:
@@ -167,9 +169,8 @@ nelmio_cors:
liip_theme:
load_controllers: false
themes:
- - baggy
- material
- autodetect_theme: wallabag_core.helper.detect_active_theme
+ autodetect_theme: Wallabag\CoreBundle\Helper\DetectActiveTheme
path_patterns:
bundle_resource:
@@ -210,14 +211,14 @@ scheb_two_factor:
google:
enabled: "%twofactor_auth%"
issuer: "%server_name%"
- template: WallabagUserBundle:Authentication:form.html.twig
+ template: "@WallabagUser/Authentication/form.html.twig"
email:
enabled: "%twofactor_auth%"
sender_email: "%twofactor_sender%"
digits: 6
- template: WallabagUserBundle:Authentication:form.html.twig
- mailer: wallabag_user.auth_code_mailer
+ template: "@WallabagUser/Authentication/form.html.twig"
+ mailer: Wallabag\UserBundle\Mailer\AuthCodeMailer
kphoen_rulerz:
targets:
@@ -404,7 +405,7 @@ sensio_framework_extra:
httplug:
clients:
wallabag_core:
- factory: 'wallabag_core.http_client_factory'
+ factory: Wallabag\CoreBundle\Helper\HttpClientFactory
config:
defaults:
timeout: 10
diff --git a/src/Wallabag/CoreBundle/Resources/config/parameters.yml b/app/config/parameters_addons.yml
similarity index 100%
rename from src/Wallabag/CoreBundle/Resources/config/parameters.yml
rename to app/config/parameters_addons.yml
diff --git a/app/config/routing.yml b/app/config/routing.yml
index 4fff4cb62..86c6602e6 100644
--- a/app/config/routing.yml
+++ b/app/config/routing.yml
@@ -33,7 +33,7 @@ rest :
homepage:
path: "/{page}"
defaults:
- _controller: WallabagCoreBundle:Entry:showUnread
+ _controller: 'Wallabag\CoreBundle\Controller\EntryController::showUnreadAction'
page : 1
requirements:
page: \d+
@@ -41,25 +41,13 @@ homepage:
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
-fos_user_security_login:
- path: /login
- defaults:
- _controller: Wallabag\UserBundle\Controller\SecurityController::loginAction
- methods: [GET, POST]
-
-fos_user_registration_register:
- path: /register
- defaults:
- _controller: Wallabag\UserBundle\Controller\RegistrationController::registerAction
- methods: [GET, POST]
-
fos_oauth_server_token:
resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"
craue_config_settings_modify:
path: /settings
defaults:
- _controller: CraueConfigBundle:Settings:modify
+ _controller: 'Craue\ConfigBundle\Controller\SettingsController::modifyAction'
fos_js_routing:
resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"
@@ -76,34 +64,34 @@ fos_js_routing:
rss_to_atom_unread:
path: /{username}/{token}/unread.xml
defaults:
- _controller: FrameworkBundle:Redirect:redirect
+ _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction'
route: unread_feed
permanent: true
rss_to_atom_archive:
path: /{username}/{token}/archive.xml
defaults:
- _controller: FrameworkBundle:Redirect:redirect
+ _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction'
route: archive_feed
permanent: true
rss_to_atom_starred:
path: /{username}/{token}/starred.xml
defaults:
- _controller: FrameworkBundle:Redirect:redirect
+ _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction'
route: starred_feed
permanent: true
rss_to_atom_all:
path: /{username}/{token}/all.xml
defaults:
- _controller: FrameworkBundle:Redirect:redirect
+ _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction'
route: all_feed
permanent: true
rss_to_atom_tags:
path: /{username}/{token}/tags/{slug}.xml
defaults:
- _controller: FrameworkBundle:Redirect:redirect
+ _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction'
route: tag_feed
permanent: true
diff --git a/app/config/security.yml b/app/config/security.yml
index 5e74e82fb..2a09648f3 100644
--- a/app/config/security.yml
+++ b/app/config/security.yml
@@ -9,7 +9,7 @@ security:
providers:
administrators:
entity:
- class: WallabagUserBundle:User
+ class: 'Wallabag\UserBundle\Entity\User'
property: username
fos_userbundle:
id: fos_user.user_provider.username_email
diff --git a/app/config/services.yml b/app/config/services.yml
index aab2a0568..eafa90809 100644
--- a/app/config/services.yml
+++ b/app/config/services.yml
@@ -1,40 +1,113 @@
+imports:
+ - { resource: services_rabbit.yml }
+ - { resource: services_redis.yml }
+ - { resource: parameters_addons.yml }
+
parameters:
lexik_form_filter.get_filter.doctrine_orm.class: Wallabag\CoreBundle\Event\Subscriber\CustomDoctrineORMSubscriber
services:
- twig.extension.text:
+ _defaults:
+ autowire: true
+ autoconfigure: true
+ public: true
+ bind:
+ $rootDir: '%kernel.root_dir%'
+ $debug: '%kernel.debug%'
+ $defaultLocale: '%kernel.default_locale%'
+ $wallabagUrl: '%domain_name%'
+ $tablePrefix: "%database_table_prefix%"
+ $defaultTheme: '%wallabag_core.theme%'
+ $encryptionKeyPath: "%wallabag_core.site_credentials.encryption_key_path%"
+ $fetchingErrorMessageTitle: "%wallabag_core.fetching_error_message_title%"
+ $fetchingErrorMessage: '%wallabag_core.fetching_error_message%'
+ $languages: '%wallabag_core.languages%'
+ $lifeTime: '%wallabag_core.cache_lifetime%'
+ $cookieFile: "%kernel.cache_dir%/cookiejar.json"
+ $logoPath: 'web/img/appicon/apple-touch-icon-152.png'
+ $registrationEnabled: '%fosuser_registration%'
+ $restrictedAccess: '@=service(''craue_config'').get(''restricted_access'')'
+ $senderEmail: "%scheb_two_factor.email.sender_email%"
+ $senderName: "%scheb_two_factor.email.sender_name%"
+ $storeArticleHeaders: '@=service(''craue_config'').get(''store_article_headers'')'
+ $supportUrl: '@=service(''craue_config'').get(''wallabag_support_url'')'
+ $themes: '%liip_theme.themes%'
+
+ Wallabag\AnnotationBundle\:
+ resource: '../../src/Wallabag/AnnotationBundle/*'
+ exclude: '../../src/Wallabag/AnnotationBundle/{Controller,Entity}'
+
+ Wallabag\ApiBundle\:
+ resource: '../../src/Wallabag/ApiBundle/*'
+ exclude: '../../src/Wallabag/ApiBundle/{Controller,Entity}'
+
+ Wallabag\CoreBundle\:
+ resource: '../../src/Wallabag/CoreBundle/*'
+ exclude: '../../src/Wallabag/CoreBundle/{Controller,Entity}'
+
+ Wallabag\ImportBundle\:
+ resource: '../../src/Wallabag/ImportBundle/*'
+ exclude: '../../src/Wallabag/ImportBundle/{Consumer,Controller,Redis}'
+
+ Wallabag\UserBundle\:
+ resource: '../../src/Wallabag/UserBundle/*'
+ exclude: '../../src/Wallabag/UserBundle/{Controller,Entity}'
+
+ Doctrine\DBAL\Connection:
+ alias: doctrine.dbal.default_connection
+
+ Doctrine\ORM\EntityManagerInterface:
+ alias: doctrine.orm.entity_manager
+
+ Doctrine\Persistence\ManagerRegistry:
+ alias: doctrine
+
+ Craue\ConfigBundle\Util\Config:
+ alias: craue_config
+
+ JMS\Serializer\SerializerInterface:
+ alias: jms_serializer
+
+ Lexik\Bundle\FormFilterBundle\Filter\FilterBuilderUpdaterInterface:
+ alias: lexik_form_filter.query_builder_updater
+
+ Liip\ThemeBundle\ActiveTheme:
+ alias: liip_theme.active_theme
+
+ Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface:
+ alias: scheb_two_factor.security.google_authenticator
+
+ Symfony\Component\HttpFoundation\Session\SessionInterface:
+ alias: session
+
+ Symfony\Component\EventDispatcher\EventDispatcherInterface:
+ alias: event_dispatcher
+
+ Symfony\Component\Form\FormFactoryInterface:
+ alias: form.factory
+
+ Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface:
+ alias: security.token_storage
+
+ Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface:
+ alias: security.authorization_checker
+
+ Symfony\Component\Translation\TranslatorInterface:
+ alias: translator
+
+ Symfony\Component\Validator\Validator\ValidatorInterface:
+ alias: validator
+
+ FOS\UserBundle\Model\UserManagerInterface:
+ alias: fos_user.user_manager
+
+ Twig_Extensions_Extension_Text:
class: Twig_Extensions_Extension_Text
- tags:
- - { name: twig.extension }
- wallabag.twig_extension:
- class: Wallabag\CoreBundle\Twig\WallabagExtension
+ MatomoTwigExtension\MatomoTwigExtension:
public: false
- arguments:
- - "@wallabag_core.entry_repository"
- - "@wallabag_core.tag_repository"
- - "@security.token_storage"
- - "%wallabag_core.cache_lifetime%"
- - "@translator"
- - "%kernel.root_dir%"
- tags:
- - { name: twig.extension }
- wallabag.twig_matomo_extension:
- class: MatomoTwigExtension\MatomoTwigExtension
- public: false
- tags:
- - { name: twig.extension }
-
- wallabag.locale_listener:
- class: Wallabag\CoreBundle\Event\Listener\LocaleListener
- arguments: ["%kernel.default_locale%"]
- tags:
- - { name: kernel.event_subscriber }
-
- wallabag.user_locale_listener:
- class: Wallabag\CoreBundle\Event\Listener\UserLocaleListener
- arguments: ["@session"]
+ Wallabag\CoreBundle\Event\Listener\UserLocaleListener:
tags:
- { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin }
@@ -42,6 +115,148 @@ services:
class: Symfony\Component\Cache\Adapter\FilesystemAdapter
public: false
arguments:
- - 'craue_config'
- - 0
- - '%kernel.cache_dir%'
+ $namespace: 'craue_config'
+ $defaultLifetime: 0
+ $directory: '%kernel.cache_dir%'
+
+ Wallabag\CoreBundle\ParamConverter\UsernameFeedTokenConverter:
+ tags:
+ - { name: request.param_converter, converter: username_feed_token_converter }
+
+ Wallabag\CoreBundle\Event\Subscriber\TablePrefixSubscriber:
+ tags:
+ - { name: doctrine.event_subscriber }
+
+ Graby\Graby:
+ arguments:
+ $config:
+ error_message: '%wallabag_core.fetching_error_message%'
+ error_message_title: '%wallabag_core.fetching_error_message_title%'
+ calls:
+ - [ setLogger, [ "@logger" ] ]
+ tags:
+ - { name: monolog.logger, channel: graby }
+
+ Graby\SiteConfig\ConfigBuilder:
+ arguments:
+ $config: {}
+
+ wallabag_core.http_client:
+ alias: 'httplug.client.wallabag_core'
+
+ Wallabag\CoreBundle\GuzzleSiteAuthenticator\GrabySiteConfigBuilder:
+ tags:
+ - { name: monolog.logger, channel: graby }
+
+ # service alias override
+ bd_guzzle_site_authenticator.site_config_builder:
+ alias: Wallabag\CoreBundle\GuzzleSiteAuthenticator\GrabySiteConfigBuilder
+
+ Wallabag\CoreBundle\Helper\HttpClientFactory:
+ calls:
+ - ["addSubscriber", ["@bd_guzzle_site_authenticator.authenticator_subscriber"]]
+
+ Wallabag\CoreBundle\Operator\PHP\Matches:
+ tags:
+ - { name: rulerz.operator, target: native, operator: matches }
+
+ Wallabag\CoreBundle\Operator\Doctrine\Matches:
+ tags:
+ - { name: rulerz.operator, target: doctrine, operator: matches, inline: true }
+
+ Wallabag\CoreBundle\Operator\PHP\NotMatches:
+ tags:
+ - { name: rulerz.operator, target: native, operator: notmatches }
+
+ Wallabag\CoreBundle\Operator\Doctrine\NotMatches:
+ tags:
+ - { name: rulerz.operator, target: doctrine, operator: notmatches, inline: true }
+
+ Wallabag\CoreBundle\Operator\PHP\PatternMatches:
+ tags:
+ - { name: rulerz.operator, target: native, operator: "~" }
+
+ Predis\Client:
+ arguments:
+ $parameters:
+ scheme: '%redis_scheme%'
+ host: '%redis_host%'
+ port: '%redis_port%'
+ path: '%redis_path%'
+ password: '%redis_password%'
+
+ Wallabag\CoreBundle\Controller\ExceptionController: ~
+
+ Wallabag\CoreBundle\Event\Subscriber\SQLiteCascadeDeleteSubscriber:
+ tags:
+ - { name: doctrine.event_subscriber }
+
+ Wallabag\CoreBundle\Event\Subscriber\DownloadImagesSubscriber:
+ arguments:
+ $enabled: '@=service(''craue_config'').get(''download_images_enabled'')'
+
+ Wallabag\CoreBundle\Helper\DownloadImages:
+ arguments:
+ $baseFolder: "%kernel.project_dir%/web/assets/images"
+
+ wallabag_core.entry.download_images.client:
+ alias: 'httplug.client.wallabag_core.entry.download_images'
+
+ Wallabag\UserBundle\EventListener\CreateConfigListener:
+ arguments:
+ $theme: "%wallabag_core.theme%"
+ $itemsOnPage: "%wallabag_core.items_on_page%"
+ $feedLimit: "%wallabag_core.feed_limit%"
+ $language: "%wallabag_core.language%"
+ $readingSpeed: "%wallabag_core.reading_speed%"
+ $actionMarkAsRead: "%wallabag_core.action_mark_as_read%"
+ $listMode: "%wallabag_core.list_mode%"
+
+ Wallabag\UserBundle\EventListener\AuthenticationFailureListener:
+ tags:
+ - { name: kernel.event_listener, event: security.authentication.failure, method: onAuthenticationFailure }
+
+ wallabag_import.pocket.client:
+ alias: 'httplug.client.wallabag_import.pocket.client'
+
+ Wallabag\ImportBundle\Import\PocketImport:
+ calls:
+ - [ setClient, [ "@wallabag_import.pocket.client" ] ]
+ tags:
+ - { name: wallabag_import.import, alias: pocket }
+
+ Wallabag\ImportBundle\Import\WallabagV1Import:
+ tags:
+ - { name: wallabag_import.import, alias: wallabag_v1 }
+
+ Wallabag\ImportBundle\Import\WallabagV2Import:
+ tags:
+ - { name: wallabag_import.import, alias: wallabag_v2 }
+
+ Wallabag\ImportBundle\Import\ElcuratorImport:
+ tags:
+ - { name: wallabag_import.import, alias: elcurator }
+
+ Wallabag\ImportBundle\Import\ReadabilityImport:
+ tags:
+ - { name: wallabag_import.import, alias: readability }
+
+ Wallabag\ImportBundle\Import\InstapaperImport:
+ tags:
+ - { name: wallabag_import.import, alias: instapaper }
+
+ Wallabag\ImportBundle\Import\PinboardImport:
+ tags:
+ - { name: wallabag_import.import, alias: pinboard }
+
+ Wallabag\ImportBundle\Import\DeliciousImport:
+ tags:
+ - { name: wallabag_import.import, alias: delicious }
+
+ Wallabag\ImportBundle\Import\FirefoxImport:
+ tags:
+ - { name: wallabag_import.import, alias: firefox }
+
+ Wallabag\ImportBundle\Import\ChromeImport:
+ tags:
+ - { name: wallabag_import.import, alias: chrome }
diff --git a/app/config/services_rabbit.yml b/app/config/services_rabbit.yml
new file mode 100644
index 000000000..e407745d2
--- /dev/null
+++ b/app/config/services_rabbit.yml
@@ -0,0 +1,56 @@
+# RabbitMQ stuff
+services:
+ _defaults:
+ autowire: true
+ autoconfigure: true
+ public: true
+
+ wallabag_import.consumer.amqp.pocket:
+ class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
+ arguments:
+ $import: '@Wallabag\ImportBundle\Import\PocketImport'
+
+ wallabag_import.consumer.amqp.readability:
+ class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
+ arguments:
+ $import: '@Wallabag\ImportBundle\Import\ReadabilityImport'
+
+ wallabag_import.consumer.amqp.instapaper:
+ class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
+ arguments:
+ $import: '@Wallabag\ImportBundle\Import\InstapaperImport'
+
+ wallabag_import.consumer.amqp.pinboard:
+ class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
+ arguments:
+ $import: '@Wallabag\ImportBundle\Import\PinboardImport'
+
+ wallabag_import.consumer.amqp.delicious:
+ class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
+ arguments:
+ $import: '@Wallabag\ImportBundle\Import\DeliciousImport'
+
+ wallabag_import.consumer.amqp.wallabag_v1:
+ class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
+ arguments:
+ $import: '@Wallabag\ImportBundle\Import\WallabagV1Import'
+
+ wallabag_import.consumer.amqp.wallabag_v2:
+ class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
+ arguments:
+ $import: '@Wallabag\ImportBundle\Import\WallabagV2Import'
+
+ wallabag_import.consumer.amqp.elcurator:
+ class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
+ arguments:
+ $import: '@Wallabag\ImportBundle\Import\ElcuratorImport'
+
+ wallabag_import.consumer.amqp.firefox:
+ class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
+ arguments:
+ $import: '@Wallabag\ImportBundle\Import\FirefoxImport'
+
+ wallabag_import.consumer.amqp.chrome:
+ class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
+ arguments:
+ $import: '@Wallabag\ImportBundle\Import\ChromeImport'
diff --git a/src/Wallabag/ImportBundle/Resources/config/redis.yml b/app/config/services_redis.yml
similarity index 59%
rename from src/Wallabag/ImportBundle/Resources/config/redis.yml
rename to app/config/services_redis.yml
index 893778c03..02c7eba95 100644
--- a/src/Wallabag/ImportBundle/Resources/config/redis.yml
+++ b/app/config/services_redis.yml
@@ -1,11 +1,15 @@
# Redis stuff
services:
+ _defaults:
+ autowire: true
+ autoconfigure: true
+ public: true
+
# readability
wallabag_import.queue.redis.readability:
class: Simpleue\Queue\RedisQueue
arguments:
- - "@wallabag_core.redis.client"
- - "wallabag.import.readability"
+ $queueName: "wallabag.import.readability"
wallabag_import.producer.redis.readability:
class: Wallabag\ImportBundle\Redis\Producer
@@ -15,18 +19,13 @@ services:
wallabag_import.consumer.redis.readability:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
- - "@doctrine.orm.entity_manager"
- - "@wallabag_user.user_repository"
- - "@wallabag_import.readability.import"
- - "@event_dispatcher"
- - "@logger"
+ $import: '@Wallabag\ImportBundle\Import\ReadabilityImport'
# instapaper
wallabag_import.queue.redis.instapaper:
class: Simpleue\Queue\RedisQueue
arguments:
- - "@wallabag_core.redis.client"
- - "wallabag.import.instapaper"
+ $queueName: "wallabag.import.instapaper"
wallabag_import.producer.redis.instapaper:
class: Wallabag\ImportBundle\Redis\Producer
@@ -36,18 +35,13 @@ services:
wallabag_import.consumer.redis.instapaper:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
- - "@doctrine.orm.entity_manager"
- - "@wallabag_user.user_repository"
- - "@wallabag_import.instapaper.import"
- - "@event_dispatcher"
- - "@logger"
+ $import: '@Wallabag\ImportBundle\Import\InstapaperImport'
# pinboard
wallabag_import.queue.redis.pinboard:
class: Simpleue\Queue\RedisQueue
arguments:
- - "@wallabag_core.redis.client"
- - "wallabag.import.pinboard"
+ $queueName: "wallabag.import.pinboard"
wallabag_import.producer.redis.pinboard:
class: Wallabag\ImportBundle\Redis\Producer
@@ -57,18 +51,13 @@ services:
wallabag_import.consumer.redis.pinboard:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
- - "@doctrine.orm.entity_manager"
- - "@wallabag_user.user_repository"
- - "@wallabag_import.pinboard.import"
- - "@event_dispatcher"
- - "@logger"
+ $import: '@Wallabag\ImportBundle\Import\PinboardImport'
# delicious
wallabag_import.queue.redis.delicious:
class: Simpleue\Queue\RedisQueue
arguments:
- - "@wallabag_core.redis.client"
- - "wallabag.import.delicious"
+ $queueName: "wallabag.import.delicious"
wallabag_import.producer.redis.delicious:
class: Wallabag\ImportBundle\Redis\Producer
@@ -78,18 +67,13 @@ services:
wallabag_import.consumer.redis.delicious:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
- - "@doctrine.orm.entity_manager"
- - "@wallabag_user.user_repository"
- - "@wallabag_import.delicious.import"
- - "@event_dispatcher"
- - "@logger"
+ $import: '@Wallabag\ImportBundle\Import\DeliciousImport'
# pocket
wallabag_import.queue.redis.pocket:
class: Simpleue\Queue\RedisQueue
arguments:
- - "@wallabag_core.redis.client"
- - "wallabag.import.pocket"
+ $queueName: "wallabag.import.pocket"
wallabag_import.producer.redis.pocket:
class: Wallabag\ImportBundle\Redis\Producer
@@ -99,18 +83,13 @@ services:
wallabag_import.consumer.redis.pocket:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
- - "@doctrine.orm.entity_manager"
- - "@wallabag_user.user_repository"
- - "@wallabag_import.pocket.import"
- - "@event_dispatcher"
- - "@logger"
+ $import: '@Wallabag\ImportBundle\Import\PocketImport'
# wallabag v1
wallabag_import.queue.redis.wallabag_v1:
class: Simpleue\Queue\RedisQueue
arguments:
- - "@wallabag_core.redis.client"
- - "wallabag.import.wallabag_v1"
+ $queueName: "wallabag.import.wallabag_v1"
wallabag_import.producer.redis.wallabag_v1:
class: Wallabag\ImportBundle\Redis\Producer
@@ -120,18 +99,13 @@ services:
wallabag_import.consumer.redis.wallabag_v1:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
- - "@doctrine.orm.entity_manager"
- - "@wallabag_user.user_repository"
- - "@wallabag_import.wallabag_v1.import"
- - "@event_dispatcher"
- - "@logger"
+ $import: '@Wallabag\ImportBundle\Import\WallabagV1Import'
# wallabag v2
wallabag_import.queue.redis.wallabag_v2:
class: Simpleue\Queue\RedisQueue
arguments:
- - "@wallabag_core.redis.client"
- - "wallabag.import.wallabag_v2"
+ $queueName: "wallabag.import.wallabag_v2"
wallabag_import.producer.redis.wallabag_v2:
class: Wallabag\ImportBundle\Redis\Producer
@@ -141,18 +115,13 @@ services:
wallabag_import.consumer.redis.wallabag_v2:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
- - "@doctrine.orm.entity_manager"
- - "@wallabag_user.user_repository"
- - "@wallabag_import.wallabag_v2.import"
- - "@event_dispatcher"
- - "@logger"
+ $import: '@Wallabag\ImportBundle\Import\WallabagV2Import'
# elcurator
wallabag_import.queue.redis.elcurator:
class: Simpleue\Queue\RedisQueue
arguments:
- - "@wallabag_core.redis.client"
- - "wallabag.import.elcurator"
+ $queueName: "wallabag.import.elcurator"
wallabag_import.producer.redis.elcurator:
class: Wallabag\ImportBundle\Redis\Producer
@@ -162,18 +131,13 @@ services:
wallabag_import.consumer.redis.elcurator:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
- - "@doctrine.orm.entity_manager"
- - "@wallabag_user.user_repository"
- - "@wallabag_import.elcurator.import"
- - "@event_dispatcher"
- - "@logger"
+ $import: '@Wallabag\ImportBundle\Import\ElcuratorImport'
# firefox
wallabag_import.queue.redis.firefox:
class: Simpleue\Queue\RedisQueue
arguments:
- - "@wallabag_core.redis.client"
- - "wallabag.import.firefox"
+ $queueName: "wallabag.import.firefox"
wallabag_import.producer.redis.firefox:
class: Wallabag\ImportBundle\Redis\Producer
@@ -183,18 +147,13 @@ services:
wallabag_import.consumer.redis.firefox:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
- - "@doctrine.orm.entity_manager"
- - "@wallabag_user.user_repository"
- - "@wallabag_import.firefox.import"
- - "@event_dispatcher"
- - "@logger"
+ $import: '@Wallabag\ImportBundle\Import\FirefoxImport'
# chrome
wallabag_import.queue.redis.chrome:
class: Simpleue\Queue\RedisQueue
arguments:
- - "@wallabag_core.redis.client"
- - "wallabag.import.chrome"
+ $queueName: "wallabag.import.chrome"
wallabag_import.producer.redis.chrome:
class: Wallabag\ImportBundle\Redis\Producer
@@ -204,8 +163,4 @@ services:
wallabag_import.consumer.redis.chrome:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
- - "@doctrine.orm.entity_manager"
- - "@wallabag_user.user_repository"
- - "@wallabag_import.chrome.import"
- - "@event_dispatcher"
- - "@logger"
+ $import: '@Wallabag\ImportBundle\Import\ChromeImport'
diff --git a/app/config/services_test.yml b/app/config/services_test.yml
index 1b3aff63e..5073b64b9 100644
--- a/app/config/services_test.yml
+++ b/app/config/services_test.yml
@@ -9,11 +9,11 @@ services:
public: true
wallabag_core.entry_repository.test:
- alias: wallabag_core.entry_repository
+ alias: Wallabag\CoreBundle\Repository\EntryRepository
public: true
wallabag_user.user_repository.test:
- alias: wallabag_user.user_repository
+ alias: Wallabag\UserBundle\Repository\UserRepository
public: true
filesystem_cache:
diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml
index 210c63e76..46977235e 100644
--- a/app/config/wallabag.yml
+++ b/app/config/wallabag.yml
@@ -41,10 +41,6 @@ wallabag_core:
name: share_public
value: 1
section: entry
- -
- name: carrot
- value: 1
- section: entry
-
name: share_diaspora
value: 1
@@ -65,18 +61,10 @@ wallabag_core:
name: share_shaarli
value: 1
section: entry
- -
- name: share_scuttle
- value: 1
- section: entry
-
name: shaarli_url
value: https://myshaarli.com
section: entry
- -
- name: scuttle_url
- value: https://scuttle.org
- section: entry
-
name: share_mail
value: 1
@@ -178,9 +166,6 @@ wallabag_core:
-
rule: _all ~ "https?://www\.lemonde\.fr/tiny.*"
-wallabag_user:
- registration_enabled: "%fosuser_registration%"
-
wallabag_import:
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv']
resource_dir: "%kernel.project_dir%/web/uploads/import"
diff --git a/app/config/webpack/common.js b/app/config/webpack/common.js
index ebca21009..cc16bafc3 100644
--- a/app/config/webpack/common.js
+++ b/app/config/webpack/common.js
@@ -7,7 +7,6 @@ const rootDir = path.resolve(__dirname, '../../../');
module.exports = {
entry: {
material: path.join(rootDir, './app/Resources/static/themes/material/index.js'),
- baggy: path.join(rootDir, './app/Resources/static/themes/baggy/index.js'),
public: path.join(rootDir, './app/Resources/static/themes/_global/share.js'),
},
output: {
diff --git a/bin/symfony_requirements b/bin/symfony_requirements
deleted file mode 100755
index a7bf65a1b..000000000
--- a/bin/symfony_requirements
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/usr/bin/env php
-getPhpIniConfigPath();
-
-echo_title('Symfony Requirements Checker');
-
-echo '> PHP is using the following php.ini file:'.PHP_EOL;
-if ($iniPath) {
- echo_style('green', ' '.$iniPath);
-} else {
- echo_style('yellow', ' WARNING: No configuration file (php.ini) used by PHP!');
-}
-
-echo PHP_EOL.PHP_EOL;
-
-echo '> Checking Symfony requirements:'.PHP_EOL.' ';
-
-$messages = array();
-foreach ($symfonyRequirements->getRequirements() as $req) {
- if ($helpText = get_error_message($req, $lineSize)) {
- echo_style('red', 'E');
- $messages['error'][] = $helpText;
- } else {
- echo_style('green', '.');
- }
-}
-
-$checkPassed = empty($messages['error']);
-
-foreach ($symfonyRequirements->getRecommendations() as $req) {
- if ($helpText = get_error_message($req, $lineSize)) {
- echo_style('yellow', 'W');
- $messages['warning'][] = $helpText;
- } else {
- echo_style('green', '.');
- }
-}
-
-if ($checkPassed) {
- echo_block('success', 'OK', 'Your system is ready to run Symfony projects');
-} else {
- echo_block('error', 'ERROR', 'Your system is not ready to run Symfony projects');
-
- echo_title('Fix the following mandatory requirements', 'red');
-
- foreach ($messages['error'] as $helpText) {
- echo ' * '.$helpText.PHP_EOL;
- }
-}
-
-if (!empty($messages['warning'])) {
- echo_title('Optional recommendations to improve your setup', 'yellow');
-
- foreach ($messages['warning'] as $helpText) {
- echo ' * '.$helpText.PHP_EOL;
- }
-}
-
-echo PHP_EOL;
-echo_style('title', 'Note');
-echo ' The command console could use a different php.ini file'.PHP_EOL;
-echo_style('title', '~~~~');
-echo ' than the one used with your web server. To be on the'.PHP_EOL;
-echo ' safe side, please check the requirements from your web'.PHP_EOL;
-echo ' server using the ';
-echo_style('yellow', 'web/config.php');
-echo ' script.'.PHP_EOL;
-echo PHP_EOL;
-
-exit($checkPassed ? 0 : 1);
-
-function get_error_message(Requirement $requirement, $lineSize)
-{
- if ($requirement->isFulfilled()) {
- return;
- }
-
- $errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL;
- $errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL;
-
- return $errorMessage;
-}
-
-function echo_title($title, $style = null)
-{
- $style = $style ?: 'title';
-
- echo PHP_EOL;
- echo_style($style, $title.PHP_EOL);
- echo_style($style, str_repeat('~', strlen($title)).PHP_EOL);
- echo PHP_EOL;
-}
-
-function echo_style($style, $message)
-{
- // ANSI color codes
- $styles = array(
- 'reset' => "\033[0m",
- 'red' => "\033[31m",
- 'green' => "\033[32m",
- 'yellow' => "\033[33m",
- 'error' => "\033[37;41m",
- 'success' => "\033[37;42m",
- 'title' => "\033[34m",
- );
- $supports = has_color_support();
-
- echo($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : '');
-}
-
-function echo_block($style, $title, $message)
-{
- $message = ' '.trim($message).' ';
- $width = strlen($message);
-
- echo PHP_EOL.PHP_EOL;
-
- echo_style($style, str_repeat(' ', $width));
- echo PHP_EOL;
- echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT));
- echo PHP_EOL;
- echo_style($style, $message);
- echo PHP_EOL;
- echo_style($style, str_repeat(' ', $width));
- echo PHP_EOL;
-}
-
-function has_color_support()
-{
- static $support;
-
- if (null === $support) {
- if (DIRECTORY_SEPARATOR == '\\') {
- $support = false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
- } else {
- $support = function_exists('posix_isatty') && @posix_isatty(STDOUT);
- }
- }
-
- return $support;
-}
diff --git a/composer.json b/composer.json
index 72f2fd76e..36d1b6739 100644
--- a/composer.json
+++ b/composer.json
@@ -37,6 +37,7 @@
"ext-ctype": "*",
"ext-curl": "*",
"ext-dom": "*",
+ "ext-filter": "*",
"ext-gd": "*",
"ext-hash": "*",
"ext-iconv": "*",
@@ -50,26 +51,34 @@
"ext-tidy": "*",
"ext-tokenizer": "*",
"ext-xml": "*",
- "composer": "< 2.3",
"babdev/pagerfanta-bundle": "^2.5",
"bdunogier/guzzle-site-authenticator": "^1.0.0",
"craue/config-bundle": "^2.3.0",
"defuse/php-encryption": "^2.1",
+ "doctrine/collections": "^1.6",
+ "doctrine/common": "^2.13",
+ "doctrine/dbal": "^2.13",
"doctrine/doctrine-bundle": "^1.9",
"doctrine/doctrine-cache-bundle": "^1.3",
"doctrine/doctrine-migrations-bundle": "^1.3",
+ "doctrine/event-manager": "^1.1",
+ "doctrine/migrations": "^1.8",
"doctrine/orm": "^2.6",
+ "doctrine/persistence": "^1.3",
"enshrined/svg-sanitize": "^0.15.4",
"friendsofsymfony/jsrouting-bundle": "^2.2",
"friendsofsymfony/oauth-server-bundle": "^1.5",
"friendsofsymfony/rest-bundle": "~2.1",
- "friendsofsymfony/user-bundle": "2.0.*",
+ "friendsofsymfony/user-bundle": "2.1.*",
"guzzlehttp/guzzle": "^5.3.1",
+ "guzzlehttp/psr7": "^1.8",
"html2text/html2text": "^4.1",
"incenteev/composer-parameter-handler": "^2.1",
"j0k3r/graby": "^2.0",
"javibravo/simpleue": "^2.0",
+ "jms/serializer": "^3.17",
"jms/serializer-bundle": "~3.6",
+ "kphoen/rulerz": "^0.21",
"kphoen/rulerz-bundle": "~0.13",
"laminas/laminas-code": "^3.4",
"laminas/laminas-diactoros": "^2.3",
@@ -81,31 +90,41 @@
"nelmio/cors-bundle": "~1.5",
"ocramius/proxy-manager": "^2.1.1",
"pagerfanta/pagerfanta": "^2.4",
+ "php-amqplib/php-amqplib": "^2.12",
"php-amqplib/rabbitmq-bundle": "^1.14",
+ "php-http/client-common": "^2.4",
+ "php-http/discovery": "^1.14",
"php-http/guzzle5-adapter": "^2.0",
+ "php-http/httplug": "^2.3",
"php-http/httplug-bundle": "^1.14",
+ "php-http/message": "^1.13",
+ "php-http/message-factory": "^1.0",
"pragmarx/recovery": "^0.2.0",
"predis/predis": "^1.1.3",
+ "psr/http-message": "^1.0",
+ "psr/log": "^1.1",
"scheb/two-factor-bundle": "^4.11.0",
- "sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^5.2",
"sentry/sentry-symfony": "3.5.3",
"stof/doctrine-extensions-bundle": "^1.2",
+ "swiftmailer/swiftmailer": "^6.3",
"symfony/dom-crawler": "^3.4",
"symfony/monolog-bundle": "^3.1",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/symfony": "3.4.*",
"tecnickcom/tcpdf": "^6.3.0",
"twig/extensions": "^1.5",
+ "twig/twig": "^2.15",
"wallabag/php-mobi": "~1.0",
"wallabag/phpepub": "^4.0.10",
+ "willdurand/hateoas": "^3.8",
"willdurand/hateoas-bundle": "~2.1"
},
"require-dev": {
"dama/doctrine-test-bundle": "^6.0",
"doctrine/doctrine-fixtures-bundle": "~3.0",
"friendsofphp/php-cs-fixer": "~2.13",
- "guzzlehttp/psr7": "^1.0",
+ "friendsoftwig/twigcs": "^4.1",
"m6web/redis-mock": "^5.0",
"php-http/mock-client": "^1.0",
"phpstan/extension-installer": "^1.0",
@@ -122,10 +141,8 @@
"scripts": {
"post-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
- "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
- "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
- "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
- "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
+ "bin/console cache:clear --no-warmup",
+ "bin/console assets:install web --symlink --relative"
],
"post-install-cmd": [
"@post-cmd"
@@ -135,12 +152,6 @@
]
},
"extra": {
- "symfony-app-dir": "app",
- "symfony-bin-dir": "bin",
- "symfony-var-dir": "var",
- "symfony-web-dir": "web",
- "symfony-tests-dir": "tests",
- "symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
}
diff --git a/composer.lock b/composer.lock
index 0a4605dc2..efc69dc87 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "5aec7c6af1a3c05510db2e1243da8db5",
+ "content-hash": "e01063964db1acb5dd93d6d0a8d309d8",
"packages": [
{
"name": "babdev/pagerfanta-bundle",
@@ -2549,26 +2549,27 @@
},
{
"name": "friendsofsymfony/user-bundle",
- "version": "v2.0.2",
+ "version": "v2.1.2",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfSymfony/FOSUserBundle.git",
- "reference": "2fc8a023d7ab482321cf7ec810ed49eab40eb50f"
+ "reference": "1049935edd24ec305cc6cfde1875372fa9600446"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/zipball/2fc8a023d7ab482321cf7ec810ed49eab40eb50f",
- "reference": "2fc8a023d7ab482321cf7ec810ed49eab40eb50f",
+ "url": "https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/zipball/1049935edd24ec305cc6cfde1875372fa9600446",
+ "reference": "1049935edd24ec305cc6cfde1875372fa9600446",
"shasum": ""
},
"require": {
"paragonie/random_compat": "^1 || ^2",
"php": "^5.5.9 || ^7.0",
- "symfony/form": "^2.7 || ^3.0",
- "symfony/framework-bundle": "^2.7 || ^3.0",
- "symfony/security-bundle": "^2.7 || ^3.0",
- "symfony/templating": "^2.7 || ^3.0",
- "symfony/twig-bundle": "^2.7 || ^3.0",
+ "symfony/form": "^2.8 || ^3.0 || ^4.0",
+ "symfony/framework-bundle": "^2.8 || ^3.0 || ^4.0",
+ "symfony/security-bundle": "^2.8 || ^3.0 || ^4.0",
+ "symfony/templating": "^2.8 || ^3.0 || ^4.0",
+ "symfony/twig-bundle": "^2.8 || ^3.0 || ^4.0",
+ "symfony/validator": "^2.8 || ^3.0 || ^4.0",
"twig/twig": "^1.28 || ^2.0"
},
"conflict": {
@@ -2577,18 +2578,17 @@
},
"require-dev": {
"doctrine/doctrine-bundle": "^1.3",
- "friendsofphp/php-cs-fixer": "^1.11",
- "phpunit/phpunit": "~4.8|~5.0",
+ "friendsofphp/php-cs-fixer": "^2.2",
+ "phpunit/phpunit": "^4.8.35|^5.7.11|^6.5",
"swiftmailer/swiftmailer": "^4.3 || ^5.0 || ^6.0",
- "symfony/console": "^2.7 || ^3.0",
- "symfony/phpunit-bridge": "^2.7 || ^3.0",
- "symfony/validator": "^2.7 || ^3.0",
- "symfony/yaml": "^2.7 || ^3.0"
+ "symfony/console": "^2.8 || ^3.0 || ^4.0",
+ "symfony/phpunit-bridge": "^2.8 || ^3.0 || ^4.0",
+ "symfony/yaml": "^2.8 || ^3.0 || ^4.0"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "2.1.x-dev"
}
},
"autoload": {
@@ -2613,8 +2613,7 @@
"homepage": "https://github.com/friendsofsymfony/FOSUserBundle/contributors"
},
{
- "name": "Thibault Duplessis",
- "email": "thibault.duplessis@gmail.com"
+ "name": "Thibault Duplessis"
}
],
"description": "Symfony FOSUserBundle",
@@ -2625,9 +2624,9 @@
"support": {
"docs": "https://symfony.com/doc/master/bundles/FOSUserBundle/index.html",
"issues": "https://github.com/FriendsOfSymfony/FOSUserBundle/issues",
- "source": "https://github.com/FriendsOfSymfony/FOSUserBundle/tree/2.0.x"
+ "source": "https://github.com/FriendsOfSymfony/FOSUserBundle/tree/v2.1.2"
},
- "time": "2017-11-29T17:01:21+00:00"
+ "time": "2018-03-08T08:59:27+00:00"
},
{
"name": "gedmo/doctrine-extensions",
@@ -4492,16 +4491,16 @@
},
{
"name": "j0k3r/graby-site-config",
- "version": "1.0.158",
+ "version": "1.0.159",
"source": {
"type": "git",
"url": "https://github.com/j0k3r/graby-site-config.git",
- "reference": "980c2aadf60f067f5eae34d10d3b194a91434394"
+ "reference": "e5bfb9d608f0ce6390d6791ede196c769216ee84"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/980c2aadf60f067f5eae34d10d3b194a91434394",
- "reference": "980c2aadf60f067f5eae34d10d3b194a91434394",
+ "url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/e5bfb9d608f0ce6390d6791ede196c769216ee84",
+ "reference": "e5bfb9d608f0ce6390d6791ede196c769216ee84",
"shasum": ""
},
"require": {
@@ -4530,9 +4529,9 @@
"description": "Graby site config files",
"support": {
"issues": "https://github.com/j0k3r/graby-site-config/issues",
- "source": "https://github.com/j0k3r/graby-site-config/tree/1.0.158"
+ "source": "https://github.com/j0k3r/graby-site-config/tree/1.0.159"
},
- "time": "2022-10-20T13:53:08+00:00"
+ "time": "2022-11-01T02:53:54+00:00"
},
{
"name": "j0k3r/httplug-ssrf-plugin",
@@ -7398,16 +7397,16 @@
},
{
"name": "phpseclib/phpseclib",
- "version": "3.0.16",
+ "version": "3.0.17",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
- "reference": "7181378909ed8890be4db53d289faac5b77f8b05"
+ "reference": "dbc2307d5c69aeb22db136c52e91130d7f2ca761"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/7181378909ed8890be4db53d289faac5b77f8b05",
- "reference": "7181378909ed8890be4db53d289faac5b77f8b05",
+ "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/dbc2307d5c69aeb22db136c52e91130d7f2ca761",
+ "reference": "dbc2307d5c69aeb22db136c52e91130d7f2ca761",
"shasum": ""
},
"require": {
@@ -7488,7 +7487,7 @@
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
- "source": "https://github.com/phpseclib/phpseclib/tree/3.0.16"
+ "source": "https://github.com/phpseclib/phpseclib/tree/3.0.17"
},
"funding": [
{
@@ -7504,20 +7503,20 @@
"type": "tidelift"
}
],
- "time": "2022-09-05T18:03:08+00:00"
+ "time": "2022-10-24T10:51:50+00:00"
},
{
"name": "phpstan/phpdoc-parser",
- "version": "1.12.0",
+ "version": "1.13.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
- "reference": "5f13698464773fa6f5392a9e311f81e23e9c3ba7"
+ "reference": "33aefcdab42900e36366d0feab6206e2dd68f947"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/5f13698464773fa6f5392a9e311f81e23e9c3ba7",
- "reference": "5f13698464773fa6f5392a9e311f81e23e9c3ba7",
+ "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/33aefcdab42900e36366d0feab6206e2dd68f947",
+ "reference": "33aefcdab42900e36366d0feab6206e2dd68f947",
"shasum": ""
},
"require": {
@@ -7547,9 +7546,9 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
- "source": "https://github.com/phpstan/phpdoc-parser/tree/1.12.0"
+ "source": "https://github.com/phpstan/phpdoc-parser/tree/1.13.0"
},
- "time": "2022-10-20T07:49:58+00:00"
+ "time": "2022-10-21T09:57:39+00:00"
},
{
"name": "phpzip/phpzip",
@@ -8421,63 +8420,6 @@
"abandoned": "scheb/2fa-bundle",
"time": "2020-10-30T19:24:18+00:00"
},
- {
- "name": "sensio/distribution-bundle",
- "version": "v5.0.25",
- "source": {
- "type": "git",
- "url": "https://github.com/sensiolabs/SensioDistributionBundle.git",
- "reference": "80a38234bde8321fb92aa0b8c27978a272bb4baf"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/80a38234bde8321fb92aa0b8c27978a272bb4baf",
- "reference": "80a38234bde8321fb92aa0b8c27978a272bb4baf",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.9",
- "sensiolabs/security-checker": "~5.0|~6.0",
- "symfony/class-loader": "~2.3|~3.0",
- "symfony/config": "~2.3|~3.0",
- "symfony/dependency-injection": "~2.3|~3.0",
- "symfony/filesystem": "~2.3|~3.0",
- "symfony/http-kernel": "~2.3|~3.0",
- "symfony/process": "~2.3|~3.0"
- },
- "type": "symfony-bundle",
- "extra": {
- "branch-alias": {
- "dev-master": "5.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Sensio\\Bundle\\DistributionBundle\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- }
- ],
- "description": "Base bundle for Symfony Distributions",
- "keywords": [
- "configuration",
- "distribution"
- ],
- "support": {
- "issues": "https://github.com/sensiolabs/SensioDistributionBundle/issues",
- "source": "https://github.com/sensiolabs/SensioDistributionBundle/tree/master"
- },
- "abandoned": true,
- "time": "2019-06-18T15:43:58+00:00"
- },
{
"name": "sensio/framework-extra-bundle",
"version": "v5.4.1",
@@ -8555,59 +8497,6 @@
},
"time": "2019-07-08T08:31:25+00:00"
},
- {
- "name": "sensiolabs/security-checker",
- "version": "v6.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sensiolabs/security-checker.git",
- "reference": "a576c01520d9761901f269c4934ba55448be4a54"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/a576c01520d9761901f269c4934ba55448be4a54",
- "reference": "a576c01520d9761901f269c4934ba55448be4a54",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1.3",
- "symfony/console": "^2.8|^3.4|^4.2|^5.0",
- "symfony/http-client": "^4.3|^5.0",
- "symfony/mime": "^4.3|^5.0",
- "symfony/polyfill-ctype": "^1.11"
- },
- "bin": [
- "security-checker"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "6.0-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "SensioLabs\\Security\\": "SensioLabs/Security"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien.potencier@gmail.com"
- }
- ],
- "description": "A security checker for your composer.lock",
- "support": {
- "issues": "https://github.com/sensiolabs/security-checker/issues",
- "source": "https://github.com/sensiolabs/security-checker/tree/master"
- },
- "abandoned": "https://github.com/fabpot/local-php-security-checker",
- "time": "2019-11-01T13:20:14+00:00"
- },
{
"name": "sentry/sdk",
"version": "2.2.0",
@@ -9277,16 +9166,16 @@
},
{
"name": "symfony/http-client",
- "version": "v5.4.14",
+ "version": "v5.4.15",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-client.git",
- "reference": "8a3929c814cba77db93de61c22759e0dbeaa4c87"
+ "reference": "8f29b0f06c9ff48c8431e78eb90c8bd6f82cb12b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-client/zipball/8a3929c814cba77db93de61c22759e0dbeaa4c87",
- "reference": "8a3929c814cba77db93de61c22759e0dbeaa4c87",
+ "url": "https://api.github.com/repos/symfony/http-client/zipball/8f29b0f06c9ff48c8431e78eb90c8bd6f82cb12b",
+ "reference": "8f29b0f06c9ff48c8431e78eb90c8bd6f82cb12b",
"shasum": ""
},
"require": {
@@ -9344,7 +9233,7 @@
"description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-client/tree/v5.4.14"
+ "source": "https://github.com/symfony/http-client/tree/v5.4.15"
},
"funding": [
{
@@ -9360,7 +9249,7 @@
"type": "tidelift"
}
],
- "time": "2022-10-11T15:16:01+00:00"
+ "time": "2022-10-25T16:22:13+00:00"
},
{
"name": "symfony/http-client-contracts",
@@ -9440,89 +9329,6 @@
],
"time": "2022-04-12T15:48:08+00:00"
},
- {
- "name": "symfony/mime",
- "version": "v5.4.13",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/mime.git",
- "reference": "bb2ccf759e2b967dcd11bdee5bdf30dddd2290bd"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/mime/zipball/bb2ccf759e2b967dcd11bdee5bdf30dddd2290bd",
- "reference": "bb2ccf759e2b967dcd11bdee5bdf30dddd2290bd",
- "shasum": ""
- },
- "require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/polyfill-intl-idn": "^1.10",
- "symfony/polyfill-mbstring": "^1.0",
- "symfony/polyfill-php80": "^1.16"
- },
- "conflict": {
- "egulias/email-validator": "~3.0.0",
- "phpdocumentor/reflection-docblock": "<3.2.2",
- "phpdocumentor/type-resolver": "<1.4.0",
- "symfony/mailer": "<4.4"
- },
- "require-dev": {
- "egulias/email-validator": "^2.1.10|^3.1",
- "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
- "symfony/dependency-injection": "^4.4|^5.0|^6.0",
- "symfony/property-access": "^4.4|^5.1|^6.0",
- "symfony/property-info": "^4.4|^5.1|^6.0",
- "symfony/serializer": "^5.2|^6.0"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Mime\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Allows manipulating MIME messages",
- "homepage": "https://symfony.com",
- "keywords": [
- "mime",
- "mime-type"
- ],
- "support": {
- "source": "https://github.com/symfony/mime/tree/v5.4.13"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2022-09-01T18:18:29+00:00"
- },
{
"name": "symfony/monolog-bundle",
"version": "v3.6.0",
@@ -12337,6 +12143,55 @@
],
"time": "2021-11-15T17:17:55+00:00"
},
+ {
+ "name": "friendsoftwig/twigcs",
+ "version": "v4.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/friendsoftwig/twigcs.git",
+ "reference": "ad7e235fe3cc7842b5919f109afaacc56bb3ff49"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/friendsoftwig/twigcs/zipball/ad7e235fe3cc7842b5919f109afaacc56bb3ff49",
+ "reference": "ad7e235fe3cc7842b5919f109afaacc56bb3ff49",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.0",
+ "symfony/console": "^3.4 || ^4.3 || ^5.0",
+ "symfony/filesystem": "^3.4 || ^4.3 || ^5.0",
+ "symfony/finder": "^3.4 || ^4.3 || ^5.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^6.5 || ^7.2"
+ },
+ "bin": [
+ "bin/twigcs"
+ ],
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "FriendsOfTwig\\Twigcs\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Tristan Maindron",
+ "email": "tmaindron@gmail.com"
+ }
+ ],
+ "description": "Checkstyle automation for Twig",
+ "support": {
+ "issues": "https://github.com/friendsoftwig/twigcs/issues",
+ "source": "https://github.com/friendsoftwig/twigcs/tree/v4.1.0"
+ },
+ "time": "2021-02-04T13:07:32+00:00"
+ },
{
"name": "m6web/redis-mock",
"version": "v5.3.0",
@@ -12613,16 +12468,16 @@
},
{
"name": "phpstan/phpstan",
- "version": "0.12.99",
+ "version": "0.12.100",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7"
+ "reference": "48236ddf823547081b2b153d1cd2994b784328c3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b4d40f1d759942f523be267a1bab6884f46ca3f7",
- "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/48236ddf823547081b2b153d1cd2994b784328c3",
+ "reference": "48236ddf823547081b2b153d1cd2994b784328c3",
"shasum": ""
},
"require": {
@@ -12653,7 +12508,7 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
- "source": "https://github.com/phpstan/phpstan/tree/0.12.99"
+ "source": "https://github.com/phpstan/phpstan/tree/0.12.100"
},
"funding": [
{
@@ -12664,16 +12519,12 @@
"url": "https://github.com/phpstan",
"type": "github"
},
- {
- "url": "https://www.patreon.com/phpstan",
- "type": "patreon"
- },
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
}
],
- "time": "2021-09-12T20:09:55+00:00"
+ "time": "2022-11-01T09:52:08+00:00"
},
{
"name": "phpstan/phpstan-doctrine",
@@ -13048,6 +12899,7 @@
"ext-ctype": "*",
"ext-curl": "*",
"ext-dom": "*",
+ "ext-filter": "*",
"ext-gd": "*",
"ext-hash": "*",
"ext-iconv": "*",
@@ -13060,12 +12912,11 @@
"ext-simplexml": "*",
"ext-tidy": "*",
"ext-tokenizer": "*",
- "ext-xml": "*",
- "composer": "< 2.3"
+ "ext-xml": "*"
},
"platform-dev": [],
"platform-overrides": {
"php": "7.4.29"
},
- "plugin-api-version": "2.2.0"
+ "plugin-api-version": "2.3.0"
}
diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile
index 67488d1fd..c22237266 100644
--- a/docker/php/Dockerfile
+++ b/docker/php/Dockerfile
@@ -65,7 +65,7 @@ RUN npm install -g yarn
RUN curl -L -o /usr/local/bin/envsubst https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m`; \
chmod +x /usr/local/bin/envsubst
-COPY --from=composer:2.2.12 /usr/bin/composer /usr/local/bin/composer
+COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
COPY entrypoint.sh /entrypoint.sh
COPY config/ /opt/wallabag/config/
diff --git a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php
index 883ce4a89..4bf51b5f2 100644
--- a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php
+++ b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php
@@ -2,8 +2,10 @@
namespace Wallabag\AnnotationBundle\Controller;
-use FOS\RestBundle\Controller\FOSRestController;
+use FOS\RestBundle\Controller\AbstractFOSRestController;
+use JMS\Serializer\SerializerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
+use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Wallabag\AnnotationBundle\Entity\Annotation;
@@ -11,7 +13,7 @@ use Wallabag\AnnotationBundle\Form\EditAnnotationType;
use Wallabag\AnnotationBundle\Form\NewAnnotationType;
use Wallabag\CoreBundle\Entity\Entry;
-class WallabagAnnotationController extends FOSRestController
+class WallabagAnnotationController extends AbstractFOSRestController
{
/**
* Retrieve annotations for an entry.
@@ -24,12 +26,12 @@ class WallabagAnnotationController extends FOSRestController
{
$annotationRows = $this
->getDoctrine()
- ->getRepository('WallabagAnnotationBundle:Annotation')
+ ->getRepository(Annotation::class)
->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
$total = \count($annotationRows);
$annotations = ['total' => $total, 'rows' => $annotationRows];
- $json = $this->get('jms_serializer')->serialize($annotations, 'json');
+ $json = $this->get(SerializerInterface::class)->serialize($annotations, 'json');
return (new JsonResponse())->setJson($json);
}
@@ -49,7 +51,7 @@ class WallabagAnnotationController extends FOSRestController
$annotation = new Annotation($this->getUser());
$annotation->setEntry($entry);
- $form = $this->get('form.factory')->createNamed('', NewAnnotationType::class, $annotation, [
+ $form = $this->get(FormFactoryInterface::class)->createNamed('', NewAnnotationType::class, $annotation, [
'csrf_protection' => false,
'allow_extra_fields' => true,
]);
@@ -59,7 +61,7 @@ class WallabagAnnotationController extends FOSRestController
$em->persist($annotation);
$em->flush();
- $json = $this->get('jms_serializer')->serialize($annotation, 'json');
+ $json = $this->get(SerializerInterface::class)->serialize($annotation, 'json');
return JsonResponse::fromJsonString($json);
}
@@ -72,7 +74,7 @@ class WallabagAnnotationController extends FOSRestController
*
* @see Wallabag\ApiBundle\Controller\WallabagRestController
*
- * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation")
+ * @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
*
* @return JsonResponse
*/
@@ -80,7 +82,7 @@ class WallabagAnnotationController extends FOSRestController
{
$data = json_decode($request->getContent(), true);
- $form = $this->get('form.factory')->createNamed('', EditAnnotationType::class, $annotation, [
+ $form = $this->get(FormFactoryInterface::class)->createNamed('', EditAnnotationType::class, $annotation, [
'csrf_protection' => false,
'allow_extra_fields' => true,
]);
@@ -91,7 +93,7 @@ class WallabagAnnotationController extends FOSRestController
$em->persist($annotation);
$em->flush();
- $json = $this->get('jms_serializer')->serialize($annotation, 'json');
+ $json = $this->get(SerializerInterface::class)->serialize($annotation, 'json');
return JsonResponse::fromJsonString($json);
}
@@ -104,7 +106,7 @@ class WallabagAnnotationController extends FOSRestController
*
* @see Wallabag\ApiBundle\Controller\WallabagRestController
*
- * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation")
+ * @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
*
* @return JsonResponse
*/
@@ -114,7 +116,7 @@ class WallabagAnnotationController extends FOSRestController
$em->remove($annotation);
$em->flush();
- $json = $this->get('jms_serializer')->serialize($annotation, 'json');
+ $json = $this->get(SerializerInterface::class)->serialize($annotation, 'json');
return (new JsonResponse())->setJson($json);
}
diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
index 0de5c934e..59c17e447 100644
--- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
+++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
@@ -2,15 +2,21 @@
namespace Wallabag\AnnotationBundle\Repository;
-use Doctrine\ORM\EntityRepository;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\QueryBuilder;
+use Doctrine\Persistence\ManagerRegistry;
use Wallabag\AnnotationBundle\Entity\Annotation;
/**
* AnnotationRepository.
*/
-class AnnotationRepository extends EntityRepository
+class AnnotationRepository extends ServiceEntityRepository
{
+ public function __construct(ManagerRegistry $registry)
+ {
+ parent::__construct($registry, Annotation::class);
+ }
+
/**
* Retrieves all annotations for a user.
*
diff --git a/src/Wallabag/AnnotationBundle/Resources/config/routing_annotations.yml b/src/Wallabag/AnnotationBundle/Resources/config/routing_annotations.yml
index 4f3a5c93b..ba076b9f4 100644
--- a/src/Wallabag/AnnotationBundle/Resources/config/routing_annotations.yml
+++ b/src/Wallabag/AnnotationBundle/Resources/config/routing_annotations.yml
@@ -1,4 +1,4 @@
annotations:
type: rest
- resource: "WallabagAnnotationBundle:WallabagAnnotation"
- name_prefix: annotations_
+ resource: 'Wallabag\AnnotationBundle\Controller\WallabagAnnotationController'
+ name_prefix: annotations_
diff --git a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php
index 66693189a..58c942d40 100644
--- a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php
@@ -26,7 +26,7 @@ class AnnotationRestController extends WallabagRestController
{
$this->validateAuthentication();
- return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:getAnnotations', [
+ return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::getAnnotationsAction', [
'entry' => $entry,
]);
}
@@ -48,7 +48,7 @@ class AnnotationRestController extends WallabagRestController
{
$this->validateAuthentication();
- return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:postAnnotation', [
+ return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::postAnnotationAction', [
'request' => $request,
'entry' => $entry,
]);
@@ -63,7 +63,7 @@ class AnnotationRestController extends WallabagRestController
* }
* )
*
- * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation")
+ * @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
*
* @return JsonResponse
*/
@@ -71,7 +71,7 @@ class AnnotationRestController extends WallabagRestController
{
$this->validateAuthentication();
- return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:putAnnotation', [
+ return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::putAnnotationAction', [
'annotation' => $annotation,
'request' => $request,
]);
@@ -86,7 +86,7 @@ class AnnotationRestController extends WallabagRestController
* }
* )
*
- * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation")
+ * @ParamConverter("annotation", class="Wallabag\AnnotationBundle\Entity\Annotation")
*
* @return JsonResponse
*/
@@ -94,7 +94,7 @@ class AnnotationRestController extends WallabagRestController
{
$this->validateAuthentication();
- return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:deleteAnnotation', [
+ return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::deleteAnnotationAction', [
'annotation' => $annotation,
]);
}
diff --git a/src/Wallabag/ApiBundle/Controller/ConfigRestController.php b/src/Wallabag/ApiBundle/Controller/ConfigRestController.php
index 134efd19d..24c26103e 100644
--- a/src/Wallabag/ApiBundle/Controller/ConfigRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/ConfigRestController.php
@@ -3,6 +3,7 @@
namespace Wallabag\ApiBundle\Controller;
use JMS\Serializer\SerializationContext;
+use JMS\Serializer\SerializerInterface;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -19,7 +20,7 @@ class ConfigRestController extends WallabagRestController
{
$this->validateAuthentication();
- $json = $this->get('jms_serializer')->serialize(
+ $json = $this->get(SerializerInterface::class)->serialize(
$this->getUser()->getConfig(),
'json',
SerializationContext::create()->setGroups(['config_api'])
diff --git a/src/Wallabag/ApiBundle/Controller/DeveloperController.php b/src/Wallabag/ApiBundle/Controller/DeveloperController.php
index 3224d7893..a8a67ad3a 100644
--- a/src/Wallabag/ApiBundle/Controller/DeveloperController.php
+++ b/src/Wallabag/ApiBundle/Controller/DeveloperController.php
@@ -3,8 +3,12 @@
namespace Wallabag\ApiBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route;
+use Symfony\Component\Translation\TranslatorInterface;
use Wallabag\ApiBundle\Entity\Client;
use Wallabag\ApiBundle\Form\Type\ClientType;
@@ -15,11 +19,11 @@ class DeveloperController extends Controller
*
* @Route("/developer", name="developer")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function indexAction()
{
- $clients = $this->getDoctrine()->getRepository('WallabagApiBundle:Client')->findByUser($this->getUser()->getId());
+ $clients = $this->getDoctrine()->getRepository(Client::class)->findByUser($this->getUser()->getId());
return $this->render('@WallabagCore/themes/common/Developer/index.html.twig', [
'clients' => $clients,
@@ -31,7 +35,7 @@ class DeveloperController extends Controller
*
* @Route("/developer/client/create", name="developer_create_client")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function createClientAction(Request $request)
{
@@ -45,9 +49,9 @@ class DeveloperController extends Controller
$em->persist($client);
$em->flush();
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
- $this->get('translator')->trans('flashes.developer.notice.client_created', ['%name%' => $client->getName()])
+ $this->get(TranslatorInterface::class)->trans('flashes.developer.notice.client_created', ['%name%' => $client->getName()])
);
return $this->render('@WallabagCore/themes/common/Developer/client_parameters.html.twig', [
@@ -67,7 +71,7 @@ class DeveloperController extends Controller
*
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client")
*
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * @return RedirectResponse
*/
public function deleteClientAction(Client $client)
{
@@ -79,9 +83,9 @@ class DeveloperController extends Controller
$em->remove($client);
$em->flush();
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
- $this->get('translator')->trans('flashes.developer.notice.client_deleted', ['%name%' => $client->getName()])
+ $this->get(TranslatorInterface::class)->trans('flashes.developer.notice.client_deleted', ['%name%' => $client->getName()])
);
return $this->redirect($this->generateUrl('developer'));
@@ -92,7 +96,7 @@ class DeveloperController extends Controller
*
* @Route("/developer/howto/first-app", name="developer_howto_firstapp")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function howtoFirstAppAction()
{
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
index 9b6aa1b9d..3b898368c 100644
--- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
@@ -5,6 +5,8 @@ namespace Wallabag\ApiBundle\Controller;
use Hateoas\Configuration\Route;
use Hateoas\Representation\Factory\PagerfantaFactory;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
+use Pagerfanta\Pagerfanta;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -14,7 +16,11 @@ use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Event\EntryDeletedEvent;
use Wallabag\CoreBundle\Event\EntrySavedEvent;
+use Wallabag\CoreBundle\Helper\ContentProxy;
+use Wallabag\CoreBundle\Helper\EntriesExport;
+use Wallabag\CoreBundle\Helper\TagsAssigner;
use Wallabag\CoreBundle\Helper\UrlHasher;
+use Wallabag\CoreBundle\Repository\EntryRepository;
class EntryRestController extends WallabagRestController
{
@@ -40,7 +46,7 @@ class EntryRestController extends WallabagRestController
public function getEntriesExistsAction(Request $request)
{
$this->validateAuthentication();
- $repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
+ $repo = $this->getDoctrine()->getRepository(Entry::class);
$returnId = (null === $request->query->get('return_id')) ? false : (bool) $request->query->get('return_id');
@@ -136,8 +142,8 @@ class EntryRestController extends WallabagRestController
$domainName = (null === $request->query->get('domain_name')) ? '' : (string) $request->query->get('domain_name');
try {
- /** @var \Pagerfanta\Pagerfanta $pager */
- $pager = $this->get('wallabag_core.entry_repository')->findEntries(
+ /** @var Pagerfanta $pager */
+ $pager = $this->get(EntryRepository::class)->findEntries(
$this->getUser()->getId(),
$isArchived,
$isStarred,
@@ -215,7 +221,7 @@ class EntryRestController extends WallabagRestController
$this->validateAuthentication();
$this->validateUserAccess($entry->getUser()->getId());
- return $this->get('wallabag_core.helper.entries_export')
+ return $this->get(EntriesExport::class)
->setEntries($entry)
->updateTitle('entry')
->updateAuthor('entry')
@@ -247,7 +253,7 @@ class EntryRestController extends WallabagRestController
// handle multiple urls
foreach ($urls as $key => $url) {
- $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
+ $entry = $this->get(EntryRepository::class)->findByUrlAndUserId(
$url,
$this->getUser()->getId()
);
@@ -256,7 +262,7 @@ class EntryRestController extends WallabagRestController
if (false !== $entry) {
// entry deleted, dispatch event about it!
- $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
+ $this->get(EventDispatcherInterface::class)->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
$em = $this->getDoctrine()->getManager();
$em->remove($entry);
@@ -301,7 +307,7 @@ class EntryRestController extends WallabagRestController
// handle multiple urls
foreach ($urls as $key => $url) {
- $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
+ $entry = $this->get(EntryRepository::class)->findByUrlAndUserId(
$url,
$this->getUser()->getId()
);
@@ -311,7 +317,7 @@ class EntryRestController extends WallabagRestController
if (false === $entry) {
$entry = new Entry($this->getUser());
- $this->get('wallabag_core.content_proxy')->updateEntry($entry, $url);
+ $this->get(ContentProxy::class)->updateEntry($entry, $url);
}
$em = $this->getDoctrine()->getManager();
@@ -321,7 +327,7 @@ class EntryRestController extends WallabagRestController
$results[$key]['entry'] = $entry instanceof Entry ? $entry->getId() : false;
// entry saved, dispatch event about it!
- $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
+ $this->get(EventDispatcherInterface::class)->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
}
return $this->sendResponse($results);
@@ -358,7 +364,7 @@ class EntryRestController extends WallabagRestController
$url = $request->request->get('url');
- $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
+ $entry = $this->get(EntryRepository::class)->findByUrlAndUserId(
$url,
$this->getUser()->getId()
);
@@ -371,7 +377,7 @@ class EntryRestController extends WallabagRestController
$data = $this->retrieveValueFromRequest($request);
try {
- $this->get('wallabag_core.content_proxy')->updateEntry(
+ $this->get(ContentProxy::class)->updateEntry(
$entry,
$entry->getUrl(),
[
@@ -401,7 +407,7 @@ class EntryRestController extends WallabagRestController
}
if (!empty($data['tags'])) {
- $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $data['tags']);
+ $this->get(TagsAssigner::class)->assignTagsToEntry($entry, $data['tags']);
}
if (!empty($data['origin_url'])) {
@@ -417,11 +423,11 @@ class EntryRestController extends WallabagRestController
}
if (empty($entry->getDomainName())) {
- $this->get('wallabag_core.content_proxy')->setEntryDomainName($entry);
+ $this->get(ContentProxy::class)->setEntryDomainName($entry);
}
if (empty($entry->getTitle())) {
- $this->get('wallabag_core.content_proxy')->setDefaultEntryTitle($entry);
+ $this->get(ContentProxy::class)->setDefaultEntryTitle($entry);
}
$em = $this->getDoctrine()->getManager();
@@ -429,7 +435,7 @@ class EntryRestController extends WallabagRestController
$em->flush();
// entry saved, dispatch event about it!
- $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
+ $this->get(EventDispatcherInterface::class)->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
return $this->sendResponse($entry);
}
@@ -463,7 +469,7 @@ class EntryRestController extends WallabagRestController
$this->validateAuthentication();
$this->validateUserAccess($entry->getUser()->getId());
- $contentProxy = $this->get('wallabag_core.content_proxy');
+ $contentProxy = $this->get(ContentProxy::class);
$data = $this->retrieveValueFromRequest($request);
@@ -518,7 +524,7 @@ class EntryRestController extends WallabagRestController
if (!empty($data['tags'])) {
$entry->removeAllTags();
- $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $data['tags']);
+ $this->get(TagsAssigner::class)->assignTagsToEntry($entry, $data['tags']);
}
if (null !== $data['isPublic']) {
@@ -534,11 +540,11 @@ class EntryRestController extends WallabagRestController
}
if (empty($entry->getDomainName())) {
- $this->get('wallabag_core.content_proxy')->setEntryDomainName($entry);
+ $this->get(ContentProxy::class)->setEntryDomainName($entry);
}
if (empty($entry->getTitle())) {
- $this->get('wallabag_core.content_proxy')->setDefaultEntryTitle($entry);
+ $this->get(ContentProxy::class)->setDefaultEntryTitle($entry);
}
$em = $this->getDoctrine()->getManager();
@@ -546,7 +552,7 @@ class EntryRestController extends WallabagRestController
$em->flush();
// entry saved, dispatch event about it!
- $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
+ $this->get(EventDispatcherInterface::class)->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
return $this->sendResponse($entry);
}
@@ -569,7 +575,7 @@ class EntryRestController extends WallabagRestController
$this->validateUserAccess($entry->getUser()->getId());
try {
- $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
+ $this->get(ContentProxy::class)->updateEntry($entry, $entry->getUrl());
} catch (\Exception $e) {
$this->get('logger')->error('Error while saving an entry', [
'exception' => $e,
@@ -589,7 +595,7 @@ class EntryRestController extends WallabagRestController
$em->flush();
// entry saved, dispatch event about it!
- $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
+ $this->get(EventDispatcherInterface::class)->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
return $this->sendResponse($entry);
}
@@ -627,7 +633,7 @@ class EntryRestController extends WallabagRestController
}
// entry deleted, dispatch event about it!
- $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
+ $this->get(EventDispatcherInterface::class)->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
$em = $this->getDoctrine()->getManager();
$em->remove($entry);
@@ -676,7 +682,7 @@ class EntryRestController extends WallabagRestController
$tags = $request->request->get('tags', '');
if (!empty($tags)) {
- $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
+ $this->get(TagsAssigner::class)->assignTagsToEntry($entry, $tags);
}
$em = $this->getDoctrine()->getManager();
@@ -736,7 +742,7 @@ class EntryRestController extends WallabagRestController
$results = [];
foreach ($list as $key => $element) {
- $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
+ $entry = $this->get(EntryRepository::class)->findByUrlAndUserId(
$element->url,
$this->getUser()->getId()
);
@@ -752,7 +758,7 @@ class EntryRestController extends WallabagRestController
$label = trim($label);
$tag = $this->getDoctrine()
- ->getRepository('WallabagCoreBundle:Tag')
+ ->getRepository(Tag::class)
->findOneByLabel($label);
if (false !== $tag) {
@@ -794,7 +800,7 @@ class EntryRestController extends WallabagRestController
// handle multiple urls
foreach ($list as $key => $element) {
- $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
+ $entry = $this->get(EntryRepository::class)->findByUrlAndUserId(
$element->url,
$this->getUser()->getId()
);
@@ -805,7 +811,7 @@ class EntryRestController extends WallabagRestController
$tags = $element->tags;
if (false !== $entry && !(empty($tags))) {
- $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
+ $this->get(TagsAssigner::class)->assignTagsToEntry($entry, $tags);
$em = $this->getDoctrine()->getManager();
$em->persist($entry);
diff --git a/src/Wallabag/ApiBundle/Controller/SearchRestController.php b/src/Wallabag/ApiBundle/Controller/SearchRestController.php
index 7b415ea24..54709f317 100644
--- a/src/Wallabag/ApiBundle/Controller/SearchRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/SearchRestController.php
@@ -9,6 +9,7 @@ use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter;
use Pagerfanta\Pagerfanta;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
+use Wallabag\CoreBundle\Repository\EntryRepository;
class SearchRestController extends WallabagRestController
{
@@ -33,7 +34,7 @@ class SearchRestController extends WallabagRestController
$page = (int) $request->query->get('page', 1);
$perPage = (int) $request->query->get('perPage', 30);
- $qb = $this->get('wallabag_core.entry_repository')
+ $qb = $this->get(EntryRepository::class)
->getBuilderForSearchByUser(
$this->getUser()->getId(),
$term,
diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php
index 1b9f3aea2..7e14e8d1c 100644
--- a/src/Wallabag/ApiBundle/Controller/TagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php
@@ -2,6 +2,7 @@
namespace Wallabag\ApiBundle\Controller;
+use JMS\Serializer\SerializerInterface;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
@@ -22,10 +23,10 @@ class TagRestController extends WallabagRestController
$this->validateAuthentication();
$tags = $this->getDoctrine()
- ->getRepository('WallabagCoreBundle:Tag')
+ ->getRepository(Tag::class)
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
- $json = $this->get('jms_serializer')->serialize($tags, 'json');
+ $json = $this->get(SerializerInterface::class)->serialize($tags, 'json');
return (new JsonResponse())->setJson($json);
}
@@ -46,7 +47,7 @@ class TagRestController extends WallabagRestController
$this->validateAuthentication();
$label = $request->get('tag', '');
- $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser([$label], $this->getUser()->getId());
+ $tags = $this->getDoctrine()->getRepository(Tag::class)->findByLabelsAndUser([$label], $this->getUser()->getId());
if (empty($tags)) {
throw $this->createNotFoundException('Tag not found');
@@ -55,12 +56,12 @@ class TagRestController extends WallabagRestController
$tag = $tags[0];
$this->getDoctrine()
- ->getRepository('WallabagCoreBundle:Entry')
+ ->getRepository(Entry::class)
->removeTag($this->getUser()->getId(), $tag);
$this->cleanOrphanTag($tag);
- $json = $this->get('jms_serializer')->serialize($tag, 'json');
+ $json = $this->get(SerializerInterface::class)->serialize($tag, 'json');
return (new JsonResponse())->setJson($json);
}
@@ -82,19 +83,19 @@ class TagRestController extends WallabagRestController
$tagsLabels = $request->get('tags', '');
- $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser(explode(',', $tagsLabels), $this->getUser()->getId());
+ $tags = $this->getDoctrine()->getRepository(Tag::class)->findByLabelsAndUser(explode(',', $tagsLabels), $this->getUser()->getId());
if (empty($tags)) {
throw $this->createNotFoundException('Tags not found');
}
$this->getDoctrine()
- ->getRepository('WallabagCoreBundle:Entry')
+ ->getRepository(Entry::class)
->removeTags($this->getUser()->getId(), $tags);
$this->cleanOrphanTag($tags);
- $json = $this->get('jms_serializer')->serialize($tags, 'json');
+ $json = $this->get(SerializerInterface::class)->serialize($tags, 'json');
return (new JsonResponse())->setJson($json);
}
@@ -114,19 +115,19 @@ class TagRestController extends WallabagRestController
{
$this->validateAuthentication();
- $tagFromDb = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser([$tag->getLabel()], $this->getUser()->getId());
+ $tagFromDb = $this->getDoctrine()->getRepository(Tag::class)->findByLabelsAndUser([$tag->getLabel()], $this->getUser()->getId());
if (empty($tagFromDb)) {
throw $this->createNotFoundException('Tag not found');
}
$this->getDoctrine()
- ->getRepository('WallabagCoreBundle:Entry')
+ ->getRepository(Entry::class)
->removeTag($this->getUser()->getId(), $tag);
$this->cleanOrphanTag($tag);
- $json = $this->get('jms_serializer')->serialize($tag, 'json');
+ $json = $this->get(SerializerInterface::class)->serialize($tag, 'json');
return (new JsonResponse())->setJson($json);
}
diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php
index 922ab7bbb..5d91cd582 100644
--- a/src/Wallabag/ApiBundle/Controller/UserRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php
@@ -2,14 +2,20 @@
namespace Wallabag\ApiBundle\Controller;
+use Craue\ConfigBundle\Util\Config;
use FOS\UserBundle\Event\UserEvent;
use FOS\UserBundle\FOSUserEvents;
+use FOS\UserBundle\Model\UserManagerInterface;
use JMS\Serializer\SerializationContext;
+use JMS\Serializer\SerializerInterface;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Translation\TranslatorInterface;
use Wallabag\ApiBundle\Entity\Client;
use Wallabag\UserBundle\Entity\User;
+use Wallabag\UserBundle\Form\NewUserType;
class UserRestController extends WallabagRestController
{
@@ -45,20 +51,20 @@ class UserRestController extends WallabagRestController
*/
public function putUserAction(Request $request)
{
- if (!$this->container->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) {
- $json = $this->get('jms_serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json');
+ if (!$this->container->getParameter('fosuser_registration') || !$this->get(Config::class)->get('api_user_registration')) {
+ $json = $this->get(SerializerInterface::class)->serialize(['error' => "Server doesn't allow registrations"], 'json');
return (new JsonResponse())
->setJson($json)
->setStatusCode(JsonResponse::HTTP_FORBIDDEN);
}
- $userManager = $this->get('fos_user.user_manager');
+ $userManager = $this->get(UserManagerInterface::class);
$user = $userManager->createUser();
// user will be disabled BY DEFAULT to avoid spamming account to be enabled
$user->setEnabled(false);
- $form = $this->createForm('Wallabag\UserBundle\Form\NewUserType', $user, [
+ $form = $this->createForm(NewUserType::class, $user, [
'csrf_protection' => false,
]);
@@ -92,7 +98,7 @@ class UserRestController extends WallabagRestController
$errors['password'] = $this->translateErrors($data['plainPassword']['children']['first']['errors']);
}
- $json = $this->get('jms_serializer')->serialize(['error' => $errors], 'json');
+ $json = $this->get(SerializerInterface::class)->serialize(['error' => $errors], 'json');
return (new JsonResponse())
->setJson($json)
@@ -111,7 +117,7 @@ class UserRestController extends WallabagRestController
// dispatch a created event so the associated config will be created
$event = new UserEvent($user, $request);
- $this->get('event_dispatcher')->dispatch(FOSUserEvents::USER_CREATED, $event);
+ $this->get(EventDispatcherInterface::class)->dispatch(FOSUserEvents::USER_CREATED, $event);
return $this->sendUser($user, 'user_api_with_client', JsonResponse::HTTP_CREATED);
}
@@ -126,7 +132,7 @@ class UserRestController extends WallabagRestController
*/
private function sendUser(User $user, $group = 'user_api', $status = JsonResponse::HTTP_OK)
{
- $json = $this->get('jms_serializer')->serialize(
+ $json = $this->get(SerializerInterface::class)->serialize(
$user,
'json',
SerializationContext::create()->setGroups([$group])
@@ -148,7 +154,7 @@ class UserRestController extends WallabagRestController
{
$translatedErrors = [];
foreach ($errors as $error) {
- $translatedErrors[] = $this->get('translator')->trans($error);
+ $translatedErrors[] = $this->get(TranslatorInterface::class)->trans($error);
}
return $translatedErrors;
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
index 44fd96835..5ac85d39a 100644
--- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
@@ -4,8 +4,11 @@ namespace Wallabag\ApiBundle\Controller;
use FOS\RestBundle\Controller\AbstractFOSRestController;
use JMS\Serializer\SerializationContext;
+use JMS\Serializer\SerializerInterface;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Symfony\Component\HttpFoundation\JsonResponse;
+use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
+use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
class WallabagRestController extends AbstractFOSRestController
@@ -22,7 +25,7 @@ class WallabagRestController extends AbstractFOSRestController
public function getVersionAction()
{
$version = $this->container->getParameter('wallabag_core.version');
- $json = $this->get('jms_serializer')->serialize($version, 'json');
+ $json = $this->get(SerializerInterface::class)->serialize($version, 'json');
return (new JsonResponse())->setJson($json);
}
@@ -39,15 +42,15 @@ class WallabagRestController extends AbstractFOSRestController
$info = [
'appname' => 'wallabag',
'version' => $this->container->getParameter('wallabag_core.version'),
- 'allowed_registration' => $this->container->getParameter('wallabag_user.registration_enabled'),
+ 'allowed_registration' => $this->container->getParameter('fosuser_registration'),
];
- return (new JsonResponse())->setJson($this->get('jms_serializer')->serialize($info, 'json'));
+ return (new JsonResponse())->setJson($this->get(SerializerInterface::class)->serialize($info, 'json'));
}
protected function validateAuthentication()
{
- if (false === $this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) {
+ if (false === $this->get(AuthorizationCheckerInterface::class)->isGranted('IS_AUTHENTICATED_FULLY')) {
throw new AccessDeniedException();
}
}
@@ -60,7 +63,7 @@ class WallabagRestController extends AbstractFOSRestController
*/
protected function validateUserAccess($requestUserId)
{
- $user = $this->get('security.token_storage')->getToken()->getUser();
+ $user = $this->get(TokenStorageInterface::class)->getToken()->getUser();
if ($requestUserId !== $user->getId()) {
throw $this->createAccessDeniedException('Access forbidden. Entry user id: ' . $requestUserId . ', logged user id: ' . $user->getId());
}
@@ -79,7 +82,7 @@ class WallabagRestController extends AbstractFOSRestController
$context = new SerializationContext();
$context->setSerializeNull(true);
- $json = $this->get('jms_serializer')->serialize($data, 'json', $context);
+ $json = $this->get(SerializerInterface::class)->serialize($data, 'json', $context);
return (new JsonResponse())->setJson($json);
}
diff --git a/src/Wallabag/ApiBundle/Form/Type/ClientType.php b/src/Wallabag/ApiBundle/Form/Type/ClientType.php
index 14dc5c44f..3d00b2ac8 100644
--- a/src/Wallabag/ApiBundle/Form/Type/ClientType.php
+++ b/src/Wallabag/ApiBundle/Form/Type/ClientType.php
@@ -9,6 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Wallabag\ApiBundle\Entity\Client;
class ClientType extends AbstractType
{
@@ -40,7 +41,7 @@ class ClientType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\ApiBundle\Entity\Client',
+ 'data_class' => Client::class,
]);
}
diff --git a/src/Wallabag/ApiBundle/Repository/ClientRepository.php b/src/Wallabag/ApiBundle/Repository/ClientRepository.php
index fc14262e2..1c00e1645 100644
--- a/src/Wallabag/ApiBundle/Repository/ClientRepository.php
+++ b/src/Wallabag/ApiBundle/Repository/ClientRepository.php
@@ -2,10 +2,17 @@
namespace Wallabag\ApiBundle\Repository;
-use Doctrine\ORM\EntityRepository;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
+use Doctrine\Persistence\ManagerRegistry;
+use Wallabag\ApiBundle\Entity\Client;
-class ClientRepository extends EntityRepository
+class ClientRepository extends ServiceEntityRepository
{
+ public function __construct(ManagerRegistry $registry)
+ {
+ parent::__construct($registry, Client::class);
+ }
+
public function findOneBy(array $criteria, array $orderBy = null)
{
if (!empty($criteria['id'])) {
diff --git a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml
index 7785d25f2..de592c217 100644
--- a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml
+++ b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml
@@ -1,39 +1,39 @@
entry:
type: rest
- resource: "WallabagApiBundle:EntryRest"
+ resource: 'Wallabag\ApiBundle\Controller\EntryRestController'
name_prefix: api_
search:
type: rest
- resource: "WallabagApiBundle:SearchRest"
+ resource: 'Wallabag\ApiBundle\Controller\SearchRestController'
name_prefix: api_
tag:
type: rest
- resource: "WallabagApiBundle:TagRest"
+ resource: 'Wallabag\ApiBundle\Controller\TagRestController'
name_prefix: api_
tagging_rule:
type: rest
- resource: "WallabagApiBundle:TaggingRuleRest"
+ resource: 'Wallabag\ApiBundle\Controller\TaggingRuleRestController'
name_prefix: api_
annotation:
type: rest
- resource: "WallabagApiBundle:AnnotationRest"
+ resource: 'Wallabag\ApiBundle\Controller\AnnotationRestController'
name_prefix: api_
misc:
type: rest
- resource: "WallabagApiBundle:WallabagRest"
+ resource: 'Wallabag\ApiBundle\Controller\WallabagRestController'
name_prefix: api_
user:
type: rest
- resource: "WallabagApiBundle:UserRest"
+ resource: 'Wallabag\ApiBundle\Controller\UserRestController'
name_prefix: api_
config:
type: rest
- resource: "WallabagApiBundle:ConfigRest"
+ resource: 'Wallabag\ApiBundle\Controller\ConfigRestController'
name_prefix: api_
diff --git a/src/Wallabag/CoreBundle/Command/CleanDownloadedImagesCommand.php b/src/Wallabag/CoreBundle/Command/CleanDownloadedImagesCommand.php
index d81becdc3..90af26cb0 100644
--- a/src/Wallabag/CoreBundle/Command/CleanDownloadedImagesCommand.php
+++ b/src/Wallabag/CoreBundle/Command/CleanDownloadedImagesCommand.php
@@ -8,6 +8,8 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Finder\Finder;
+use Wallabag\CoreBundle\Helper\DownloadImages;
+use Wallabag\CoreBundle\Repository\EntryRepository;
class CleanDownloadedImagesCommand extends ContainerAwareCommand
{
@@ -34,7 +36,7 @@ class CleanDownloadedImagesCommand extends ContainerAwareCommand
$io->text('Dry run mode
enabled (no images will be removed)');
}
- $downloadImages = $this->getContainer()->get('wallabag_core.entry.download_images');
+ $downloadImages = $this->getContainer()->get(DownloadImages::class);
$baseFolder = $downloadImages->getBaseFolder();
$io->text('Retrieve existing images');
@@ -56,7 +58,7 @@ class CleanDownloadedImagesCommand extends ContainerAwareCommand
$io->text('Retrieve valid folders attached to a user');
- $entries = $this->getContainer()->get('wallabag_core.entry_repository')->findAllEntriesIdByUserId();
+ $entries = $this->getContainer()->get(EntryRepository::class)->findAllEntriesIdByUserId();
// retrieve _valid_ folders from existing entries
$validPaths = [];
diff --git a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
index 64b91520a..5af642dd8 100644
--- a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
+++ b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
@@ -2,6 +2,7 @@
namespace Wallabag\CoreBundle\Command;
+use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\NoResultException;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
@@ -9,7 +10,9 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Wallabag\CoreBundle\Entity\Entry;
+use Wallabag\CoreBundle\Repository\EntryRepository;
use Wallabag\UserBundle\Entity\User;
+use Wallabag\UserBundle\Repository\UserRepository;
class CleanDuplicatesCommand extends ContainerAwareCommand
{
@@ -49,7 +52,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
$this->io->success('Finished cleaning.');
} else {
- $users = $this->getContainer()->get('wallabag_user.user_repository')->findAll();
+ $users = $this->getContainer()->get(UserRepository::class)->findAll();
$this->io->text(sprintf('Cleaning through
%d user accounts', \count($users)));
@@ -65,8 +68,8 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
private function cleanDuplicates(User $user)
{
- $em = $this->getContainer()->get('doctrine.orm.entity_manager');
- $repo = $this->getContainer()->get('wallabag_core.entry_repository');
+ $em = $this->getContainer()->get(EntityManagerInterface::class);
+ $repo = $this->getContainer()->get(EntryRepository::class);
$entries = $repo->findAllEntriesIdAndUrlByUserId($user->getId());
@@ -105,10 +108,10 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
*
* @param string $username
*
- * @return \Wallabag\UserBundle\Entity\User
+ * @return User
*/
private function getUser($username)
{
- return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username);
+ return $this->getContainer()->get(UserRepository::class)->findOneByUserName($username);
}
}
diff --git a/src/Wallabag/CoreBundle/Command/ExportCommand.php b/src/Wallabag/CoreBundle/Command/ExportCommand.php
index 128f9d65b..a24a7ce2e 100644
--- a/src/Wallabag/CoreBundle/Command/ExportCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ExportCommand.php
@@ -8,6 +8,9 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
+use Wallabag\CoreBundle\Helper\EntriesExport;
+use Wallabag\CoreBundle\Repository\EntryRepository;
+use Wallabag\UserBundle\Repository\UserRepository;
class ExportCommand extends ContainerAwareCommand
{
@@ -35,14 +38,14 @@ class ExportCommand extends ContainerAwareCommand
$io = new SymfonyStyle($input, $output);
try {
- $user = $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($input->getArgument('username'));
+ $user = $this->getContainer()->get(UserRepository::class)->findOneByUserName($input->getArgument('username'));
} catch (NoResultException $e) {
$io->error(sprintf('User "%s" not found.', $input->getArgument('username')));
return 1;
}
- $entries = $this->getContainer()->get('wallabag_core.entry_repository')
+ $entries = $this->getContainer()->get(EntryRepository::class)
->getBuilderForAllByUser($user->getId())
->getQuery()
->getResult();
@@ -56,7 +59,7 @@ class ExportCommand extends ContainerAwareCommand
}
try {
- $data = $this->getContainer()->get('wallabag_core.helper.entries_export')
+ $data = $this->getContainer()->get(EntriesExport::class)
->setEntries($entries)
->updateTitle('All')
->updateAuthor('All')
diff --git a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php
index f870059bb..1d0fa3031 100644
--- a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php
+++ b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php
@@ -2,11 +2,14 @@
namespace Wallabag\CoreBundle\Command;
+use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\NoResultException;
+use Doctrine\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
+use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Helper\UrlHasher;
use Wallabag\UserBundle\Entity\User;
@@ -40,7 +43,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
return 1;
}
} else {
- $users = $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findAll();
+ $users = $this->getDoctrine()->getRepository(User::class)->findAll();
$output->writeln(sprintf('Generating hashed urls for "%d" users', \count($users)));
@@ -56,8 +59,8 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
private function generateHashedUrls(User $user)
{
- $em = $this->getContainer()->get('doctrine.orm.entity_manager');
- $repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
+ $em = $this->getContainer()->get(EntityManagerInterface::class);
+ $repo = $this->getDoctrine()->getRepository(Entry::class);
$entries = $repo->findByEmptyHashedUrlAndUserId($user->getId());
@@ -86,11 +89,11 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
*/
private function getUser($username)
{
- return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username);
+ return $this->getDoctrine()->getRepository(User::class)->findOneByUserName($username);
}
private function getDoctrine()
{
- return $this->getContainer()->get('doctrine');
+ return $this->getContainer()->get(ManagerRegistry::class);
}
}
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 8d08187a9..1dafde40d 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -2,8 +2,13 @@
namespace Wallabag\CoreBundle\Command;
+use Doctrine\DBAL\Connection;
+use Doctrine\DBAL\Exception\DriverException;
+use Doctrine\ORM\EntityManagerInterface;
+use Doctrine\Persistence\ManagerRegistry;
use FOS\UserBundle\Event\UserEvent;
use FOS\UserBundle\FOSUserEvents;
+use FOS\UserBundle\Model\UserManagerInterface;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
@@ -12,6 +17,7 @@ use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
use Wallabag\CoreBundle\Entity\InternalSetting;
@@ -20,21 +26,28 @@ class InstallCommand extends ContainerAwareCommand
/**
* @var InputInterface
*/
- protected $defaultInput;
+ private $defaultInput;
/**
* @var SymfonyStyle
*/
- protected $io;
+ private $io;
/**
* @var array
*/
- protected $functionExists = [
+ private $functionExists = [
'curl_exec',
'curl_multi_init',
];
+ private bool $runOtherCommands = true;
+
+ public function disableRunOtherCommands(): void
+ {
+ $this->runOtherCommands = false;
+ }
+
protected function configure()
{
$this
@@ -68,11 +81,11 @@ class InstallCommand extends ContainerAwareCommand
$this->io->success('You can now configure your web server, see https://doc.wallabag.org');
}
- protected function checkRequirements()
+ private function checkRequirements()
{
$this->io->section('Step 1 of 4: Checking system requirements.');
- $doctrineManager = $this->getContainer()->get('doctrine')->getManager();
+ $doctrineManager = $this->getContainer()->get(ManagerRegistry::class)->getManager();
$rows = [];
@@ -95,7 +108,7 @@ class InstallCommand extends ContainerAwareCommand
$status = '
OK! ';
$help = '';
- $conn = $this->getContainer()->get('doctrine')->getManager()->getConnection();
+ $conn = $this->getContainer()->get(ManagerRegistry::class)->getManager()->getConnection();
try {
$conn->connect();
@@ -168,7 +181,7 @@ class InstallCommand extends ContainerAwareCommand
return $this;
}
- protected function setupDatabase()
+ private function setupDatabase()
{
$this->io->section('Step 2 of 4: Setting up database.');
@@ -236,7 +249,7 @@ class InstallCommand extends ContainerAwareCommand
return $this;
}
- protected function setupAdmin()
+ private function setupAdmin()
{
$this->io->section('Step 3 of 4: Administration setup.');
@@ -244,9 +257,9 @@ class InstallCommand extends ContainerAwareCommand
return $this;
}
- $em = $this->getContainer()->get('doctrine.orm.entity_manager');
+ $em = $this->getContainer()->get(EntityManagerInterface::class);
- $userManager = $this->getContainer()->get('fos_user.user_manager');
+ $userManager = $this->getContainer()->get(UserManagerInterface::class);
$user = $userManager->createUser();
$user->setUsername($this->io->ask('Username', 'wallabag'));
@@ -264,21 +277,21 @@ class InstallCommand extends ContainerAwareCommand
// dispatch a created event so the associated config will be created
$event = new UserEvent($user);
- $this->getContainer()->get('event_dispatcher')->dispatch(FOSUserEvents::USER_CREATED, $event);
+ $this->getContainer()->get(EventDispatcherInterface::class)->dispatch(FOSUserEvents::USER_CREATED, $event);
$this->io->text('
Administration successfully setup. ');
return $this;
}
- protected function setupConfig()
+ private function setupConfig()
{
$this->io->section('Step 4 of 4: Config setup.');
- $em = $this->getContainer()->get('doctrine.orm.entity_manager');
+ $em = $this->getContainer()->get(EntityManagerInterface::class);
// cleanup before insert new stuff
- $em->createQuery('DELETE FROM WallabagCoreBundle:InternalSetting')->execute();
- $em->createQuery('DELETE FROM WallabagCoreBundle:IgnoreOriginInstanceRule')->execute();
+ $em->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\InternalSetting')->execute();
+ $em->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule')->execute();
foreach ($this->getContainer()->getParameter('wallabag_core.default_internal_settings') as $setting) {
$newSetting = new InternalSetting();
@@ -307,8 +320,12 @@ class InstallCommand extends ContainerAwareCommand
* @param string $command
* @param array $parameters Parameters to this command (usually 'force' => true)
*/
- protected function runCommand($command, $parameters = [])
+ private function runCommand($command, $parameters = [])
{
+ if (!$this->runOtherCommands) {
+ return $this;
+ }
+
$parameters = array_merge(
['command' => $command],
$parameters,
@@ -329,7 +346,7 @@ class InstallCommand extends ContainerAwareCommand
// PDO does not always close the connection after Doctrine commands.
// See https://github.com/symfony/symfony/issues/11750.
- $this->getContainer()->get('doctrine')->getManager()->getConnection()->close();
+ $this->getContainer()->get(ManagerRegistry::class)->getManager()->getConnection()->close();
if (0 !== $exitCode) {
$this->getApplication()->setAutoExit(true);
@@ -347,7 +364,7 @@ class InstallCommand extends ContainerAwareCommand
*/
private function isDatabasePresent()
{
- $connection = $this->getContainer()->get('doctrine')->getManager()->getConnection();
+ $connection = $this->getContainer()->get(ManagerRegistry::class)->getManager()->getConnection();
$databaseName = $connection->getDatabase();
try {
@@ -368,7 +385,7 @@ class InstallCommand extends ContainerAwareCommand
// custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite
if ('sqlite' === $schemaManager->getDatabasePlatform()->getName()) {
- $params = $this->getContainer()->get('doctrine.dbal.default_connection')->getParams();
+ $params = $this->getContainer()->get(Connection::class)->getParams();
if (isset($params['path']) && file_exists($params['path'])) {
return true;
@@ -379,7 +396,7 @@ class InstallCommand extends ContainerAwareCommand
try {
return \in_array($databaseName, $schemaManager->listDatabases(), true);
- } catch (\Doctrine\DBAL\Exception\DriverException $e) {
+ } catch (DriverException $e) {
// it means we weren't able to get database list, assume the database doesn't exist
return false;
@@ -394,7 +411,7 @@ class InstallCommand extends ContainerAwareCommand
*/
private function isSchemaPresent()
{
- $schemaManager = $this->getContainer()->get('doctrine')->getManager()->getConnection()->getSchemaManager();
+ $schemaManager = $this->getContainer()->get(ManagerRegistry::class)->getManager()->getConnection()->getSchemaManager();
return \count($schemaManager->listTableNames()) > 0 ? true : false;
}
diff --git a/src/Wallabag/CoreBundle/Command/ListUserCommand.php b/src/Wallabag/CoreBundle/Command/ListUserCommand.php
index a7101a020..d26fba30c 100644
--- a/src/Wallabag/CoreBundle/Command/ListUserCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ListUserCommand.php
@@ -8,6 +8,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
+use Wallabag\UserBundle\Repository\UserRepository;
class ListUserCommand extends ContainerAwareCommand
{
@@ -26,13 +27,13 @@ class ListUserCommand extends ContainerAwareCommand
{
$io = new SymfonyStyle($input, $output);
- $users = $this->getContainer()->get('wallabag_user.user_repository')
+ $users = $this->getContainer()->get(UserRepository::class)
->getQueryBuilderForSearch($input->getArgument('search'))
->setMaxResults($input->getOption('limit'))
->getQuery()
->getResult();
- $nbUsers = $this->getContainer()->get('wallabag_user.user_repository')
+ $nbUsers = $this->getContainer()->get(UserRepository::class)
->getSumUsers();
$rows = [];
diff --git a/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php b/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php
index 10918872f..e02aa7218 100644
--- a/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php
@@ -3,12 +3,17 @@
namespace Wallabag\CoreBundle\Command;
use Doctrine\ORM\NoResultException;
+use Doctrine\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Wallabag\CoreBundle\Event\EntrySavedEvent;
+use Wallabag\CoreBundle\Helper\ContentProxy;
+use Wallabag\CoreBundle\Repository\EntryRepository;
+use Wallabag\UserBundle\Repository\UserRepository;
class ReloadEntryCommand extends ContainerAwareCommand
{
@@ -30,7 +35,7 @@ class ReloadEntryCommand extends ContainerAwareCommand
if ($username = $input->getArgument('username')) {
try {
$userId = $this->getContainer()
- ->get('wallabag_user.user_repository')
+ ->get(UserRepository::class)
->findOneByUserName($username)
->getId();
} catch (NoResultException $e) {
@@ -40,7 +45,7 @@ class ReloadEntryCommand extends ContainerAwareCommand
}
}
- $entryRepository = $this->getContainer()->get('wallabag_core.entry_repository');
+ $entryRepository = $this->getContainer()->get(EntryRepository::class);
$entryIds = $entryRepository->findAllEntriesIdByUserId($userId);
$nbEntries = \count($entryIds);
@@ -63,9 +68,9 @@ class ReloadEntryCommand extends ContainerAwareCommand
$progressBar = $io->createProgressBar($nbEntries);
- $contentProxy = $this->getContainer()->get('wallabag_core.content_proxy');
- $em = $this->getContainer()->get('doctrine')->getManager();
- $dispatcher = $this->getContainer()->get('event_dispatcher');
+ $contentProxy = $this->getContainer()->get(ContentProxy::class);
+ $em = $this->getContainer()->get(ManagerRegistry::class)->getManager();
+ $dispatcher = $this->getContainer()->get(EventDispatcherInterface::class);
$progressBar->start();
foreach ($entryIds as $entryId) {
diff --git a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php
index 87bccf718..f982db734 100644
--- a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php
@@ -9,6 +9,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Wallabag\UserBundle\Entity\User;
+use Wallabag\UserBundle\Repository\UserRepository;
class ShowUserCommand extends ContainerAwareCommand
{
@@ -64,10 +65,10 @@ class ShowUserCommand extends ContainerAwareCommand
*
* @param string $username
*
- * @return \Wallabag\UserBundle\Entity\User
+ * @return User
*/
private function getUser($username)
{
- return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username);
+ return $this->getContainer()->get(UserRepository::class)->findOneByUserName($username);
}
}
diff --git a/src/Wallabag/CoreBundle/Command/TagAllCommand.php b/src/Wallabag/CoreBundle/Command/TagAllCommand.php
index 666654c02..66eb2a36a 100644
--- a/src/Wallabag/CoreBundle/Command/TagAllCommand.php
+++ b/src/Wallabag/CoreBundle/Command/TagAllCommand.php
@@ -3,11 +3,15 @@
namespace Wallabag\CoreBundle\Command;
use Doctrine\ORM\NoResultException;
+use Doctrine\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
+use Wallabag\CoreBundle\Helper\RuleBasedTagger;
+use Wallabag\UserBundle\Entity\User;
+use Wallabag\UserBundle\Repository\UserRepository;
class TagAllCommand extends ContainerAwareCommand
{
@@ -35,7 +39,7 @@ class TagAllCommand extends ContainerAwareCommand
return 1;
}
- $tagger = $this->getContainer()->get('wallabag_core.rule_based_tagger');
+ $tagger = $this->getContainer()->get(RuleBasedTagger::class);
$io->text(sprintf('Tagging entries for user
%s ...', $user->getUserName()));
@@ -59,15 +63,15 @@ class TagAllCommand extends ContainerAwareCommand
*
* @param string $username
*
- * @return \Wallabag\UserBundle\Entity\User
+ * @return User
*/
private function getUser($username)
{
- return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username);
+ return $this->getContainer()->get(UserRepository::class)->findOneByUserName($username);
}
private function getDoctrine()
{
- return $this->getContainer()->get('doctrine');
+ return $this->getContainer()->get(ManagerRegistry::class);
}
}
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 5841f4da7..2db7dd93f 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -2,9 +2,15 @@
namespace Wallabag\CoreBundle\Controller;
+use Craue\ConfigBundle\Util\Config;
+use Doctrine\DBAL\Platforms\SqlitePlatform;
+use Doctrine\Persistence\ManagerRegistry;
+use FOS\UserBundle\Model\UserManagerInterface;
use JMS\Serializer\SerializationContext;
use JMS\Serializer\SerializerBuilder;
+use Liip\ThemeBundle\ActiveTheme;
use PragmaRX\Recovery\Recovery as BackupCodes;
+use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -12,8 +18,11 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\Routing\Annotation\Route;
+use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
-use Wallabag\CoreBundle\Entity\Config;
+use Symfony\Component\Validator\Validator\ValidatorInterface;
+use Wallabag\AnnotationBundle\Entity\Annotation;
+use Wallabag\CoreBundle\Entity\Config as ConfigEntity;
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
use Wallabag\CoreBundle\Entity\RuleInterface;
use Wallabag\CoreBundle\Entity\TaggingRule;
@@ -24,7 +33,10 @@ use Wallabag\CoreBundle\Form\Type\IgnoreOriginUserRuleType;
use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType;
use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
use Wallabag\CoreBundle\Form\Type\UserInformationType;
+use Wallabag\CoreBundle\Repository\EntryRepository;
+use Wallabag\CoreBundle\Repository\TagRepository;
use Wallabag\CoreBundle\Tools\Utils;
+use Wallabag\UserBundle\Repository\UserRepository;
class ConfigController extends Controller
{
@@ -35,7 +47,7 @@ class ConfigController extends Controller
{
$em = $this->getDoctrine()->getManager();
$config = $this->getConfig();
- $userManager = $this->container->get('fos_user.user_manager');
+ $userManager = $this->container->get(UserManagerInterface::class);
$user = $this->getUser();
// handle basic config detail (this form is defined as a service)
@@ -49,7 +61,7 @@ class ConfigController extends Controller
$this->addFlash(
'notice',
- 'Baggy is deprecated, forced to Material theme.'
+ 'Baggy is gone, forced to Material theme.'
);
}
@@ -59,7 +71,7 @@ class ConfigController extends Controller
$request->getSession()->set('_locale', $config->getLanguage());
// switch active theme
- $activeTheme = $this->get('liip_theme.active_theme');
+ $activeTheme = $this->get(ActiveTheme::class);
$activeTheme->setName($config->getTheme());
$this->addFlash(
@@ -75,7 +87,7 @@ class ConfigController extends Controller
$pwdForm->handleRequest($request);
if ($pwdForm->isSubmitted() && $pwdForm->isValid()) {
- if ($this->get('craue_config')->get('demo_mode_enabled') && $this->get('craue_config')->get('demo_mode_username') === $user->getUsername()) {
+ if ($this->get(Config::class)->get('demo_mode_enabled') && $this->get(Config::class)->get('demo_mode_username') === $user->getUsername()) {
$message = 'flashes.config.notice.password_not_updated_demo';
} else {
$message = 'flashes.config.notice.password_updated';
@@ -129,7 +141,7 @@ class ConfigController extends Controller
if ($request->query->has('tagging-rule')) {
$taggingRule = $this->getDoctrine()
- ->getRepository('WallabagCoreBundle:TaggingRule')
+ ->getRepository(TaggingRule::class)
->find($request->query->get('tagging-rule'));
if ($this->getUser()->getId() !== $taggingRule->getConfig()->getUser()->getId()) {
@@ -192,7 +204,7 @@ class ConfigController extends Controller
if ($request->query->has('ignore-origin-user-rule')) {
$ignoreOriginUserRule = $this->getDoctrine()
- ->getRepository('WallabagCoreBundle:IgnoreOriginUserRule')
+ ->getRepository(IgnoreOriginUserRule::class)
->find($request->query->get('ignore-origin-user-rule'));
if ($this->getUser()->getId() !== $ignoreOriginUserRule->getConfig()->getUser()->getId()) {
@@ -220,7 +232,7 @@ class ConfigController extends Controller
return $this->redirect($this->generateUrl('config') . '#set6');
}
- return $this->render('WallabagCoreBundle:Config:index.html.twig', [
+ return $this->render('@WallabagCore/Config/index.html.twig', [
'form' => [
'config' => $configForm->createView(),
'feed' => $feedForm->createView(),
@@ -236,7 +248,7 @@ class ConfigController extends Controller
],
'twofactor_auth' => $this->getParameter('twofactor_auth'),
'wallabag_url' => $this->getParameter('domain_name'),
- 'enabled_users' => $this->get('wallabag_user.user_repository')->getSumEnabledUsers(),
+ 'enabled_users' => $this->get(UserRepository::class)->getSumEnabledUsers(),
]);
}
@@ -254,7 +266,7 @@ class ConfigController extends Controller
$user = $this->getUser();
$user->setEmailTwoFactor(false);
- $this->container->get('fos_user.user_manager')->updateUser($user, true);
+ $this->container->get(UserManagerInterface::class)->updateUser($user, true);
$this->addFlash(
'notice',
@@ -281,7 +293,7 @@ class ConfigController extends Controller
$user->setBackupCodes(null);
$user->setEmailTwoFactor(true);
- $this->container->get('fos_user.user_manager')->updateUser($user, true);
+ $this->container->get(UserManagerInterface::class)->updateUser($user, true);
$this->addFlash(
'notice',
@@ -307,7 +319,7 @@ class ConfigController extends Controller
$user->setGoogleAuthenticatorSecret('');
$user->setBackupCodes(null);
- $this->container->get('fos_user.user_manager')->updateUser($user, true);
+ $this->container->get(UserManagerInterface::class)->updateUser($user, true);
$this->addFlash(
'notice',
@@ -329,7 +341,7 @@ class ConfigController extends Controller
}
$user = $this->getUser();
- $secret = $this->get('scheb_two_factor.security.google_authenticator')->generateSecret();
+ $secret = $this->get(GoogleAuthenticatorInterface::class)->generateSecret();
$user->setGoogleAuthenticatorSecret($secret);
$user->setEmailTwoFactor(false);
@@ -344,16 +356,16 @@ class ConfigController extends Controller
$user->setBackupCodes($backupCodesHashed);
- $this->container->get('fos_user.user_manager')->updateUser($user, true);
+ $this->container->get(UserManagerInterface::class)->updateUser($user, true);
$this->addFlash(
'notice',
'flashes.config.notice.otp_enabled'
);
- return $this->render('WallabagCoreBundle:Config:otp_app.html.twig', [
+ return $this->render('@WallabagCore/Config/otp_app.html.twig', [
'backupCodes' => $backupCodes,
- 'qr_code' => $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user),
+ 'qr_code' => $this->get(GoogleAuthenticatorInterface::class)->getQRContent($user),
'secret' => $secret,
]);
}
@@ -373,7 +385,7 @@ class ConfigController extends Controller
$user->setGoogleAuthenticatorSecret(null);
$user->setBackupCodes(null);
- $this->container->get('fos_user.user_manager')->updateUser($user, true);
+ $this->container->get(UserManagerInterface::class)->updateUser($user, true);
return $this->redirect($this->generateUrl('config') . '#set3');
}
@@ -385,7 +397,7 @@ class ConfigController extends Controller
*/
public function otpAppCheckAction(Request $request)
{
- $isValid = $this->get('scheb_two_factor.security.google_authenticator')->checkCode(
+ $isValid = $this->get(GoogleAuthenticatorInterface::class)->checkCode(
$this->getUser(),
$request->get('_auth_code')
);
@@ -545,7 +557,7 @@ class ConfigController extends Controller
switch ($type) {
case 'annotations':
$this->getDoctrine()
- ->getRepository('WallabagAnnotationBundle:Annotation')
+ ->getRepository(Annotation::class)
->removeAllByUserId($this->getUser()->getId());
break;
case 'tags':
@@ -554,24 +566,24 @@ class ConfigController extends Controller
case 'entries':
// SQLite doesn't care about cascading remove, so we need to manually remove associated stuff
// otherwise they won't be removed ...
- if ($this->get('doctrine')->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
- $this->getDoctrine()->getRepository('WallabagAnnotationBundle:Annotation')->removeAllByUserId($this->getUser()->getId());
+ if ($this->get(ManagerRegistry::class)->getConnection()->getDatabasePlatform() instanceof SqlitePlatform) {
+ $this->getDoctrine()->getRepository(Annotation::class)->removeAllByUserId($this->getUser()->getId());
}
// manually remove tags to avoid orphan tag
$this->removeAllTagsByUserId($this->getUser()->getId());
- $this->get('wallabag_core.entry_repository')->removeAllByUserId($this->getUser()->getId());
+ $this->get(EntryRepository::class)->removeAllByUserId($this->getUser()->getId());
break;
case 'archived':
- if ($this->get('doctrine')->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
+ if ($this->get(ManagerRegistry::class)->getConnection()->getDatabasePlatform() instanceof SqlitePlatform) {
$this->removeAnnotationsForArchivedByUserId($this->getUser()->getId());
}
// manually remove tags to avoid orphan tag
$this->removeTagsForArchivedByUserId($this->getUser()->getId());
- $this->get('wallabag_core.entry_repository')->removeArchivedByUserId($this->getUser()->getId());
+ $this->get(EntryRepository::class)->removeArchivedByUserId($this->getUser()->getId());
break;
}
@@ -590,11 +602,11 @@ class ConfigController extends Controller
*
* @throws AccessDeniedHttpException
*
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * @return RedirectResponse
*/
public function deleteAccountAction(Request $request)
{
- $enabledUsers = $this->get('wallabag_user.user_repository')
+ $enabledUsers = $this->get(UserRepository::class)
->getSumEnabledUsers();
if ($enabledUsers <= 1) {
@@ -604,10 +616,10 @@ class ConfigController extends Controller
$user = $this->getUser();
// logout current user
- $this->get('security.token_storage')->setToken(null);
+ $this->get(TokenStorageInterface::class)->setToken(null);
$request->getSession()->invalidate();
- $em = $this->get('fos_user.user_manager');
+ $em = $this->get(UserManagerInterface::class);
$em->deleteUser($user);
return $this->redirect($this->generateUrl('fos_user_security_login'));
@@ -618,7 +630,7 @@ class ConfigController extends Controller
*
* @Route("/config/view-mode", name="switch_view_mode")
*
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * @return RedirectResponse
*/
public function changeViewModeAction(Request $request)
{
@@ -639,11 +651,11 @@ class ConfigController extends Controller
*
* @Route("/locale/{language}", name="changeLocale")
*
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * @return RedirectResponse
*/
public function setLocaleAction(Request $request, $language = null)
{
- $errors = $this->get('validator')->validate($language, (new LocaleConstraint()));
+ $errors = $this->get(ValidatorInterface::class)->validate($language, (new LocaleConstraint()));
if (0 === \count($errors)) {
$request->getSession()->set('_locale', $language);
@@ -690,7 +702,7 @@ class ConfigController extends Controller
return;
}
- $this->get('wallabag_core.entry_repository')
+ $this->get(EntryRepository::class)
->removeTags($userId, $tags);
// cleanup orphan tags
@@ -712,7 +724,7 @@ class ConfigController extends Controller
*/
private function removeAllTagsByUserId($userId)
{
- $tags = $this->get('wallabag_core.tag_repository')->findAllTags($userId);
+ $tags = $this->get(TagRepository::class)->findAllTags($userId);
$this->removeAllTagsByStatusAndUserId($tags, $userId);
}
@@ -723,7 +735,7 @@ class ConfigController extends Controller
*/
private function removeTagsForArchivedByUserId($userId)
{
- $tags = $this->get('wallabag_core.tag_repository')->findForArchivedArticlesByUser($userId);
+ $tags = $this->get(TagRepository::class)->findForArchivedArticlesByUser($userId);
$this->removeAllTagsByStatusAndUserId($tags, $userId);
}
@@ -732,7 +744,7 @@ class ConfigController extends Controller
$em = $this->getDoctrine()->getManager();
$archivedEntriesAnnotations = $this->getDoctrine()
- ->getRepository('WallabagAnnotationBundle:Annotation')
+ ->getRepository(Annotation::class)
->findAllArchivedEntriesByUser($userId);
foreach ($archivedEntriesAnnotations as $archivedEntriesAnnotation) {
@@ -756,17 +768,17 @@ class ConfigController extends Controller
* Retrieve config for the current user.
* If no config were found, create a new one.
*
- * @return Config
+ * @return ConfigEntity
*/
private function getConfig()
{
$config = $this->getDoctrine()
- ->getRepository('WallabagCoreBundle:Config')
+ ->getRepository(ConfigEntity::class)
->findOneByUser($this->getUser());
// should NEVER HAPPEN ...
if (!$config) {
- $config = new Config($this->getUser());
+ $config = new ConfigEntity($this->getUser());
}
return $config;
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index 54ee6bf7e..6c607d4d3 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -2,45 +2,91 @@
namespace Wallabag\CoreBundle\Controller;
+use Craue\ConfigBundle\Util\Config;
use Doctrine\ORM\NoResultException;
+use Lexik\Bundle\FormFilterBundle\Filter\FilterBuilderUpdaterInterface;
use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter;
use Pagerfanta\Exception\OutOfRangeCurrentPageException;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
+use Symfony\Component\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Entity\Entry;
+use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Event\EntryDeletedEvent;
use Wallabag\CoreBundle\Event\EntrySavedEvent;
use Wallabag\CoreBundle\Form\Type\EditEntryType;
use Wallabag\CoreBundle\Form\Type\EntryFilterType;
use Wallabag\CoreBundle\Form\Type\NewEntryType;
use Wallabag\CoreBundle\Form\Type\SearchEntryType;
+use Wallabag\CoreBundle\Helper\ContentProxy;
+use Wallabag\CoreBundle\Helper\PreparePagerForEntries;
+use Wallabag\CoreBundle\Helper\Redirect;
+use Wallabag\CoreBundle\Repository\EntryRepository;
+use Wallabag\CoreBundle\Repository\TagRepository;
class EntryController extends Controller
{
/**
* @Route("/mass", name="mass_action")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function massAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$values = $request->request->all();
+ $tagsToAdd = [];
+ $tagsToRemove = [];
+
$action = 'toggle-read';
if (isset($values['toggle-star'])) {
$action = 'toggle-star';
} elseif (isset($values['delete'])) {
$action = 'delete';
+ } elseif (isset($values['tag'])) {
+ $action = 'tag';
+
+ if (isset($values['tags'])) {
+ $labels = array_filter(explode(',', $values['tags']),
+ function ($v) {
+ $v = trim($v);
+
+ return '' !== $v;
+ });
+ foreach ($labels as $label) {
+ $remove = false;
+ if (0 === strpos($label, '-')) {
+ $label = substr($label, 1);
+ $remove = true;
+ }
+ $tag = $this->get(TagRepository::class)->findOneByLabel($label);
+ if ($remove) {
+ if (null !== $tag) {
+ $tagsToRemove[] = $tag;
+ }
+ } else {
+ if (null === $tag) {
+ $tag = new Tag();
+ $tag->setLabel($label);
+ }
+ $tagsToAdd[] = $tag;
+ }
+ }
+ }
}
if (isset($values['entry-checkbox'])) {
foreach ($values['entry-checkbox'] as $id) {
/** @var Entry * */
- $entry = $this->get('wallabag_core.entry_repository')->findById((int) $id)[0];
+ $entry = $this->get(EntryRepository::class)->findById((int) $id)[0];
$this->checkUserAction($entry);
@@ -48,8 +94,15 @@ class EntryController extends Controller
$entry->toggleArchive();
} elseif ('toggle-star' === $action) {
$entry->toggleStar();
+ } elseif ('tag' === $action) {
+ foreach ($tagsToAdd as $tag) {
+ $entry->addTag($tag);
+ }
+ foreach ($tagsToRemove as $tag) {
+ $entry->removeTag($tag);
+ }
} elseif ('delete' === $action) {
- $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
+ $this->get(EventDispatcherInterface::class)->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
$em->remove($entry);
}
}
@@ -57,7 +110,7 @@ class EntryController extends Controller
$em->flush();
}
- $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
+ $redirectUrl = $this->get(Redirect::class)->to($request->headers->get('referer'));
return $this->redirect($redirectUrl);
}
@@ -70,7 +123,7 @@ class EntryController extends Controller
* Default parameter for page is hardcoded (in duplication of the defaults from the Route)
* because this controller is also called inside the layout template without any page as argument
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function searchFormAction(Request $request, $page = 1, $currentRoute = null)
{
@@ -87,7 +140,7 @@ class EntryController extends Controller
return $this->showEntries('search', $request, $page);
}
- return $this->render('WallabagCoreBundle:Entry:search_form.html.twig', [
+ return $this->render('@WallabagCore/Entry/search_form.html.twig', [
'form' => $form->createView(),
'currentRoute' => $currentRoute,
]);
@@ -96,7 +149,7 @@ class EntryController extends Controller
/**
* @Route("/new-entry", name="new_entry")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function addEntryFormAction(Request $request)
{
@@ -110,9 +163,9 @@ class EntryController extends Controller
$existingEntry = $this->checkIfEntryAlreadyExists($entry);
if (false !== $existingEntry) {
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
- $this->get('translator')->trans('flashes.entry.notice.entry_already_saved', ['%date%' => $existingEntry->getCreatedAt()->format('d-m-Y')])
+ $this->get(TranslatorInterface::class)->trans('flashes.entry.notice.entry_already_saved', ['%date%' => $existingEntry->getCreatedAt()->format('d-m-Y')])
);
return $this->redirect($this->generateUrl('view', ['id' => $existingEntry->getId()]));
@@ -125,12 +178,12 @@ class EntryController extends Controller
$em->flush();
// entry saved, dispatch event about it!
- $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
+ $this->get(EventDispatcherInterface::class)->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
return $this->redirect($this->generateUrl('homepage'));
}
- return $this->render('WallabagCoreBundle:Entry:new_form.html.twig', [
+ return $this->render('@WallabagCore/Entry/new_form.html.twig', [
'form' => $form->createView(),
]);
}
@@ -138,7 +191,7 @@ class EntryController extends Controller
/**
* @Route("/bookmarklet", name="bookmarklet")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function addEntryViaBookmarkletAction(Request $request)
{
@@ -153,7 +206,7 @@ class EntryController extends Controller
$em->flush();
// entry saved, dispatch event about it!
- $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
+ $this->get(EventDispatcherInterface::class)->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
}
return $this->redirect($this->generateUrl('homepage'));
@@ -162,11 +215,11 @@ class EntryController extends Controller
/**
* @Route("/new", name="new")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function addEntryAction()
{
- return $this->render('WallabagCoreBundle:Entry:new.html.twig');
+ return $this->render('@WallabagCore/Entry/new.html.twig');
}
/**
@@ -174,7 +227,7 @@ class EntryController extends Controller
*
* @Route("/edit/{id}", requirements={"id" = "\d+"}, name="edit")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function editEntryAction(Request $request, Entry $entry)
{
@@ -189,7 +242,7 @@ class EntryController extends Controller
$em->persist($entry);
$em->flush();
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
'flashes.entry.notice.entry_updated'
);
@@ -197,7 +250,7 @@ class EntryController extends Controller
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
}
- return $this->render('WallabagCoreBundle:Entry:edit.html.twig', [
+ return $this->render('@WallabagCore/Entry/edit.html.twig', [
'form' => $form->createView(),
]);
}
@@ -209,7 +262,7 @@ class EntryController extends Controller
*
* @Route("/all/list/{page}", name="all", defaults={"page" = "1"})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showAllAction(Request $request, $page)
{
@@ -223,12 +276,12 @@ class EntryController extends Controller
*
* @Route("/unread/list/{page}", name="unread", defaults={"page" = "1"})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showUnreadAction(Request $request, $page)
{
// load the quickstart if no entry in database
- if (1 === (int) $page && 0 === $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId())) {
+ if (1 === (int) $page && 0 === $this->get(EntryRepository::class)->countAllEntriesByUser($this->getUser()->getId())) {
return $this->redirect($this->generateUrl('quickstart'));
}
@@ -242,7 +295,7 @@ class EntryController extends Controller
*
* @Route("/archive/list/{page}", name="archive", defaults={"page" = "1"})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showArchiveAction(Request $request, $page)
{
@@ -256,7 +309,7 @@ class EntryController extends Controller
*
* @Route("/starred/list/{page}", name="starred", defaults={"page" = "1"})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showStarredAction(Request $request, $page)
{
@@ -270,7 +323,7 @@ class EntryController extends Controller
*
* @Route("/untagged/list/{page}", name="untagged", defaults={"page" = "1"})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showUntaggedEntriesAction(Request $request, $page)
{
@@ -284,7 +337,7 @@ class EntryController extends Controller
*
* @Route("/annotated/list/{page}", name="annotated", defaults={"page" = "1"})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showWithAnnotationsEntriesAction(Request $request, $page)
{
@@ -298,15 +351,15 @@ class EntryController extends Controller
*
* @Route("/{type}/random", name="random_entry", requirements={"type": "unread|starred|archive|untagged|annotated|all"})
*
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * @return RedirectResponse
*/
public function redirectRandomEntryAction($type = 'all')
{
try {
- $entry = $this->get('wallabag_core.entry_repository')
+ $entry = $this->get(EntryRepository::class)
->getRandomEntry($this->getUser()->getId(), $type);
} catch (NoResultException $e) {
- $bag = $this->get('session')->getFlashBag();
+ $bag = $this->get(SessionInterface::class)->getFlashBag();
$bag->clear();
$bag->add('notice', 'flashes.entry.notice.no_random_entry');
@@ -321,14 +374,14 @@ class EntryController extends Controller
*
* @Route("/view/{id}", requirements={"id" = "\d+"}, name="view")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function viewAction(Entry $entry)
{
$this->checkUserAction($entry);
return $this->render(
- 'WallabagCoreBundle:Entry:entry.html.twig',
+ '@WallabagCore/Entry/entry.html.twig',
['entry' => $entry]
);
}
@@ -339,7 +392,7 @@ class EntryController extends Controller
*
* @Route("/reload/{id}", requirements={"id" = "\d+"}, name="reload_entry")
*
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * @return RedirectResponse
*/
public function reloadAction(Entry $entry)
{
@@ -349,7 +402,7 @@ class EntryController extends Controller
// if refreshing entry failed, don't save it
if ($this->getParameter('wallabag_core.fetching_error_message') === $entry->getContent()) {
- $bag = $this->get('session')->getFlashBag();
+ $bag = $this->get(SessionInterface::class)->getFlashBag();
$bag->clear();
$bag->add('notice', 'flashes.entry.notice.entry_reloaded_failed');
@@ -361,7 +414,7 @@ class EntryController extends Controller
$em->flush();
// entry saved, dispatch event about it!
- $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
+ $this->get(EventDispatcherInterface::class)->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
}
@@ -371,7 +424,7 @@ class EntryController extends Controller
*
* @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry")
*
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * @return RedirectResponse
*/
public function toggleArchiveAction(Request $request, Entry $entry)
{
@@ -385,12 +438,12 @@ class EntryController extends Controller
$message = 'flashes.entry.notice.entry_archived';
}
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
$message
);
- $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
+ $redirectUrl = $this->get(Redirect::class)->to($request->headers->get('referer'));
return $this->redirect($redirectUrl);
}
@@ -400,7 +453,7 @@ class EntryController extends Controller
*
* @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry")
*
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * @return RedirectResponse
*/
public function toggleStarAction(Request $request, Entry $entry)
{
@@ -415,12 +468,12 @@ class EntryController extends Controller
$message = 'flashes.entry.notice.entry_starred';
}
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
$message
);
- $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
+ $redirectUrl = $this->get(Redirect::class)->to($request->headers->get('referer'));
return $this->redirect($redirectUrl);
}
@@ -430,7 +483,7 @@ class EntryController extends Controller
*
* @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry")
*
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * @return RedirectResponse
*/
public function deleteEntryAction(Request $request, Entry $entry)
{
@@ -445,13 +498,13 @@ class EntryController extends Controller
);
// entry deleted, dispatch event about it!
- $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
+ $this->get(EventDispatcherInterface::class)->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
$em = $this->getDoctrine()->getManager();
$em->remove($entry);
$em->flush();
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
'flashes.entry.notice.entry_deleted'
);
@@ -460,7 +513,7 @@ class EntryController extends Controller
$referer = $request->headers->get('referer');
$to = (1 !== preg_match('#' . $url . '$#i', $referer) ? $referer : null);
- $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($to);
+ $redirectUrl = $this->get(Redirect::class)->to($to);
return $this->redirect($redirectUrl);
}
@@ -470,7 +523,7 @@ class EntryController extends Controller
*
* @Route("/share/{id}", requirements={"id" = "\d+"}, name="share")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function shareAction(Entry $entry)
{
@@ -494,7 +547,7 @@ class EntryController extends Controller
*
* @Route("/share/delete/{id}", requirements={"id" = "\d+"}, name="delete_share")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function deleteShareAction(Entry $entry)
{
@@ -517,11 +570,11 @@ class EntryController extends Controller
* @Route("/share/{uid}", requirements={"uid" = ".+"}, name="share_entry")
* @Cache(maxage="25200", smaxage="25200", public=true)
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function shareEntryAction(Entry $entry)
{
- if (!$this->get('craue_config')->get('share_public')) {
+ if (!$this->get(Config::class)->get('share_public')) {
throw $this->createAccessDeniedException('Sharing an entry is disabled for this user.');
}
@@ -538,7 +591,7 @@ class EntryController extends Controller
*
* @Route("/domain/{id}/{page}", requirements={"id" = ".+"}, defaults={"page" = 1}, name="same_domain")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function getSameDomainEntries(Request $request, $page = 1)
{
@@ -552,11 +605,11 @@ class EntryController extends Controller
* @param string $type Entries type: unread, starred or archive
* @param int $page
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
private function showEntries($type, Request $request, $page)
{
- $repository = $this->get('wallabag_core.entry_repository');
+ $repository = $this->get(EntryRepository::class);
$searchTerm = (isset($request->get('search_entry')['term']) ? $request->get('search_entry')['term'] : '');
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
@@ -601,12 +654,12 @@ class EntryController extends Controller
$form->submit($request->query->get($form->getName()));
// build the query from the given form object
- $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($form, $qb);
+ $this->get(FilterBuilderUpdaterInterface::class)->addFilterConditions($form, $qb);
}
$pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false);
- $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare($pagerAdapter);
+ $entries = $this->get(PreparePagerForEntries::class)->prepare($pagerAdapter);
try {
$entries->setCurrentPage($page);
@@ -616,11 +669,11 @@ class EntryController extends Controller
}
}
- $nbEntriesUntagged = $this->get('wallabag_core.entry_repository')
+ $nbEntriesUntagged = $this->get(EntryRepository::class)
->countUntaggedEntriesByUser($this->getUser()->getId());
return $this->render(
- 'WallabagCoreBundle:Entry:entries.html.twig', [
+ '@WallabagCore/Entry/entries.html.twig', [
'form' => $form->createView(),
'entries' => $entries,
'currentPage' => $page,
@@ -642,7 +695,7 @@ class EntryController extends Controller
$message = 'flashes.entry.notice.' . $prefixMessage;
try {
- $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
+ $this->get(ContentProxy::class)->updateEntry($entry, $entry->getUrl());
} catch (\Exception $e) {
$this->get('logger')->error('Error while saving an entry', [
'exception' => $e,
@@ -653,14 +706,14 @@ class EntryController extends Controller
}
if (empty($entry->getDomainName())) {
- $this->get('wallabag_core.content_proxy')->setEntryDomainName($entry);
+ $this->get(ContentProxy::class)->setEntryDomainName($entry);
}
if (empty($entry->getTitle())) {
- $this->get('wallabag_core.content_proxy')->setDefaultEntryTitle($entry);
+ $this->get(ContentProxy::class)->setDefaultEntryTitle($entry);
}
- $this->get('session')->getFlashBag()->add('notice', $message);
+ $this->get(SessionInterface::class)->getFlashBag()->add('notice', $message);
}
/**
@@ -680,6 +733,6 @@ class EntryController extends Controller
*/
private function checkIfEntryAlreadyExists(Entry $entry)
{
- return $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
+ return $this->get(EntryRepository::class)->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
}
}
diff --git a/src/Wallabag/CoreBundle/Controller/ExceptionController.php b/src/Wallabag/CoreBundle/Controller/ExceptionController.php
index 461309ea9..ffff3c85f 100644
--- a/src/Wallabag/CoreBundle/Controller/ExceptionController.php
+++ b/src/Wallabag/CoreBundle/Controller/ExceptionController.php
@@ -20,7 +20,7 @@ class ExceptionController extends BaseExceptionController
// For error pages, try to find a template for the specific HTTP status code and format
if (!$showException) {
- $template = sprintf('WallabagCoreBundle:Exception:%s.%s.twig', $name, $format);
+ $template = sprintf('@WallabagCore/Exception/%s.%s.twig', $name, $format);
if ($this->templateExists($template)) {
return $template;
}
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php
index 2db335527..5b2325507 100644
--- a/src/Wallabag/CoreBundle/Controller/ExportController.php
+++ b/src/Wallabag/CoreBundle/Controller/ExportController.php
@@ -4,9 +4,13 @@ namespace Wallabag\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\CoreBundle\Entity\Entry;
+use Wallabag\CoreBundle\Helper\EntriesExport;
+use Wallabag\CoreBundle\Repository\EntryRepository;
+use Wallabag\CoreBundle\Repository\TagRepository;
/**
* The try/catch can be removed once all formats will be implemented.
@@ -24,12 +28,12 @@ class ExportController extends Controller
* "id": "\d+"
* })
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function downloadEntryAction(Entry $entry, $format)
{
try {
- return $this->get('wallabag_core.helper.entries_export')
+ return $this->get(EntriesExport::class)
->setEntries($entry)
->updateTitle('entry')
->updateAuthor('entry')
@@ -50,17 +54,17 @@ class ExportController extends Controller
* "category": "all|unread|starred|archive|tag_entries|untagged|search|annotated|same_domain"
* })
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function downloadEntriesAction(Request $request, $format, $category)
{
$method = ucfirst($category);
$methodBuilder = 'getBuilderFor' . $method . 'ByUser';
- $repository = $this->get('wallabag_core.entry_repository');
+ $repository = $this->get(EntryRepository::class);
$title = $method;
if ('tag_entries' === $category) {
- $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag'));
+ $tag = $this->get(TagRepository::class)->findOneBySlug($request->query->get('tag'));
$entries = $repository->findAllByTagId(
$this->getUser()->getId(),
@@ -95,7 +99,7 @@ class ExportController extends Controller
}
try {
- return $this->get('wallabag_core.helper.entries_export')
+ return $this->get(EntriesExport::class)
->setEntries($entries)
->updateTitle($title)
->updateAuthor($method)
diff --git a/src/Wallabag/CoreBundle/Controller/FeedController.php b/src/Wallabag/CoreBundle/Controller/FeedController.php
index 5e33839eb..3eed1dad4 100644
--- a/src/Wallabag/CoreBundle/Controller/FeedController.php
+++ b/src/Wallabag/CoreBundle/Controller/FeedController.php
@@ -14,6 +14,8 @@ use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Wallabag\CoreBundle\Entity\Tag;
+use Wallabag\CoreBundle\Helper\PreparePagerForEntries;
+use Wallabag\CoreBundle\Repository\EntryRepository;
use Wallabag\UserBundle\Entity\User;
class FeedController extends Controller
@@ -23,11 +25,11 @@ class FeedController extends Controller
*
* @Route("/feed/{username}/{token}/unread/{page}", name="unread_feed", defaults={"page"=1, "_format"="xml"})
*
- * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter")
+ * @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
*
* @param $page
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showUnreadFeedAction(User $user, $page)
{
@@ -39,11 +41,11 @@ class FeedController extends Controller
*
* @Route("/feed/{username}/{token}/archive/{page}", name="archive_feed", defaults={"page"=1, "_format"="xml"})
*
- * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter")
+ * @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
*
* @param $page
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showArchiveFeedAction(User $user, $page)
{
@@ -55,11 +57,11 @@ class FeedController extends Controller
*
* @Route("/feed/{username}/{token}/starred/{page}", name="starred_feed", defaults={"page"=1, "_format"="xml"})
*
- * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter")
+ * @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
*
* @param $page
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showStarredFeedAction(User $user, $page)
{
@@ -71,9 +73,9 @@ class FeedController extends Controller
*
* @Route("/feed/{username}/{token}/all/{page}", name="all_feed", defaults={"page"=1, "_format"="xml"})
*
- * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter")
+ * @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showAllFeedAction(User $user, $page)
{
@@ -85,10 +87,10 @@ class FeedController extends Controller
*
* @Route("/feed/{username}/{token}/tags/{slug}/{page}", name="tag_feed", defaults={"page"=1, "_format"="xml"})
*
- * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter")
+ * @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showTagsFeedAction(Request $request, User $user, Tag $tag, $page)
{
@@ -113,7 +115,7 @@ class FeedController extends Controller
UrlGeneratorInterface::ABSOLUTE_URL
);
- $entriesByTag = $this->get('wallabag_core.entry_repository')->findAllByTagId(
+ $entriesByTag = $this->get(EntryRepository::class)->findAllByTagId(
$user->getId(),
$tag->getId(),
$sorts[$sort]
@@ -121,7 +123,7 @@ class FeedController extends Controller
$pagerAdapter = new ArrayAdapter($entriesByTag);
- $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare(
+ $entries = $this->get(PreparePagerForEntries::class)->prepare(
$pagerAdapter,
$user
);
@@ -180,11 +182,11 @@ class FeedController extends Controller
* @param string $type Entries type: unread, starred or archive
* @param int $page
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
private function showEntries($type, User $user, $page = 1)
{
- $repository = $this->get('wallabag_core.entry_repository');
+ $repository = $this->get(EntryRepository::class);
switch ($type) {
case 'starred':
diff --git a/src/Wallabag/CoreBundle/Controller/IgnoreOriginInstanceRuleController.php b/src/Wallabag/CoreBundle/Controller/IgnoreOriginInstanceRuleController.php
index ef1f0ed74..22fbf5fa0 100644
--- a/src/Wallabag/CoreBundle/Controller/IgnoreOriginInstanceRuleController.php
+++ b/src/Wallabag/CoreBundle/Controller/IgnoreOriginInstanceRuleController.php
@@ -3,9 +3,16 @@
namespace Wallabag\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Symfony\Component\Form\Form;
+use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route;
+use Symfony\Component\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
+use Wallabag\CoreBundle\Form\Type\IgnoreOriginInstanceRuleType;
+use Wallabag\CoreBundle\Repository\IgnoreOriginInstanceRuleRepository;
/**
* IgnoreOriginInstanceRuleController controller.
@@ -21,9 +28,9 @@ class IgnoreOriginInstanceRuleController extends Controller
*/
public function indexAction()
{
- $rules = $this->get('wallabag_core.ignore_origin_instance_rule_repository')->findAll();
+ $rules = $this->get(IgnoreOriginInstanceRuleRepository::class)->findAll();
- return $this->render('WallabagCoreBundle:IgnoreOriginInstanceRule:index.html.twig', [
+ return $this->render('@WallabagCore/IgnoreOriginInstanceRule/index.html.twig', [
'rules' => $rules,
]);
}
@@ -33,13 +40,13 @@ class IgnoreOriginInstanceRuleController extends Controller
*
* @Route("/new", name="ignore_origin_instance_rules_new", methods={"GET", "POST"})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function newAction(Request $request)
{
$ignoreOriginInstanceRule = new IgnoreOriginInstanceRule();
- $form = $this->createForm('Wallabag\CoreBundle\Form\Type\IgnoreOriginInstanceRuleType', $ignoreOriginInstanceRule);
+ $form = $this->createForm(IgnoreOriginInstanceRuleType::class, $ignoreOriginInstanceRule);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
@@ -47,15 +54,15 @@ class IgnoreOriginInstanceRuleController extends Controller
$em->persist($ignoreOriginInstanceRule);
$em->flush();
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
- $this->get('translator')->trans('flashes.ignore_origin_instance_rule.notice.added')
+ $this->get(TranslatorInterface::class)->trans('flashes.ignore_origin_instance_rule.notice.added')
);
return $this->redirectToRoute('ignore_origin_instance_rules_index');
}
- return $this->render('WallabagCoreBundle:IgnoreOriginInstanceRule:new.html.twig', [
+ return $this->render('@WallabagCore/IgnoreOriginInstanceRule/new.html.twig', [
'rule' => $ignoreOriginInstanceRule,
'form' => $form->createView(),
]);
@@ -66,12 +73,12 @@ class IgnoreOriginInstanceRuleController extends Controller
*
* @Route("/{id}/edit", name="ignore_origin_instance_rules_edit", methods={"GET", "POST"})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function editAction(Request $request, IgnoreOriginInstanceRule $ignoreOriginInstanceRule)
{
$deleteForm = $this->createDeleteForm($ignoreOriginInstanceRule);
- $editForm = $this->createForm('Wallabag\CoreBundle\Form\Type\IgnoreOriginInstanceRuleType', $ignoreOriginInstanceRule);
+ $editForm = $this->createForm(IgnoreOriginInstanceRuleType::class, $ignoreOriginInstanceRule);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editForm->isValid()) {
@@ -79,15 +86,15 @@ class IgnoreOriginInstanceRuleController extends Controller
$em->persist($ignoreOriginInstanceRule);
$em->flush();
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
- $this->get('translator')->trans('flashes.ignore_origin_instance_rule.notice.updated')
+ $this->get(TranslatorInterface::class)->trans('flashes.ignore_origin_instance_rule.notice.updated')
);
return $this->redirectToRoute('ignore_origin_instance_rules_index');
}
- return $this->render('WallabagCoreBundle:IgnoreOriginInstanceRule:edit.html.twig', [
+ return $this->render('@WallabagCore/IgnoreOriginInstanceRule/edit.html.twig', [
'rule' => $ignoreOriginInstanceRule,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
@@ -99,7 +106,7 @@ class IgnoreOriginInstanceRuleController extends Controller
*
* @Route("/{id}", name="ignore_origin_instance_rules_delete", methods={"DELETE"})
*
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * @return RedirectResponse
*/
public function deleteAction(Request $request, IgnoreOriginInstanceRule $ignoreOriginInstanceRule)
{
@@ -107,9 +114,9 @@ class IgnoreOriginInstanceRuleController extends Controller
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
- $this->get('translator')->trans('flashes.ignore_origin_instance_rule.notice.deleted')
+ $this->get(TranslatorInterface::class)->trans('flashes.ignore_origin_instance_rule.notice.deleted')
);
$em = $this->getDoctrine()->getManager();
@@ -125,7 +132,7 @@ class IgnoreOriginInstanceRuleController extends Controller
*
* @param IgnoreOriginInstanceRule $ignoreOriginInstanceRule The ignore origin instance rule entity
*
- * @return \Symfony\Component\Form\Form The form
+ * @return Form The form
*/
private function createDeleteForm(IgnoreOriginInstanceRule $ignoreOriginInstanceRule)
{
diff --git a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
index 4320c5ffe..67b262947 100644
--- a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
+++ b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
@@ -2,10 +2,19 @@
namespace Wallabag\CoreBundle\Controller;
+use Craue\ConfigBundle\Util\Config;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Symfony\Component\Form\Form;
+use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route;
+use Symfony\Component\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Entity\SiteCredential;
+use Wallabag\CoreBundle\Form\Type\SiteCredentialType;
+use Wallabag\CoreBundle\Helper\CryptoProxy;
+use Wallabag\CoreBundle\Repository\SiteCredentialRepository;
use Wallabag\UserBundle\Entity\User;
/**
@@ -24,9 +33,9 @@ class SiteCredentialController extends Controller
{
$this->isSiteCredentialsEnabled();
- $credentials = $this->get('wallabag_core.site_credential_repository')->findByUser($this->getUser());
+ $credentials = $this->get(SiteCredentialRepository::class)->findByUser($this->getUser());
- return $this->render('WallabagCoreBundle:SiteCredential:index.html.twig', [
+ return $this->render('@WallabagCore/SiteCredential/index.html.twig', [
'credentials' => $credentials,
]);
}
@@ -36,7 +45,7 @@ class SiteCredentialController extends Controller
*
* @Route("/new", name="site_credentials_new", methods={"GET", "POST"})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function newAction(Request $request)
{
@@ -44,26 +53,26 @@ class SiteCredentialController extends Controller
$credential = new SiteCredential($this->getUser());
- $form = $this->createForm('Wallabag\CoreBundle\Form\Type\SiteCredentialType', $credential);
+ $form = $this->createForm(SiteCredentialType::class, $credential);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
- $credential->setUsername($this->get('wallabag_core.helper.crypto_proxy')->crypt($credential->getUsername()));
- $credential->setPassword($this->get('wallabag_core.helper.crypto_proxy')->crypt($credential->getPassword()));
+ $credential->setUsername($this->get(CryptoProxy::class)->crypt($credential->getUsername()));
+ $credential->setPassword($this->get(CryptoProxy::class)->crypt($credential->getPassword()));
$em = $this->getDoctrine()->getManager();
$em->persist($credential);
$em->flush();
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
- $this->get('translator')->trans('flashes.site_credential.notice.added', ['%host%' => $credential->getHost()])
+ $this->get(TranslatorInterface::class)->trans('flashes.site_credential.notice.added', ['%host%' => $credential->getHost()])
);
return $this->redirectToRoute('site_credentials_index');
}
- return $this->render('WallabagCoreBundle:SiteCredential:new.html.twig', [
+ return $this->render('@WallabagCore/SiteCredential/new.html.twig', [
'credential' => $credential,
'form' => $form->createView(),
]);
@@ -74,7 +83,7 @@ class SiteCredentialController extends Controller
*
* @Route("/{id}/edit", name="site_credentials_edit", methods={"GET", "POST"})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function editAction(Request $request, SiteCredential $siteCredential)
{
@@ -83,26 +92,26 @@ class SiteCredentialController extends Controller
$this->checkUserAction($siteCredential);
$deleteForm = $this->createDeleteForm($siteCredential);
- $editForm = $this->createForm('Wallabag\CoreBundle\Form\Type\SiteCredentialType', $siteCredential);
+ $editForm = $this->createForm(SiteCredentialType::class, $siteCredential);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editForm->isValid()) {
- $siteCredential->setUsername($this->get('wallabag_core.helper.crypto_proxy')->crypt($siteCredential->getUsername()));
- $siteCredential->setPassword($this->get('wallabag_core.helper.crypto_proxy')->crypt($siteCredential->getPassword()));
+ $siteCredential->setUsername($this->get(CryptoProxy::class)->crypt($siteCredential->getUsername()));
+ $siteCredential->setPassword($this->get(CryptoProxy::class)->crypt($siteCredential->getPassword()));
$em = $this->getDoctrine()->getManager();
$em->persist($siteCredential);
$em->flush();
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
- $this->get('translator')->trans('flashes.site_credential.notice.updated', ['%host%' => $siteCredential->getHost()])
+ $this->get(TranslatorInterface::class)->trans('flashes.site_credential.notice.updated', ['%host%' => $siteCredential->getHost()])
);
return $this->redirectToRoute('site_credentials_index');
}
- return $this->render('WallabagCoreBundle:SiteCredential:edit.html.twig', [
+ return $this->render('@WallabagCore/SiteCredential/edit.html.twig', [
'credential' => $siteCredential,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
@@ -114,7 +123,7 @@ class SiteCredentialController extends Controller
*
* @Route("/{id}", name="site_credentials_delete", methods={"DELETE"})
*
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ * @return RedirectResponse
*/
public function deleteAction(Request $request, SiteCredential $siteCredential)
{
@@ -126,9 +135,9 @@ class SiteCredentialController extends Controller
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
- $this->get('translator')->trans('flashes.site_credential.notice.deleted', ['%host%' => $siteCredential->getHost()])
+ $this->get(TranslatorInterface::class)->trans('flashes.site_credential.notice.deleted', ['%host%' => $siteCredential->getHost()])
);
$em = $this->getDoctrine()->getManager();
@@ -144,7 +153,7 @@ class SiteCredentialController extends Controller
*/
private function isSiteCredentialsEnabled()
{
- if (!$this->get('craue_config')->get('restricted_access')) {
+ if (!$this->get(Config::class)->get('restricted_access')) {
throw $this->createNotFoundException('Feature "restricted_access" is disabled, controllers too.');
}
}
@@ -154,7 +163,7 @@ class SiteCredentialController extends Controller
*
* @param SiteCredential $siteCredential The site credential entity
*
- * @return \Symfony\Component\Form\Form The form
+ * @return Form The form
*/
private function createDeleteForm(SiteCredential $siteCredential)
{
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php
index 7df73e8c7..b32f3ad31 100644
--- a/src/Wallabag/CoreBundle/Controller/TagController.php
+++ b/src/Wallabag/CoreBundle/Controller/TagController.php
@@ -8,18 +8,25 @@ use Pagerfanta\Exception\OutOfRangeCurrentPageException;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Form\Type\NewTagType;
use Wallabag\CoreBundle\Form\Type\RenameTagType;
+use Wallabag\CoreBundle\Helper\PreparePagerForEntries;
+use Wallabag\CoreBundle\Helper\Redirect;
+use Wallabag\CoreBundle\Helper\TagsAssigner;
+use Wallabag\CoreBundle\Repository\EntryRepository;
+use Wallabag\CoreBundle\Repository\TagRepository;
class TagController extends Controller
{
/**
* @Route("/new-tag/{entry}", requirements={"entry" = "\d+"}, name="new_tag")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function addTagFormAction(Request $request, Entry $entry)
{
@@ -27,7 +34,7 @@ class TagController extends Controller
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
- $this->get('wallabag_core.tags_assigner')->assignTagsToEntry(
+ $this->get(TagsAssigner::class)->assignTagsToEntry(
$entry,
$form->get('label')->getData()
);
@@ -36,7 +43,7 @@ class TagController extends Controller
$em->persist($entry);
$em->flush();
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
'flashes.tag.notice.tag_added'
);
@@ -44,7 +51,7 @@ class TagController extends Controller
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
}
- return $this->render('WallabagCoreBundle:Tag:new_form.html.twig', [
+ return $this->render('@WallabagCore/Tag/new_form.html.twig', [
'form' => $form->createView(),
'entry' => $entry,
]);
@@ -55,7 +62,7 @@ class TagController extends Controller
*
* @Route("/remove-tag/{entry}/{tag}", requirements={"entry" = "\d+", "tag" = "\d+"}, name="remove_tag")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function removeTagFromEntry(Request $request, Entry $entry, Tag $tag)
{
@@ -69,7 +76,7 @@ class TagController extends Controller
$em->flush();
}
- $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'), '', true);
+ $redirectUrl = $this->get(Redirect::class)->to($request->headers->get('referer'), '', true);
return $this->redirect($redirectUrl);
}
@@ -79,13 +86,13 @@ class TagController extends Controller
*
* @Route("/tag/list", name="tag")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showTagAction()
{
- $tags = $this->get('wallabag_core.tag_repository')
+ $tags = $this->get(TagRepository::class)
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
- $nbEntriesUntagged = $this->get('wallabag_core.entry_repository')
+ $nbEntriesUntagged = $this->get(EntryRepository::class)
->countUntaggedEntriesByUser($this->getUser()->getId());
$renameForms = [];
@@ -93,7 +100,7 @@ class TagController extends Controller
$renameForms[$tag['id']] = $this->createForm(RenameTagType::class, new Tag())->createView();
}
- return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
+ return $this->render('@WallabagCore/Tag/tags.html.twig', [
'tags' => $tags,
'renameForms' => $renameForms,
'nbEntriesUntagged' => $nbEntriesUntagged,
@@ -106,18 +113,18 @@ class TagController extends Controller
* @Route("/tag/list/{slug}/{page}", name="tag_entries", defaults={"page" = "1"})
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function showEntriesForTagAction(Tag $tag, $page, Request $request)
{
- $entriesByTag = $this->get('wallabag_core.entry_repository')->findAllByTagId(
+ $entriesByTag = $this->get(EntryRepository::class)->findAllByTagId(
$this->getUser()->getId(),
$tag->getId()
);
$pagerAdapter = new ArrayAdapter($entriesByTag);
- $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare($pagerAdapter);
+ $entries = $this->get(PreparePagerForEntries::class)->prepare($pagerAdapter);
try {
$entries->setCurrentPage($page);
@@ -130,7 +137,7 @@ class TagController extends Controller
}
}
- return $this->render('WallabagCoreBundle:Entry:entries.html.twig', [
+ return $this->render('@WallabagCore/Entry/entries.html.twig', [
'form' => null,
'entries' => $entries,
'currentPage' => $page,
@@ -145,14 +152,14 @@ class TagController extends Controller
* @Route("/tag/rename/{slug}", name="tag_rename")
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function renameTagAction(Tag $tag, Request $request)
{
$form = $this->createForm(RenameTagType::class, new Tag());
$form->handleRequest($request);
- $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'), '', true);
+ $redirectUrl = $this->get(Redirect::class)->to($request->headers->get('referer'), '', true);
if ($form->isSubmitted() && $form->isValid()) {
$newTag = new Tag();
@@ -162,18 +169,18 @@ class TagController extends Controller
return $this->redirect($redirectUrl);
}
- $tagFromRepo = $this->get('wallabag_core.tag_repository')->findOneByLabel($newTag->getLabel());
+ $tagFromRepo = $this->get(TagRepository::class)->findOneByLabel($newTag->getLabel());
if (null !== $tagFromRepo) {
$newTag = $tagFromRepo;
}
- $entries = $this->get('wallabag_core.entry_repository')->findAllByTagId(
+ $entries = $this->get(EntryRepository::class)->findAllByTagId(
$this->getUser()->getId(),
$tag->getId()
);
foreach ($entries as $entry) {
- $this->get('wallabag_core.tags_assigner')->assignTagsToEntry(
+ $this->get(TagsAssigner::class)->assignTagsToEntry(
$entry,
$newTag->getLabel(),
[$newTag]
@@ -183,7 +190,7 @@ class TagController extends Controller
$this->getDoctrine()->getManager()->flush();
- $this->get('session')->getFlashBag()->add(
+ $this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
'flashes.tag.notice.tag_renamed'
);
@@ -197,20 +204,20 @@ class TagController extends Controller
*
* @Route("/tag/search/{filter}", name="tag_this_search")
*
- * @return \Symfony\Component\HttpFoundation\Response
+ * @return Response
*/
public function tagThisSearchAction($filter, Request $request)
{
$currentRoute = $request->query->has('currentRoute') ? $request->query->get('currentRoute') : '';
/** @var QueryBuilder $qb */
- $qb = $this->get('wallabag_core.entry_repository')->getBuilderForSearchByUser($this->getUser()->getId(), $filter, $currentRoute);
+ $qb = $this->get(EntryRepository::class)->getBuilderForSearchByUser($this->getUser()->getId(), $filter, $currentRoute);
$em = $this->getDoctrine()->getManager();
$entries = $qb->getQuery()->getResult();
foreach ($entries as $entry) {
- $this->get('wallabag_core.tags_assigner')->assignTagsToEntry(
+ $this->get(TagsAssigner::class)->assignTagsToEntry(
$entry,
$filter
);
@@ -220,6 +227,32 @@ class TagController extends Controller
$em->flush();
- return $this->redirect($this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'), '', true));
+ return $this->redirect($this->get(Redirect::class)->to($request->headers->get('referer'), '', true));
+ }
+
+ /**
+ * Delete a given tag for the current user.
+ *
+ * @Route("/tag/delete/{slug}", name="tag_delete")
+ * @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
+ *
+ * @return Response
+ */
+ public function removeTagAction(Tag $tag, Request $request)
+ {
+ foreach ($tag->getEntriesByUserId($this->getUser()->getId()) as $entry) {
+ $this->get(EntryRepository::class)->removeTag($this->getUser()->getId(), $tag);
+ }
+
+ // remove orphan tag in case no entries are associated to it
+ if (0 === \count($tag->getEntries())) {
+ $em = $this->getDoctrine()->getManager();
+ $em->remove($tag);
+ $em->flush();
+ }
+
+ $redirectUrl = $this->get(Redirect::class)->to($request->headers->get('referer'), '', true);
+
+ return $this->redirect($redirectUrl);
}
}
diff --git a/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
index ffcce7173..68cbe2182 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
@@ -8,6 +8,7 @@ use Doctrine\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Entity\SiteCredential;
+use Wallabag\CoreBundle\Helper\CryptoProxy;
use Wallabag\UserBundle\DataFixtures\UserFixtures;
class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface, ContainerAwareInterface
@@ -29,15 +30,15 @@ class SiteCredentialFixtures extends Fixture implements DependentFixtureInterfac
{
$credential = new SiteCredential($this->getReference('admin-user'));
$credential->setHost('.super.com');
- $credential->setUsername($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('.super'));
- $credential->setPassword($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('bar'));
+ $credential->setUsername($this->container->get(CryptoProxy::class)->crypt('.super'));
+ $credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
$manager->persist($credential);
$credential = new SiteCredential($this->getReference('admin-user'));
$credential->setHost('paywall.example.com');
- $credential->setUsername($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('paywall.example'));
- $credential->setPassword($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('bar'));
+ $credential->setUsername($this->container->get(CryptoProxy::class)->crypt('paywall.example'));
+ $credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
$manager->persist($credential);
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
index af91e5886..ac47656c3 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
@@ -2,9 +2,7 @@
namespace Wallabag\CoreBundle\DependencyInjection;
-use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
class WallabagCoreExtension extends Extension
@@ -31,10 +29,6 @@ class WallabagCoreExtension extends Extension
$container->setParameter('wallabag_core.default_internal_settings', $config['default_internal_settings']);
$container->setParameter('wallabag_core.site_credentials.encryption_key_path', $config['encryption_key_path']);
$container->setParameter('wallabag_core.default_ignore_origin_instance_rules', $config['default_ignore_origin_instance_rules']);
-
- $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
- $loader->load('services.yml');
- $loader->load('parameters.yml');
}
public function getAlias()
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index f4e988e2b..5a00c0dbe 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -881,7 +881,7 @@ class Entry
}
/**
- * @return \Datetime
+ * @return \DateTime
*/
public function getPublishedAt()
{
@@ -891,7 +891,7 @@ class Entry
/**
* @return Entry
*/
- public function setPublishedAt(\Datetime $publishedAt)
+ public function setPublishedAt(\DateTime $publishedAt)
{
$this->publishedAt = $publishedAt;
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php
index ef8d7d3bc..125a6f124 100644
--- a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php
+++ b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php
@@ -2,7 +2,7 @@
namespace Wallabag\CoreBundle\Event\Subscriber;
-use Doctrine\ORM\EntityManager;
+use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Wallabag\CoreBundle\Entity\Entry;
@@ -17,7 +17,7 @@ class DownloadImagesSubscriber implements EventSubscriberInterface
private $enabled;
private $logger;
- public function __construct(EntityManager $em, DownloadImages $downloadImages, $enabled, LoggerInterface $logger)
+ public function __construct(EntityManagerInterface $em, DownloadImages $downloadImages, $enabled, LoggerInterface $logger)
{
$this->em = $em;
$this->downloadImages = $downloadImages;
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php
index dcadeedfc..7dd95994a 100644
--- a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php
+++ b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php
@@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Event\Subscriber;
use Doctrine\Bundle\DoctrineBundle\Registry;
use Doctrine\Common\EventSubscriber;
+use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Wallabag\CoreBundle\Entity\Entry;
@@ -40,7 +41,7 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber
public function preRemove(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
- if (!$this->doctrine->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform
+ if (!$this->doctrine->getConnection()->getDatabasePlatform() instanceof SqlitePlatform
|| !$entity instanceof Entry) {
return;
}
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php
index fb8f225fc..939db34d0 100644
--- a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php
+++ b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php
@@ -18,11 +18,11 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo;
*/
class TablePrefixSubscriber implements EventSubscriber
{
- protected $prefix = '';
+ protected $tablePrefix = '';
- public function __construct($prefix)
+ public function __construct($tablePrefix)
{
- $this->prefix = (string) $prefix;
+ $this->tablePrefix = (string) $tablePrefix;
}
public function getSubscribedEvents()
@@ -39,12 +39,12 @@ class TablePrefixSubscriber implements EventSubscriber
return;
}
- $classMetadata->setPrimaryTable(['name' => $this->prefix . $classMetadata->getTableName()]);
+ $classMetadata->setPrimaryTable(['name' => $this->tablePrefix . $classMetadata->getTableName()]);
foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
if (ClassMetadataInfo::MANY_TO_MANY === $mapping['type'] && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) {
$mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name'];
- $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName;
+ $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->tablePrefix . $mappedTableName;
}
}
}
diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
index 81c4a6166..70553a3da 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
@@ -8,7 +8,8 @@ use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
-use Symfony\Component\Validator\Constraints;
+use Symfony\Component\Validator\Constraints\Length;
+use Symfony\Component\Validator\Constraints\NotBlank;
class ChangePasswordType extends AbstractType
{
@@ -26,11 +27,11 @@ class ChangePasswordType extends AbstractType
'first_options' => ['label' => 'config.form_password.new_password_label'],
'second_options' => ['label' => 'config.form_password.repeat_new_password_label'],
'constraints' => [
- new Constraints\Length([
+ new Length([
'min' => 8,
'minMessage' => 'validator.password_too_short',
]),
- new Constraints\NotBlank(),
+ new NotBlank(),
],
'label' => 'config.form_password.new_password_label',
])
diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
index af916b29f..2ea776512 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
@@ -77,7 +77,7 @@ class ConfigType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\CoreBundle\Entity\Config',
+ 'data_class' => Config::class,
]);
}
diff --git a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
index 2fc4c204b..911616594 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
@@ -8,6 +8,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Wallabag\CoreBundle\Entity\Entry;
class EditEntryType extends AbstractType
{
@@ -39,7 +40,7 @@ class EditEntryType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
+ 'data_class' => Entry::class,
]);
}
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
index ba2f53662..44448bfb7 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
@@ -2,7 +2,6 @@
namespace Wallabag\CoreBundle\Form\Type;
-use Doctrine\ORM\EntityRepository;
use Lexik\Bundle\FormFilterBundle\Filter\FilterOperands;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType;
@@ -15,6 +14,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
+use Wallabag\CoreBundle\Repository\EntryRepository;
class EntryFilterType extends AbstractType
{
@@ -24,7 +24,7 @@ class EntryFilterType extends AbstractType
/**
* Repository & user are used to get a list of language entries for this user.
*/
- public function __construct(EntityRepository $entryRepository, TokenStorageInterface $tokenStorage)
+ public function __construct(EntryRepository $entryRepository, TokenStorageInterface $tokenStorage)
{
$this->repository = $entryRepository;
diff --git a/src/Wallabag/CoreBundle/Form/Type/FeedType.php b/src/Wallabag/CoreBundle/Form/Type/FeedType.php
index 9b34daf4c..b2ebddb38 100644
--- a/src/Wallabag/CoreBundle/Form/Type/FeedType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/FeedType.php
@@ -6,6 +6,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Wallabag\CoreBundle\Entity\Config;
class FeedType extends AbstractType
{
@@ -25,7 +26,7 @@ class FeedType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\CoreBundle\Entity\Config',
+ 'data_class' => Config::class,
]);
}
diff --git a/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginInstanceRuleType.php b/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginInstanceRuleType.php
index d2e414fb7..608cbf7cf 100644
--- a/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginInstanceRuleType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginInstanceRuleType.php
@@ -7,6 +7,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
class IgnoreOriginInstanceRuleType extends AbstractType
{
@@ -26,7 +27,7 @@ class IgnoreOriginInstanceRuleType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule',
+ 'data_class' => IgnoreOriginInstanceRule::class,
]);
}
diff --git a/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php b/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php
index b9110f17b..7e96b144f 100644
--- a/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php
@@ -7,6 +7,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
class IgnoreOriginUserRuleType extends AbstractType
{
@@ -26,7 +27,7 @@ class IgnoreOriginUserRuleType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\CoreBundle\Entity\IgnoreOriginUserRule',
+ 'data_class' => IgnoreOriginUserRule::class,
]);
}
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php
index 7af1e5895..ecbd68ba7 100644
--- a/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php
@@ -6,6 +6,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Wallabag\CoreBundle\Entity\Entry;
class NewEntryType extends AbstractType
{
@@ -23,7 +24,7 @@ class NewEntryType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
+ 'data_class' => Entry::class,
]);
}
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewTagType.php b/src/Wallabag/CoreBundle/Form/Type/NewTagType.php
index e830ade48..ed4fa67a2 100644
--- a/src/Wallabag/CoreBundle/Form/Type/NewTagType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/NewTagType.php
@@ -7,6 +7,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Wallabag\CoreBundle\Entity\Tag;
class NewTagType extends AbstractType
{
@@ -28,7 +29,7 @@ class NewTagType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\CoreBundle\Entity\Tag',
+ 'data_class' => Tag::class,
]);
}
diff --git a/src/Wallabag/CoreBundle/Form/Type/RenameTagType.php b/src/Wallabag/CoreBundle/Form/Type/RenameTagType.php
index e62700487..a639b4e9e 100644
--- a/src/Wallabag/CoreBundle/Form/Type/RenameTagType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/RenameTagType.php
@@ -6,6 +6,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Wallabag\CoreBundle\Entity\Tag;
class RenameTagType extends AbstractType
{
@@ -24,7 +25,7 @@ class RenameTagType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\CoreBundle\Entity\Tag',
+ 'data_class' => Tag::class,
]);
}
diff --git a/src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php b/src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php
index fd409ad2c..0bf1acb60 100644
--- a/src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/SiteCredentialType.php
@@ -8,6 +8,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Wallabag\CoreBundle\Entity\SiteCredential;
class SiteCredentialType extends AbstractType
{
@@ -33,7 +34,7 @@ class SiteCredentialType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\CoreBundle\Entity\SiteCredential',
+ 'data_class' => SiteCredential::class,
]);
}
diff --git a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php
index 732606c91..1a356df53 100644
--- a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php
@@ -7,6 +7,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Wallabag\CoreBundle\Entity\TaggingRule;
use Wallabag\CoreBundle\Form\DataTransformer\StringToListTransformer;
class TaggingRuleType extends AbstractType
@@ -35,7 +36,7 @@ class TaggingRuleType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\CoreBundle\Entity\TaggingRule',
+ 'data_class' => TaggingRule::class,
]);
}
diff --git a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
index 6e4c9154c..c8544e428 100644
--- a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
@@ -2,6 +2,7 @@
namespace Wallabag\CoreBundle\Form\Type;
+use FOS\UserBundle\Form\Type\RegistrationFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
@@ -9,6 +10,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Wallabag\UserBundle\Entity\User;
class UserInformationType extends AbstractType
{
@@ -40,13 +42,13 @@ class UserInformationType extends AbstractType
public function getParent()
{
- return 'FOS\UserBundle\Form\Type\RegistrationFormType';
+ return RegistrationFormType::class;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'data_class' => 'Wallabag\UserBundle\Entity\User',
+ 'data_class' => User::class,
]);
}
diff --git a/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php b/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php
index ec951be84..347c0d03b 100644
--- a/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php
+++ b/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php
@@ -16,15 +16,18 @@ class DetectActiveTheme implements DeviceDetectionInterface
{
protected $tokenStorage;
protected $defaultTheme;
+ protected $themes;
/**
* @param TokenStorageInterface $tokenStorage Needed to retrieve the current user
* @param string $defaultTheme Default theme when user isn't logged in
+ * @param array $themes Themes come from the LiipThemeBundle (liip_theme.themes)
*/
- public function __construct(TokenStorageInterface $tokenStorage, $defaultTheme)
+ public function __construct(TokenStorageInterface $tokenStorage, $defaultTheme, $themes)
{
$this->tokenStorage = $tokenStorage;
$this->defaultTheme = $defaultTheme;
+ $this->themes = $themes;
}
public function setUserAgent($userAgent)
@@ -60,6 +63,10 @@ class DetectActiveTheme implements DeviceDetectionInterface
return $this->defaultTheme;
}
+ if (!\in_array($config->getTheme(), $this->themes, true)) {
+ return $this->defaultTheme;
+ }
+
return $config->getTheme();
}
}
diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php
index b15b87dfa..970f5522d 100644
--- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php
+++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php
@@ -189,7 +189,7 @@ class DownloadImages
switch ($ext) {
case 'gif':
// use Imagick if available to keep GIF animation
- if (class_exists('\\Imagick')) {
+ if (class_exists(\Imagick::class)) {
try {
$imagick = new \Imagick();
$imagick->readImageBlob($res->getBody());
diff --git a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php
index ea864acbb..48194c234 100644
--- a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php
+++ b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php
@@ -18,7 +18,7 @@ class HttpClientFactory implements ClientFactory
/** @var [\GuzzleHttp\Event\SubscriberInterface] */
private $subscribers = [];
- /** @var \GuzzleHttp\Cookie\CookieJar */
+ /** @var CookieJar */
private $cookieJar;
private $restrictedAccess;
diff --git a/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php b/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php
index e16101619..9ddd6fae1 100644
--- a/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php
+++ b/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php
@@ -10,7 +10,7 @@ namespace Wallabag\CoreBundle\Operator\Doctrine;
*
* This operator will be used to compile tagging rules in DQL, usable
* by Doctrine ORM.
- * It's registered in RulerZ using a service (wallabag.operator.doctrine.matches);
+ * It's registered in RulerZ using a service;
*/
class Matches
{
diff --git a/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php b/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php
index 8e50f8d67..a106b0f09 100644
--- a/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php
+++ b/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php
@@ -10,7 +10,7 @@ namespace Wallabag\CoreBundle\Operator\Doctrine;
*
* This operator will be used to compile tagging rules in DQL, usable
* by Doctrine ORM.
- * It's registered in RulerZ using a service (wallabag.operator.doctrine.notmatches);
+ * It's registered in RulerZ using a service;
*/
class NotMatches
{
diff --git a/src/Wallabag/CoreBundle/Operator/PHP/Matches.php b/src/Wallabag/CoreBundle/Operator/PHP/Matches.php
index bc0c3f8f7..ef553a899 100644
--- a/src/Wallabag/CoreBundle/Operator/PHP/Matches.php
+++ b/src/Wallabag/CoreBundle/Operator/PHP/Matches.php
@@ -10,7 +10,7 @@ namespace Wallabag\CoreBundle\Operator\PHP;
*
* This operator will be used to compile tagging rules in PHP, usable
* directly on Entry objects for instance.
- * It's registered in RulerZ using a service (wallabag.operator.array.matches);
+ * It's registered in RulerZ using a service;
*/
class Matches
{
diff --git a/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php b/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php
index bd4d887a6..6b383c0f6 100644
--- a/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php
+++ b/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php
@@ -10,7 +10,7 @@ namespace Wallabag\CoreBundle\Operator\PHP;
*
* This operator will be used to compile tagging rules in PHP, usable
* directly on Entry objects for instance.
- * It's registered in RulerZ using a service (wallabag.operator.array.notmatches);
+ * It's registered in RulerZ using a service;
*/
class NotMatches
{
diff --git a/src/Wallabag/CoreBundle/Operator/PHP/PatternMatches.php b/src/Wallabag/CoreBundle/Operator/PHP/PatternMatches.php
index 532e2bb39..872187434 100644
--- a/src/Wallabag/CoreBundle/Operator/PHP/PatternMatches.php
+++ b/src/Wallabag/CoreBundle/Operator/PHP/PatternMatches.php
@@ -10,7 +10,7 @@ namespace Wallabag\CoreBundle\Operator\PHP;
*
* This operator will be used to compile ignore origin rules in PHP, usable
* directly on Entry objects for instance.
- * It's registered in RulerZ using a service (wallabag.operator.array.pattern_matches);
+ * It's registered in RulerZ using a service;
*/
class PatternMatches
{
diff --git a/src/Wallabag/CoreBundle/Repository/ConfigRepository.php b/src/Wallabag/CoreBundle/Repository/ConfigRepository.php
index b2b1f627a..c09aabd19 100644
--- a/src/Wallabag/CoreBundle/Repository/ConfigRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/ConfigRepository.php
@@ -2,8 +2,14 @@
namespace Wallabag\CoreBundle\Repository;
-use Doctrine\ORM\EntityRepository;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
+use Doctrine\Persistence\ManagerRegistry;
+use Wallabag\CoreBundle\Entity\Config;
-class ConfigRepository extends EntityRepository
+class ConfigRepository extends ServiceEntityRepository
{
+ public function __construct(ManagerRegistry $registry)
+ {
+ parent::__construct($registry, Config::class);
+ }
}
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index 8bb48a889..7cadb091a 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -2,17 +2,23 @@
namespace Wallabag\CoreBundle\Repository;
-use Doctrine\ORM\EntityRepository;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\NoResultException;
use Doctrine\ORM\QueryBuilder;
+use Doctrine\Persistence\ManagerRegistry;
use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter;
use Pagerfanta\Pagerfanta;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Helper\UrlHasher;
-class EntryRepository extends EntityRepository
+class EntryRepository extends ServiceEntityRepository
{
+ public function __construct(ManagerRegistry $registry)
+ {
+ parent::__construct($registry, Entry::class);
+ }
+
/**
* Retrieves all entries for a user.
*
diff --git a/src/Wallabag/CoreBundle/Repository/IgnoreOriginInstanceRuleRepository.php b/src/Wallabag/CoreBundle/Repository/IgnoreOriginInstanceRuleRepository.php
index 708a0edee..ccf321174 100644
--- a/src/Wallabag/CoreBundle/Repository/IgnoreOriginInstanceRuleRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/IgnoreOriginInstanceRuleRepository.php
@@ -2,8 +2,14 @@
namespace Wallabag\CoreBundle\Repository;
-use Doctrine\ORM\EntityRepository;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
+use Doctrine\Persistence\ManagerRegistry;
+use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
-class IgnoreOriginInstanceRuleRepository extends EntityRepository
+class IgnoreOriginInstanceRuleRepository extends ServiceEntityRepository
{
+ public function __construct(ManagerRegistry $registry)
+ {
+ parent::__construct($registry, IgnoreOriginInstanceRule::class);
+ }
}
diff --git a/src/Wallabag/CoreBundle/Repository/IgnoreOriginUserRuleRepository.php b/src/Wallabag/CoreBundle/Repository/IgnoreOriginUserRuleRepository.php
index 8aa4c2652..f41c5b7b4 100644
--- a/src/Wallabag/CoreBundle/Repository/IgnoreOriginUserRuleRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/IgnoreOriginUserRuleRepository.php
@@ -2,8 +2,14 @@
namespace Wallabag\CoreBundle\Repository;
-use Doctrine\ORM\EntityRepository;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
+use Doctrine\Persistence\ManagerRegistry;
+use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
-class IgnoreOriginUserRuleRepository extends EntityRepository
+class IgnoreOriginUserRuleRepository extends ServiceEntityRepository
{
+ public function __construct(ManagerRegistry $registry)
+ {
+ parent::__construct($registry, IgnoreOriginUserRule::class);
+ }
}
diff --git a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php
index aeadd7704..0c2ad6fb5 100644
--- a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php
@@ -2,17 +2,22 @@
namespace Wallabag\CoreBundle\Repository;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
+use Doctrine\Persistence\ManagerRegistry;
+use Wallabag\CoreBundle\Entity\SiteCredential;
use Wallabag\CoreBundle\Helper\CryptoProxy;
/**
* SiteCredentialRepository.
*/
-class SiteCredentialRepository extends \Doctrine\ORM\EntityRepository
+class SiteCredentialRepository extends ServiceEntityRepository
{
private $cryptoProxy;
- public function setCrypto(CryptoProxy $cryptoProxy)
+ public function __construct(ManagerRegistry $registry, CryptoProxy $cryptoProxy)
{
+ parent::__construct($registry, SiteCredential::class);
+
$this->cryptoProxy = $cryptoProxy;
}
diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php
index 3e64f8b26..ffa2c0b36 100644
--- a/src/Wallabag/CoreBundle/Repository/TagRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php
@@ -2,12 +2,18 @@
namespace Wallabag\CoreBundle\Repository;
-use Doctrine\ORM\EntityRepository;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\QueryBuilder;
+use Doctrine\Persistence\ManagerRegistry;
use Wallabag\CoreBundle\Entity\Tag;
-class TagRepository extends EntityRepository
+class TagRepository extends ServiceEntityRepository
{
+ public function __construct(ManagerRegistry $registry)
+ {
+ parent::__construct($registry, Tag::class);
+ }
+
/**
* Count all tags per user.
*
diff --git a/src/Wallabag/CoreBundle/Repository/TaggingRuleRepository.php b/src/Wallabag/CoreBundle/Repository/TaggingRuleRepository.php
index de3807388..3f38dc85d 100644
--- a/src/Wallabag/CoreBundle/Repository/TaggingRuleRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/TaggingRuleRepository.php
@@ -2,8 +2,14 @@
namespace Wallabag\CoreBundle\Repository;
-use Doctrine\ORM\EntityRepository;
+use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
+use Doctrine\Persistence\ManagerRegistry;
+use Wallabag\CoreBundle\Entity\TaggingRule;
-class TaggingRuleRepository extends EntityRepository
+class TaggingRuleRepository extends ServiceEntityRepository
{
+ public function __construct(ManagerRegistry $registry)
+ {
+ parent::__construct($registry, TaggingRule::class);
+ }
}
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
deleted file mode 100644
index 5dfdb9a26..000000000
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ /dev/null
@@ -1,270 +0,0 @@
-services:
- wallabag_core.helper.detect_active_theme:
- class: Wallabag\CoreBundle\Helper\DetectActiveTheme
- arguments:
- - "@security.token_storage"
- - "%wallabag_core.theme%"
-
- # custom form type
- wallabag_core.form.type.config:
- class: Wallabag\CoreBundle\Form\Type\ConfigType
- arguments:
- - "%liip_theme.themes%"
- - "%wallabag_core.languages%"
- tags:
- - { name: form.type }
-
- wallabag_core.filter.type.entry:
- class: Wallabag\CoreBundle\Form\Type\EntryFilterType
- arguments:
- - "@wallabag_core.entry_repository"
- - "@security.token_storage"
- tags:
- - { name: form.type }
-
- wallabag_core.param_converter.username_feed_token_converter:
- class: Wallabag\CoreBundle\ParamConverter\UsernameFeedTokenConverter
- tags:
- - { name: request.param_converter, converter: username_feed_token_converter }
- arguments:
- - "@doctrine"
-
- wallabag_core.subscriber.table_prefix:
- class: Wallabag\CoreBundle\Event\Subscriber\TablePrefixSubscriber
- arguments:
- - "%database_table_prefix%"
- tags:
- - { name: doctrine.event_subscriber }
-
- wallabag_core.graby:
- class: Graby\Graby
- arguments:
- -
- error_message: '%wallabag_core.fetching_error_message%'
- error_message_title: '%wallabag_core.fetching_error_message_title%'
- - "@wallabag_core.http_client"
- - "@wallabag_core.graby.config_builder"
- calls:
- - [ setLogger, [ "@logger" ] ]
- tags:
- - { name: monolog.logger, channel: graby }
-
- wallabag_core.graby.config_builder:
- class: Graby\SiteConfig\ConfigBuilder
- arguments:
- - {}
- - "@logger"
-
- wallabag_core.http_client:
- alias: 'httplug.client.wallabag_core'
-
- wallabag_core.guzzle_authenticator.config_builder:
- class: Wallabag\CoreBundle\GuzzleSiteAuthenticator\GrabySiteConfigBuilder
- arguments:
- - "@wallabag_core.graby.config_builder"
- - "@security.token_storage"
- - "@wallabag_core.site_credential_repository"
- - '@logger'
- tags:
- - { name: monolog.logger, channel: graby }
-
- # service alias override
- bd_guzzle_site_authenticator.site_config_builder:
- alias: wallabag_core.guzzle_authenticator.config_builder
-
- wallabag_core.http_client_factory:
- class: Wallabag\CoreBundle\Helper\HttpClientFactory
- arguments:
- - "@wallabag_core.guzzle.cookie_jar"
- - '@=service(''craue_config'').get(''restricted_access'')'
- - '@logger'
- calls:
- - ["addSubscriber", ["@bd_guzzle_site_authenticator.authenticator_subscriber"]]
-
- wallabag_core.guzzle.cookie_jar:
- class: Wallabag\CoreBundle\Helper\FileCookieJar
- arguments:
- - "@logger"
- - "%kernel.cache_dir%/cookiejar.json"
-
- wallabag_core.content_proxy:
- class: Wallabag\CoreBundle\Helper\ContentProxy
- arguments:
- - "@wallabag_core.graby"
- - "@wallabag_core.rule_based_tagger"
- - "@wallabag_core.rule_based_ignore_origin_processor"
- - "@validator"
- - "@logger"
- - '%wallabag_core.fetching_error_message%'
- - '@=service(''craue_config'').get(''store_article_headers'')'
-
- wallabag_core.tags_assigner:
- class: Wallabag\CoreBundle\Helper\TagsAssigner
- arguments:
- - "@wallabag_core.tag_repository"
-
- wallabag_core.rule_based_tagger:
- class: Wallabag\CoreBundle\Helper\RuleBasedTagger
- arguments:
- - "@rulerz"
- - "@wallabag_core.tag_repository"
- - "@wallabag_core.entry_repository"
- - "@logger"
-
- wallabag_core.rule_based_ignore_origin_processor:
- class: Wallabag\CoreBundle\Helper\RuleBasedIgnoreOriginProcessor
- arguments:
- - "@rulerz"
- - "@logger"
- - "@wallabag_core.ignore_origin_instance_rule_repository"
-
- # repository as a service
- wallabag_core.entry_repository:
- class: Wallabag\CoreBundle\Repository\EntryRepository
- factory: [ "@doctrine.orm.default_entity_manager", getRepository ]
- arguments:
- - WallabagCoreBundle:Entry
-
- wallabag_core.tag_repository:
- class: Wallabag\CoreBundle\Repository\TagRepository
- factory: [ "@doctrine.orm.default_entity_manager", getRepository ]
- arguments:
- - WallabagCoreBundle:Tag
-
- wallabag_core.site_credential_repository:
- class: Wallabag\CoreBundle\Repository\SiteCredentialRepository
- factory: [ "@doctrine.orm.default_entity_manager", getRepository ]
- arguments:
- - WallabagCoreBundle:SiteCredential
- calls:
- - [ setCrypto, [ "@wallabag_core.helper.crypto_proxy" ] ]
-
- wallabag_core.ignore_origin_instance_rule_repository:
- class: Wallabag\CoreBundle\Repository\IgnoreOriginInstanceRuleRepository
- factory: [ "@doctrine.orm.default_entity_manager", getRepository ]
- arguments:
- - WallabagCoreBundle:IgnoreOriginInstanceRule
-
- wallabag_core.helper.entries_export:
- class: Wallabag\CoreBundle\Helper\EntriesExport
- arguments:
- - "@translator"
- - '%domain_name%'
- - web/img/appicon/apple-touch-icon-152.png
- - "@security.token_storage"
-
- wallabag.operator.array.matches:
- class: Wallabag\CoreBundle\Operator\PHP\Matches
- tags:
- - { name: rulerz.operator, target: native, operator: matches }
-
- wallabag.operator.doctrine.matches:
- class: Wallabag\CoreBundle\Operator\Doctrine\Matches
- tags:
- - { name: rulerz.operator, target: doctrine, operator: matches, inline: true }
-
- wallabag.operator.array.notmatches:
- class: Wallabag\CoreBundle\Operator\PHP\NotMatches
- tags:
- - { name: rulerz.operator, target: native, operator: notmatches }
-
- wallabag.operator.doctrine.notmatches:
- class: Wallabag\CoreBundle\Operator\Doctrine\NotMatches
- tags:
- - { name: rulerz.operator, target: doctrine, operator: notmatches, inline: true }
-
- wallabag.operator.array.pattern_matches:
- class: Wallabag\CoreBundle\Operator\PHP\PatternMatches
- tags:
- - { name: rulerz.operator, target: native, operator: "~" }
-
- wallabag_core.helper.redirect:
- class: Wallabag\CoreBundle\Helper\Redirect
- arguments:
- - "@router"
- - "@security.token_storage"
-
- wallabag_core.helper.prepare_pager_for_entries:
- class: Wallabag\CoreBundle\Helper\PreparePagerForEntries
- arguments:
- - "@security.token_storage"
- - "@router"
-
- wallabag_core.redis.client:
- class: Predis\Client
- arguments:
- -
- scheme: '%redis_scheme%'
- host: '%redis_host%'
- port: '%redis_port%'
- path: '%redis_path%'
- password: '%redis_password%'
-
- wallabag_core.exception_controller:
- class: Wallabag\CoreBundle\Controller\ExceptionController
- public: true
- arguments:
- - '@twig'
- - '%kernel.debug%'
-
- wallabag_core.subscriber.sqlite_cascade_delete:
- class: Wallabag\CoreBundle\Event\Subscriber\SQLiteCascadeDeleteSubscriber
- arguments:
- - "@doctrine"
- tags:
- - { name: doctrine.event_subscriber }
-
- wallabag_core.subscriber.download_images:
- class: Wallabag\CoreBundle\Event\Subscriber\DownloadImagesSubscriber
- arguments:
- - "@doctrine.orm.default_entity_manager"
- - "@wallabag_core.entry.download_images"
- - '@=service(''craue_config'').get(''download_images_enabled'')'
- - "@logger"
- tags:
- - { name: kernel.event_subscriber }
-
- wallabag_core.entry.download_images:
- class: Wallabag\CoreBundle\Helper\DownloadImages
- arguments:
- - "@wallabag_core.entry.download_images.client"
- - "%kernel.project_dir%/web/assets/images"
- - '%domain_name%'
- - "@logger"
-
- wallabag_core.entry.download_images.client:
- alias: 'httplug.client.wallabag_core.entry.download_images'
-
- wallabag_core.helper.crypto_proxy:
- class: Wallabag\CoreBundle\Helper\CryptoProxy
- arguments:
- - "%wallabag_core.site_credentials.encryption_key_path%"
- - "@logger"
-
- wallabag_core.command.clean_duplicates:
- class: Wallabag\CoreBundle\Command\CleanDuplicatesCommand
- tags: ['console.command']
-
- wallabag_core.command.export:
- class: Wallabag\CoreBundle\Command\ExportCommand
- tags: ['console.command']
-
- wallabag_core.command.install:
- class: Wallabag\CoreBundle\Command\InstallCommand
- tags: ['console.command']
-
- wallabag_core.command.list_user:
- class: Wallabag\CoreBundle\Command\ListUserCommand
- tags: ['console.command']
-
- wallabag_core.command.reload_entry:
- class: Wallabag\CoreBundle\Command\ReloadEntryCommand
- tags: ['console.command']
-
- wallabag_core.command.show_user:
- class: Wallabag\CoreBundle\Command\ShowUserCommand
- tags: ['console.command']
-
- wallabag_core.command.tag_all:
- class: Wallabag\CoreBundle\Command\TagAllCommand
- tags: ['console.command']
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index d4d9cf557..defd81ac7 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -457,6 +457,8 @@ quickstart:
email: By email
gitter: On Gitter
tag:
+ confirm:
+ delete: Delete the %name% tag
page_title: Tags
list:
number_on_the_page: '{0} There are no tags.|{1} There is one tag.|]1,Inf[ There are %count% tags.'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index c3fc7bb90..7adedc13e 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -458,6 +458,8 @@ quickstart:
email: Par courriel
gitter: Sur Gitter
tag:
+ confirm:
+ delete: Supprimer le tag %name%
page_title: Étiquettes
list:
number_on_the_page: '{0} Il n’y a pas d''étiquette.|{1} Il y a une étiquette.|]1,Inf[ Il y a %count% étiquettes.'
diff --git a/src/Wallabag/CoreBundle/Resources/views/base.html.twig b/src/Wallabag/CoreBundle/Resources/views/base.html.twig
index 9d3352d98..00e66482f 100644
--- a/src/Wallabag/CoreBundle/Resources/views/base.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/base.html.twig
@@ -49,7 +49,7 @@
{% endif %}
{% block scripts %}
-
+
{% endblock %}
{% block title %}{% endblock %} – wallabag
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
deleted file mode 100644
index 3ce48dfa3..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
+++ /dev/null
@@ -1,503 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'config.page_title'|trans }}{% endblock %}
-
-{% block content %}
-
{{ 'config.tab_menu.settings'|trans }}
-
- {{ form_start(form.config) }}
- {{ form_errors(form.config) }}
-
-
-
- {{ form_label(form.config.theme) }}
- {{ form_errors(form.config.theme) }}
- {{ form_widget(form.config.theme) }}
-
-
- live_help
-
-
-
-
-
- {{ form_label(form.config.items_per_page) }}
- {{ form_errors(form.config.items_per_page) }}
- {{ form_widget(form.config.items_per_page) }}
-
-
- live_help
-
-
-
-
-
- {{ form_label(form.config.reading_speed) }}
- {{ form_errors(form.config.reading_speed) }}
- {{ form_widget(form.config.reading_speed) }}
-
- {{ 'config.form_settings.reading_speed.help_message'|trans }}
- myreadspeed
-
-
-
- live_help
-
-
-
-
-
- {{ form_label(form.config.action_mark_as_read) }}
- {{ form_errors(form.config.action_mark_as_read) }}
- {{ form_widget(form.config.action_mark_as_read) }}
-
-
-
-
-
- {{ form_label(form.config.language) }}
- {{ form_errors(form.config.language) }}
- {{ form_widget(form.config.language) }}
-
-
- live_help
-
-
-
-
-
-
- live_help
-
-
-
-
-
-
-
- {{ form_rest(form.config) }}
-
-
-
{{ 'config.tab_menu.feed'|trans }}
-
- {{ form_start(form.feed) }}
- {{ form_errors(form.feed) }}
-
-
- {{ 'config.form_feed.description'|trans }}
-
-
-
-
-
-
- {% if feed.token %}
-
-
-
{{ 'config.form_feed.feed_links'|trans }}
-
-
-
- {% endif %}
-
-
-
- {{ form_label(form.feed.feed_limit) }}
- {{ form_errors(form.feed.feed_limit) }}
- {{ form_widget(form.feed.feed_limit) }}
-
-
-
- {{ form_rest(form.feed) }}
-
-
-
{{ 'config.tab_menu.user_info'|trans }}
-
- {{ form_start(form.user) }}
- {{ form_errors(form.user) }}
-
-
- {{ 'config.form_user.login_label'|trans }}
- {{ app.user.username }}
-
-
-
-
-
- {{ form_label(form.user.name) }}
- {{ form_errors(form.user.name) }}
- {{ form_widget(form.user.name) }}
-
-
-
-
-
- {{ form_label(form.user.email) }}
- {{ form_errors(form.user.email) }}
- {{ form_widget(form.user.email) }}
-
-
-
- {{ form_widget(form.user.save) }}
-
- {% if twofactor_auth %}
-
{{ 'config.otp.page_title'|trans }}
-
-
- {{ 'config.form_user.two_factor_description'|trans }}
-
-
-
-
-
- {{ 'config.form_user.two_factor.table_method'|trans }}
- {{ 'config.form_user.two_factor.table_state'|trans }}
- {{ 'config.form_user.two_factor.table_action'|trans }}
-
-
-
-
-
- {{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}
- {% if app.user.isEmailTwoFactor %}{{ 'config.form_user.two_factor.state_enabled'|trans }} {% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}
- {{ 'config.form_user.two_factor.action_email'|trans }} {% if app.user.isEmailTwoFactor %}Disable {% endif %}
-
-
- {{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}
- {% if app.user.isGoogleTwoFactor %}{{ 'config.form_user.two_factor.state_enabled'|trans }} {% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}
- {{ 'config.form_user.two_factor.action_app'|trans }} {% if app.user.isGoogleTwoFactor %}Disable {% endif %}
-
-
-
-
- {% endif %}
-
- {{ form_widget(form.user._token) }}
-
-
- {% if enabled_users > 1 %}
-
{{ 'config.form_user.delete.title'|trans }}
-
-
{{ 'config.form_user.delete.description'|trans }}
-
- {{ 'config.form_user.delete.button'|trans }}
-
- {% endif %}
-
-
{{ 'config.tab_menu.password'|trans }}
-
- {{ form_start(form.pwd) }}
- {{ form_errors(form.pwd) }}
-
-
- {{ 'config.form_password.description'|trans }}
-
-
-
-
- {{ form_label(form.pwd.old_password) }}
- {{ form_errors(form.pwd.old_password) }}
- {{ form_widget(form.pwd.old_password) }}
-
-
-
-
-
- {{ form_label(form.pwd.new_password.first) }}
- {{ form_errors(form.pwd.new_password.first) }}
- {{ form_widget(form.pwd.new_password.first) }}
-
-
-
-
-
- {{ form_label(form.pwd.new_password.second) }}
- {{ form_errors(form.pwd.new_password.second) }}
- {{ form_widget(form.pwd.new_password.second) }}
-
-
-
- {{ form_rest(form.pwd) }}
-
-
-
{{ 'config.tab_menu.rules'|trans }}
-
-
- {% for tagging_rule in app.user.config.taggingRules %}
-
- {{ 'config.form_rules.if_label'|trans }}
- « {{ tagging_rule.rule }} »
- {{ 'config.form_rules.then_tag_as_label'|trans }}
- « {{ tagging_rule.tags|join(', ') }} »
- ✎
-
-
- {% endfor %}
-
-
- {{ form_start(form.new_tagging_rule) }}
- {{ form_errors(form.new_tagging_rule) }}
-
-
-
- {{ form_label(form.new_tagging_rule.rule) }}
- {{ form_errors(form.new_tagging_rule.rule) }}
- {{ form_widget(form.new_tagging_rule.rule) }}
-
-
-
-
-
- {{ form_label(form.new_tagging_rule.tags) }}
- {{ form_errors(form.new_tagging_rule.tags) }}
- {{ form_widget(form.new_tagging_rule.tags) }}
-
-
-
- {{ form_rest(form.new_tagging_rule) }}
-
-
-
-
{{ 'config.form_rules.card.import_tagging_rules'|trans }}
-
{{ 'config.form_rules.card.import_tagging_rules_detail'|trans }}
-
-
- {{ form_start(form.import_tagging_rule) }}
- {{ form_errors(form.import_tagging_rule) }}
-
-
-
- {{ form_label(form.import_tagging_rule.file) }}
- {{ form_errors(form.import_tagging_rule.file) }}
- {{ form_widget(form.import_tagging_rule.file) }}
-
-
-
- {{ form_rest(form.import_tagging_rule) }}
-
-
- {% if app.user.config.taggingRules is not empty %}
-
- {% endif %}
-
-
-
-
{{ 'config.tab_menu.ignore_origin'|trans }}
-
-
- {% for ignore_origin_rule in app.user.config.ignoreOriginRules %}
-
- {{ 'config.form_rules.if_label'|trans }}
- « {{ ignore_origin_rule.rule }} »
- ✎
-
-
- {% endfor %}
-
-
- {{ form_start(form.new_ignore_origin_user_rule) }}
- {{ form_errors(form.new_ignore_origin_user_rule) }}
-
-
-
- {{ form_label(form.new_ignore_origin_user_rule.rule) }}
- {{ form_errors(form.new_ignore_origin_user_rule.rule) }}
- {{ form_widget(form.new_ignore_origin_user_rule.rule) }}
-
-
-
- {{ form_rest(form.new_ignore_origin_user_rule) }}
-
-
-
-
-
{{ 'config.reset.title'|trans }}
-
- {{ 'config.reset.description'|trans }}
-
-
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig
deleted file mode 100644
index b16e6a050..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig
+++ /dev/null
@@ -1,55 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'config.page_title'|trans }} > {{ 'config.otp.page_title'|trans }}{% endblock %}
-
-{% block content %}
-
{{ 'config.otp.page_title'|trans }}
-
-
-
- {{ 'config.otp.app.two_factor_code_description_1'|trans }}
- {{ 'config.otp.app.two_factor_code_description_2'|trans }}
-
-
-
-
-
-
-
- {{ 'config.otp.app.two_factor_code_description_3'|trans }}
-
- {{ backupCodes|join("\n")|nl2br }}
-
-
- {{ 'config.otp.app.two_factor_code_description_4'|trans }}
-
- {% for flashMessage in app.session.flashbag.get("two_factor") %}
-
- {{ flashMessage|trans }}
-
- {% endfor %}
-
-
-
-
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/edit.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/edit.html.twig
deleted file mode 100644
index e974fc694..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/edit.html.twig
+++ /dev/null
@@ -1,7 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'entry.edit.page_title'|trans }}{% endblock %}
-
-{% block content %}
- {{ form(form) }}
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
deleted file mode 100644
index 8dc6fd507..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
+++ /dev/null
@@ -1,219 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block head %}
- {{ parent() }}
- {% if tag is defined and app.user.config.feedToken %}
-
- {% endif %}
-{% endblock %}
-
-{% block title %}
- {% set filter = '' %}
- {% if tag is defined %}
- {% set filter = tag %}
- {% endif %}
- {% if searchTerm is defined and searchTerm is not empty %}
- {% set filter = searchTerm %}
- {% endif %}
- {% include "@WallabagCore/themes/common/Entry/_title.html.twig" with {'filter': filter} %}
-{% endblock %}
-
-{% block content %}
- {% set currentRoute = app.request.attributes.get('_route') %}
- {% if currentRoute == 'homepage' %}
- {% set currentRoute = 'unread' %}
- {% endif %}
- {% set listMode = app.user.config.listMode %}
-
-
{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
-
-
-
- {% for entry in entries %}
-
-
-
- {% set readingTime = entry.readingTime / app.user.config.readingSpeed * 200 %}
-
-
- {% if readingTime > 0 %}
- {{ 'entry.list.reading_time_minutes'|trans({'%readingTime%': readingTime|round}) }}
- {% else %}
- {{ 'entry.list.reading_time_less_one_minute'|trans|raw }}
- {% endif %}
-
-
-
- {{ entry.createdAt|date('Y-m-d') }}
-
-
-
-
-
- {% if (entry.previewPicture is null or listMode == 1) %}
-
-
{{ entry.content|striptags|slice(0, 300) }}…
- {% else %}
-
- {% for tag in entry.tags | slice(0, 3) %}
- {{ tag.label }}
- {% endfor %}
-
-
- {% endif %}
-
- {% endfor %}
-
- {% if entries.getNbPages > 1 %}
- {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
- {% endif %}
-
-
-
-
-
- {% if form is not null %}
-
- {% endif %}
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
deleted file mode 100644
index 42f33f54e..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
+++ /dev/null
@@ -1,116 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ entry.title|e|default('entry.default_title'|trans)|raw }} ({{ entry.domainName|removeWww }}){% endblock %}
-
-{% block content %}
-
-
- {{ entry.title|e|default('entry.default_title'|trans)|raw }} ✎
-
-
-
-
-
-
- {{ entry.createdAt|date('Y-m-d H:i') }}
-
-
- {% if entry.publishedAt is not null %}
-
- {{ entry.publishedAt|date('Y-m-d H:i') }}
-
- {% endif %}
-
- {% if entry.publishedBy is not empty %}
-
- {% for author in entry.publishedBy %}
- {{ author }}{% if not loop.last %}, {% endif %}
- {% endfor %}
-
- {% endif %}
-
-
- {% set readingTime = entry.readingTime / app.user.config.readingSpeed * 200 %}
- {% if readingTime > 0 %}
- {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }}
- {% else %}
- {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }}
- {% endif %}
-
-
-
comment {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}
-
- {% if entry.originUrl is not empty %}
-
launch
-
- {{ entry.originUrl|striptags|removeSchemeAndWww|truncate(32) }}
-
- {% endif %}
-
-
-
-
- {{ entry.content | raw }}
-
-
-
-
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/new.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/new.html.twig
deleted file mode 100644
index 03768a3d8..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/new.html.twig
+++ /dev/null
@@ -1,7 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'entry.new.page_title'|trans }}{% endblock %}
-
-{% block content %}
- {{ render(controller( "WallabagCoreBundle:Entry:addEntryForm" )) }}
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/new_form.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/new_form.html.twig
deleted file mode 100644
index 8c1290681..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/new_form.html.twig
+++ /dev/null
@@ -1,14 +0,0 @@
-
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/search_form.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/search_form.html.twig
deleted file mode 100644
index 20821b6d3..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/search_form.html.twig
+++ /dev/null
@@ -1,17 +0,0 @@
-
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Exception/error.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Exception/error.html.twig
deleted file mode 100644
index c6bf24810..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Exception/error.html.twig
+++ /dev/null
@@ -1,24 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'error.page_title'|trans }}{% endblock %}
-
-{% block body_class %}login{% endblock %}
-
-{% block menu %}{% endblock %}
-{% block messages %}{% endblock %}
-{% block header %}{% endblock %}
-
-{% block content %}
-
-
-
-
-
{{ status_code }}: {{ status_text }}
-
{{ exception.message }}
-
-
-
-{% endblock %}
-
-{% block footer %}
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/IgnoreOriginInstanceRule/edit.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/IgnoreOriginInstanceRule/edit.html.twig
deleted file mode 100644
index 30c2a520f..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/IgnoreOriginInstanceRule/edit.html.twig
+++ /dev/null
@@ -1,87 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'ignore_origin_instance_rule.page_title'|trans }}{% endblock %}
-
-{% block content %}
-
-
-
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/IgnoreOriginInstanceRule/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/IgnoreOriginInstanceRule/index.html.twig
deleted file mode 100644
index 2de7cf0a4..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/IgnoreOriginInstanceRule/index.html.twig
+++ /dev/null
@@ -1,42 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'ignore_origin_instance_rule.page_title'|trans }}{% endblock %}
-
-{% block content %}
-
-
-
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/IgnoreOriginInstanceRule/new.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/IgnoreOriginInstanceRule/new.html.twig
deleted file mode 100644
index cb052ff05..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/IgnoreOriginInstanceRule/new.html.twig
+++ /dev/null
@@ -1,80 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'ignore_origin_instance_rule.page_title'|trans }}{% endblock %}
-
-{% block content %}
-
-
-
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Mail/forgotPassword.txt.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Mail/forgotPassword.txt.twig
deleted file mode 100644
index 631bcb887..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Mail/forgotPassword.txt.twig
+++ /dev/null
@@ -1,6 +0,0 @@
-Hello {{username}}!
-
-To reset your password - please visit {{confirmationUrl}}
-
-Regards,
-Wallabag bot
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/README.md b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/README.md
deleted file mode 100644
index 3db078735..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Baggy Theme
-
-theme created by Thomas LEBEAU alias Courgette http://thomaslebeau.fr/
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/edit.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/edit.html.twig
deleted file mode 100644
index 882be430f..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/edit.html.twig
+++ /dev/null
@@ -1,60 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'site_credential.page_title'|trans }}{% endblock %}
-
-{% block content %}
-
-
-
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/index.html.twig
deleted file mode 100644
index 324854add..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/index.html.twig
+++ /dev/null
@@ -1,42 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'site_credential.page_title'|trans }}{% endblock %}
-
-{% block content %}
-
-
-
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/new.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/new.html.twig
deleted file mode 100644
index 3c008cdec..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/SiteCredential/new.html.twig
+++ /dev/null
@@ -1,53 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'site_credential.page_title'|trans }}{% endblock %}
-
-{% block content %}
-
-
-
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/new_form.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/new_form.html.twig
deleted file mode 100644
index 6e552560e..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/new_form.html.twig
+++ /dev/null
@@ -1,13 +0,0 @@
-
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig
deleted file mode 100644
index aa17b8428..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig
+++ /dev/null
@@ -1,40 +0,0 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
-
-{% block title %}{{ 'tag.page_title'|trans }}{% endblock %}
-
-{% block content %}
-
-
{{ 'tag.list.number_on_the_page'|transchoice(tags|length) }}
-
-
-
-
-
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
deleted file mode 100644
index d0be1e5cc..000000000
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
+++ /dev/null
@@ -1,77 +0,0 @@
-{% extends "WallabagCoreBundle::base.html.twig" %}
-
-{% block css %}
- {{ parent() }}
- {% if not app.debug %}
-
- {% endif %}
-{% endblock %}
-
-{% block scripts %}
- {{ parent() }}
-
-{% endblock %}
-
-{% block header %}
-
-
- {% block logo %}
-
-
-
- {% endblock %}
-
-
-{% endblock %}
-
-{% block menu %}
-
-
-
-
-
-
-
-
- {{ 'menu.left.search'|trans }}
-
-
- {% if craue_setting('restricted_access') %}
-
- {% endif %}
-
- {% if is_granted('ROLE_SUPER_ADMIN') %}
-
-
-
- {% endif %}
-
-
-
-
-
-
-
-{% endblock %}
-
-{% block messages %}
-
-
⚠️ You are using the Baggy theme which is now deprecated.
-
It will be removed in the next version. You can use the Material theme by updating the theme config .
-
-
- {% for flashMessage in app.session.flashbag.get('notice') %}
-
-
×
-
{{ flashMessage|trans }}
-
- {% endfor %}
-{% endblock %}
-
-{% block footer %}
-
-{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/screenshot.jpg b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/screenshot.jpg
deleted file mode 100755
index 1aa8f1461..000000000
Binary files a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/screenshot.jpg and /dev/null differ
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client.html.twig
index 8a5da71a9..2911f6a4e 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client.html.twig
@@ -1,4 +1,4 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
+{% extends "@WallabagCore/layout.html.twig" %}
{% block title %}{{ 'developer.client.page_title'|trans }}{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig
index 3a3ba0c97..59412a708 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig
@@ -1,4 +1,4 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
+{% extends "@WallabagCore/layout.html.twig" %}
{% block title %}{{ 'developer.client_parameter.page_title'|trans }}{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/howto_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/howto_app.html.twig
index dcadfa49a..0f40b7914 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/howto_app.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/howto_app.html.twig
@@ -1,4 +1,4 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
+{% extends "@WallabagCore/layout.html.twig" %}
{% block title %}{{ 'developer.howto.page_title'|trans }}{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig
index b83bf96fa..1dac14653 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig
@@ -1,4 +1,4 @@
-{% extends "WallabagCoreBundle::layout.html.twig" %}
+{% extends "@WallabagCore/layout.html.twig" %}
{% block title %}{{ 'developer.page_title'|trans }}{% endblock %}
@@ -55,10 +55,10 @@
-
{{ 'developer.remove.warn_message_1'|trans({'%name%': client.name }) }}
-
{{ 'developer.remove.warn_message_2'|trans({'%name%': client.name }) }}
+
{{ 'developer.remove.warn_message_1'|trans({'%name%': client.name}) }}
+
{{ 'developer.remove.warn_message_2'|trans({'%name%': client.name}) }}
- {{ 'developer.remove.action'|trans({'%name%': client.name }) }}
+ {{ 'developer.remove.action'|trans({'%name%': client.name}) }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_feed_link.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_feed_link.html.twig
index 6df4c160d..7e84da66d 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_feed_link.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_feed_link.html.twig
@@ -1,11 +1,11 @@
{% if tag is defined %}