public function getBinary(File $file) { $id = trim($file->getId(), '/'); $fileName = pathinfo($id, PATHINFO_FILENAME); if ($fileName != '') { return @file_get_contents($this->baseFolder . '/' . $id); } return false; }
public function getBinary(File $file) { $url = 'file/' . trim($file->getId(), '/'); try { $response = $this->getClient()->get($url); return $response->getBody()->getContents(); } catch (ClientException $e) { if ($e->getResponse()->getStatusCode() == 404) { return false; } throw new ClientException($e->getMessage(), $e->getRequest(), $e->getResponse(), $e); } }
public function getBinary(File $file) { $this->connect(); if (file_exists($this->scheme . '/' . $file->getId())) { return @file_get_contents($this->scheme . '/' . $file->getId()); } return false; }
protected function mustBuildImage(File $file, $filename) { if ($this->timestampCheck == false) { return true; } $fs = new Filesystem(); if (!$fs->exists($this->basePath . '/' . $filename)) { return true; } $info = new \SplFileInfo($this->basePath . '/' . $filename); if ($file->getTimestampLastChange() > $info->getCTime()) { return true; } // Change timestamp of the file, to mark it as "active" $fs->touch($this->basePath . '/' . $filename); return false; }