Skip to content

Commit 0b25592

Browse files
author
Tizian Schmidlin
authored
Merge pull request #11 from markuspoerschke/typo3-v9
TYPO3 v9 compatibilty
2 parents 702ca6b + 9bffc01 commit 0b25592

22 files changed

+611
-602
lines changed

.editorconfig

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_style = space
11+
indent_size = 4
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
15+
# TS/JS-Files
16+
[*.{ts,js}]
17+
indent_size = 2
18+
19+
# JSON-Files
20+
[*.json]
21+
indent_style = tab
22+
23+
# ReST-Files
24+
[*.rst]
25+
indent_size = 3
26+
27+
# YAML-Files
28+
[*.{yaml,yml}]
29+
indent_size = 2
30+
31+
# package.json
32+
# .travis.yml
33+
[{package.json,.travis.yml}]
34+
indent_size = 2
35+
36+
# TypoScript
37+
[*.{typoscript,tsconfig}]
38+
indent_size = 2
39+
40+
# XLF-Files
41+
[*.xlf]
42+
indent_style = tab
43+
44+
# SQL-Files
45+
[*.sql]
46+
indent_style = tab
47+
indent_size = 2
48+
49+
# .htaccess
50+
[{_.htaccess,.htaccess}]
51+
indent_style = tab

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## 4.0.0
8+
9+
### Changed
10+
11+
* Simulate BE is always active
12+
* Cookie name has to be defined in extension configuration
13+
* Implement using a PSR-15 middleware instead of a TypoScript plugin
14+
15+
### Added
16+
17+
* Minimal PHP version 7.2
18+
* Support TYPO3 v9
19+
* CHANGELOG
20+
21+
### Removed
22+
23+
* Support TYPO3 v8
24+
* Support TYPO3 v7
25+
* Support PHP 5
26+
* TypoScript object `plugin.tx_simulatebe_pi1`
27+
28+
## 3.0.4
29+
30+
### Added
31+
32+
* Support TYPO3 v8

ChangeLog

Lines changed: 0 additions & 101 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
3+
namespace Cabag\Simulatebe\Configuration;
4+
5+
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
6+
use TYPO3\CMS\Core\Utility\GeneralUtility;
7+
8+
class Configuration
9+
{
10+
private $onLinkParameter = false;
11+
private $linkParameterName = 'login';
12+
private $fakeTimeout = 0;
13+
private $cookieName = 'simulatebe';
14+
15+
public function __construct(bool $onLinkParameter, string $linkParameterName, int $fakeTimeout, string $cookieName)
16+
{
17+
$this->onLinkParameter = $onLinkParameter;
18+
$this->linkParameterName = $linkParameterName;
19+
$this->fakeTimeout = $fakeTimeout;
20+
$this->cookieName = $cookieName;
21+
}
22+
23+
public static function fromGlobals(): self
24+
{
25+
$configuration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('simulatebe');
26+
27+
return new static(
28+
(bool)$configuration['simulatebeOnLinkParameter'],
29+
(string)$configuration['simulatebeLinkParameter'],
30+
(int)$configuration['simulatebeFakeTimeout'],
31+
(string)$configuration['simulatebeCookieName']
32+
);
33+
}
34+
35+
/**
36+
* @return bool
37+
*/
38+
public function getOnLinkParameter(): bool
39+
{
40+
return $this->onLinkParameter;
41+
}
42+
43+
/**
44+
* @return string
45+
*/
46+
public function getLinkParameterName(): string
47+
{
48+
return $this->linkParameterName;
49+
}
50+
51+
/**
52+
* @return int
53+
*/
54+
public function getFakeTimeout(): int
55+
{
56+
return $this->fakeTimeout;
57+
}
58+
59+
/**
60+
* @return string
61+
*/
62+
public function getCookieName(): string
63+
{
64+
return $this->cookieName;
65+
}
66+
}

0 commit comments

Comments
 (0)