/** * 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()); }
/** * 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()); }
/** * 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()); }
/** * 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; }
/** * Gets the to file type * * @return int to file type */ public function GetToFileType() { if (!$this->diffInfoRead) { $this->ReadDiffInfo(); } return GitPHP_FilesystemObject::ObjectType($this->toMode); }