Returns the basepath for the current field/data combination.
If a `path` is specified in settings, then that will be used as
the replacement pattern

@return string
@throws LogicException if a replacement is not valid for the current dataset
548810
public function basepath()
    {
        $defaultPath = 'webroot{DS}files{DS}{model}{DS}{field}{DS}';
        $path = Hash::get($this->settings, 'path', $defaultPath);
        if (strpos($path, '{primaryKey}') !== false) {
            if ($this->entity->isNew()) {
                throw new LogicException('{primaryKey} substitution not allowed for new entities');
            }
            if (is_array($this->table->getPrimaryKey())) {
                throw new LogicException('{primaryKey} substitution not valid for composite primary keys');
            }
        }

        $replacements = [
            '{primaryKey}' => $this->entity->get($this->table->getPrimaryKey()),
            '{model}' => $this->table->getAlias(),
            '{table}' => $this->table->getTable(),
            '{field}' => $this->field,
            '{year}' => date("Y"),
            '{month}' => date("m"),
            '{day}' => date("d"),
            '{time}' => time(),
            '{microtime}' => microtime(true),
            '{DS}' => DIRECTORY_SEPARATOR,
        ];

        if (preg_match_all("/{field-value:(\w+)}/", $path, $matches)) {
            foreach ($matches[1] as $field) {
                $value = $this->entity->get($field);
                if ($value === null) {
                    throw new LogicException(sprintf('Field value for substitution is missing: %s', $field));
                } elseif (!is_scalar($value)) {
                    throw new LogicException(sprintf('Field value for substitution must be a integer, float, string or boolean: %s', $field));
                } elseif (strlen($value) < 1) {
                    throw new LogicException(sprintf('Field value for substitution must be non-zero in length: %s', $field));
                }

                $replacements[sprintf('{field-value:%s}', $field)] = $value;
            }
        }

        return str_replace(
            array_keys($replacements),
            array_values($replacements),
            $path
        );
    }
332673
public function getBasePath()
    {
        //
        if ($this->resolvePath && $this->resolvePath instanceof \Closure) {
            $pathHandler = $this->resolvePath;
            $this->basePath = $pathHandler($this->basePath);
        }

        return $this->basePath;
    }
670790
public function getBasePath(): string
	{
		if($this->basePath === null)
		{
			$path = $this->server->get('SCRIPT_NAME');

			$this->basePath = rtrim(str_replace(basename($path), '', $path), '/');
		}

		return $this->basePath;
	}
1309225
private function getFilePath()
    {
        $fullName = $this->fullName;
        if (substr($fullName, 0, 1) != '/') {
            $fullName = '/' . $fullName;
        }
        return $this->getSetting('storePath') . $fullName;
    }
1010922
public function getBasePath()
    {
        return (!empty($this->config['General']['base_path'])
                && !empty($this->config['General']['use_base_path']))
            ? $this->config['General']['base_path'] : null;
    }
12760
protected function getPath(): ?string
    {
        $path = $this->input->getOption('path');

        // First we will check for an explicitly specified path from the user. If one
        // exists we will use that as the path to the assets. This allows the free
        // storage of assets wherever is best for this developer's web projects.
        if (\is_null($path)) {
            return null;
        }

        return $this->laravel->basePath().'/'.$path;
    }
886628
public function getSubPath()
    {
        if ($this->hasChildren()) {
            $path = $this->getFilename();
            $name = $this->getBasename();
            return str_replace($name, '', $path);
        }
        return null;
    }
1117119
protected String getBasePath(String rootPath) {

        if (rootPath.endsWith(INHERITANCE_CONFIG_FILE_NAME)) {
            return rootPath.substring(0, rootPath.length() - INHERITANCE_CONFIG_FILE_NAME.length());
        }
        return rootPath;
    }
1151090
public function getPath() : ?string 
    {
        if ( ! $this->hasPath()) {
            $this->setPath($this->getDefaultPath());
        }
        return $this->path;
    }
509528
protected function filePath()
    {
        if ($this->filePath) {
            return $this->filePath;
        }

        $base = $this->appConfig->get('base_path');
        $output = $this->output();
        $this->filePath = str_replace('/', DIRECTORY_SEPARATOR, $base.$output);
        return $this->filePath;
    }
958427
public function getObject()
    {
        if ($this->sourceObject === null && $this->isSourceObjectResolved === false) {
            $this->isSourceObjectResolved = true;

            try {
                $model = $this->modelFactory()->create($this->objectType())->load($this->objectId());
                if ($model->id()) {
                    $this->sourceObject = $model;
                }
            } catch (Exception $e) {
                throw new LogicException(sprintf(
                    'Could not load the source object of the relationship: %s',
                    $e->getMessage()
                ), 0, $e);
            }
        }

        return $this->sourceObject;
    }
637108
public function getPath()
    {
        $path = parent::getPath();
        if ('' == $path)
        {
            $path = '/';
        }
        if ($this->siteRoot)
        {
            $path = substr($path, strlen($this->siteRoot));
        }
        return $path;
    }
653817
function getBasePath()
    {
        $filename = basename($this->getServer()->get('SCRIPT_FILENAME', ''));
        $baseUrl  = $this->getBaseUrl();

        // Empty base url detected
        if ($baseUrl === '')
            return '';

        // basename() matches the script filename; return the directory
        if (basename($baseUrl) === $filename)
            return str_replace('\\', '/', dirname($baseUrl));

        // Base path is identical to base URL
        return rtrim($baseUrl, '/');
    }
1319068
protected function prepareBasePath()
    {
        $baseUrl = $this->getBaseUrl();
        if (empty($baseUrl)) {
            return '';
        }

        $filename = basename($this->server->get('SCRIPT_FILENAME'));
        if (basename($baseUrl) === $filename) {
            $basePath = \dirname($baseUrl);
        } else {
            $basePath = $baseUrl;
        }

        if ('\\' === \DIRECTORY_SEPARATOR) {
            $basePath = str_replace('\\', '/', $basePath);
        }

        return rtrim($basePath, '/');
    }
31244
public function getRelativePath()
    {
        if ($this->path === $this->basePath) {
            return '';
        }
        return substr($this->path, strlen($this->basePath) + 1);
    }
205821
public static function getDefaultPath()
    {
        // use static path for all Unix-based systems
        if (DIRECTORY_SEPARATOR !== '\\') {
            return '/etc/hosts';
        }

        // Windows actually stores the path in the registry under
        // \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath
        $path = '%SystemRoot%\\system32\drivers\etc\hosts';

        $base = getenv('SystemRoot');
        if ($base === false) {
            $base = 'C:\\Windows';
        }

        return str_replace('%SystemRoot%', $base, $path);
    }
172002
protected function getDatabasePath() : string
    {
        $databasePath = $this->getDataDirectory() . DIRECTORY_SEPARATOR . $this->getDatabaseFileName();

        if (!$this->isFileReadable($databasePath)) {
            if (!file_exists($databasePath)) {
                throw new ParserRuntimeException(
                    "Linked database file '$databasePath' not found. Parser data need to be generated.",
                    1458898365
                );
            } else {
                throw new ParserRuntimeException("Linked database file '$databasePath' is not readable.", 1458898366);
            }
        } elseif (!is_file($databasePath)) {
            throw new ParserRuntimeException("Invalid database file name '$databasePath' in link file.", 1458898367);
        }

        return $databasePath;
    }