This fix resolves the issue of the wrong title for FAL irre relations.
Now the title of the sys_file metadata will be displayed,
if there's no title for the sys_file_reference.
Additionally the title, labels and placeholder
will be cropped if necessary.

* Adjust default permissions back to "world readable" (775/664)
* Do not attempt to fix permissions on an existing folder structure
* Streamline the separation of Notices, Warnings and Errors
* Cosmetical optimizations in the "Folder Structure" item
* Also report if the default permissions are too insecure (i.e.
world writeable / readable).

Note that the new defaults (775/664) are set to make the system work
by default on almost most scenarios, but the recommended secure setup
is still 770/660. This is on purpose to make the administrator aware
of it but will require manual intervention (i.e. "thinking") if this
setup will work or not (we cannot detect that automatically).

On some systems even "332" characters is too large. To also cope with
potential utf8mb4 setups (1 char = 4 bytes), and staying under 1000 byte
limit, we reduce the amount of characters in the index to 249.

Extbase BaseTestClass comes with a not mocked objectManager that
gives headaches if it is injected to a test subject. Releasing
the extensionmanager test classes from this and using core
UnitTestCase as parent reveals these parts in existing tests,
those are fixed with the patch.

The implemented locking is fine, but currently breaks a fresh new
installation (when there is no typo3temp directory yet). We remove
this feature for the release of beta7 and merge it afterwards again
to be able to improve upon it during the next week before the release
candidate.

While the FAL tests were already streamlined and simplified a lot,
the ResourceStorageTest class is still a mixture of functional and
unit test that involves heavy set up code and still does not mock
dependencies properly.
This test class needs a rewrite and a clean separation of units
together with a number of working functional tests to be of any use.
For now, all tests that rely on initialized database are skipped and
marked as TODO.

During bootstrapping in index_ts.php there is a check
for an existing be_typo_user cookie which enables
TimeTracking. The simple static getter triggers the loading
and parsing of BackendUserAuthentication and
AbstractUserAuthentication which are both pretty fat classes
and have an impact upon eID calls and frontend calls.

This patch inlines the cookie name retrieval and defers thus
the loading of the fat classes.

Tests of the Typo3DatabaseBackend are refactored to not depend on
initialized $GLOBALS['TYPO3_DB'] anymore, queries and quoting is
now performed to a mock object. Next to a better separation this
has the advantage of a nice speedup executing those tests.

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.

Since the refactoring of the publicURL Feature and the possibility to
link to files via jump-scripts the generation of publicUrls for files
in storage zero is broken due to the fact that every relative base-path
for this URL is appended with a slash.

If the base-path has been empty (like for storage 0), appending a slash
makes it absolute.

This patch changes the behaviour to only append a slash on non-empty
paths.

The test class contains only one test, but to execute this,
it depends on many classes which are not all properly mocked and a
nightmare to maintain. Additionally the test has nothing
to do with the execution of tasks, so subject scope is not met.

ext:backend test getNodesSetsIsMountPointField() works on getNode()
of PageTree DataProvider. The method has tons of dependencies that
are sometimes even static, and the method is recursive. It is very
hard to test properly and the current test is still not mocking
completly. The test is removed for now since it does not give us
much benefit and is hard to maintain in current state, the subject
method should be covered by tests again if it was refactored.

If the FunctionalTestCaseBootstrapUtility::removeInstance() tries to
delete an existing symlink to a folder, the function unlink() is used.
This leads to a warning on Windows systems because unlink can only
delete files and symlinks to files.
This patch adds a rmdir() call for symlinks which works for Windows
system as well.

Remove dependencies in BackendUtilityTest with better mocking and
introduce static:: instead of self:: in BackendUtility for late
static binding.
The flexForm test for getExcludeFields() is separated to an own
test and an array duplication bug confusing array key and value
in getExcludeFields() is fixed along the way.

Method doLanguageAndWorkspaceOverlay of
Extbase\Persistence\Generic\Storage\Typo3DbBackend should not attempt
to get a parent record if the overlays are in a separate table (most
probably pages_language_overlay) by checking whether
$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerTable'] is set.

PHP issue https://bugs.php.net/bug.php?id=50688 triggers a warning
in ArrayUtility::sortArraysByKey() on some supported PHP versions
like debian wheezy 5.4.4. Since this is a language error and the
code itself is correct and covered by unit tests, the warning is
now suppressed using the @ operator.

setUp() of memcache cache backend tests checks with fsockopen() if
a connect to memcache is possible to skip the tests if memcache is
not available. If fsockopen fails it throws a warning, this should
be suppressed.

Method array2xml converts elements with value NULL to
nodes with attribute type "NULL" and empty value, e.g.:
<node index="myIndex" type="NULL"></node>
This is not correct transformed back in xml2array and results
in an empty string as value.
This in turn results in wrong imported data using impexp with
xml format.

Current menu implementation does not add the cHash in language
menus. This causes a non-cached page and performance
degradation if the page contains parameters and a user switches
between languages. Together with extensions like RealURL it
can become a long time issue because of the caching of wrong
URLs. The fix implements analysis for the query string and
relevant parameters to decide whether the cHash should be
added or not.

Each entry in the New Content Element wizard is tested to be valid,
i.e. the tt_content_defValues defined by that entry must be allowed
for the current BE user. Also, an entry may not select values that are
removed via TSconfig.

Setting TCEFORM.tt_content.[column].keepItems acts as a whitelist of
allowed values for *that* column. But the validity checks are done
hardcoded against the *CType* column.

While Typo3DbBackend claims to be the glue between Extbase
and TYPO3, it hardly uses the TYPO3 DB API.

This patch enhances getObjectData- and getObjectCountByQuery
- the main methods used when dealing with domain models
through a repository - to use the TYPO3 DB API. In conjunction
this enables Extbase to use the preparedStatement introduced
in TYPO3 4.5.

Because prepared queries might not be desirable in all circum-
stances, they are disabled by default. They can be enable on
a per-query-basis via
$query->getQuerySettings()->setUsePreparedStatement(TRUE);

Prepared statements will *only* be used for SELECT queries.

* consistent use of the TYPO3 DB API
use exec_SELECTgetRows and exec_SELECTcountRows() even for
non-prepared queries. This should help a lot along the way
to support DBAL.

* preparedStatement in custom statements
When using custom statements, it's now possible to use a pre-
pared statement in $query->statement(), instead of a query-
string. The prepared statement has to be initialized already
though, because Extbase cannot take care of splitting your
custom query string. The parameters are given as array in the
second argument as usual.

* deprecated using parameters in non-prepared custom statement
If a custom query string is used with $query->statement(),
giving the parameters in the second argument is deprecated.

* get count working
Counting - especially with limit and offset - has been broken
for quite some time now. By refactoring the limit and offset
parameters and adapting exec_SELECTcountRows() this should
now work again.

The next step is to separate the query parsing from the backend
and introduce an intelligent query cache. This will work as a
drop-in-replacement. The @todo-annotations are intended to stay
there for the next patch.

There are some edge cases where "is_public"
can never be true within a storage record in the BE,
for instance for storage located outside
the document root or for storage driven by special driver
such as Flickr, ...

If records are found in a database table that are not part of
the assertion data-set, currently the whole record array from
the database is shown as failure.
The assertion has information about the fields that should have
been asserted. To keep a better overview, the failure message
is reduced now to exactly those fields.