mirror of
https://github.com/standardebooks/web.git
synced 2025-07-18 20:36:38 -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
|
@ -433,7 +433,7 @@ class Library{
|
|||
try{
|
||||
$ebookWwwFilesystemPath = preg_replace('|/content\.opf|ius', '', $path);
|
||||
|
||||
$ebooks[] = new Ebook($ebookWwwFilesystemPath);
|
||||
$ebooks[] = Ebook::FromFilesystem($ebookWwwFilesystemPath);
|
||||
}
|
||||
catch(\Exception){
|
||||
// An error in a book isn't fatal; just carry on.
|
||||
|
@ -704,7 +704,7 @@ class Library{
|
|||
try{
|
||||
$ebookWwwFilesystemPath = preg_replace('|/content\.opf|ius', '', $filename);
|
||||
|
||||
$ebook = new Ebook($ebookWwwFilesystemPath);
|
||||
$ebook = Ebook::FromFilesystem($ebookWwwFilesystemPath);
|
||||
|
||||
$ebooks[$ebookWwwFilesystemPath] = $ebook;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue