Download the PHP package wyz/practicalafas without Composer

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

PracticalAFAS

Basic tests

A PHP library for communicating with AFAS Profit in a practical way, using either SOAP or REST.

Introduction

This is library code, for use by your own code/another project. Whoever is reading this, supposedly already has an idea of what they want to achieve and what AFAS Profit is, so we won't address that here.

This code formed through three principles:

Alternative / rough comparison

An (as of 2026) equally often used project is Afas Profit API.

A very rough / estimated comparison:

For simple tasks (fetching data using non-complicated filters): both are fine. For somewhat more advanced use:

Code structure

The code can be divided in several parts which are not tightly coupled:

Using the Connection class

Your code needs to instantiate a client first, like in this example:

...so if the 'Outputmode' option is not set, getData() returns an array of data rows instead (i.e. the XML/JSON string gets decoded for you).

This is all that's necessary for 'simple' use. More info about Get connectors is in a separate text, and the below is included for comparison, but is optional reading.

Client classes / difference with using Connection

If you want to stay as close to AFAS endpoints' data structure as possible: there is nothing against simply using a client class standalone, and ignoring all other code. There is one public method, callAfas(), which either returns a string containing the return value from a successful API call, or throws an exception.

You will need to know a bit more about AFAS endpoints' behavior, because the clients contain almost no logic around argument/output validation. All they handle is

Choose the client that suits you. (The structure of JSON data returned from the REST endpoint sometimes seems closer to AFAS' own data structures, and seemed to be more lenient with certain queries which the SOAP endpoint refused. The SOAP endpoint also returns a data schema, in case you need that.)

You would want to use Connection class (per above) instead, if you

RestCurlClient examples

SoapAppClient examples

Further reading

Get connectors

Update connectors / UpdateObject classes

Hints for developers

Compatibility

The code likely is still compatible with PHP5 (5.4 and up) although v2.4 has only been tested on PHP8.

As of v2.4: I am not opposed to adding code that is incompatible with PHP5, but at the same time am not planning a rewrite of the existing code.

Client classes for REST and SOAP use PHP's standard Curl + JSON and SOAP + SimpleXML extensions; if these do not work for you, PRs with new / modified clients are welcome.

Automatic testing is only done for the UpdateConnector classes. (I currently don't consider the Client classes in need of tests. Connection could use some light tests, but it's not on my to-do list.)

Authors

I like contributing open source software to the world and I like opening up semi-closed underdocumented systems. (Which was the case with AFAS in 2012, but it has gotten better.) Give me a shout-out if this is useful or if you have a contribution. Contact me if you need integration work done. (I have experience with several other systems.)

License

This library is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments


All versions of practicalafas with dependencies

PHP Build Version
Package Version
Requires ext-openssl 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 wyz/practicalafas contains the following files

Loading the files please wait ...