function _live_css_document_root in Live CSS 7.2
Same name and namespace in other branches
- 6.2 live_css.module \_live_css_document_root()
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 _live_css_document_root()
- live_css_save in ./
live_css.module - Callback to save a file edited live.
File
- ./
live_css.module, line 362 - Allows editing and a live view of all changes in real-time in the browser.
Code
function _live_css_document_root() {
$absolute_dir = dirname(__FILE__);
$relative_dir = drupal_get_path('module', 'live_css');
return drupal_substr($absolute_dir, 0, -1 * (1 + drupal_strlen($relative_dir)));
}