From 52810e380f38c9c2dc32963361d41b6d6b30853c Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Sun, 16 Sep 2018 16:41:44 +0200 Subject: [PATCH] INITAL Version Camp Munich 2018 --- .gitignore | 11 +++ Classes/Controller/FrontendUserController.php | 54 +++++++++++ composer.json | 26 ++++++ readme.rst | 91 +++++++++++++++++++ 4 files changed, 182 insertions(+) create mode 100644 .gitignore create mode 100644 Classes/Controller/FrontendUserController.php create mode 100644 composer.json create mode 100644 readme.rst diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f950a50 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +composer.lock +vendor +index.php +typo3 +/Tests +/Results +infection* +phpunit.xml.dist +debug-log.txt +per-mutator.md +summary-log.txt diff --git a/Classes/Controller/FrontendUserController.php b/Classes/Controller/FrontendUserController.php new file mode 100644 index 0000000..8bb3ba8 --- /dev/null +++ b/Classes/Controller/FrontendUserController.php @@ -0,0 +1,54 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use TYPO3\CMS\Extbase\Domain\Model\FrontendUser; +use TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; + +/** + * Lists and enables editing of frontend users. + */ +class FrontendUserController extends ActionController +{ + /** + * @var FrontendUserRepository + */ + protected $frontendUserRepository; + + public function __construct(FrontendUserRepository $frontendUserRepository) + { + $this->frontendUserRepository = $frontendUserRepository; + } + + public function indexAction() + { + $this->view->assign('frontendUsers', $this->frontendUserRepository->findAll()); + } + + /** + * @param FrontendUser $frontendUser + */ + public function showAction(FrontendUser $frontendUser) + { + $this->view->assign('frontendUser', $frontendUser); + } +} diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..9c49067 --- /dev/null +++ b/composer.json @@ -0,0 +1,26 @@ +{ + "name": "codappix/testing_talk", + "description": "Example Extension to show testing", + "type": "typo3-cms-extension", + "license": "GPL-2.0-or-later", + "authors": [ + { + "name": "Daniel Siepmann", + "email": "coding@daniel-siepmann.de" + } + ], + "autoload": { + "psr-4": { + "Codappix\\ExtbaseTheGoodPartsTalk\\": "Classes/" + } + }, + "require": { + "typo3/cms-core": "^8.7", + "typo3/testing-framework": "~2.0.4" + }, + "extra": { + "typo3/cms": { + "web-dir": "web" + } + } +} diff --git a/readme.rst b/readme.rst new file mode 100644 index 0000000..c93272f --- /dev/null +++ b/readme.rst @@ -0,0 +1,91 @@ +Extbase the good parts +====================== + +Most of the times Extbase is not the best choice. + +Why? + +Because nowadays we have: + +* Form Framework + +* FLUIDTEMPLATE / Standalone Fluid + +* DataProcessors + +But if you need Extbase, it offers some good parts, which will be explained below +with working unit tests. + +.. contents:: :local: + +Start +----- + +Execute the following:: + + git clone https://github.com/DanielSiepmann/extbase-the-good-parts.git + cd extbase-the-good-parts + +Clean everything:: + + rm -rf composer.lock vendor web Results + +Installation development dependencies using composer:: + + composer install + +Links: + +* https://docs.typo3.org/typo3cms/ExtbaseFluidBook/ + +* https://docs.typo3.org/typo3cms/ExtbaseGuide/ + +Dependency Injection +-------------------- + +* Method injection + +* Annotation + +* Constructor + +See: + +* https://daniel-siepmann.de/Posts/2017/2017-08-17-typo3-injection.html + +* https://daniel-siepmann.de/Posts/Migrated/2015-10-20-extbase-inject-settings.html + +Property Mapping +---------------- + +See :file:`web/typo3/sysext/extbase/ext_localconf.php`, +https://docs.typo3.org/typo3cms/ExtbaseFluidBook/10-Outlook/4-Property-mapping.html + +Validation +---------- + +Command Controllers +------------------- + +TypoScript Configuration +------------------------ + +See https://docs.typo3.org/typo3cms/ExtbaseFluidBook/b-ExtbaseReference/Index.html#typoscript-configuration + +Settings array +-------------- + + +ObjectAccess from Fluid +----------------------- + +See + +* :file:`web/typo3/sysext/fluid/Classes/Core/Variables/CmsVariableProvider.php` + +* :file:`web/typo3/sysext/extbase/Classes/Reflection/ObjectAccess.php` + +Configuration Mapping DB +------------------------ + +See https://docs.typo3.org/typo3cms/ExtbaseFluidBook/b-ExtbaseReference/Index.html#persistence