mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 10:56:46 -04:00
Fix incorrect filesystem determination and simplify hash calculation
This commit is contained in:
parent
163ada3b09
commit
274605a0e8
1 changed files with 2 additions and 3 deletions
|
@ -314,8 +314,7 @@ class Ebook{
|
||||||
}
|
}
|
||||||
|
|
||||||
private function GetLatestCommitHash(): string{
|
private function GetLatestCommitHash(): string{
|
||||||
$gitCommits = $this->GitCommits;
|
return substr(sha1($this->GitCommits[0]->Hash), 0, 8);
|
||||||
return substr(sha1($gitCommits[0]->Created->format('U') . ' ' . $gitCommits[0]->Message), 0, 8);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function GetHeroImageUrl(): string{
|
protected function GetHeroImageUrl(): string{
|
||||||
|
@ -606,7 +605,7 @@ class Ebook{
|
||||||
$ebookFromFilesystem = new Ebook();
|
$ebookFromFilesystem = new Ebook();
|
||||||
|
|
||||||
// First, construct a source repo path from our WWW filesystem path.
|
// First, construct a source repo path from our WWW filesystem path.
|
||||||
if(str_starts_with($wwwFilesystemPath, '/')){
|
if(is_dir($wwwFilesystemPath . '/.git')){
|
||||||
$ebookFromFilesystem->RepoFilesystemPath = $wwwFilesystemPath;
|
$ebookFromFilesystem->RepoFilesystemPath = $wwwFilesystemPath;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue