Download the PHP package tourcms/tourcms-php without Composer

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

PHP Wrapper for the TourCMS API

Installation

Installing via Composer (Recommended)

  1. Install Composer, add "tourcms/tourcms-php": "4.*", to the requires section of your composer.json:
  2. Ensure you are including composer's autoload.php, alternatively include TourCMS.php directly.

Installing Manually

  1. Download the source zip, extract to your web server
  2. Include TourCMS.php in your source

Upgrading from version 1.x

If you are upgrading from version 1.x of the library the latest TourCMS.php should be more or less a straight swap. The major change being that to adhere to PHP PSR-4 standards, the class is now namespaced. Broadly speaking there are two different ways to update existing code to account for this:

Aliasing the namespace

If you already have a global include file that includes TourCMS.php you could add the following line immediately after TourCMS.php is included:

Your existing code should then work as-is, for example when you create a new instance of the TourCMS class you would have:

Using the fully qualified name

Alternatively use the fully qualified name when you create a new instance of the class:

Usage

Further Examples

API documentation on tourcms.com

Each API method in the TourCMS API documentation includes full PHP sample code.

Examples in this repository

Additionally there are some examples included in this repository, to run them:

  1. Copy the src/examples directory to your web root
  2. Rename examples/config-example.php to examples/config.php
  3. Load your API credentials in the config file and ensure the path to TourCMS.php is correct
  4. Point your web browser at the examples folder

Environment test

The library can attempt to check your local environment and API credentials, useful if you are having trouble connecting. First off make sure you are including TourCMS.php, either via autoload or explicitly.

Response headers

TourCMS responds with some useful information in the response headers. There is a method to retrieve the last set of response headers via the PHP wrapper.

Set User-Agent

Set a User-Agent header. Useful when trying to determine which application or process is making API calls.

Set X-Request-Identifier

Set a uuid or other id to the request. Useful for tracking/logging. Should be pseudo random / unique, e.g. UUID.

Override base URL

By default the base URL will point to TourCMS main production environment. There is a method to override this to point at another base URL, intended for testing purposes.


All versions of tourcms-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
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 tourcms/tourcms-php contains the following files

Loading the files please wait ....