aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r--src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php5
-rw-r--r--src/Wallabag/CoreBundle/Command/ExportCommand.php5
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php1
-rw-r--r--src/Wallabag/CoreBundle/Command/ShowUserCommand.php5
-rw-r--r--src/Wallabag/CoreBundle/Helper/ContentProxy.php10
5 files changed, 8 insertions, 18 deletions
diff --git a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
index d964439d..b4aa4e47 100644
--- a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
+++ b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
@@ -111,9 +111,4 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
111 { 111 {
112 return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username); 112 return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username);
113 } 113 }
114
115 private function getDoctrine()
116 {
117 return $this->getContainer()->get('doctrine');
118 }
119} 114}
diff --git a/src/Wallabag/CoreBundle/Command/ExportCommand.php b/src/Wallabag/CoreBundle/Command/ExportCommand.php
index c2e4be05..291926e4 100644
--- a/src/Wallabag/CoreBundle/Command/ExportCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ExportCommand.php
@@ -69,9 +69,4 @@ class ExportCommand extends ContainerAwareCommand
69 69
70 return 0; 70 return 0;
71 } 71 }
72
73 private function getDoctrine()
74 {
75 return $this->getContainer()->get('doctrine');
76 }
77} 72}
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 50551480..c7809053 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -14,7 +14,6 @@ use Symfony\Component\Console\Output\BufferedOutput;
14use Symfony\Component\Console\Output\OutputInterface; 14use Symfony\Component\Console\Output\OutputInterface;
15use Symfony\Component\Console\Question\ConfirmationQuestion; 15use Symfony\Component\Console\Question\ConfirmationQuestion;
16use Symfony\Component\Console\Question\Question; 16use Symfony\Component\Console\Question\Question;
17use Wallabag\CoreBundle\Entity\Config;
18 17
19class InstallCommand extends ContainerAwareCommand 18class InstallCommand extends ContainerAwareCommand
20{ 19{
diff --git a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php
index 33888fa3..090309d9 100644
--- a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php
@@ -72,9 +72,4 @@ class ShowUserCommand extends ContainerAwareCommand
72 { 72 {
73 return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username); 73 return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username);
74 } 74 }
75
76 private function getDoctrine()
77 {
78 return $this->getContainer()->get('doctrine');
79 }
80} 75}
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
index 656ac6ee..1ac7ad83 100644
--- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php
+++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
@@ -126,11 +126,17 @@ class ContentProxy
126 126
127 // is it a timestamp? 127 // is it a timestamp?
128 if (filter_var($date, FILTER_VALIDATE_INT) !== false) { 128 if (filter_var($date, FILTER_VALIDATE_INT) !== false) {
129 $date = '@' . $value; 129 $date = '@' . $date;
130 } 130 }
131 131
132 try { 132 try {
133 $entry->setPublishedAt(new \DateTime($date)); 133 // is it already a DateTime?
134 // (it's inside the try/catch in case of fail to be parse time string)
135 if (!$date instanceof \DateTime) {
136 $date = new \DateTime($date);
137 }
138
139 $entry->setPublishedAt($date);
134 } catch (\Exception $e) { 140 } catch (\Exception $e) {
135 $this->logger->warning('Error while defining date', ['e' => $e, 'url' => $entry->getUrl(), 'date' => $value]); 141 $this->logger->warning('Error while defining date', ['e' => $e, 'url' => $entry->getUrl(), 'date' => $value]);
136 } 142 }