Download the PHP package kiwilan/php-ebook without Composer

On this page you can find all versions of the php package kiwilan/php-ebook. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-ebook

PHP eBook

Banner with eReader picture in background and PHP eBook title

php version downloads license tests codecov

PHP package to read metadata and extract covers from eBooks, comics and audiobooks.

To know more see Supported formats. Supports Linux, macOS and Windows.

[!NOTE]

This package favors eBooks in open formats such as .epub (from IDPF) or .cbz (from CBA) and which be parsed with native PHP, so for the best possible experience we recommend converting the eBooks you use. If you want to know more about eBook ecosystem, you can read documentation.

[!WARNING]

For DRM (Digital Rights Management) eBooks, in some cases you could read metadata but not contents (like HTML files for EPUB). To use all features, you have to use a software to remove DRM before using this package. For EPUB, you can use calibre with DeDRM plugin, this guide can help you.

About

This package was built for bookshelves-project/bookshelves, a web app to handle eBooks.

Requirements

[!NOTE]

You have to install requirements only if you want to read metadata for these formats, e.g. if you want to read metadata from .cbr files, you have to install rar PHP extension or p7zip binary. So all requirements for PHP extensions and binaries are optional.

[!WARNING]

Archives are handle with kiwilan/php-archive, for some formats (.cbr and .cb7) rar PHP extension or p7zip binary could be necessary. Some guides to install these requirements are available on kiwilan/php-archive.

Features

Roadmap

Installation

You can install the package via composer:

Usage

With eBook files or audiobook* files (to know more about formats, see Supported formats).

*: should be installed separately, see Requirements.

For pages count, you can use these methods:

[!NOTE]

For performance reasons, with EPUB, pagesCount and wordsCount are only available on demand. If you use var_dump to check eBook, these properties will be null.

Some metadata can be stored into extras() method, without typing, directly from metadata.

[!NOTE]

For audiobooks, all metadata are stored into extras array, you will find duplicate with Ebook::class properties. See Formats specifications for more informations.

To know if eBook is valid, you can use isValid() static method, before read().

To get additional data, you can use these methods:

To access to archive of eBook, you can use getArchive() method. You can find more informations about archive in kiwilan/php-archive.

And to test if some data exists:

Metadata

Ebook::class contains many informations but if you want to access to raw metadata, metadata() method is available.

MetaTitle

Can be set if book's title is not null.

Cover

Cover can be extracted from ebook.

[!NOTE]

Formats specifications

Audiobooks

For audiobooks, you have to install seperately kiwilan/php-audio.

Properties of Audio::class are:

Ebook Audio
title title
author artist
description description
publisher albumArtist
series album
volume trackNumber
publishDate artist
copyright year or creationDate
copyright encodingBy
tags genre
language language

You can find all metadata into getExtras() array of Ebook::class.

EPUB

With EPUB, metadata are extracted from OPF file, META-INF/container.xml files, you could access to these metatada but you can also get chapters from NCX file. And with chapters() method you can merge NCX and HTML chapters to get full book chapters with label, source and content.

[!NOTE]

For performance reasons, with ncx, html and chapters are only available on demand. If you use var_dump to check metadata, these properties will be null.

Creation

You can create an EPUB or CBZ file with create() static method.

[!NOTE]

Only EPUB and CBZ are supported for creation.

Supported formats

There is a lot of different formats for eBooks and comics, if you want to know more about:

Name Extensions Supported Uses Support cover Support series
EPUB (IDPF) .epub βœ… Native zip βœ… βœ…
Kindle (Amazon) .azw, .azw3, .kf8, .kfx βœ… Native filesystem βœ… (See MOBI cover note) ❌
Mobipocket .mobi, .prc βœ… Native filesystem βœ… (See MOBI cover note) ❌
PDF .pdf βœ… smalot/pdfparser (included) Uses imagick ❌
iBook (Apple) .ibooks ❌ N/A N/A
DjVu .djvu, .djv ❌ N/A N/A
Rich Text Format .rtf ❌ N/A N/A
FictionBook .fb2 βœ… Native filesystem βœ… βœ…
Broadband eBooks .lrf, .lrx ❌ N/A N/A
Palm Media .pdb ❌ N/A N/A
Comics CBZ .cbz βœ… Native zip βœ… βœ…
Comics CBR .cbr βœ… rar PHP extension or p7zip binary βœ… βœ…
Comics CB7 .cb7 βœ… p7zip binary βœ… βœ…
Comics CBT .cbt βœ… Native phar βœ… βœ…
Audio .mp3, .m4a, .m4b, .flac, .ogg βœ… If kiwilan/php-audio is installed Depends of format ❌

MOBI cover note

Mobipocket files and derivatives (.mobi, .prc, .azw, .azw3, .kf8, .kfx) can have a cover image embedded in the file. With native solution of php-ebook cover could be extracted but resolution is not good. Best solution is to convert file with calibre and use EPUB format.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of php-ebook with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
kiwilan/php-archive Version ^2.2.0
kiwilan/php-xml-reader Version ^1.0.11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kiwilan/php-ebook contains the following files

Loading the files please wait ....