Download the PHP package benbjurstrom/cloudflare-images-php without Composer

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

Cloudflare Images PHP client

This is a framework-agnostic PHP client for Cloudflare Images built on the amazing Saloon v2 🤠 library.

Latest Version on Packagist GitHub Tests Action Status

Table of contents

🚀 Quick start

Install with composer.

Create a new api instance.

Then use it to get details about an existing image.

Or to upload a new image from an image string.

Or generate a one time upload url that lets your users upload images directly to cloudflare without exposing your api key.

You can find more information about direct creator uploads in the Cloudflare Docs.

Using with Laravel

Begin by adding your credentials to your services config file.

Bind the CloudflareImages class in a service provider. `

And use anywhere in your application.

Test your integration using Saloon's amazing response recording.

Response Data

All responses are returned as data objects. Detailed information can be found by inspecting the following class properties:

Image Metadata

Cloudflare allows you attach a modifiable key-value store to your images. To attach metadata to your image chain withMetadata($metadata) onto your api instance before calling the create, createFromUrl, update, or getUploadUrl methods. For example:

Private Images

Cloudflare allows you to configure an image to only be accessible with a signed URL token. To make an image private chain private(true) onto your api instance before calling the create, createFromUrl, update, or getUploadUrl methods. For example:

To generate signatures instantiate your api with the optional signing key parameter and then pass the url you want to sign to the signUrl method.

You can find more information about serving private images in the Cloudflare documentation.

Custom IDs

Cloudflare allows you to configure a custom identifier if you wish. To do so chain withCustomId($id) onto your api instance before calling the create, createFromUrl, or getUploadUrl methods. For example:

Note that images with a custom ID cannot be made private. You can find more information about custom ids in the Cloudflare documentation.

Available Image Methods

get()

Use to get details about an image such as its file name, metadata, and available variants. Returns an ImageData object.

list()

Use to get a paginated list of images. Returns an ImagesData object.

create()

Use to upload an image from an image string. Returns an ImageData object.

createFromUrl()

Use to add an image to Cloudflare from a given url. Returns an ImageData object.

update()

Use to update an image's metadata or privacy setting. Returns an ImageData object.

⚠️ WARNING - Modifying an image's privacy setting will change the image's identifier.

delete()

Use to delete an image. Returns a boolean.

getUploadUrl()

Use to generate a one time upload url that lets your users upload images directly to cloudflare without exposing your api key. Returns an UploadUrlData object.

You can find more information about direct creator uploads in the Cloudflare Docs.

Variant Methods

list()

Use to get a list of all variants. Returns a VariantsData object.


All versions of cloudflare-images-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1.0
saloonphp/saloon Version ^2.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 benbjurstrom/cloudflare-images-php contains the following files

Loading the files please wait ....