You are here

public static function DatabaseFileUtilityBase::getPath in Smart IP 8.3

Same name and namespace in other branches
  1. 8.4 src/DatabaseFileUtilityBase.php \Drupal\smart_ip\DatabaseFileUtilityBase::getPath()
  2. 8.2 src/DatabaseFileUtilityBase.php \Drupal\smart_ip\DatabaseFileUtilityBase::getPath()

Get Smart IP's data source module's database file's path. This should return the fixed Drupal folder if auto update is on or if custom path is empty with auto update off.

Parameters

bool $autoUpdate:

string $customPath:

Return value

string

Overrides DatabaseFileUtilityInterface::getPath

File

src/DatabaseFileUtilityBase.php, line 58
Contains \Drupal\smart_ip\DatabaseFileUtilityBase.

Class

DatabaseFileUtilityBase
Database file utility methods class wrapper.

Namespace

Drupal\smart_ip

Code

public static function getPath($autoUpdate, $customPath) {
  if ($autoUpdate == TRUE || $autoUpdate == FALSE && empty($customPath)) {

    /** @var \Drupal\Core\File\FileSystem $filesystem */
    $filesystem = \Drupal::service('file_system');
    return $filesystem
      ->realpath(self::DRUPAL_FOLDER);
  }
  return $customPath;
}