Download the PHP package crwlr/crwl-extension-utils without Composer

On this page you can find all versions of the php package crwlr/crwl-extension-utils. 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 crwl-extension-utils

crwl.io Extension Utils

These utilities enable you to develop extensions for the crwl.io web crawling and scraping app.

How to Package Your Custom Steps for the crwl.io App

The crwlr.software documentation provides a detailed explanation of how to build your own steps for the crwlr/crawler library.

Once you've successfully created a working step, the most challenging part of your task is already complete. To integrate your custom steps into the crwl.io app, follow these simple steps:

Composer Package Setup

Ensure your package repository's composer.json file resembles the following template:

Feel free to customize it according to your preferences, but ensure that it includes dependencies on the following three packages: crwlr/crawler, crwlr/crwl-extension-utils and illuminate/support.

For a well-organized project structure, we recommend the following folder arrangement:

In your .gitignore, include at least the following entries:

Step Builders

To create a StepBuilder for your step, follow the example below:

If your step requires configuration, define the necessary parameters in the configParams() method. The crwl.io app's crawler creation/editing form will display corresponding inputs for these config options. When the crawler runs, the StepBuilder::configToStep() method is invoked with the user-saved configuration data. In this method, construct your custom step with the configured values and return it.

Currently, the available config param types are string, int, and bool. Optionally, you can specify a default value (default()), an input label (inputLabel()), and a description text (description()) for each configuration parameter.

If your step doesn't require any settings, the StepBuilder looks rather minimalistic:

If your step needs a filesystem path, where it can store files, you can use $this->fileStoragePath inside the builder. The crwl.io app sets this path for all step builders before building any steps.

When creating a step builder for an HTTP loading step, please implement the following method:

ServiceProvider and Registering Package and Steps

To make your steps accessible in the crwl.io app, the final step is to register an extension package and all your steps using the ExtensionPackageManager included in this package. Since crwl.io is a Laravel application, this is accomplished through a ServiceProvider class:

To complete the setup, add the ServiceProvider to the extra section in the composer.json file:

With these configurations in place, your extension package is ready for use. If your extension is private, ensure you grant access to the crwlrsoft GitHub organization. As a super-user on your crwl.io instance, you can then install your extension via the extensions page in the app.

Custom Steps Performing HTTP Requests Without the crwlr/crawler HttpLoader

In scenarios where your custom steps need to execute HTTP requests that cannot leverage the HttpLoader from the crwlr/crawler package—such as when utilizing a REST API SDK to retrieve data from an API—you'll need to ensure that every HTTP request is tracked when executing your custom steps within the crwl.io app.

To accomplish this, you have two options:

Using a guzzle Client instance

If you want to use a Guzzle Client instance for the requests (it's common practice for PHP API SDKs to let you provide your own Guzzle instance), use the TrackingGuzzleClientFactory from this package:

You can also pass your custom Guzzle configuration as an argument:

Using the RequestTracker

In scenarios where utilizing a Guzzle Client instance for requests is not feasible, you need to call either RequestTracker::trackHttpResponse() or if your request was executed using a headless browser RequestTracker::trackHeadlessBrowserResponse().

If you can provide request/response instances implementing the PSR-7 RequestInterface and/or ResponseInterface, please do so:


All versions of crwl-extension-utils with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
crwlr/crawler Version ^1.8|^2.0
illuminate/support Version ^9.27|^10.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 crwlr/crwl-extension-utils contains the following files

Loading the files please wait ....