INITAL Version Camp Munich 2018

This commit is contained in:
Daniel Siepmann 2018-09-16 16:41:44 +02:00
commit 52810e380f
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
4 changed files with 182 additions and 0 deletions

11
.gitignore vendored Normal file
View file

@ -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

View file

@ -0,0 +1,54 @@
<?php
namespace Codappix\ExtbaseTheGoodPartsTalk\Controller;
/*
* Copyright (C) 2018 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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);
}
}

26
composer.json Normal file
View file

@ -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"
}
}
}

91
readme.rst Normal file
View file

@ -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