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

peterh at torproject.org peterh at torproject.org
Tue May 11 21:17:51 UTC 2021


commit 945f003f2247a52a97268beda482e12aaab90c96
Author: Peter Haight <peterh at giantrabbit.com>
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;
+  }
+}





More information about the tor-commits mailing list