From a491348d442ab8e6cd2fa403d4365cdad78e52ce Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Thu, 21 Jun 2018 14:13:41 -0700 Subject: Vendoring deprecated composer libs --- vendor/fguillot/picodb/lib/PicoDb/UrlParser.php | 93 ------------------------- 1 file changed, 93 deletions(-) delete mode 100644 vendor/fguillot/picodb/lib/PicoDb/UrlParser.php (limited to 'vendor/fguillot/picodb/lib/PicoDb/UrlParser.php') diff --git a/vendor/fguillot/picodb/lib/PicoDb/UrlParser.php b/vendor/fguillot/picodb/lib/PicoDb/UrlParser.php deleted file mode 100644 index d8fcaf00..00000000 --- a/vendor/fguillot/picodb/lib/PicoDb/UrlParser.php +++ /dev/null @@ -1,93 +0,0 @@ -url = getenv($environmentVariable); - } - - /** - * Get object instance - * - * @access public - * @param string $environmentVariable - * @return static - */ - public static function getInstance($environmentVariable = 'DATABASE_URL') - { - return new static($environmentVariable); - } - - /** - * Return true if the variable is defined - * - * @access public - * @return bool - */ - public function isEnvironmentVariableDefined() - { - return ! empty($this->url); - } - - /** - * Get settings from URL - * - * @access public - * @param string $url - * @return array - */ - public function getSettings($url = '') - { - $url = $url ?: $this->url; - $components = parse_url($url); - - if ($components === false) { - return array(); - } - - return array( - 'driver' => $this->getUrlComponent($components, 'scheme'), - 'username' => $this->getUrlComponent($components, 'user'), - 'password' => $this->getUrlComponent($components, 'pass'), - 'hostname' => $this->getUrlComponent($components, 'host'), - 'port' => $this->getUrlComponent($components, 'port'), - 'database' => ltrim($this->getUrlComponent($components, 'path'), '/'), - ); - } - - /** - * Get URL component - * - * @access private - * @param array $components - * @param string $component - * @return mixed|null - */ - private function getUrlComponent(array $components, $component) - { - return ! empty($components[$component]) ? $components[$component] : null; - } -} -- cgit v1.2.3