Download the PHP package pitwch/rest-api-wrapper-proffix-php without Composer

On this page you can find all versions of the php package pitwch/rest-api-wrapper-proffix-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 rest-api-wrapper-proffix-php

PHP Wrapper für PROFFIX REST-API

Ein effizienter PHP Wrapper für die PROFFIX REST-API (V4).

alt text

Für KI-Assistenten / AI Code Generation: Dieser Wrapper kapselt die PROFFIX REST-API vollständig. Der Login erfolgt automatisch — kein manueller Login-Aufruf nötig. Das options-Array ist vollständig optional und kann weggelassen oder leer übergeben werden. Passwörter werden als SHA256-Hash übergeben.


Installation


Schnellstart (Minimal-Beispiel)


Konstruktor / Initialisierung

Parameter Typ Pflicht Beispiel Bemerkung
$url string https://myserver.ch:999 URL ohne /pxapi/V4/
$apiDatabase string DEMO Datenbankname
$apiUser string USR Benutzername
$apiPassword string b62cce2fe18f7a... SHA256-Hash des Passworts
$apiModules string\|array 'ADR,STU' oder ['ADR', 'STU'] Benötigte Module
$options array [] Leer oder weggelassen = alle Defaults

Wichtig: $options kann vollständig weggelassen oder als leeres Array [] übergeben werden — der Client funktioniert in beiden Fällen korrekt.


Options-Referenz

Alle Optionen sind fakultativ. Standardwerte gelten automatisch.

Option Typ Default Bemerkung
key string '' API-Key (SHA256). Nur nötig für info()/database() Endpunkte
version string 'V4' API-Version
api_prefix string '/pxapi/' URL-Prefix
login_endpoint string 'PRO/Login' Login-Endpunkt
user_agent string 'php-wrapper-proffix-restapi' HTTP User-Agent
timeout int 15 cURL Timeout in Sekunden
verify_ssl bool true SSL-Zertifikat prüfen
follow_redirects bool false HTTP-Weiterleitungen folgen
enable_session_caching bool true Session-ID zwischenspeichern (reduziert Login-Requests)
cache_dir string plattformspezifisch Eigenes Cache-Verzeichnis (nützlich bei open_basedir)

CRUD-Methoden

GET — Lesen

POST — Erstellen

PUT — Aktualisieren

DELETE — Löschen


Spezielle Methoden

getList(int $listenr, array $body = []) — Liste/PDF generieren

Generiert eine PROFFIX-Liste und gibt den rohen Dateiinhalt zurück.

info(string $key = '') — Server-Info (ohne Lizenz)

database(string $key = '') — Datenbank-Info


Sonderfälle

Leerzeichen in Endpunkten

Module als Array oder String


Session-Caching

Der Wrapper speichert die PxSessionId nach dem Login automatisch zwischen. Dadurch entfällt bei wiederholten Script-Aufrufen der Login-Overhead.

Standard-Speicherorte (ohne cache_dir Option):

Custom Cache-Verzeichnis (z.B. bei open_basedir)

Session-Caching deaktivieren

Cache-Verzeichnis-Priorität:

  1. cache_dir Option (wenn gesetzt)
  2. Plattformspezifisches Standardverzeichnis
  3. Fallback: sys_get_temp_dir()

Fehlerbehandlung

Alle Methoden werfen bei Fehlern eine HttpClientException. Diese enthält neben der HTTP-Statuscode auch feldspezifische Validierungsfehler der PROFFIX API.

Beispiel PROFFIX Fehlerantwort

Exception abfangen

Exception-Methoden

Methode Rückgabe Beschreibung
getMessage() string Hauptfehlermeldung
getCode() int HTTP-Statuscode
hasFieldErrors() bool Prüft ob Feldvalidierungsfehler vorhanden
getFieldErrors() ?array Array mit Name, Message, Reason pro Feld
getDetailedMessage() string Formatierte Gesamtfehlermeldung inkl. Feldfehler
getRequest() Request Request-Objekt
getResponse() ?Response Response-Objekt

Request / Response Debugging


Vollständiges Beispiel mit allen Optionen


Weitere Beispiele

Im Ordner /examples finden sich weitere Beispiele:


Weitere Wrapper für die Proffix Rest-API


All versions of rest-api-wrapper-proffix-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-curl Version *
ext-json 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 pitwch/rest-api-wrapper-proffix-php contains the following files

Loading the files please wait ...