[BUGFIX] Cleanup EXT:cshmanual

* Removed require_once which is deprecated.
* Introduced a use-statement for GeneralUtility
* Removed TYPO3_MOD_PATH
* Links generated by make_seeAlso() were double htmlspecialchars
  encoded after security patch https://review.typo3.org/27636

Resolves: #56826
Related: #55509
Releases: 6.2
Change-Id: I8effc7c6bf9828dde4f1c69754b207864b3122ba
Reviewed-on: https://review.typo3.org/28303
Reviewed-by: Stefan Neufeind
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[TASK] Ext:rtehtmlarea entry scripts cleanup

This patch turns all remaining RTE module scripts (mod4, mod5, mod6)
into CSRF protected wizards.

Resolves: #55674
Releases: 6.2
Change-Id: I8421ff05240f6eedcaf40c805d9dd92ea7d4c30b
Reviewed-on: https://review.typo3.org/28208
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[BUGFIX] Fields of type group file are not properly indexed

If an record with a field of type "group", internal_type "file"
should be indexed in the ReferenceIndex an SQL error exception
gets thrown. So the relation to the file isn't represented in the
refindex. Thus those files are also missing in exports created
with system extension impexp.

This is caused by wrong array keys and incorrectly storing a file
relation as DB relation since merge of FAL.

Resolves: #56353
Resolves: #56352
Releases: 6.2, 6.1, 6.0
Change-Id: I78211efcb6bf3032811ef0b0e20ed7f98f9fa8fb
Reviewed-on: https://review.typo3.org/27310
Tested-by: Sebastian Fischer
Tested-by: Christian Zenker
Reviewed-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[BUGFIX] Implement locking in ClassLoader

After cache clearing we can run in the situation that 2 processes will
rebuild the ClassLoader cache which will lead to a non useable cache,
which produces fatals. As the data is generated more than once the load
of the server increases per request while ClassLoader cache is build.

The implemented Locking will stop this issue. Every process waits till
the first is ready and then looks if data was generated and stops re-
generating the cache.

To-Do: Make it work also for first time installation when there is
no typo3temp/ directory yet.

Resolves: #55099
Releases: 6.2
Change-Id: I9c1916b5b5860e86fe19a1fc292d8ab5a196d960
Reviewed-on: https://review.typo3.org/28480
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
[BUGFIX] Prevent Inclusion of ResourceStorage from Bootstrap

During bootstrapping the ResourceStorage and ResourceFactory
is loaded and evaluated just because of two constants containing
signal names used in ext_localconf. This introduces unnecessary
overhead especially in eID context.

The constants have been extracted to an interface that are way
faster parsed.

Resolves: #56335
Releases: 6.2
Change-Id: I509593d2720c595fa7e4f1c9b5c63fd09fea724c
Reviewed-on: https://review.typo3.org/28416
Reviewed-by: Wouter Wolters
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
[BUGFIX] Documentation does not initialize signal slot dispatcher

The documentation module does not initialize the signal slot dispatcher
in its ext_localconf.php, but rather reuses the already set variable
from another core extension.

Create the object explicitly before using it.

Resolves: #57009
Releases: 6.2
Change-Id: Ifbd3199f9cef0b2d2d6dacc4569280c5e668822c
Reviewed-on: https://review.typo3.org/28481
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[TASK] Follow-up: Use prepared statements in generic persistence

Fixes using $query->statement() without parameters.

Resolves: #56915
Resolves: #55360
Releases: 6.2
Change-Id: Ia149313f5f9f719d7dba0a21a3eb39ea4f5052e8
Reviewed-on: https://review.typo3.org/28442
Reviewed-by: Markus Klein
Reviewed-by: Dennis J
Tested-by: Dennis J
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[TASK] Use queryCache in generic persistence

At the moment extbase persistence is quite slow. To some degree,
the query building is responsible for that. For each and every
query the parseQuery() and buildQuery() methods are called.

This patch introduces a query cache to store the query structure.
This way a query can be reused, even when fired with different
parameters.

* Introduce a parameterIdentifier to the comparison
	In the way the extbase query object model works, it's hard to
	identify an object in a way which is unique and still compre-
	hensible. To ease this, an identifier is introduced.

* Move parsing to an external QueryParser
	All the query parsing is now seperated from the storageBackend.
	The query parsing is mostly left the way it was, it should be
	re-profiled later.

* introduce cache extbase_typo3dbbackend_queries

* No more statement handling by reference
	Make getStatementParts() return the query and parameters in an
	array instead of handing down the parameters by reference.

* Split up parseQuery in preparsing and real parsing with caching
	In every call the query has to be preparsed to determine the
	identifier and extract the parameters. The identifier can then
	be used to look up the query structure in the cache. If it is
	not (yet) cached, Extbase will do the real parsing which takes
	some more time.

* Introduce useQueryCache to querySettings
	Like preparedStatements, caching the queries does not always
	make sense and will spam your cache under certain conditions.
	It's enabled by default and can be disabled on a per-query-
	basis.

* Use named parameter's placeholders
	Instead of using "?" as parameter's placeholder and relying
	on the right order of parameters in the array, named place-
	holders are used to ensure the correct association.

* Move unit tests around to fit the new queryParser

Resolves: #55167
Releases: 6.2
Change-Id: I517c0500cad75cae96fd739f2ff7222db80b42a5
Reviewed-on: https://review.typo3.org/27555
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Tested-by: Philipp Gampe
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[BUGFIX] Element browser doesn't use FAL info to for file dimensions

The dimensions of a file are fetch during indexing. These values
should be used as for remote files or certain filetype getimagesize()
will not work or give unwanted overhead.

Resolves: #56864
Releases: 6.2
Change-Id: I14ece9c0dbf414f4cb0759d3065a1c5b5782ca29
Reviewed-on: https://review.typo3.org/28404
Reviewed-by: Markus Klein
Reviewed-by: Tomita Militaru
Reviewed-by: Wouter Wolters
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Tested-by: Markus Klein
[BUGFIX] Respect timezone in online Backend user list

To display the session timestamps in the online Backend users list
in the correct timezone the DateViewHelper will now create the
DateTime object because it already takes care of the correct timezone
handling.

Resolves: #56985
Releases: 6.2
Change-Id: I65003c3f5505f4fe96160f917131fe13a3a53416
Reviewed-on: https://review.typo3.org/28462
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[TASK] Enrich many-to-many functional tests in live workspace

Resolves: #57014
Change-Id: Ib3a5688a111d3ce38c3672fad0a11b195839323d
Reviewed-on: https://review.typo3.org/28486
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[CLEANUP] Fix docheader param for Folder:addFile()

Add missing conflictMode 'changeName'.

Releases: 6.2, 6.1, 6.0
Resolves: #57004
Change-Id: Ie5c32e96c1292dbaecc505d54240f1a7a5c720fe
Reviewed-on: https://review.typo3.org/28476
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
[TASK] Remove reference to old tx_templavoila nesting tag

This change removes a reference to the old <tx_templavoila>
nesting tag which was switched away from in TYPO3 4.7, making
section objects inside sections in flexforms, use the proper
array index path "title" instead of "tx_templavoila.title".

Releases: 6.2
Resolves: #54503
Change-Id: I4c975cf4eed127ca90ead3d7566fbc826f5b78db
Reviewed-on: https://review.typo3.org/26482
Reviewed-by: Wouter Wolters
Reviewed-by: Fabien Udriot
Reviewed-by: Dmitry Dulepov
Tested-by: Wouter Wolters
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[TASK] Retry request on 403 in linkvalidator

When the linkvalidator detects a 403 error when doing a HEAD request to
an external URL it will retry the request using the GET method.

Resolves: #54513
Releases: 6.2
Change-Id: Ib36b6cbb8e981b95c348afd5a063ca4f5040de75
Reviewed-on: https://review.typo3.org/26489
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[FEATURE] Execute native prepared queries

As TYPO3 is now using mysqli, prepared queries are natively supported
and should be used.

DBAL, however, does not yet actually use native prepared queries but
falls back to standard queries by replacing placeholders and executing
the underlying SQL query.

Change-Id: If50da6e6d27af89e01c0439bcb9d39a85615a75d
Resolves: #27372
Releases: 6.2
Reviewed-on: https://review.typo3.org/28231
Reviewed-by: Andreas Fernandez
Tested-by: Andreas Fernandez
Tested-by: Wouter Wolters
Reviewed-by: Markus Klein
Reviewed-by: Stefan Neufeind
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
[BUGFIX] Use language overlay for image rendering

In the image rendering TypoScript configuration of css_styled_content
the uid is removed from the references configuration of the FILES
content object.

This makes sure that the language overlay mechanism from the FILES
content object is used.

Resolves: #56712
Releases: 6.2
Change-Id: Iaea43ca006826facfba40a846da67704dd3154ea
Reviewed-on: https://review.typo3.org/28210
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[TASK] Simplify TYPO3_DB->cleanIntArray

Instead of iterating over the array and calling "intval" for each
element the "array_map" php function gets used.

Change-Id: I5ae699f9bc158eb0caebf1fc9ea8ebaa3cdd73ca
Resolves: #56738
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/28234
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[BUGFIX] Respect table mapping on caching

The method analyzeFields() of DBAL's DatabaseConnection caches the
table structure. The cache always uses the real table name, ignoring
any mapping, which results in a RuntimeException:

"Could not update BLOB >>>> no WHERE clause found!"

The method now checks for a possible mapping and sets the alias
as table name.

Resolves: #56349
Releases: 6.2
Change-Id: I9599cebc8604103c3749bc142cd44b813f018a72
Reviewed-on: https://review.typo3.org/27874
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
[TASK] Cleanup ext_localconf.php of sysexts

As TYPO3 is loading all ext_localconf.php on each call,
the existing code can be cleaned up by removing
old information, putting BE-only functionality in
TYPO3_MODE == 'BE' and install-tool only
in Install only mode.

Also, some hardcoded require_once statements are
removed.

Benefits are that FE does not need to load everything
all the time.

I haven't noticed any side-effects so far, but please
test extensively.

Resolves: #55593
Releases: 6.2
Change-Id: Ibc37e84cb2af05ddb6b227290330aad31037a018
Reviewed-on: https://review.typo3.org/27286
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Fabien Udriot
Tested-by: Fabien Udriot
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[BUGFIX] Fix foreign_table for l10n_parent in sys_file_metadata

Instead of sys_file_metadata sys_file_reference was configured.

Resolves: #57046
Releases: 6.2
Change-Id: I1194012cbacb0415993672338d6ac6ee0a515dc1
Reviewed-on: https://review.typo3.org/28501
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Markus Klein
Tested-by: Markus Klein