[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [donate/master] Fixed Uncaught Exception Error: "Class 'Tor\Uri' not found"



commit 945f003f2247a52a97268beda482e12aaab90c96
Author: Peter Haight <peterh@xxxxxxxxxxxxxxx>
Date:   Fri Oct 2 16:03:04 2020 -0700

    Fixed Uncaught Exception Error: "Class 'Tor\Uri' not found"
    
    Forgot to checkin a file.
---
 src/Uri.php | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/Uri.php b/src/Uri.php
new file mode 100644
index 00000000..f128184b
--- /dev/null
+++ b/src/Uri.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Tor;
+
+class Uri extends \Slim\Http\Uri  {
+  public $queryParams = [];
+
+  public function addQueryParam($name, $value) {
+    $this->queryParams[$name] = $value;
+  }
+
+  public static function buildQueryString($queryParams) {
+    return http_build_query($queryParams);
+  }
+
+  public function __toString() {
+    $this->query = static::buildQueryString($this->queryParams);
+    return parent::__toString();
+  }
+
+  public function toString() {
+    return (string) $this;
+  }
+}



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits