Esempio n. 1
0
 public function compareLast(Version $version)
 {
     $resolver = $version->resolver();
     $last = $resolver->last();
     $result = $this->compare($last, $resolver);
     if ($result === false) {
         return false;
     }
     if (!PageUtils::putContents($last, $result->comparable2)) {
         error_handler(E_USER_ERROR, "Failed to save \"{$r2}\"", basename(__FILE__), 28);
         return false;
     }
     return $result;
 }
Esempio n. 2
0
 public function version()
 {
     $version = new Version();
     $version->setEntity($this->entity());
     $version->setTimestamp($this->created_at);
     return $version;
 }
Esempio n. 3
0
 public function getDownload(Request $request, Page $page, Version $version)
 {
     $parameters = $request->route()->parameters();
     $transformer = new Transforms();
     $transforms = $transformer->filterTransforms($parameters);
     if ($transforms) {
         $downloadable = $transformer->apply($transforms, $version->downloadable());
         return new DownloadWorker($downloadable);
     }
     return $this->viewDownload(compact('page', 'version'));
 }