Download the PHP package salesmachine-io/salesmachine-php without Composer

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

SalesMachine.IO PHP Client Library

salesmachine-php is a library which allows you to easily send data from your PHP aplication to SalesMachine.IO. The library can be used right away without a complicated setup as shown in the examples below.

When using this library in a high traffic production environment you can use different options to optimize the behavior. See the chapter Usage in Production Environments and Options for more details.

Requirements

First off, you need to have an account at SalesMachine.IO and be in possession of valid API credentials. The requirements regarding your PHP environment are quite basic:

Quick Guide and Code Examples

Installation

The salesmachine-php client library comes as a Composer package.

Init Salesmachine

Salesmachine::init($api_key, $api_secret, array('use_buffer' => true));

Create or Update a Contact

Salesmachine::set_contact($contact_uid, array('name' => 'John Doe', 'email' => '[email protected]'));

Track Pageview of a Contact

Salesmachine::track_pageview($contact_uid, array('/dashboard'));

Track Events of a Contact

Salesmachine::track_event($contact_uid, 'your event name');

Using salesmachine-php in Production Environments

While the default settings get you going right away, it is recommended to change some settings for production environments.

By default, all requests to SalesMachine.IO are with CURL in real time. On a high traffic environment this can eventually lead to reduced performance on the host site. It is therefore recommended to enable the option "use_buffer" which will buffer all requests to a local file first.

The local buffer can then be sent with a cron job in regular intervals by using the code below. This method ensures that the SalesMachine.IO library won't degrade the performance of the host environment.

Store a requests in local buffer

Salesmachine::init($api_key, $api_secret, array('use_buffer' => true));
Salesmachine::set_contact($contact_uid, array('name' => 'John Doe', 'email' => '[email protected]'));
...

Process local buffer in cron job

Salesmachine::init($api_key, $api_secret);
Salesmachine::flush();

Options

When calling Salesmachine::init($api_key, $api_secret) an array of options can be passed as a third parameter. If this parameter is not present or option keys are missing, the default values are taken.

Option Default Description
use_https true Whether or not to send the data to SalesMachine SSL encrypted
use_buffer true If set to false, requests will be sent one by one instead of batch. This is not recommended since it will add load to Salesmachine.io servers.
debug false If activated, debug information will be written to the log file in test/analytics-xx.log

Additional Information

For more information please visit


All versions of salesmachine-php with dependencies

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

Loading the files please wait ....