Download the PHP package typisttech/cloudflare-wp-api without Composer

On this page you can find all versions of the php package typisttech/cloudflare-wp-api. 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-wp-api

Cloudflare WP API

Latest Stable Version Total Downloads Build Status codecov Scrutinizer Code Quality PHP Versions Tested StyleCI Dependency Status License Donate via PayPal Hire Typist Tech

WordPress HTTP API replacement of the jamesryanbell/cloudflare package.

Why use WP HTTP API instead of curl?

curl is great. However, it is not always available on every hosts, especially shared hosting. Using WordPress HTTP API lets WordPress figure out the best way to make HTTP requests. It could be curl or something else. You don't need to care about it. See WordPress codex.

Install

Installation should be done via composer, details of how to install composer can be found at https://getcomposer.org/.

Since the jamesryanbell/cloudflare package doesn't provide a way to inject client objects, we have to rename Cloudflare\Api to Cloudflare\BaseApi. And, use our Api class instead

You have to run the command on every composer install and composer update. A better way to do so is to add this command to composer.json like so:

Usage

Once $ cfwp build is done, you can use it exactly the same as the original package.

See jamesryanbell/cloudflare for more details about the original package.

Successful responses

Decode body array from wp_remote_request.

Error responses

WP_Error object. Maybe returned from wp_remote_request, or one of the followings:

Code Message Data
authentication-error Authentication information must be provided
authentication-error Email is not valid
decode-error Response errors is not an array response

Or, one of the Coudlfare defined error codes, here is some example:

Code Message Data
1012 Request must contain one of 'purge_everything' or 'files' response
1210 That operation is no longer allowed for that domain response

Start Developing

This command will clone the project source code from GitHub and install its dependencies.

Running the Tests

Cloudflare WP API run tests on Codeception and relies wp-browser to provide WordPress integration. Before testing, you have to install WordPress locally and add a codeception.yml file. See Varying Vagrant Vagrants configuration example.

Actually run the tests:

We also test all PHP files against PSR-2: Coding Style Guide and part of the WordPress coding standard.

Check the code style with $ composer check-style and fix it with $ composer fix-style.

Feedback

Please provide feedback! We want to make this library useful in as many projects as possible. Please submit an issue and point out what you do and don't like, or fork the project and make suggestions. No issue is too small.

Change log

Please see CHANGELOG for more information on what has changed recently.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONDUCT for details.

Credits

Cloudflare WP API is a Typist Tech project and maintained by Tang Rufus, freelance developer for hire.

Full list of contributors can be found here.

Special thanks to James Bell whose Cloudflare package make this project possible.

License

Cloudflare WP API is licensed under the GPLv2 (or later) from the Free Software Foundation. Please see License File for more information.


All versions of cloudflare-wp-api with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
jamesryanbell/cloudflare Version ^1.10
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 typisttech/cloudflare-wp-api contains the following files

Loading the files please wait ...