Ebook
in package
Table of Contents
Properties
- $archive : BaseArchive|null
- $audio : Audio|null
- $authorMain : BookAuthor|null
- $authors : array<string|int, BookAuthor>
- $basename : string
- $copyright : string|null
- $countsParsed : bool
- $cover : EbookCover|null
- $createdAt : DateTime|null
- $description : string|null
- $execTime : float|null
- $extension : string
- $extras : array<string, mixed>
- $filename : string
- $format : EbookFormatEnum|null
- $hasParser : bool
- $identifiers : array<string|int, BookIdentifier>
- $isArchive : bool
- $isAudio : bool
- $isBadFile : bool
- $isMobi : bool
- $language : string|null
- $metaTitle : MetaTitle|null
- $pagesCount : int|null
- $parser : EbookParser|null
- $path : string
- $publishDate : DateTime|null
- $publisher : string|null
- $series : string|null
- $size : int
- $tags : array<string|int, string>
- $title : string|null
- $volume : int|float|null
- $wordsCount : int|null
Methods
- __toString() : string
- create() : ArchiveZipCreate
- Create an ebook file.
- getArchive() : BaseArchive|null
- Archive reader, from `kiwilan/php-archive`.
- getAudio() : Audio|null
- Audio reader, from `kiwilan/php-audio`.
- getAuthorMain() : BookAuthor|null
- First author of the book (useful if you need to display only one author).
- getAuthors() : array<string|int, BookAuthor>
- All authors of the book.
- getBasename() : string
- Basename of the ebook, e.g. `The Clan of the Cave Bear.epub`.
- getCopyright() : string|null
- Copyright of the book.
- getCover() : EbookCover|null
- Cover of the ebook.
- getCreatedAt() : DateTime|null
- Creation date of the ebook.
- getDescription() : string|null
- Raw description of the book.
- getDescriptionAdvanced() : BookDescription
- Advanced description with multi-options for the book.
- getExecTime() : float|null
- Execution time for parsing the ebook.
- getExtension() : string
- Extension of the ebook, e.g. `epub`.
- getExtra() : mixed
- Get key from `extras` safely.
- getExtras() : array<string, mixed>
- Extras of the ebook.
- getFilename() : string
- Filename of the ebook, e.g. `The Clan of the Cave Bear`.
- getFormat() : EbookFormatEnum|null
- Format of the ebook.
- getIdentifiers() : array<string|int, BookIdentifier>
- Identifiers of the book.
- getLanguage() : string|null
- Language of the book.
- getMetadata() : EbookParser|null
- Parser of the ebook.
- getMetaTitle() : MetaTitle|null
- Title metadata of the book with slug, sort title, series slug, etc.
- getPagesCount() : int|null
- Page count of the ebook.
- getParser() : EbookParser|null
- Parser of the ebook.
- getPath() : string
- Physical path to the ebook.
- getPublishDate() : DateTime|null
- Publish date of the book.
- getPublisher() : string|null
- Publisher of the book.
- getSeries() : string|null
- Series of the book.
- getSize() : int
- Size of the ebook, in bytes.
- getSizeHumanReadable() : string
- Size of the ebook in human readable format, e.g. `1.23 MB`.
- getTags() : array<string|int, string>
- Tags of the book.
- getTitle() : string|null
- Title of the book.
- getVolume() : int|float|null
- Volume of the book.
- getWordsCount() : int|null
- Word count of the ebook.
- hasCover() : bool
- Whether the ebook has a cover.
- hasMetadata() : bool
- Whether the ebook has parser.
- hasParser() : bool
- Whether the ebook has parser.
- hasSeries() : bool
- Whether the ebook has series.
- isArchive() : bool
- Whether the ebook is an archive.
- isAudio() : bool
- Whether the ebook is an audio.
- isBadFile() : bool
- Whether the ebook is a bad file.
- isMobi() : bool
- Whether the ebook is a mobi.
- isValid() : bool
- Check if an ebook file is valid.
- read() : self|null
- Read an ebook file.
- setAuthor() : self
- setAuthorMain() : self
- setAuthors() : self
- setCopyright() : self
- setDescription() : self
- setExtra() : self
- setExtras() : self
- setHasParser() : self
- setIdentifier() : self
- setIdentifiers() : self
- setLanguage() : self
- setMetaTitle() : self
- setPagesCount() : self
- setPublishDate() : self
- setPublisher() : self
- setSeries() : self
- setTag() : self
- setTags() : self
- setTitle() : self
- setVolume() : self
- setWordsCount() : self
- toArray() : array<string|int, mixed>
- toJson() : string
- toXml() : string|null
- wordsByPage() : int
- __construct() : mixed
- audiobook() : EbookModule
- cba() : EbookModule
- clean() : self
- convertCounts() : self
- convertEbook() : self
- djvu() : EbookModule
- epub() : EbookModule
- fb2() : EbookModule
- generateFileMetadata() : void
- Generate file metadata.
- mobi() : EbookModule
- parseFile() : Ebook
- Parse an ebook file.
- pdf() : EbookModule
Properties
$archive
protected
BaseArchive|null
$archive
= null
$audio
protected
Audio|null
$audio
= null
$authorMain
protected
BookAuthor|null
$authorMain
= null
$authors
protected
array<string|int, BookAuthor>
$authors
= []
$basename
protected
string
$basename
$copyright
protected
string|null
$copyright
= null
$countsParsed
protected
bool
$countsParsed
= false
$cover
protected
EbookCover|null
$cover
= null
$createdAt
protected
DateTime|null
$createdAt
= null
$description
protected
string|null
$description
= null
$execTime
protected
float|null
$execTime
= null
$extension
protected
string
$extension
$extras
protected
array<string, mixed>
$extras
= []
$filename
protected
string
$filename
$format
protected
EbookFormatEnum|null
$format
= null
$hasParser
protected
bool
$hasParser
= false
$identifiers
protected
array<string|int, BookIdentifier>
$identifiers
= []
$isArchive
protected
bool
$isArchive
= false
$isAudio
protected
bool
$isAudio
= false
$isBadFile
protected
bool
$isBadFile
= false
$isMobi
protected
bool
$isMobi
= false
$language
protected
string|null
$language
= null
$metaTitle
protected
MetaTitle|null
$metaTitle
= null
$pagesCount
protected
int|null
$pagesCount
= null
$parser
protected
EbookParser|null
$parser
= null
$path
protected
string
$path
$publishDate
protected
DateTime|null
$publishDate
= null
$publisher
protected
string|null
$publisher
= null
$series
protected
string|null
$series
= null
$size
protected
int
$size
= 0
$tags
protected
array<string|int, string>
$tags
= []
$title
protected
string|null
$title
= null
$volume
protected
int|float|null
$volume
= null
$wordsCount
protected
int|null
$wordsCount
= null
Methods
__toString()
public
__toString() : string
Return values
stringcreate()
Create an ebook file.
public
static create(string $path) : ArchiveZipCreate
Parameters
- $path : string
Return values
ArchiveZipCreategetArchive()
Archive reader, from `kiwilan/php-archive`.
public
getArchive() : BaseArchive|null
Tags
Return values
BaseArchive|nullgetAudio()
Audio reader, from `kiwilan/php-audio`.
public
getAudio() : Audio|null
You have to install kiwilan/php-audio to use this feature.
Tags
Return values
Audio|nullgetAuthorMain()
First author of the book (useful if you need to display only one author).
public
getAuthorMain() : BookAuthor|null
Return values
BookAuthor|nullgetAuthors()
All authors of the book.
public
getAuthors() : array<string|int, BookAuthor>
Return values
array<string|int, BookAuthor>getBasename()
Basename of the ebook, e.g. `The Clan of the Cave Bear.epub`.
public
getBasename() : string
Return values
stringgetCopyright()
Copyright of the book.
public
getCopyright([int|null $limit = null ]) : string|null
Parameters
- $limit : int|null = null
Return values
string|nullgetCover()
Cover of the ebook.
public
getCover() : EbookCover|null
Return values
EbookCover|nullgetCreatedAt()
Creation date of the ebook.
public
getCreatedAt() : DateTime|null
Return values
DateTime|nullgetDescription()
Raw description of the book.
public
getDescription() : string|null
Return values
string|nullgetDescriptionAdvanced()
Advanced description with multi-options for the book.
public
getDescriptionAdvanced() : BookDescription
Return values
BookDescriptiongetExecTime()
Execution time for parsing the ebook.
public
getExecTime() : float|null
Return values
float|nullgetExtension()
Extension of the ebook, e.g. `epub`.
public
getExtension() : string
Return values
stringgetExtra()
Get key from `extras` safely.
public
getExtra(string $key) : mixed
Parameters
- $key : string
getExtras()
Extras of the ebook.
public
getExtras() : array<string, mixed>
Return values
array<string, mixed>getFilename()
Filename of the ebook, e.g. `The Clan of the Cave Bear`.
public
getFilename() : string
Return values
stringgetFormat()
Format of the ebook.
public
getFormat() : EbookFormatEnum|null
Return values
EbookFormatEnum|nullgetIdentifiers()
Identifiers of the book.
public
getIdentifiers() : array<string|int, BookIdentifier>
Return values
array<string|int, BookIdentifier>getLanguage()
Language of the book.
public
getLanguage() : string|null
Return values
string|nullgetMetadata()
Parser of the ebook.
public
getMetadata() : EbookParser|null
Use getParser() instead.
Return values
EbookParser|nullgetMetaTitle()
Title metadata of the book with slug, sort title, series slug, etc.
public
getMetaTitle() : MetaTitle|null
Can be null if the title is null.
Return values
MetaTitle|nullgetPagesCount()
Page count of the ebook.
public
getPagesCount() : int|null
Return values
int|nullgetParser()
Parser of the ebook.
public
getParser() : EbookParser|null
Return values
EbookParser|nullgetPath()
Physical path to the ebook.
public
getPath() : string
Return values
stringgetPublishDate()
Publish date of the book.
public
getPublishDate() : DateTime|null
Return values
DateTime|nullgetPublisher()
Publisher of the book.
public
getPublisher() : string|null
Return values
string|nullgetSeries()
Series of the book.
public
getSeries() : string|null
Return values
string|nullgetSize()
Size of the ebook, in bytes.
public
getSize() : int
You can use getSizeHumanReadable() to get the size in human readable format.
Return values
intgetSizeHumanReadable()
Size of the ebook in human readable format, e.g. `1.23 MB`.
public
getSizeHumanReadable() : string
Return values
stringgetTags()
Tags of the book.
public
getTags() : array<string|int, string>
Return values
array<string|int, string>getTitle()
Title of the book.
public
getTitle() : string|null
Return values
string|nullgetVolume()
Volume of the book.
public
getVolume() : int|float|null
Return values
int|float|nullgetWordsCount()
Word count of the ebook.
public
getWordsCount() : int|null
Return values
int|nullhasCover()
Whether the ebook has a cover.
public
hasCover() : bool
Return values
boolhasMetadata()
Whether the ebook has parser.
public
hasMetadata() : bool
Use hasParser() instead.
Return values
boolhasParser()
Whether the ebook has parser.
public
hasParser() : bool
Return values
boolhasSeries()
Whether the ebook has series.
public
hasSeries() : bool
Return values
boolisArchive()
Whether the ebook is an archive.
public
isArchive() : bool
Return values
boolisAudio()
Whether the ebook is an audio.
public
isAudio() : bool
Return values
boolisBadFile()
Whether the ebook is a bad file.
public
isBadFile() : bool
Return values
boolisMobi()
Whether the ebook is a mobi.
public
isMobi() : bool
Return values
boolisValid()
Check if an ebook file is valid.
public
static isValid(string $path) : bool
Parameters
- $path : string
Return values
boolread()
Read an ebook file.
public
static read(string $path) : self|null
Parameters
- $path : string
Return values
self|nullsetAuthor()
public
setAuthor(BookAuthor $author) : self
Parameters
- $author : BookAuthor
Return values
selfsetAuthorMain()
public
setAuthorMain(BookAuthor|null $authorMain) : self
Parameters
- $authorMain : BookAuthor|null
Return values
selfsetAuthors()
public
setAuthors(array<string|int, BookAuthor> $authors) : self
Parameters
- $authors : array<string|int, BookAuthor>
Return values
selfsetCopyright()
public
setCopyright(string|null $copyright) : self
Parameters
- $copyright : string|null
Return values
selfsetDescription()
public
setDescription(string|array<string|int, mixed>|null $description) : self
Parameters
- $description : string|array<string|int, mixed>|null
Return values
selfsetExtra()
public
setExtra(mixed $value[, string|null $key = null ]) : self
Parameters
- $value : mixed
- $key : string|null = null
Return values
selfsetExtras()
public
setExtras(array<string, mixed> $extras) : self
Parameters
- $extras : array<string, mixed>
Return values
selfsetHasParser()
public
setHasParser(bool $hasParser) : self
Parameters
- $hasParser : bool
Return values
selfsetIdentifier()
public
setIdentifier(BookIdentifier $identifier) : self
Parameters
- $identifier : BookIdentifier
Return values
selfsetIdentifiers()
public
setIdentifiers(array<string|int, BookIdentifier> $identifiers) : self
Parameters
- $identifiers : array<string|int, BookIdentifier>
Return values
selfsetLanguage()
public
setLanguage(string|null $language) : self
Parameters
- $language : string|null
Return values
selfsetMetaTitle()
public
setMetaTitle(Ebook $ebook) : self
Parameters
- $ebook : Ebook
Return values
selfsetPagesCount()
public
setPagesCount(int|null $pagesCount) : self
Parameters
- $pagesCount : int|null
Return values
selfsetPublishDate()
public
setPublishDate(DateTime|null $publishDate) : self
Parameters
- $publishDate : DateTime|null
Return values
selfsetPublisher()
public
setPublisher(string|null $publisher) : self
Parameters
- $publisher : string|null
Return values
selfsetSeries()
public
setSeries(string|null $series) : self
Parameters
- $series : string|null
Return values
selfsetTag()
public
setTag(string|null $tag) : self
Parameters
- $tag : string|null
Return values
selfsetTags()
public
setTags(array<string|int, string>|null $tags) : self
Parameters
- $tags : array<string|int, string>|null
Return values
selfsetTitle()
public
setTitle(string|null $title) : self
Parameters
- $title : string|null
Return values
selfsetVolume()
public
setVolume(int|string|float|null $volume) : self
Parameters
- $volume : int|string|float|null
Return values
selfsetWordsCount()
public
setWordsCount(int|null $wordsCount) : self
Parameters
- $wordsCount : int|null
Return values
selftoArray()
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toJson()
public
toJson() : string
Return values
stringtoXml()
public
toXml(string $path) : string|null
Parameters
- $path : string
Return values
string|nullwordsByPage()
public
static wordsByPage() : int
Return values
int__construct()
protected
__construct(string $path, string $filename, string $basename, string $extension[, int $size = 0 ][, DateTime|null $createdAt = null ][, BaseArchive|null $archive = null ][, Audio|null $audio = null ][, bool $isArchive = false ][, bool $isAudio = false ][, bool $isMobi = false ][, bool $isBadFile = false ][, EbookParser|null $parser = null ][, bool $hasParser = false ]) : mixed
Parameters
- $path : string
- $filename : string
- $basename : string
- $extension : string
- $size : int = 0
- $createdAt : DateTime|null = null
- $archive : BaseArchive|null = null
- $audio : Audio|null = null
- $isArchive : bool = false
- $isAudio : bool = false
- $isMobi : bool = false
- $isBadFile : bool = false
- $parser : EbookParser|null = null
- $hasParser : bool = false
audiobook()
private
audiobook() : EbookModule
Return values
EbookModulecba()
private
cba() : EbookModule
Return values
EbookModuleclean()
private
clean() : self
Return values
selfconvertCounts()
private
convertCounts() : self
Return values
selfconvertEbook()
private
convertEbook() : self
Return values
selfdjvu()
private
djvu() : EbookModule
Return values
EbookModuleepub()
private
epub() : EbookModule
Return values
EbookModulefb2()
private
fb2() : EbookModule
Return values
EbookModulegenerateFileMetadata()
Generate file metadata.
private
generateFileMetadata() : void
mobi()
private
mobi() : EbookModule
Return values
EbookModuleparseFile()
Parse an ebook file.
private
static parseFile(string $path) : Ebook
Parameters
- $path : string
Return values
Ebookpdf()
private
pdf() : EbookModule