Download the PHP package ohseesoftware/caddy-config-php without Composer

On this page you can find all versions of the php package ohseesoftware/caddy-config-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 caddy-config-php

Caddy Config PHP

Caddy v2 API helper for PHP.

Current Release Build Status Badge Coverage Status Maintainability Score Downloads MIT License


Caddy v2 allows you to update your Caddy configuration via a JSON API. This package is a simple helper library to update parts of your configuration.

Functionality for updating all aspects of the configuration will be added over time.

Usage

To get started, create an instance of OhSeeSoftware\CaddyConfig\Client, ensuring to pass your Caddy network address as the first argument:

From there, you can use the $client instance to make API requests to your Caddy instance.

The idea behind the wrapper is that you can have a Client singleton class, and then use the $client->request() method to create new Request instances. You should create a new Request instance per HTTP request you send to your Caddy server.

API Methods

Client

__constructor()

Creates a new instance of the Client class.

Arguments:

setCaddyHost()

Allows you to change the Caddy host after creating the Client instance.

Arguments:

request()

Returns a new Request instance which you use to make configuration requests.

No arguments.

Request

Use the Request class to compose your request to send to Caddy. Here's an example of how you can add a new host to a server:

__constructor()

Creates a new instance of the Request class.

Arguments:

addHost()

Sends a request to Caddy to add the given host.

Arguments:

Returns:

http()

Adds the http path, "/apps/http", to the request URI.

No arguments.

Returns:

server()

Adds the server path, "/servers/{server}", to the request URI.

Arguments:

Returns:

route()

Adds the route path, "/routes/{routeIndex}", to the request URI.

Arguments:

Returns:

match()

Adds the match path, "/match/{matchIndex}", to the request URI.

Arguments:

Returns:

sendRequest()

Sends the built request to the Caddy server.

Arguments:

Returns:

Response

__constructor()

Creates a new instance of the Response class.

Arguments:

getBody()

Returns the response body as a string.

No arguments.

isSuccessful()

Returns a boolean indicating if the request was successful. Status codes of 200 or 201 are considered successful, everything else is not.

No arguments.

License

The MIT License (MIT). Please see License File for more information.


All versions of caddy-config-php with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.4
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 ohseesoftware/caddy-config-php contains the following files

Loading the files please wait ....