FIX Avoid infinite loops on ?isDev=1 and Deprecation class

If any of the functionality triggered by Director::isDev()
was causing deprecation errors, the system would go into
an infinite loop. Since the only way to cause this is the DB
checking functionality, we disable that for Deprecation.
Side effect of this change: You can't show deprecation notices
on a live site by forcing the session into dev mode.
more meaningful error message in ConfigStaticManifest.php (depth < 0)

Changed error from: Fatal error: Hmm - depth calc wrong, hit negatives in /var/www/tangoio.maori.nz/framework/core/manifest/ConfigStaticManifest.php on line 242 

... to .... 


Fatal error: Hmm - depth calc wrong, hit negatives, see: /var/www/mysite.maori.nz/mymodule/code/MyClass.php in /var/www/mysite.maori.nz/framework/core/manifest/ConfigStaticManifest.php on line 240

The first error is completely meaningless and impossible to debug...
MINOR typo where display_errors wasn't checked properly
Merge pull request #2584 from ss23/patch-3

MINOR typo where display_errors wasn't checked properly
FIX: Move stage choosing into a pre-request filter.

This ensures that the correct stage is selected, even if the request
does not come through the model as controller system. This fixes an
issue where custom controllers would always be on the "Stage" stage.
Merge pull request #2586 from ss23/3.0-staging-fix

FIX: Move stage choosing into a pre-request filter.
BUG backtrace now filters MySQLi arguments

Add MySQLi functions mysqli() and select_db() to the list of filtered
function arguments to avoid exposing sensitive data
Merge pull request #2625 from colymba/mysqli-backtrace-filtering

BUG backtrace now filters MySQLi arguments
Merge pull request #2236 from chillu/pulls/isdev-infinite-loop

FIX Avoid infinite loops on ?isDev=1 and Deprecation class
FIX "Draft" stage to fix dev/build, Versioned docs (fixes #2619)
Merge pull request #2632 from chillu/pulls/versioned-docs

FIX "Draft" stage to fix dev/build, Versioned docs (fixes #2619)
Merge pull request #2470 from sunnysideup/patch-19

more meaningful error message in ConfigStaticManifest.php (depth < 0)
Merge remote-tracking branch 'origin/3.0' into 3.1

Conflicts:
	control/Director.php
Fixed merge error