mirror of
https://github.com/standardebooks/web.git
synced 2025-07-21 06:45:14 -04:00
Rename the constructor Ebook::__construct()
to static Ebook::FromFilesystem()
Also added `GetFoo()` methods for all the derived properties like `GetUrl()`, `GetHasDownloads()`, etc. Removed that logic from the constructor so that it's reusable in `Ebook::FromFilesystem()` and `Ebook::GetByIdentifier()`
This commit is contained in:
parent
f605a4df60
commit
2098b265a8
9 changed files with 656 additions and 279 deletions
|
@ -7,7 +7,7 @@ use function Safe\preg_replace;
|
|||
use function Safe\apcu_fetch;
|
||||
use function Safe\shuffle;
|
||||
|
||||
$ebook = new Ebook();
|
||||
$ebook = null;
|
||||
$transcriptionSources = [];
|
||||
$scanSources = [];
|
||||
$otherSources = [];
|
||||
|
@ -45,7 +45,7 @@ try{
|
|||
$ebook = apcu_fetch('ebook-' . $wwwFilesystemPath);
|
||||
}
|
||||
catch(Safe\Exceptions\ApcuException){
|
||||
$ebook = new Ebook($wwwFilesystemPath);
|
||||
$ebook = Ebook::FromFilesystem($wwwFilesystemPath);
|
||||
}
|
||||
|
||||
// Divide our sources into transcriptions and scans
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue