Download the PHP package exfriend/cloudfactory without Composer

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

CloudFactory is a nice and powerful library for building crawlers in PHP. It provides a simple, human readable API while keeping all power of cURL under the hood. Key feature of CloudFactory is Request Validation. When using proxies in multi-threaded environment you will often get lots of problems with timeouts, response spoofing, HTTP/proxy errors and invalid content.

The goal of CloudFactory is to minimize the effort needed for 100% valid content delivery, and you can achieve that by using this library.

Requirements

Installation

composer require exfriend/cloudfactory

Basic Usage

Features

Setting curl options

Option setters

You can set raw curl options as well as use some helpers available on Request object.

You can set almost all of the options directly on the Engine instance:

Concurrent requests

Request priority

You can set priority for each request by using ->withPriority(int). This way when it comes to pulling the request from the queue, they will be sorted by priority.

The more priority you set, the higher your request will be in the queue.

Request callbacks

Response validation

You can validate your responses using validateWith( callable ) when building a request. Your callable should accept the instance of Request as a parameter and return boolean true or false as a validity indicator.

Depending on the validity, engine will call callbacks provided with onSuccess or onFail or onLastFail.

You can set maxTries( int ) to inform the engine how many times the request should be repeated before it fails the last time.

Note that on the last failed try both onFail and onLastFail callback groups will be called.

Passing additional data

You can use store(key,value) method when creating the request to pass any additional data on the storage bag of your request. You can access it from callback like this:

Dynamically add requests

You can add new requests while engine is still running e.g. from callback.

Request collection

When you add a request with $engine->addRequest() it gets pushed to $engine->requests collection. It extends Illuminate\Support\Collection which is the powerful collection pattern implementation used in Laravel. This means you have all the perks like $htmls = $engine->requests()->processed()->pluck('response') to get all responses as array.

Full documentation on collections can be found on the Official Laravel Documentation pages.

Callback stacking

You can process the results using $engine->requests collection or/and using callbacks.

You can add multiple callbacks for each state.

This gives you a possibility to easily write for example proxy rotating trait for your own descendant of Request class.

Examples

For more examples check out the ./examples directory.

Contributing

This package is work-in-progress.


All versions of cloudfactory with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
guzzlehttp/guzzle Version ^6.2
illuminate/support Version ^5.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 exfriend/cloudfactory contains the following files

Loading the files please wait ....