HH\Facts\db_path

Return the DB path corresponding to the given directory of Hack code

namespace HH\Facts;

function db_path(
  string $root,
): ?string;

The given directory must be a valid path containing a .hhvmconfig.hdf file at its root, and this .hhvmconfig.hdf file must contain either the Autoload.TrustedDBPath or the Autoload.Query setting. Otherwise, this function will return null.

If the Autoload.TrustedDBPath setting points to a valid path, this function will just return that path.

Otherwise, if the Autoload.Query setting exists, this function calculates the DB's location for that repo based on the query, path, version, and Unix user.

Parameters

  • string $root

Returns

  • ?string