src/Discovery/PathFinderCore.php
protected function isDrupalRoot($directory) {
    if (!empty($directory) && is_dir($directory) && file_exists($directory . DIRECTORY_SEPARATOR . '/index.php')) {
      // Drupal 7 root.
      // We check for the presence of 'modules/field/field.module' to differentiate this from a D6 site
      return (file_exists($directory . DIRECTORY_SEPARATOR . 'includes/common.inc')
        && file_exists($directory . DIRECTORY_SEPARATOR . 'misc/drupal.js')
        && file_exists($directory . DIRECTORY_SEPARATOR . 'modules/field/field.module'));
    }
    return FALSE;
  }
protected function isDrupalRoot($directory) {
    if (!empty($directory) && is_dir($directory) && file_exists($directory . DIRECTORY_SEPARATOR . '/index.php')) {
      // Drupal 7 root.
      // We check for the presence of 'modules/field/field.module' to differentiate this from a D6 site
      return (file_exists($directory . DIRECTORY_SEPARATOR . 'includes/common.inc')
        && file_exists($directory . DIRECTORY_SEPARATOR . 'misc/drupal.js')
        && file_exists($directory . DIRECTORY_SEPARATOR . 'modules/field/field.module'));
    }
    return FALSE;
  }
protected function isDrupalRoot ( $ directory ) { if ( ! empty ( $ directory ) && is_dir ( $ directory ) && file_exists ( $ directory . DIRECTORY_SEPARATOR . '/index.php' ) ) { // Drupal 7 root. // We check for the presence of 'modules/field/field.module' to differentiate this from a D6 site return ( file_exists ( $ directory . DIRECTORY_SEPARATOR . 'includes/common.inc' ) && file_exists ( $ directory . DIRECTORY_SEPARATOR . 'misc/drupal.js' ) && file_exists ( $ directory . DIRECTORY_SEPARATOR . 'modules/field/field.module' ) ) ; } return FALSE ; }
Checks if the passed directory is the Drupal root.

@param string $directory
The directory path.

@return bool
TRUE if the passed directory is the Drupal root.
Checks if the passed directory is the Drupal root .