public static function bind_manipulation_capture()
    {
        $current = DB::get_conn();
        if (!$current || !$current->getConnector()->getSelectedDatabase() || @$current->isManipulationLoggingCapture) {
            return;
        } // If not yet set, or its already captured, just return

        $type = get_class($current);
        $sanitisedType = str_replace('\\', '_', $type);
        $file = TEMP_FOLDER . "/.cache.CLC.$sanitisedType";
        $dbClass = 'AuditLoggerManipulateCapture_' . $sanitisedType;

        if (!is_file($file)) {
            file_put_contents($file, "<?php
				class $dbClass extends $type
                {
					public \$isManipulationLoggingCapture = true;

					public function manipulate(\$manipulation)
                    {
						\SilverStripe\Auditor\AuditHook::handle_manipulation(\$manipulation);
						return parent::manipulate(\$manipulation);
					}
				}
			");
        }

        require_once $file;

        /** @var Database $captured */
        $captured = new $dbClass();

        $captured->setConnector($current->getConnector());
        $captured->setQueryBuilder($current->getQueryBuilder());
        $captured->setSchemaManager($current->getSchemaManager());

        // The connection might have had it's name changed (like if we're currently in a test)
        $captured->selectDatabase($current->getConnector()->getSelectedDatabase());

        DB::set_conn($captured);
    }