/** * @return SS_Datetime */ public function Created() { $created = $this->commit->getCommitterDate(); $created->setTimezone(new DateTimeZone(date_default_timezone_get())); $d = SS_Datetime::create(); $d->setValue($created->format('Y-m-d H:i:s')); return $d; }
/** * * @return SS_Datetime */ public function Created() { $created = $this->commit->getCommitterDate(); // gitonomy sets the time to UTC, so now we set the timezone to // whatever PHP is set to (date.timezone). This will change in the future if each // deploynaut user has their own timezone $created->setTimezone(new DateTimeZone(date_default_timezone_get())); $d = new SS_Datetime(); $d->setValue($created->format('Y-m-d H:i:s')); return $d; }
/** * @param string $sha * @return array */ protected function getCommitData($sha) { try { $repo = $this->Project()->getRepository(); if ($repo !== false) { $commit = new \Gitonomy\Git\Commit($repo, $sha); return ['AuthorName' => (string) Convert::raw2xml($commit->getAuthorName()), 'AuthorEmail' => (string) Convert::raw2xml($commit->getAuthorEmail()), 'Message' => (string) Convert::raw2xml($commit->getMessage()), 'ShortHash' => Convert::raw2xml($commit->getFixedShortHash(8)), 'Hash' => Convert::raw2xml($commit->getHash())]; } } catch (\Gitonomy\Git\Exception\ReferenceNotFoundException $exc) { SS_Log::log($exc, SS_Log::WARN); } return array('AuthorName' => '(unknown)', 'AuthorEmail' => '(unknown)', 'Message' => '(unknown)', 'ShortHash' => $sha, 'Hash' => '(unknown)'); }