예제 #1
0
파일: URL.php 프로젝트: Nycto/Round-Eights
 public function testToString()
 {
     $url = new \r8\URL();
     $this->assertSame("", $url->__toString());
     $this->assertSame("", "{$url}");
     $url->setURL("http://example.net/test.html");
     $this->assertSame("http://example.net/test.html", $url->__toString());
     $this->assertSame("http://example.net/test.html", "{$url}");
 }
예제 #2
0
 /**
  * Returns a URI string describing this connection
  *
  * @return String
  */
 public function getURI()
 {
     $uri = new \r8\URL();
     $uri->setScheme("db")->setUserName($this->username)->setPassword($this->password)->setHost($this->host)->setPort($this->port)->setPath($this->database)->setQuery(array_filter(array("persistent" => $this->persistent ? "t" : NULL, "forceNew" => $this->forceNew ? "t" : NULL)));
     return $uri->__toString();
 }