/**
  * Proxy method calls to the dsn instance
  *
  * @param string $method
  * @param array $args
  * @return void
  */
 public function __call($method, $args)
 {
     $getSet = substr($method, 0, 3);
     if ($getSet === 'get' || $getSet === 'set') {
         $key = lcfirst(substr($method, 3));
         if ($getSet === 'get') {
             if (isset($this->getters[$key])) {
                 return $this->getters[$key]($this->dsn->{$key}, $this->dsn);
             }
         } else {
             if (isset($this->setters[$key])) {
                 $return = $this->setters[$key]($value, $key, $this->dsn);
                 if ($return !== null) {
                     $this->dsn->{$key} = $return;
                 }
                 return;
             }
         }
     }
     return parent::__call($method, $args);
 }
Example #2
0
 /**
  * parseUrl
  *
  * Handle the parent method only dealing with paths for the file scheme
  *
  * @param string $string
  * @return array
  */
 public function parseUrl($string)
 {
     $engine = null;
     if ($this->databaseIsPath) {
         $engine = substr($string, 0, strpos($string, ':'));
         $string = 'file' . substr($string, strlen($engine));
     }
     parent::parseUrl($string);
     if ($engine !== null) {
         $this->setEngine($engine);
     }
 }