Download the PHP package borislavsabev/simple-xml-loader without Composer

On this page you can find all versions of the php package borislavsabev/simple-xml-loader. 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 simple-xml-loader

SimpleXMLLoader

A minimalistic SimpleXml loader. Wraps the simplexml_load_XXXX() methods and provides libxml error handling.

Main goals:

Installation

This package is available on Packagist and installable via Composer:

composer require borislavsabev/simple-xml-loader

Basic usage

As this is a wrapper the wrapped library's functionality is not covered in this documentation. Please refer to:

Loop usage

Each consecutive call to a loader method resets the state of LibXML and the payload you must extract all data between calls.

Reusing XmlLoaderPayload

You can also reuse the XmlLoaderPayload in your application if you which. Say for example you use this wrapper to parse different XML file but then want to pass the result to different Services in your code that will handle any business logic. You could just get the XmlLoaderPayload and pass it along to a specific service (or whatever really):

NOTE: Generally you should have you own payload objects to pass data around in your Domain. The idea of XmlLoaderPayload is to be internal for XmlLoader thus it cannot contain any logic outside of that task.

Behaviour overwritten

There is only one behaviour change that this library introduces:
_"If you pass an empty string to simplexml_load_string() it will return false and throw no error"_.
The SimpleXmlLoader wrapper throws an XmlLoaderException in this case.

The XmlLoaderException and LibXML's libXMLError

XmlLoaderException's codes are specific to this wrapper. LibXML's libXMLError objects are just returned in an array and as received from SimpleXML/LibXML.

Personal Opinion on the SimpleXML PHP Extension

Generally SimpleXML is not a solid PHP extension and, in my mind, it should be used rarely when you need to do something simple fast. Any serious work should be done via DomDocument.
The previous two sentences are the author's personal opinion which as with any opinion should be taken with a grain of salt.

Versioning

This library follows Semver. According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.
All methods, with public visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep protected methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading.

Contributing

Please do! PR's are very welcome. The author is far from thinking that this wrapper library is perfect. Any PR must first abide by the [Main goals](#Main goals) set out by this library.

Please note that this project adheres to the Contributor Covenant v1.4. By participating in this project you agree to abide by its terms.


All versions of simple-xml-loader with dependencies

PHP Build Version
Package Version
Requires ext-libxml Version *
ext-simplexml 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 borislavsabev/simple-xml-loader contains the following files

Loading the files please wait ....