Download the PHP package sebastian/exporter without Composer

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

Latest Stable Version CI Status codecov

sebastian/exporter

This component provides the functionality to export PHP variables for visualization.

Installation

You can add this library as a local, per-project dependency to your project using Composer:

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

Usage

Exporting:

Data Types

Exporting simple types:

Exporting complex types:

Compact exports:

Customizing How Objects Are Exported

By default, an object is exported property by property. Implement the ObjectExporter interface to control how objects of a type are represented:

An object exporter is registered by passing it to Exporter's constructor. It is consulted before the default representation of an object is used:

ObjectExporterChain composes multiple object exporters into a single one. They are consulted in the order in which they are composed into the chain and the first one whose handles() method returns true is asked for the representation:

Enums are objects and are therefore passed to the object exporters as well. When no object exporter handles an object, the default representation is used for it.

Repeated Occurrences

When the same object occurs more than once, the default representation is only used for the first occurrence; subsequent occurrences are replaced with a reference to the object:

An object exporter is responsible for the entire representation of the object it handles. Every occurrence of such an object is therefore exported by it:

The exception is an object that is (indirectly) nested in itself: it cannot be exported this way without recursing infinitely and is replaced with a reference to the object (see Objects Nested in Themselves).

Exporting Nested Values

An object exporter may use the Exporter it is given to export values that are nested in the object it handles. The ExportContext it is given must be passed on when it does. Otherwise, the export of these nested values starts over with an empty context and, for instance, assigns references to arrays that are already in use elsewhere in the same export:

Objects Nested in Themselves

An object that is (indirectly) nested in itself cannot be exported by an object exporter without recursing infinitely. When such an object occurs again while it is being exported by an object exporter, it is replaced with a reference to the object:

An object exporter can provide the representation of this reference by also implementing the ObjectReferenceExporter interface. When its exportReference() method returns null, the default representation of the reference is used:

The object exporter is only asked for the representation of the reference, it is not given the opportunity to export the object again. When object exporters are composed into an ObjectExporterChain, the reference is provided by the object exporter that exports the object, which is the first one whose handles() method returns true.

Compact Exports

Exporter::shortenedExport() and Exporter::shortenedRecursiveExport() consult object exporters as well. The representation an object exporter provides is collapsed to a single line and shortened when it is longer than the configured maximum length:

Bear in mind that these representations are used where a short, single-line, and stable string is required. The representation of a data set is built using Exporter::shortenedRecursiveExport(), for instance, and is part of the name of a test that uses a data provider. An object exporter should therefore provide a representation that is compact and that does not change from one export to the next.

Custom Representations

Exporter::hasCustomRepresentationFor() tells whether an object exporter provides the representation for an object. This is meant for code that renders objects itself and wants to use the representation an object exporter provides when there is one:

Bear in mind that an object that is (indirectly) nested in itself is replaced with a reference to the object instead of being exported by an object exporter again. An object exporter that implements ObjectReferenceExporter can provide the representation of this reference.


All versions of exporter with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
sebastian/recursion-context Version ^4.0
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 sebastian/exporter contains the following files

Loading the files please wait ...