Download the PHP package queue-fair/magentoadapter without Composer

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


Queue-Fair Adapter for Magento README & Installation Guide

Queue-Fair can be added to any Magento installation easily in minutes. You will need a Queue-Fair account - please visit https://queue-fair.com/free-trial if you don't already have one. You should also have received our Technical Guide. You can find out all about Queue-Fair at https://queue-fair.com

Client-Side JavaScript Adapter

Most of our customers prefer to use the Client-Side JavaScript Adapter, which is suitable for all sites that wish solely to protect against overload.

To add the Queue-Fair Client-Side JavaScript Adapter to your Magento installation, you don't need the PHP files included in this extension.

Instead, perform the following steps:

You shoud now see the Adapter tag when you perform View Source after refreshing your pages.

There is a helpful video of these steps in action at https://magefan.com/blog/how-to-add-custom-code-in-html-head

And you're done! Your queues and activation rules can now be configured in the Queue-Fair Portal.

Server-Side Adapter

The Server-Side Adapter means that your Magento server communicates directly with the Queue-Fair servers, rather than your visitors' browsers.

This can introduce a dependency between our systems, which is why most customers prefer the Client-Side Adapter.

The Server-Side Adapter is preferred in the following use cases:

The Server-Side Adapter is a small PHP library that will run when visitors access your site. It periodically checks to see if you have changed your Queue-Fair settings in the Portal, but other than that if the visitor is requesting a page that does not match any queue's Activation Rules, it does nothing.

If a visitor requests a page that DOES match any queue's Activation Rules, the Adapter makes a determination whether that particular visitor should be queued. If so, the visitor is sent to our Queue Servers and execution and generation of the page for that HTTP request for that visitor will cease. If the Adapter determines that the visitor should not be queued, it sets a cookie to indicate that the visitor has been processed and your page executes and shows as normal.

Thus the Server-Side Adapter prevents visitors from skipping the queue by disabling the Client-Side JavaScript Adapter, and also reduces load on your Magento server when things get busy.

You will need PHP version 5.4 or above to run the Server-Side Adapter.

Here's every keystroke for the install.

1. Create a readable, writable and executable folder so that your Queue-Fair settings can be locally saved (necessary for performance of your web server under load):

Note: The settings folder can go anywhere, but for maximum security this should not be in your web root. The executable permission is needed on the folder so that the Adapter can examine its contents. You can see your Queue-Fair settings in the Portal File Manager - they are updated when you hit Make Live.

2. IMPORTANT: Make sure the system clock on your webserver is accurately set to network time! On unix systems, this is usually done with the ntp package. It doesn't matter which timezone you are using. For Debian/Ubuntu:

3. Go to your Magento installation:

4. Add the Server-Side extension to your composer requirements:

5. Update composer

This will create a new folder /path/to/magento/vendor/queue-fair/magadapter

6. Next, edit vendor/queue-fair/magadapter/QueueFairConfig.php

7. At the top of QueueFairConfig.php set your account name and account secret to the account System Name and Account Secret shown on the Your Account page of the Queue-Fair portal.

8. Change the settingsFileCacheLocation to match the folder path to the settings folder you created above.

9. Note the settingsFileCacheLifetimeMinutes setting - this is how often your web server will check for updated settings from the Queue-Fair queue servers (which change when you hit Make Live). The default value is 5 minutes. You can set this to -1 to disable local caching but DON'T DO THIS on your production machine/live queue with real people, or your server may collapse under load.

10. Note the adapterMode setting. "safe" is recommended - we also support "simple" - see the Technical Guide for further details.

11. IMPORTANT Note the debug setting - this is set to true by default, BUT you MUST set debug to false on production machines/live queues as otherwise your web logs will rapidly become full. You can safely set it to a single IP address to just output debug information for a single visitor, even on a production machine.

The debug logging statements will appear in whichever file php has been set-up to output error message information. If using Apache, it will appear in the apache error.log, and you can see the messages with

12. When you have finished making changes to QueueFairConfig.php, hit CTRL-O to save and CTRL-X to exit nano.

To make the Adapter actually run, you need to edit the master Magento index.php file. Make sure you make a back up copy of the index.php file before editing.

and just after the opening <?php tag, on the second line, add

This will ensure that the adapter is the first thing that runs when a vistor accesses any page, which is necessary both to protect your server from load from lots of visitors and also so that the adapter can set the necessary cookies. You can then use the Activation Rules in the Portal to set which pages on your site may trigger a queue.

The if statement prevents the Adapter from running on background Magento AJAX and RestAPI calls - you really only want the Adapter to run on page requests.

In the case where the Adapter sends the request elsewhere (for example to show the user a queue page), the go() method will return false and the rest of the page will NOT be generated, which means it isn't sent to the visitor's browser, which makes it secure, as well as preventing your server from having to do the work of producing the rest of the page. It is important that this code runs before the Magento framework initialises so that your server can perform this under load, when the full Magento framework is too onerous to load.

NOTE: If your Magento server is sitting behind a proxy, CDN or load balancer, you may need to edit the property sets in the above stanza to use values from forwarded headers instead. If you need help with this, contact Queue-Fair support.

IMPORTANT Unlike the JavaScript Client-Side Adapter, which only runs in browsers that run JavaScript and only on browsers requesting page URLs that contain the Adapter tag, the Server-Side Adapter may run on every request. That means if you have automated systems that call API or callback URLs on your site (such as payment gateways), and your Activation Rules match those URLs, they will also be queued when things get busy, which can have adverse effects. We recommend that you exclude API or callback URLs from the Adapter in logic in your code - you can also use the Activation Rules to achieve this.

Tap CTRL-O to save and CTRL-X to exit nano. You should also back up the index.php file after making your changes in case it gets overwritten by any future update.

That's it you're done!

To test the Server-Side Adapter

Use a queue that is not in use on other pages, or create a new queue for testing.

Testing SafeGuard

Set up an Activtion Rule to match the page you wish to test. Hit Make Live. Go to the Settings page for the queue. Put it in SafeGuard mode. Hit Make Live again.

In a new Private Browsing window, visit the page on your site.

Testing Queue

Go back to the Portal and put the queue in Demo mode on the Queue Settings page. Hit Make Live. Delete any Queue-Fair-Pass cookies from your browser. In a new tab, visit https://accountname.queue-fair.net , and delete any Queue-Fair-Pass or Queue-Fair-Data cookies that appear there. Refresh the page that you have visited on your site.

IMPORTANT: Once you are sure the Server-Side Adapter is working as expected, remove the Client-Side JavaScript Adapter tag from your pages, and don't forget to disable debug level logging in QueueFairConfig.php, and also set settingsFileCacheLifetimeMinutes to at least 5.

For maximum security

The Server-Side Adapter contains multiple checks to prevent visitors bypassing the queue, either by tampering with set cookie values or query strings, or by sharing this information with each other. When a tamper is detected, the visitor is treated as a new visitor, and will be sent to the back of the queue if people are queuing.

AND FINALLY

All client-modifiable settings are in QueueFairConfig.php . You should never find you need to modify QueueFairAdapter.php - but if something comes up, please contact [email protected] right away so we can discuss your requirements.

Remember we are here to help you! The integration process shouldn't take you more than an hour - so if you are scratching your head, ask us. Many answers are contained in the Technical Guide too. We're always happy to help!


All versions of magentoadapter with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
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 queue-fair/magentoadapter contains the following files

Loading the files please wait ....