diff --git a/README.md b/README.md index 111f296f..7a6d874a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Features What was changed in this fork? ----------------------------- - Disable anonymously access, registrations, spam/antispam, added ACL permissions. -- Support MySQL and PostgresSQL. +- Support MySQL, PostgresSQL or SQLite. - Removed HWIOBundle, Algolia, GoogleAnalytics and other not used dependencies. Table of content diff --git a/composer.json b/composer.json index b05881e6..07e07a60 100644 --- a/composer.json +++ b/composer.json @@ -98,7 +98,8 @@ }, "autoload": { "psr-4": { - "Packeton\\": "src/" + "Packeton\\": "src/", + "Oro\\": "doctrine/" } }, "replace": { diff --git a/doctrine/ORM/Query/AST/Platform/Functions/Sqlite/Month.php b/doctrine/ORM/Query/AST/Platform/Functions/Sqlite/Month.php new file mode 100644 index 00000000..174dbd9c --- /dev/null +++ b/doctrine/ORM/Query/AST/Platform/Functions/Sqlite/Month.php @@ -0,0 +1,21 @@ +parameters[SimpleFunction::PARAMETER_KEY]; + + return "STRFTIME('%m', " . $this->getExpressionValue($expression, $sqlWalker) . ")"; + } +} diff --git a/doctrine/ORM/Query/AST/Platform/Functions/Sqlite/Year.php b/doctrine/ORM/Query/AST/Platform/Functions/Sqlite/Year.php new file mode 100644 index 00000000..705bb61f --- /dev/null +++ b/doctrine/ORM/Query/AST/Platform/Functions/Sqlite/Year.php @@ -0,0 +1,21 @@ +parameters[SimpleFunction::PARAMETER_KEY]; + + return "STRFTIME('%Y', " . $this->getExpressionValue($expression, $sqlWalker) . ")"; + } +} diff --git a/src/Controller/GroupController.php b/src/Controller/GroupController.php index e047bd3b..c62b142e 100644 --- a/src/Controller/GroupController.php +++ b/src/Controller/GroupController.php @@ -11,6 +11,7 @@ use Pagerfanta\Doctrine\ORM\QueryAdapter; use Pagerfanta\Pagerfanta; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; @@ -57,7 +58,7 @@ public function createAction(Request $request) $group = new Group(); $data = $this->handleUpdate($request, $group, 'Group has been saved successfully'); - return $this->render('group/update.html.twig', $data); + return $data instanceof Response ? $data : $this->render('group/update.html.twig', $data); } /** @@ -71,7 +72,7 @@ public function updateAction(Request $request, #[Vars] Group $group) { $data = $this->handleUpdate($request, $group, 'Group has been saved successfully'); - return $this->render('group/update.html.twig', $data); + return $data instanceof Response ? $data : $this->render('group/update.html.twig', $data); } /** diff --git a/src/Form/Model/MaintainerRequest.php b/src/Form/Model/MaintainerRequest.php index 6272dad0..768cba82 100644 --- a/src/Form/Model/MaintainerRequest.php +++ b/src/Form/Model/MaintainerRequest.php @@ -12,7 +12,7 @@ namespace Packeton\Form\Model; -use FOS\UserBundle\Model\UserInterface; +use Symfony\Component\Security\Core\User\UserInterface; class MaintainerRequest {