Page MenuHomePhabricator

Add an isAbsolutePath method
ClosedPublic

Authored by joshuaspence on May 26 2015, 11:39 PM.
Tags
None
Referenced Files
F13135849: D13030.id31420.diff
Thu, May 2, 11:04 AM
F13135848: D13030.id31550.diff
Thu, May 2, 11:04 AM
F13135835: D13030.id31418.diff
Thu, May 2, 11:00 AM
Unknown Object (File)
Thu, Apr 25, 9:11 PM
Unknown Object (File)
Sat, Apr 6, 8:51 PM
Unknown Object (File)
Wed, Apr 3, 7:53 PM
Unknown Object (File)
Apr 2 2024, 10:14 PM
Unknown Object (File)
Mar 21 2024, 12:23 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
Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 6301
Build 6323: [Placeholder Plan] Wait for 30 Seconds

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.