protected function LiveCSSController::docRoot in Live CSS 8.2
Same name and namespace in other branches
- 8 lib/Drupal/live_css/Controller/LiveCSSController.php \Drupal\live_css\Controller\LiveCSSController::docRoot()
* Helper function to get the document root for the current Drupal installation. * $_SERVER['DOCUMENT_ROOT'] is not reliable across all systems, so we need a * way to get the correct value.
1 call to LiveCSSController::docRoot()
- LiveCSSController::cssSave in lib/
Drupal/ live_css/ Controller/ LiveCSSController.php - * cssSave(Request $request): * * The 'action' method for live_css. POST variables * are fetched through $request. A new JsonResponse object * is spawned as $json for interaction with the client. *
File
- lib/
Drupal/ live_css/ Controller/ LiveCSSController.php, line 110
Class
Namespace
Drupal\live_css\ControllerCode
protected function docRoot() {
$absolute_dir = dirname(__FILE__);
$relative_dir = drupal_get_path('module', 'live_css');
/**
* Directory structure changed in 8.x - adjusted below to compensate.
* If this file moves from the lib/Drupal/live_css/Controller directory,
* the number 31 must be adjusted.
*/
return drupal_substr($absolute_dir, 0, -1 * (32 + drupal_strlen($relative_dir)));
}