PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.6
ShopBuilder – WooCommerce Builder For Elementor v3.2.6
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / vendor / codesvault / howdy-qb / src / Utilities.php

Utilities.php in ShopBuilder – WooCommerce Builder For Elementor 3.2.6, at vendor/codesvault/howdy-qb/src/Utilities.php

48 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace CodesVault\Howdyqb;
4
5 class Utilities
6 {
7 public static function throughException($exception)
8 {
9 if (php_sapi_name() !== 'cli') {
10 printf("<div class='howdy-qb'>");
11 $error_msg = sprintf(
12 "<strong style='color: #d60202;'>%s</strong> <strong style='color: red;'>%s</strong>",
13 'ERROR Message:',
14 $exception->getMessage()
15 );
16 printf($error_msg);
17 printf("<br /><strong>In %s %s</strong><br /><br />", $exception->getFile(), $exception->getLine());
18 printf(
19 "<div style='max-height: 300px; overflow: scroll;'><strong>Trace:</strong> <pre>%s</pre> </div><br />",
20 $exception->getTraceAsString()
21 );
22 printf("</div>");
23 }
24
25 throw new \Exception($exception->getMessage());
26 }
27
28 public static function get_placeholder($db, $value)
29 {
30 if ($db instanceof \wpdb) {
31 if (is_array($value)) return '%s';
32 if (is_string($value)) return '%s';
33 if (is_integer($value)) return '%d';
34 if (is_float($value)) return '%f';
35 }
36 return "?";
37 }
38
39 public static function get_db_configs()
40 {
41 if (empty(QueryFactory::getConfig())) {
42 global $wpdb;
43 return $wpdb;
44 }
45 return QueryFactory::getConfig();
46 }
47 }
48