Download the PHP package gebn/brush without Composer

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

Brush

Brush is a complete object-oriented PHP wrapper for the Pastebin API.

Features

Dependencies

Install

Composer is not required, however Brush is on Packagist and may be added to a project with:

composer require gebn/brush "1.*"

Getting Started

Create an anonymous paste

Below is a minimal example showing how to submit a new paste:

There are several things to note:

Create a private paste

Private pastes must have an account associated with them, but Brush makes this easy to set up:

The Account class represents a Pastebin account. At the lowest level, it manages a user session key, which has to be provided when doing operations affecting a particular account. An instance can be created in two ways:

  1. Via a set of credentials, as above. Brush will make an HTTP request to Pastebin to retrieve a new user key when one is first needed, and will cache it for the rest of execution.
  2. Directly by passing a session key string as the only argument to Account's constructor. This saves a request, and is the recommended way if you always want to work with the same account.

In the above example, instead of manually writing a draft, we asked Brush to automatically create one from a local file. Brush will set the draft title to the name of the file, the content as the file content, and attempt to recognise the format from the file's extension. The mappings it uses to do this are in Configuration/extensions.ini. This is designed to be edited by you, so feel free to add lines according to your requirements. If you add a large number of maps, please consider contributing them in a pull request so that others may benefit!

You can also create a draft paste inheriting an account's default settings using the fromOwner(Account, Developer) method. This will retrieve the defaults for the supplied account, apply them to a new draft, and set the account as the owner.

Retrieve an account's pastes

Retrieving pastes belonging to an account is easy:

Account's getPastes() method returns an array of Paste objects, representing pastes submitted by that account. It takes an optional second argument, the maximum number of pastes to retrieve, which defaults to 50.

Delete a paste

Pastes retrieved in the above way can be removed by calling delete() on them:

N.B. For reasons of authentication, only pastes retrieved from an account can be deleted. If you attempt to delete a paste obtained via other means (e.g. a trending paste), Brush will detect this and throw a ValidationException, as Pastebin would simply reject the request. Brush will always try to warn you of errors before bothering Pastebin.

Retrieve trending pastes

Contributing

Suggestions and pull requests are welcome. Please submit these through the normal GitHub channels.

If you discover a bug, please open a new issue.

Licence

Brush is released under the MIT Licence - see the LICENSE file for details. For more information about how this allows you to use the library, see the Wikipedia article.


All versions of brush with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-curl Version *
crackle/crackle Version *
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 gebn/brush contains the following files

Loading the files please wait ....