Page MenuHomePhabricator

Add an isAbsolutePath method
ClosedPublic

Authored by joshuaspence on May 26 2015, 11:39 PM.
Tags
None
Referenced Files
F18773946: D13030.diff
Thu, Oct 9, 1:52 PM
F18705674: D13030.id.diff
Sun, Sep 28, 12:30 PM
F18423249: D13030.id31550.diff
Aug 30 2025, 7:30 PM
F18423074: D13030.id31418.diff
Aug 30 2025, 7:14 PM
F17828960: D13030.diff
Jul 26 2025, 9:41 AM
F17708917: D13030.id31583.diff
Jul 17 2025, 3:20 AM
F17702818: D13030.diff
Jul 15 2025, 11:51 PM
Unknown Object (File)
Jul 2 2025, 4:54 AM

Details

Summary

Add a Filesystem::isAbsolutePath method as this functionality is fairly general purpose and reusable.

Test Plan

This logic has just been moved from Filesystem::resolvePath.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Add an isAbsolutePath method.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.May 26 2015, 11:41 PM
epriestley edited edge metadata.

maybe this should be less reversed

This revision now requires changes to proceed.May 26 2015, 11:46 PM

This still seems questionable to me:

$is_absolute = self::isRelativePath($path);

Specifically, this code is good if you rename the method to isAbsolutePath(), or this method name is fine if you invert the logic and invert the return value before assigning. But this is setting $is_absolute = is_relative(), which doesn't make sense, and isRelativePath() is returning true for absolute (i.e., not relative) paths.

epriestley edited edge metadata.

See above.

This revision now requires changes to proceed.May 28 2015, 10:26 PM
epriestley edited edge metadata.
This revision is now accepted and ready to land.May 31 2015, 2:37 PM
This revision was automatically updated to reflect the committed changes.