/** * @return array */ public function stream_stat() { return $this->url_stat($this->stream_url->getUrl()); }
/** * @param string $url * @param array $expectedParsedUrl * * @dataProvider parserUrlProvider */ public function testSambaUrl($url, array $expectedParsedUrl) { $expectedParsedUrl = $expectedParsedUrl + array('type' => 'path', 'path' => 'to\\dir', 'host' => 'host', 'user' => 'user', 'pass' => 'password', 'domain' => '', 'share' => 'base_path', 'port' => 139, 'scheme' => 'smb', 'url' => $url); $url = new SambaUrl($url); static::assertEquals($expectedParsedUrl, $url->toArray()); }
/** * @param SambaUrl $url * @return bool */ public function isFromSameUserShare(SambaUrl $url) { if ($this->getDomain() == $url->getDomain() && $this->getHost() == $url->getHost() && $this->getShare() == $url->getShare() && $this->getUser() == $url->getUser() && $this->getPass() == $url->getPass()) { return true; } else { return false; } }
/** * @param SambaUrl $url * @param string $command * @throws SambaException */ protected function checkUrlIsPath(SambaUrl $url, $command) { if (!$url->isPath()) { throw new SambaException($command . ': error - URL should be path'); } }