PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 1.7.1
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v1.7.1
2.5.0 2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 All 34 releases
fluent-booking / vendor / wpfluent / framework / src / WPFluent / Support / Util.php

Util.php in Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution 1.7.1, at vendor/wpfluent/framework/src/WPFluent/Support/Util.php

69 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentBooking\Framework\Support;
4
5 class Util
6 {
7 /**
8 * Returns a comma-separated string or array of functions that
9 * have been called to get to the current point in code.
10 *
11 * @param string $ignoreClass
12 * @param integer $skipFrames
13 * @param boolean $pretty
14 * @return string|array
15 * @see https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/
16 */
17 public static function debugBacktraceSummary(
18 $ignoreClass = null,
19 $skipFrames = 0,
20 $pretty = true
21 ) {
22 return wp_debug_backtrace_summary(
23 $ignoreClass, $skipFrames, $pretty
24 );
25 }
26
27 /**
28 * @param string|array $value
29 * @return mixed
30 * @see https://developer.wordpress.org/reference/functions/wp_slash
31 */
32 public static function addslashes($value)
33 {
34 return wp_slash($value);
35 }
36
37 /**
38 * Convert an absolute file path to URL.
39 *
40 * @param string $filePath
41 * @return string
42 */
43 public static function pathToUrl($filePath = '')
44 {
45 if (!file_exists($filePath)) {
46 throw new \RuntimeException("File does not exist: {$filePath}");
47 }
48
49 $url = str_replace(
50 wp_normalize_path(untrailingslashit(ABSPATH)),
51 site_url(),
52 wp_normalize_path($filePath)
53 );
54
55 return esc_url_raw($url);
56 }
57
58 /**
59 * Get the user locale.
60 *
61 * @param int|null $userId
62 * @return \FluentBooking\Framework\Support\UserLocale
63 */
64 public static function getLocale($userId = null)
65 {
66 return Locale::init($userId);
67 }
68 }
69