[TASK] Tests: Remove backup of TYPO3_DB

All $GLOBALS are backed up by phpunit, no explicit backup
of $GLOBALS['TYPO3_DB'] is required.

Change-Id: I2859a5922d85a23fa8281382b1d78043ec7bd934
Resolves: #55846
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/27526
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[TASK] Execute functional tests and lint in parallel

Change-Id: Icab8cd1d7f4b9a56f10ed7fc1f6e945ff50b295c
Reviewed-on: https://review.typo3.org/27529
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[TASK] Reduce memory footprint of unit tests

Running the whole unit test suite on cli can eat up a significant
amount of memory. Most of that can not be mitigated due to phpunit
itself, but we can at least hint the PHP garbage collection by
unsetting test class properties in tearDown().

The patch introduces a generic tearDown() method that reflects the
test class and unsets all temporary properties of the class. In
effect, tests do not need to take care of unsetting properties.

The patch removes all tearDown() methods that only unset() stuff
and keeps others that do additional things but adds a call to
parent::tearDown(). Private properties are changed to protected,
so parent::tearDown can reach them. The additional computing
effort of the reflection is insignificant, the suite is nearly as
fast as before.

Results:
php 5.3: 1056MB -> 851MB
php 5.4: 870MB -> 670MB
php 5.5.: 876MB -> 674MB

Resolves: #55850
Related: #51436
Releases: 6.2
Change-Id: Ie665c53a3ab35e4808677e483d2099e0511c393f
Reviewed-on: https://review.typo3.org/27528
Reviewed-by: Helmut Hummel
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[BUGFIX] Fix behavior of revExplode if delimiter not found

If the given delimiter is not found in the given string
GeneralUtility::revExplode() will return an array with a single element
containing the unexploded string.

Resolves: #55838
Releases: 6.2
Change-Id: I1146552a625a8057be86b2745febf808638a290c
Reviewed-on: https://review.typo3.org/27524
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[FEATURE] Fallback/default case for SwitchViewhelper

In order to provide the full functionality known from the
switch/case PHP function, a default case possibility is
introduced. Use it like:
<f:switch expression="{person.gender}">
  <f:case value="female">Mrs.</f:case>
  <f:case value="male">Mr.</f:case>
  <f:case default="TRUE">Mrs. or Mr.</f:case>
</f:switch>

Change-Id: Ib9468cdabd66fb8b484cb4d07520d5b529548dd1
Resolves: #49371
Documentation: #54283
Releases: 6.2
Reviewed-on: https://review.typo3.org/26058
Reviewed-by: Benjamin Kott
Tested-by: Benjamin Kott
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[BUGFIX] Wrong check removes FE cookie

Issue #55549 added a wrong check for user uid.
As result the FE cookie gets deleted when you are
loggedin instead when your not.

This change inverses the check.

Resolves: #55845
Releases: 6.2
Change-Id: I0c59afb8c89e9f7887970eaf0a4079fe98280b2c
Reviewed-on: https://review.typo3.org/27525
Reviewed-by: Wouter Wolters
Reviewed-by: Markus Klein
Reviewed-by: Marcin Sągol
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
[TASK] Speedup travis build

Different build environments have been set up
mainly to be able to execute lint, unit tests
and functional tests in parallel. However
setting up the build environment on travis
also takes quite some time, so that overall
build times are quite high.

This change cleans up the travis configuration,
reduces the number of builds to only the configured
PHP versions and executes lint, unit tests and
functional test in parallel using the command line
tool "parallel"

By doing so, the overall build time can be reduced
by at least 50%

This change also removes the installation of a
current git version which has been added to
fix temporary Travis service errors.

Releases: 6.2
Change-Id: Ic1591ed0b596df22a648a825639c1a2bbc7ffcc2
Reviewed-on: https://review.typo3.org/27540
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[BUGFIX] Replace the table definition manipulation by signals

During installation of extensions the Extension Manager does
not take the Category API into account. The code to do so is
present in the Install Tool in the Database Compare Tool. It is
cumbersome to switch to the install tool to update the database
in order to use the category fields. The install tool and extension
manager currently need to know which components manipulate
the table definitions and this is bad coupling of components
which shouldn't know each other.

This fix replaces the individual calls to the components by two
signals and thus a generic approach.

Fixes: #53016
Releases: 6.2
Change-Id: I7f99ad7cadc323d4f8b975de97e4c665a82647a5
Reviewed-on: https://review.typo3.org/26506
Reviewed-by: Fabien Udriot
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[BUGFIX] Prevent double slash in isWithin check

If the root folder is used as folder identifier (/) no slash is appended
so that isFirstPartOfStr works correctly in the isWithin check in
LocalDriver.

Resolves: #55740
Releases: 6.2
Change-Id: I2af1cd3759656502ea84887828dfb222f0a07b64
Reviewed-on: https://review.typo3.org/27379
Reviewed-by: Markus Klein
Reviewed-by: Markus Kasten
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
[BUGFIX] Fix fatal errors upon package installation

During the installation of packages via the extension
manager a fatal error can occur when the ext_localconf
and ext_tables are loaded and use classes from their own
package. This happens because the package is activated
but the class loader is not aware yet of the new package.

This patch adds the extension temporarily to the runtime
activated packages in the class loader.

Fixes: #53795
Releases: 6.2
Change-Id: I195b86284b9a288f4d7c102168ec18ed8683cb07
Reviewed-on: https://review.typo3.org/27544
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[BUGFIX] Allow multiple aliases for a class

When working on #55559 (refactoring class alias handling)
accidentally code was introduced to avoid more than
one alias for a class name.
Remove this code to make multiple aliases work again.

Fixes: #55897
Releases: 6.2
Change-Id: I8b4b721c57c52d117130947fe92c564d6ddcdd9b
Reviewed-on: https://review.typo3.org/27558
Reviewed-by: Claus Due
Tested-by: Claus Due
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[BUGFIX] Avoid fatal error if adding composer package

Adding composer packages to „Packages“ folder will cause a fatal error
This fix prevents the extension manager from handling not legacy packages

Resolves: #55754
Releases: 6.2
Change-Id: I3ac491c8566b14578f5d3a604c63dffc1310d042
Reviewed-on: https://review.typo3.org/27402
Reviewed-by: Thomas Maroschik
Reviewed-by: Marcin Sągol
Tested-by: Thomas Maroschik
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[BUGFIX] cache_clearAtMidnight conflicts with content start/endtime

If the config.cache_ClearAtMidnight is set, the current code of
TypoScriptFrontendController::get_cache_timeout() will not take
content's starttime/endtime into account. Thus if the content
(or other configured record) has start or end time before the
midnight, it will not be taken into account and the cache timeout
will be wrong.

Change-Id: I732da8f07270a86c62b7ce5028b12b630bb2e027
Resolves: #53028
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/24951
Reviewed-by: Wouter Wolters
Reviewed-by: Peter Foerger
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[TASK] Initialize FormProtectionFactory later in alt_doc.php

The FormProtectionFactory can be initialized later.
Move the initialization to the point where it is needed.

Resolves: #55856
Releases: 6.2
Change-Id: Id83304341ddec4cc2d4d5c8a6bd40463277a37b5
Reviewed-on: https://review.typo3.org/27533
Reviewed-by: Benjamin Mack
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[TASK] Cleanup ArrayUtility::sortArraysByKey()

Replace strtolower and ternary operations with strcasecmp.

Change-Id: Ia962ef879c6ba1d91081db78f74fc577fa67c467
Resolves: #55899
Releases: 6.2
Reviewed-on: https://review.typo3.org/27559
Reviewed-by: Oliver Klee
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[TASK] Use vfsStream for getFilesInDir() tests

Change-Id: I06bb7492146a9149917bc2fc9100fbdddd9b8d09
Resolves: #55871
Releases: 6.2
Reviewed-on: https://review.typo3.org/27539
Reviewed-by: Oliver Klee
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[BUGFIX] Missing label felogin_forgotHash

Resolves: #49440
Releases: 6.2, 6,1
Change-Id: Iea20a7e9c637c2f1f13c39eebe406d07edc8a2c3
Reviewed-on: https://review.typo3.org/27453
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Karol Lamparski
Tested-by: Karol Lamparski
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[TASK] Improve EM performance when getting extension list from TER

When importing the extension list from TER, each version of each
extension is one database record. For each extension key the EM
calculates the newest version and sets the column 'current_version'
to 1 for the corresponsing extension record.

The old implementation issued one database query for each extension
key, resulting in about 6k queries, taking a long time to execute
(several minutes on my machine). After applying this patch the same
thing is done in three queries, speeding up the process.

Resolves: #55820
Related: #52949
Releases: 6.2
Change-Id: I55d3699a63b13e7c07af4babbf57d0d06f367027
Reviewed-on: https://review.typo3.org/27496
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Jost Baron
Tested-by: Jost Baron
Reviewed-by: Oliver Klee
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[TASK] add mtime sort test for getFilesInDir()

Add a test to check for mtime sorting capability of getFilesInDir().

Change-Id: I73082bcfd1f8d46b77a228b1ea7dabc1602d9d0a
Resolves: #55864
Releases: 6.2
Reviewed-on: https://review.typo3.org/27536
Reviewed-by: Oliver Klee
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[TASK] Switch order of tests

Execute unit tests first and lint last, since
the lint is las resort anyway and unlikely to fail.

Also use a simple printf instead of a php call.

Change-Id: I7471e4ac0b217e1a58d1324bd24fc7e2f517e17e
Reviewed-on: https://review.typo3.org/27564
Reviewed-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel