/**
  * Instantiates object
  *
  * @param GitPHP_Project $project the project
  * @param string $hash object hash
  */
 public function __construct($project, $hash)
 {
     parent::__construct($project, $hash);
 }
Example #2
0
 /**
  * __sleep
  *
  * Called to prepare the object for serialization
  *
  * @access public
  * @return array list of properties to serialize
  */
 public function __sleep()
 {
     $properties = array('refName', 'refDir');
     return array_merge($properties, parent::__sleep());
 }
Example #3
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 .= 'commit|' . $this->hash;
     return $key;
 }
Example #4
0
 /**
  * Called to prepare the object for serialization
  *
  * @return string[] list of properties to serialize
  */
 public function __sleep()
 {
     $properties = array('dataRead', 'parents', 'tree', 'author', 'authorEpoch', 'authorTimezone', 'committer', 'committerEpoch', 'committerTimezone', 'title', 'comment', 'readTree');
     return array_merge($properties, parent::__sleep());
 }
Example #5
0
 /**
  * Gets a hash for a string or hash-identified object
  *
  * @param string|GitPHP_GitObject $value string or hashed object
  * @param boolean $abbreviate true to abbreviate hash
  * @return string hash
  */
 private static function GetHash($value, $abbreviate = false)
 {
     if ($value instanceof GitPHP_GitObject) {
         return $value->GetHash($abbreviate);
     } else {
         if (is_string($value)) {
             return $value;
         }
     }
     return null;
 }