File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
tests/HelperFunctions/filesystem Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ Provides Laravel-specific and pure PHP helper functions.
56
56
- [to_rfc2822_email](#to_rfc2822_email)
57
57
- [to_swiftmailer_emails](#to_swiftmailer_emails)
58
58
59
+ - [Filesystem](#filesystem)
60
+ - [relative_path](#relative_path)
61
+
59
62
- [Format](#format)
60
63
- [get_dump](#get_dump)
61
64
- [format_bytes](#format_bytes)
@@ -276,6 +279,26 @@ $address = to_swiftmailer_emails(['address' => '
[email protected] ', 'name' =>
276
279
// [" [email protected] " => " John Doe" ]
277
280
` ` `
278
281
282
+ # # Filesystem
283
+
284
+ # ### `relative_path()`
285
+
286
+ Returns the relative path of a directory given another one:
287
+
288
+ ` ` ` php
289
+ $path = relative_path(' /var/www/htdocs' , ' /var/www/htdocs/example' )
290
+
291
+ // ' ../'
292
+ ` ` `
293
+
294
+ You can pass relative paths as a parameters:
295
+
296
+ ` ` ` php
297
+ $path = relative_path(' /var/www/htdocs/example/public/../../' , ' /var/' )
298
+
299
+ // ' www/htdocs/'
300
+ ` ` `
301
+
279
302
# # Format
280
303
281
304
# ### `get_dump()`
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace Illuminated \Helpers \HelperFunctions \Tests \FileSystem ;
3
+ namespace Illuminated \Helpers \HelperFunctions \Tests \Filesystem ;
4
4
5
5
use Illuminated \Helpers \HelperFunctions \Tests \TestCase ;
6
6
You can’t perform that action at this time.
0 commit comments