25 public static function project(): string {
31 if (!is_file(
"{$path}vendor/autoload.php")) {
32 $path = dirname(
$path, 3) . DIRECTORY_SEPARATOR;
44 public static function elgg(): string {
45 return dirname(__DIR__, 4) . DIRECTORY_SEPARATOR;
54 return self::project() . self::PATH_TO_CONFIG . DIRECTORY_SEPARATOR;
64 public static function settingsFile($file = self::SETTINGS_PHP): string {
65 return self::projectConfig() . $file;
84 $path = preg_replace(
'/([^:])[\/]{2,}/',
'$1/',
$path);
static project()
Get the project root (where composer is installed) path with "/".
static elgg()
Get the Elgg codebase path with "/".
static projectConfig()
Get the project's elgg-config/ path.
static settingsFile($file=self::SETTINGS_PHP)
Get path of the Elgg settings file.
const PATH_TO_CONFIG
Path from project root to config folder.
static sanitize($path, $append_slash=true)
Sanitize file paths ensuring that they begin and end with slashes etc.
Find Elgg and project paths.
const SETTINGS_PHP
Default settings filename.