Exemplo n.º 1
0
 /**
  * Called to prepare the object for serialization
  *
  * @return string[] list of properties to serialize
  */
 public function __sleep()
 {
     $properties = array('contents', 'contentsRead');
     return array_merge($properties, parent::__sleep());
 }
Exemplo n.º 2
0
 /**
  * Compares two objects by path
  *
  * @param GitPHP_FilesystemObject $a first object
  * @param GitPHP_FilesystemObject $b second object
  * @return integer comparison result
  */
 public static function ComparePath($a, $b)
 {
     return strcmp($a->GetPath(), $b->GetPath());
 }
Exemplo n.º 3
0
 /**
  * Called to prepare the object for serialization
  *
  * @return string[] list of properties to serialize
  */
 public function __sleep()
 {
     $properties = array('data', 'dataRead', 'dataEncoded', 'binary', 'size');
     if ($this->dataRead && strlen($this->data) > GitPHP_Blob::LargeBlobSize) {
         $this->data = null;
         $this->dataRead = false;
     }
     if ($this->dataRead && !$this->dataEncoded) {
         $this->EncodeData();
     }
     return array_merge($properties, parent::__sleep());
 }
Exemplo n.º 4
0
 /**
  * GetCacheKey
  *
  * Gets the cache key to use for this object
  *
  * @access public
  * @return string cache key
  */
 public function GetCacheKey()
 {
     $key = parent::GetCacheKey();
     if (!empty($key)) {
         $key .= '|';
     }
     $key .= 'tree|' . $this->hash;
     return $key;
 }
Exemplo n.º 5
0
 /**
  * Gets the to file type
  *
  * @return int to file type
  */
 public function GetToFileType()
 {
     if (!$this->diffInfoRead) {
         $this->ReadDiffInfo();
     }
     return GitPHP_FilesystemObject::ObjectType($this->toMode);
 }