Download the PHP package atelier/svg without Composer

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

Atelier SVG

Parse, build, query, optimize, sanitize and morph SVG, in pure PHP.

PHP Version Tests PHPUnit PHPStan Stable License

An SVG document as typed PHP objects rather than a string you edit with regular expressions. Load a file, query it with CSS selectors, change it, and write it back. Or build one from nothing.

Every element is a class, every attribute is validated, and nothing depends on an extension or an external binary. Backed by an extensive test suite and PHPStan at its highest level.

Query · Sanitize · Morph · Documentation

Installation

Requires PHP 8.3 or later. No extensions, no image library, no external binary.

Quick start

Loading from markup instead of a path is Svg::fromString($markup), and toString() returns the document without writing a file. See Quick start.

Parse, build and export

Svg is the fluent facade. It loads an existing document, creates an empty one, and hands back markup, a pretty-printed string, a file, or a data URI.

Parsing has profiles: the default accepts what a browser accepts, the strict one refuses what is merely loadable. See Document.

Query and edit

The whole tree is objects, and CSS selectors find your way through it.

Collections are typed and chainable rather than plain arrays. See Collections.

Every element, typed

Shapes, text, gradients, filters, clipping and masking, structure, animation: each SVG element is a class with its own attributes rather than a generic node. See Elements.

Paths

The d attribute becomes a list of typed segments, which is what makes measuring and rewriting a curve possible at all.

Building, analysis, geometry, simplification, and baking transforms into coordinates all live in Paths.

Styling and transforms

Inline styles, presentation attributes, transform matrices, and the bounding boxes that layout depends on. See Styling.

Sanitize untrusted input

Accepting an SVG upload means accepting arbitrary markup. One call strips what makes it dangerous: <script>, on* handlers, javascript: URLs, <foreignObject>, and external references.

Profiles range from permissive to strict, and validation is separate for when you need to know what is wrong rather than remove it. See Sanitization.

Optimize

Fifty passes, grouped into cleanup, conversion, removal, and restructuring. Four presets choose for you, and optimizeWith() takes a pipeline you assembled yourself.

optimizeSafe() preserves ids and metadata, optimizeAggressive() goes for the smallest file. Writing your own pass is a documented interface, not a fork. See Optimization.

Accessibility

A generated SVG is invisible to a screen reader until it is told what it shows.

Titles, descriptions, ARIA roles and labels, focus order, and an audit that reports what is missing. See Accessibility.

Morph and animate

Interpolate between two shapes, whatever their segment counts, and export the result as SMIL, CSS keyframes, JavaScript, or a sprite sheet.

See Morphing.

Documentation

The full documentation is published at ateliersvg.com/svg.

Contributing

Contributions are welcome. Visit the project on GitHub to report a bug, suggest a feature, or open a pull request.

Before submitting code, run:

Changes to public behaviour need a test and a documentation update.

Support

Bug reports, security disclosures, and contribution guidelines are collected at ateliersvg.com/support.

Sharing the package or starring it on GitHub helps more than you would think.

License

Atelier SVG is released under the MIT License.


All versions of svg with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
ext-dom Version *
ext-xml 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 atelier/svg contains the following files

Loading the files please wait ...