Download the PHP package endless-creativity/elephant-php without Composer

On this page you can find all versions of the php package endless-creativity/elephant-php. 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 elephant-php

elephant-php

CI Latest Stable Version

Convert .docx files to Markdown or semantic HTML, in pure PHP. No external binaries (LibreOffice, Pandoc), no heavyweight library (PHPWord), no shell-out — just the standard PHP extensions. elephant-php reads the structure of a document — headings, lists, tables, footnotes, images — instead of trying to reproduce Word's visual formatting.

It is a PHP port of mammoth.js and adopts its core philosophy and style-mapping DSL.

Features

See ROADMAP.md for the residual gap with mammoth.js (track-changes deletion concatenation, DSL list matchers, OMML equations).

Installation

Requires PHP 8.2+.

Usage

HTML

Markdown

Plain text

Custom style map

Mammoth's DSL is supported as a list of rule strings. Rules are tried in order; the first match wins. The default heading map (Heading 1..6 → h1..h6) is appended after your rules.

Custom image handler

By default, images are embedded as data: URIs. Plug in your own ImageHandler to write to disk / S3 / a CDN / whatever, returning the final <img> attributes.

Transform the document before rendering

transformDocument receives the parsed Document and returns a (possibly modified) Document. Combine with the Transforms helpers to walk and rebuild the tree without writing recursion by hand:

Embedded style map (read / write)

Mammoth supports embedding the style map as a part of the docx itself under mammoth/style-map. Read / write round-trips:

CLI

Conversion warnings are written to stderr regardless of the output destination.

Security defaults

The library is designed to be safe to point at untrusted .docx input out of the box. Three behaviours diverge from mammoth.js for this reason:

Always sanitise the produced HTML before injecting it into a page — the library escapes attribute values and text content, but it does not run a full HTML sanitiser, and downstream contexts may have stricter requirements (e.g., CSP that forbids inline <sup>).

Warnings on real-world documents

The following messages are expected and don't indicate malfunctions:

Development

Project guidance and porting conventions live in CLAUDE.md. Limitations and roadmap items vs mammoth in ROADMAP.md. Contributions welcome — see CONTRIBUTING.md.

Attribution

elephant-php is an independent PHP port inspired by mammoth.js by Michael Williamson. It adopts mammoth's core philosophy (extract semantics, not formatting) and style-mapping DSL. It is not affiliated with or endorsed by the mammoth.js project.

License

BSD-2-Clause. Copyright © 2026 Endless Creativity (PHP port) and © 2013 Michael Williamson (mammoth.js, from which this work derives its algorithmic structure and test fixtures).


All versions of elephant-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-dom Version *
ext-libxml Version *
ext-mbstring Version *
ext-xmlreader Version *
ext-zip Version *
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 endless-creativity/elephant-php contains the following files

Loading the files please wait ...