Drupal Module

Drupal 7 global variables vs. Drupal 8 services

Several Drupal 7 global values like global $language and global $user are also now accessed via services in Drupal 8 (and not global variables).

Drupal::languageManager()->getCurrentLanguage() and Drupal::currentUser()

Two ways to get the currentUser data:

1) Procedural code
$user = \Drupal::currentUser();
ksm($user->id());

(or)

2) OO code access the @current_user service, via dependency injection (DI)
$service = \Drupal::service('thirstysix.ex');
ksm($service->DisplayUserId());

Where are Drupal8 contact forms entries stored?

Contact form

Contact Storage module will provide storage for Contact messages which are fully-fledged entities in Drupal 8.

This plus core contact module aim to provide functionality equivalent to the base-features of Webform or Entity Form.

Contact Storage

https://www.drupal.org/project/contact_storage

Contact Storage module provides storage for all the messages submitted through the forms on your site as well as views integration to manage them.