You are here

public function AppService::dataDirectory in Forena Reports 8

Determine data directory.

Return value

string Data Directory for overridden

1 method overrides AppService::dataDirectory()
TestingAppService::dataDirectory in tests/src/Unit/Mock/TestingAppService.php
Determine data directory.

File

src/AppService.php, line 235

Class

AppService

Namespace

Drupal\forena

Code

public function dataDirectory() {

  // Determine writeable directory for data.
  $path = \Drupal::config('forena_query.settings')
    ->get('data_path');
  if (!$path) {
    $path = drupal_realpath("private://data/source");
    if ($path) {
      if (!file_exists($path)) {
        @mkdir($path, null, TRUE);
      }
    }
  }
  return $path;
}