Download the PHP package mltpss/php-sdk without Composer

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

Multipass - PHP SDK

Build Status Latest Stable Version Dependency Status

Requirements

This SDK has been tested with PHP 5.5 and greater.

We are unable to provide official support for earlier versions. For more information about end of life PHP branches, see this page.

Install

This package is intended for custom PHP websites and advanced integrations.

If you're using WordPress, we've made it easy for you. Download the SQweb plugin directly from WordPress.org, or check out the source.

Recommended : Composer + dotenv

  1. In your project root, execute composer require mltpss/php-sdk.

  2. Create a .env file at the root of your project, or edit it if you already have one.

  3. In .env, paste the following configuration:

    Change SQW_ID_SITE with your website ID and SQW_SITENAME with the name to show on the large Multipass button.

For additional settings, see "Options" below.

Composer + Manual Configuration

  1. In your project root, execute composer require mltpss/php-sdk.
  2. Create a new SQweb object passing in its configuration through the constructor. SQW_ID_SITE and SQW_SITENAME must be specified.

For additional settings, see "Options" below.

Manually

  1. Download the latest release of the SDK and unzip it in a folder named sqweb in your project root.
  2. Create a file named sqweb.config at the root of your project. This file should be one level up from the sqweb folder you just created, i.e. :

  3. In sqweb.config, paste the following configuration:

    Change SQW_ID_SITE with your website ID and SQW_SITENAME with the name to show on the large Multipass button.

For additional settings, see "Options" below.

Usage

1. Initializing the SDK

First, you have to initialise SQweb variable on the pages where you wish to use it.

If you used composer:

If you installed manually:

2. Tagging your pages

Then, you need to add our JavaScript tag to your pages. This function will do it for you, and should be inserted before the closing </body> tag in your HTML.

Make sure it is present on all your pages. Most likely you'll just have to add it to your template.

If you previously had a SQweb JavaScript tag, make sure to remove it to avoid any conflicts.

3.a Checking the credits of your subscribers

Check if the user has credits, so that you can disable ads and/or unlock premium content.

3.b Retrieving the user's email

If he wants it, the user can share his email with you, to retrieve it, check if the cookie named mltpss_e exists. Inside will be a base64 encoded string you need to retrieve and decode on your side.

for instance:

This piece of code will store the email in the $email variable if the cookie is set.

4.a Showing the Multipass button

Use this code to display the Multipass button on your pages:

We have 3 additionals sizes for the button, to use it, pass a string to the function:

We also have another type of button, the free button, which offer to share the user's email with you. To display it, use this function:

Example Buttons

4.b Customizing the Multipass button

If you want to customize our different type of button, put the following in your config file (.env if you used composer and dotenv or sqweb.config if you did not) of in the sqweb config file. For instance: SQW_LOGIN=Hello world Will show Hello world instead of Premium with Multipass on the regular button for logged out visitors.

Button Model Logged in Logged out
Tiny SQW_CONNECTED_TINY SQW_LOGIN_TINY
Regular SQW_CONNECTED SQW_LOGIN
Large - before black dot N / A SQW_BTN_UNLIMITED
Large - after black dot N / A SQW_BTN_NOADS
Large connected SQW_CONNECTED_S N / A

5. More functions

Display a support div for your users

php $sqweb = new SQweb;

$sqweb->supportBlock();

We recommend that you use it with our other blocking function :

Display only a part of your content to non premium users

For instance:

Free users will see:

Display your content later for non paying users

Example:

Limit the number of articles free users can read per day

For instance, if I want to display only 5 articles to free users:

Options

Unless otherwise noted, these options default to false. You can set them in your configuration.

Option Description
SQW_DEBUG Output various messages to the browser console while the plugin executes.
SQW_DWIDE Set to false to only enable SQweb on the current domain. Defaults to true.
SQW_LANG We support these locales: en_US, en_GB and fr_FR.
SQW_AUTOLOGIN Enable or disable our autologin feature. Defaults to true.

Known Issues

If you change the value of SQW_DWIDE after initial deployment, your users will have to log in again since their auth cookie will no longer be valid.

Troubleshooting

I am not seeing the Multipass button

Please make sure you have properly tagged your pages. Mind the position of the include and tag.

I can see the Multipass button, but I cannot login

The authentication requires cookies, which require fully qualified domain names. If you are testing on localhost or an IP, the authentication will succeed but won't be able to save a cookie in your browser.

Contributing

We welcome contributions and improvements.

Coding Style

All PHP code must conform to the PSR2 Standard.

Builds and Releases

See RELEASE.md.

Bugs and Security Vulnerabilities

If you encounter any bug or unexpected behavior, you can either report it on Github using the bug tracker, or via email at [email protected]. We will be in touch as soon as possible.

If you discover a security vulnerability within SQweb or this plugin, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.

License

Copyright (C) 2015-2017 – SQweb

This program is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY ; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.


All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >= 5.4.45
vlucas/phpdotenv Version ^2.2
ext-curl 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 mltpss/php-sdk contains the following files

Loading the files please wait ....