Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
1f7f3464
Unverified
Commit
1f7f3464
authored
3 years ago
by
Eileen McNaughton
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #20270 from demeritcowboy/relative
#2590
- Remove unused function CRM_Utils_File::relativeDirectory
parents
dec8450c
335c13d8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Utils/File.php
+0
-32
0 additions, 32 deletions
CRM/Utils/File.php
with
0 additions
and
32 deletions
CRM/Utils/File.php
+
0
−
32
View file @
1f7f3464
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment