From: demeritcowboy Date: Tue, 11 May 2021 20:39:47 +0000 (-0400) Subject: unused function X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=335c13d87862941d02394dbf81f0008e0bd6f889;p=civicrm-core.git unused function --- diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 5c4ae3c548..79bbbd4dfc 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -622,38 +622,6 @@ HTACCESS; return FALSE; } - /** - * @param $directory - * - * @return string - * @deprecated - * Computation of a relative path requires some base. - * This implementation is problematic because it relies on an - * implicit base which was constructed problematically. - */ - public static function relativeDirectory($directory) { - // Do nothing on windows - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - return $directory; - } - - // check if directory is relative, if so return immediately - if (!self::isAbsolute($directory)) { - return $directory; - } - - // make everything relative from the baseFilePath - $basePath = self::baseFilePath(); - // check if basePath is a substr of $directory, if so - // return rest of string - if (substr($directory, 0, strlen($basePath)) == $basePath) { - return substr($directory, strlen($basePath)); - } - - // return the original value - return $directory; - } - /** * @param $directory * @param string $basePath