[BUGFIX] IndexerService does not set creating user

When a backenduser uploads a file an index record is
created. The sys_file table ships with the column cruser_id
 which is never been filled because all sys_file records
are created by the IndexerService which does not take care
of that field.

Add this knowledge to the indexer service.

Releases: 6.0, 6.1
Fixes: #46596
Change-Id: I2a82ea5375b892604fc1a27376487bc4efe3a16e
Reviewed-on: https://review.typo3.org/19217
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
[BUGFIX] PHP filesystem functions are locale dependent

PHP filesystem functions like pathinfo, dirname and
basename are dependent on the locale set in PHP.
If one enables UTF8filesystem in the install tool, he may
use non-ascii characters in filenames and directory names.
For this to work properly you need to configure
SystemLocale, too.

The file abstraction layer classes need to take care of
the SystemLocale; to avoid code duplication new static
wrapper functions have been introduced.

Change-Id: I635e18d7ed08d928c6c4e427c0348dd46d9c5900
Releases: 6.0, 6.1
Resolves: #45982
Reviewed-on: https://review.typo3.org/19444
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[TASK] Adapt ArrayConstraints in IndexerTest

The tests for a parameter array check for equality of
the parameter array and the according value.
Instead we only wanna know if two keys are present and
set correctly and we do not care about other array values.

This refactors the Test to be more polite and is a follow-up
for #46596.

Change-Id: Ia7b4a0521b1d11b9494de2ff766f11b3c8bd1f60
Releases: 6.0, 6.1
Related: #46596
Reviewed-on: https://review.typo3.org/19487
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[TASK] Integrate basic TypoScript parsing test

Resolves: #46839
Releases: 6.0, 6.1
Change-Id: I3dd007908bbd127386b86dd0f31e927c1034bb97
Reviewed-on: https://review.typo3.org/19491
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[TASK] Update copyright year to 2013

Changes "(c) 2010-2012" to "(c) 2010-2013"

Releases: 6.1
Resolves: #46840
Change-Id: I0a26a9a05cfc5697eb536016aee946ad970d82b3
Reviewed-on: https://review.typo3.org/19494
Reviewed-by: Alexander Schnitzler
Tested-by: Alexander Schnitzler
Revert "[TASK] Make current persistence replaceable"

This reverts commit 4d4b047e8eca2cfd86eef94954066f292277394f.

Conflicts:
	Classes/Persistence/Generic/PersistenceManager.php
	Tests/Unit/Persistence/RepositoryTest.php

Resolves: #46837
Releases: 6.1
Change-Id: I87914c6786d75ce217993cb6a70721b821bd0647
Reviewed-on: https://review.typo3.org/19488
Reviewed-by: Alexander Schnitzler
Tested-by: Alexander Schnitzler
Revert "[TASK] Fix deprecated things in sysnote"

This reverts commit 524951cfebdc1443e084a3f2f2e95612f6a43272.

Commit 524951cfebdc1443e084a3f2f2e95612f6a43272 has to be
reverted as it relies on patch http://forge.typo3.org/issues/42506
which has been reverted due to an introduced regression.

Resolves: #46838
Releases: 6.1
Change-Id: I3d1037e508a0defbe127a6f4b8f15efdcf678ef3
Reviewed-on: https://review.typo3.org/19490
Reviewed-by: Marc Bastian Heinrichs
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[BUGFIX][EM] TER repository page fails

After the persistence patch in extbase was reverted, em needs an
adaption to make the Repository tab work again.

Change-Id: If88f9c2e52fdeed344955a62568835b3968db5e2
Fixes: #46844
Related: #46837
Releases: 6.1
Reviewed-on: https://review.typo3.org/19497
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[BUGFIX] Fix namespace in FileMountRepositoryTest

Currently a "Tests\Unit" is missing in between.

Resolves: #46845
Releases: 6.1
Change-Id: I2cb4f7fedf826ff35b66ecd4ea600bc60b41123b
Reviewed-on: https://review.typo3.org/19498
Reviewed-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[BUGFIX] Respect line breaks in stdWrap.cropHTML

By using the PCRE_DOTALL (/s) pattern modifier in the cropHTML
regular expression for preserving HTML entities the dot in the
pattern will include line breaks.

Resolves: #28741
Releases: 6.1, 6.0, 4.7, 4.6, 4.5
Change-Id: Ifda9e397406dd481b634ded22fd13cac90192118
Reviewed-on: https://review.typo3.org/18219
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Stefan Neufeind
Reviewed-by: Susanne Moog
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
[FEATURE] Allow workspace members to send item back to edit

As all members of a workspace can edit an element in review
they should also be able to send it to editing by changing
the stage. This also allows notification of the original editors
with a stage notification mail.
In the old workspaces this was possible by rejecting an element,
in the current workspaces rejection is not implemented.
So at least this will allow a notification, even though the original
editor has to be tracked by hand.

Change-Id: I0d553570cb9e32bfa49e8821c55b40089ad1bde0
Resolves: #32473
Releases: 6.1
Reviewed-on: https://review.typo3.org/13398
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[!!!][BUGFIX] Scope of ProcessedFile cannot be modified

A ProcessedFile is used to generate a preview or crop-scaled
version of a File. Actually a Task implementing the
TaskInterface defines the basics and an accordant Helper
object takes care of the modifications to that file.
There are pre-process and post-process signals that seem to
be useless in modifying the scope of a particular task, however.

Imagine a file shall be pre-processed (e.g. color profile
transformation) and that result shall be used for resizing.
The current task implementation is using the original file
directly, however the task actually shall define which is the
source (the original file) the modifications shall be based on.

This change modifies the TaskInterface with a getSourceFile()
method to overcome this limitation.

Change-Id: I280ea9a0bf056f9eee0a06995ab809fdafb8a11a
Fixes: #46795
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/19438
Reviewed-by: Stefan Neufeind
Tested-by: Steffen Ritter
Reviewed-by: Steffen Ritter
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[TASK] Remove explicit strict test from TypoScriptParserTest

The TypoScriptParser is executed in strict mode by default.

Change-Id: I95a206e184cbafaebe28f1db592bd0f6a6dda4db
Related: #46839
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/19504
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[!!!][FEATURE] Implement pre- and post-hook around SELECT queries

To use in example content/record security,
a hook is implemented before and after the SELECT call.

The interface introduces a new function that needs to be
implemented to avoid breaking functionality!

The SELECT call is the only database call without such hook

Resolves: #45699
Releases: 6.1
Change-Id: I915bd2422e3d6743a408ea53af7e6491cfe2657a
Reviewed-on: https://review.typo3.org/18411
Reviewed-by: Dmitry Dulepov
Reviewed-by: Mattias Nilsson
Tested-by: Dmitry Dulepov
Reviewed-by: Wouter Wolters
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
[FEATURE] Human readable names for special folders

The names of some special folders (user upload,
temporary files, recycler) were historically
converted to a human readable string. This is partly
broken in the current version, especially the sorting
gets mixed up. This commit changes the concept to
make the mapping more flexible (i.e., the driver can
decide what folder has which special role) and also
fixes the name mapping and sorting.

Change-Id: Iaf7dee74f4d9031ed91b446937361ecdede9a0b5
Resolves: #46542
Releases: 6.1
Reviewed-on: https://review.typo3.org/19177
Tested-by: Philipp Gampe
Tested-by: Andreas Wolf
Reviewed-by: Philipp Gampe
Reviewed-by: Andreas Wolf
[TASK] Release installation procedure from LocalConfiguration file

The dummy, government and introduction packages deliver with a
default typo3conf/LocalConfiguration.php file to set defaults. If
the installation was not yet completed, those files do not contain
database settings. The bootstrap loads LocalConfiguration and
redirects to the install tool in 123 mode, if those db credentials
are missing. This is ugly and leads to several headaches.

The patch introduces a new file called "FactoryConfiguration.php"
within ext:core Configuration directory to set those defaults now.
The packages can overload these settings with an own file in
typo3conf called "AdditionalFactoryConfiguration", eg. to load the
specific extensions needed during the install process.

This way, the packages do not deliver a "LocalConfiguration" file
anymore. The boostrap now just checks for the existence of the file
and redirects to the install tool if it doesn't exist. The install
tool then creates the "LocalConfiguration" from the factory files
at an early point in the process.

The patch has to deal with different side effect of this:
* ConfigurationManager is no singleton anymore, there was no reason
  for that in the first place anyway.
* ConfigurationManager has a new method to deal with the factory
  files.
* ConfigurationManager got some refactoring to get rid of constants
* Bootstrap is adapted to the new file existance handling.
* GeneralUtility::fixPermissions now can give default permission
  values for files if the settings do not exist yet.
* GeneralUtility::writeFile now accepts a new argument to force
  setting permissions. This is used in ConfigurationManager to
  end up with a LocalConfigurationFile with correct permissions
  as soon as installation is completed.
* As usual, the patch has a good test coverage to show everything
  works as expected.

Change-Id: Icb644534e6d1f426bc9512a941a69d3ee3727223
Resolves: #46854
Releases: 6.1
Reviewed-on: https://review.typo3.org/19506
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[TASK] Clean up DatabaseConnection class

* Reduce number of IDE warnings by fixing method annotations
* Minor nitpicks
* Remove "define visibility" TODOs for API methods

Change-Id: Ica0bf776d3f22678b6fb67cdd85da188011509b0
Reviewed-on: https://review.typo3.org/19522
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[CLEANUP] Drop incomplete tests

Resolves: #46871
Releases: 6.1
Change-Id: Ic9aabd83de82bb00be332956e4d5d9802d9a8952
Reviewed-on: https://review.typo3.org/19523
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[BUGFIX] Property Mapper chokes on already-converted objects

Fixes also PropertyMappers chokes on already converted Objects if the
targetType is a compositeType like Collection<Entity>.
Backport from Flow issues #39445, #40661 and #36988

Change-Id: I8622dd9ef15a5e8e4aa98adc4e5b0def4a913ce1
Fixes: #44214
Fixes: #44215
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/18172
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Reviewed-by: Marc Neuhaus
Reviewed-by: Markus Günther
Tested-by: Markus Günther
[BUGFIX] BE login form gives warnings in RteHtmlParser

Intialize configuration as array to prevent PHP warnings for
Illegal string offset.

Change-Id: Ic7398ba2c041c3278a1bd5562968ac5183643d3d
Fixes: #43291
Releases: 6.1, 6.0, 4.7, 4.5
Reviewed-on: https://review.typo3.org/16731
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer