Beispiel #1
0
 /**
  * Returns the file stream to handle the requested path
  *
  * @param   PathInformation     $path   The path information
  * @param   string              $mode   The mode used to open the path
  * @return  FileBuffer                  The file buffer to handle the path
  */
 public function createFileBuffer(PathInformation $path, $mode)
 {
     $repo = $path->getRepository();
     $buffer = $repo->showFile($path->getLocalPath(), $path->getRef());
     $objectInfo = $repo->getObjectInfo($path->getLocalPath(), $path->getRef());
     return new StringBuffer($buffer, $objectInfo, 'r');
 }
Beispiel #2
0
 /**
  * Returns the file stream to handle the requested path
  *
  * @param   PathInformation     $path   The path information
  * @param   string              $mode   The mode used to open the path
  * @return  FileBuffer                  The file buffer to handle the path
  */
 public function createFileBuffer(PathInformation $path, $mode)
 {
     $repo = $path->getRepository();
     $buffer = implode(str_repeat(PHP_EOL, 3), $repo->getLog($path->getArgument('limit'), $path->getArgument('skip')));
     return new StringBuffer($buffer, array(), 'r');
 }
Beispiel #3
0
 /**
  * Returns the file stream to handle the requested path
  *
  * @param   PathInformation     $path   The path information
  * @param   string              $mode   The mode used to open the path
  * @return  FileBuffer                  The file buffer to handle the path
  */
 public function createFileBuffer(PathInformation $path, $mode)
 {
     $repo = $path->getRepository();
     $buffer = $repo->showCommit($path->getArgument('ref'));
     return new StringBuffer($buffer, array(), 'r');
 }
Beispiel #4
0
 /**
  * streamWrapper::stream_close — Close an resource
  */
 public function stream_close()
 {
     $this->fileBuffer->close();
     $this->fileBuffer = null;
     $repo = $this->path->getRepository();
     $repo->add(array($this->path->getFullPath()));
     if ($repo->isDirty()) {
         $commitMsg = $this->getContextOption('commitMsg', null);
         $author = $this->getContextOption('author', null);
         $repo->commit($commitMsg, array($this->path->getFullPath()), $author);
     }
     $this->path = null;
 }