Beispiel #1
0
 public function __construct($str)
 {
     if (strstr($str, $this->getProtocol() . '://') !== 0) {
         $str = $this->getProtocol() . '://' . $str;
     }
     parent::__construct($str);
     if (!isset($this->pieces["host"]) || empty($this->pieces['host'])) {
         throw new \InvalidArgumentException("Host can't be empty");
     }
     if (!isset($this->pieces["path"]) || empty($this->pieces['path'])) {
         throw new \InvalidArgumentException("Database can't be empty");
     }
 }