Download the PHP package phly/phly-paste without Composer

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

PhlyPaste - ZF2 Pastebin Module

This is a module implementing a ZF2 pastebin.

Features

Installation

Install via composer:

To allow Markdown as a type of markup, you'll also need to install EdpMarkdown. This can be done with the following:

Next, add EdpMarkdown to your modules array in config/application.config.php.

Mongo Usage

To use Mongo as a backend, you will need to do several things.

First, add "phly/phly-mongo" as a composer.json requirement:

After running php composer.phar update, you'll also need to configure your application to use Mongo. One easy way to do this is in your site's primary module (usually "Application"):

Alternately, you can simply configure a service returning a MongoCollection, and pass that to the MongoPasteService constructor.

Make sure to create indices on each of the "hash" and "timestamp" fields:

You can do the above in your factory, if desired.

Zend\Db\TableGateway Usage

Currently, only SQLite is supported. To set up your database, do the following from your application root:

Make sure the data/paste.db file is writeable by your webserver.

Then create the following configuration in your config/autoload/global.php file (or some other autoloadable configuration file in that directory):

Once this is in place, you should be able to create and lists pastes.

CAPTCHA setup

By default, the "Dumb" CAPTCHA adapter is used. You can setup an alternate one by providing either global or local configuration under the "phly_paste" key's "captcha" subkey. Configuration is consistent with Zend\Captcha\Factory:

You can disable CAPTCHA for authenticated users. To do this, you need to define an alias named PhlyPaste\AuthService that points to a service returning a Zend\Authentication\AuthenticationService instance. Once enabled, CAPTCHAs will no longer be displayed for currently authenticated users.

API

An API is also enabled for this module. By default, it goes to the route described by the path '/paste/api/paste'. The API is JSON only, and expects that the Accept header matches against the media type 'application/hal+json' (it also allows 'application/json', but 'application/hal+json' will always be returned).

The following operations are available:

GET /paste/api/paste[?page=X]

Retrieves a single page of a list of pastes. The payload looks like the following:

HTTP/1.0 200 Ok
Content-Type: application/json

{
    "_links": {
        "canonical": {"rel": "canonical", "href": "http://pages.local/paste"},
        "self": {"rel": "self", "href": "http://pages.local/paste/api/paste"},
        "first": {"rel": "first", "href": "http://pages.local/paste/api/paste"},
        "last": {"rel": "last", "href": "http://pages.local/paste/api/paste?page=X"},
        "next": {"rel": "next", "href": "http://pages.local/paste/api/paste?page=2"}
    },
    "items": [
        [
            {"rel": "canonical", "href": "http://pages.local/paste/XYZ"},
            {"rel": "item", "href": "http://pages.local/paste/api/paste/XYZ"}
        ],
        /* ... */
    ]
}

GET /paste/api/paste/XYZ12ABC

Fetches information on a single paste. The payload looks like the following:

HTTP/1.0 200 Ok
Content-Type: application/json

{
    "_links": {
        "canonical": {"rel": "canonical", "href": "http://pages.local/paste/XYZ12ABC"},
        "self": {"rel": "self", "href": "http://pages.local/paste/api/paste/XYZ12ABC"},
        "up": {"rel": "up", "href": "http://pages.local/paste/api/paste"}
    },
    "title": "...",
    "language": "...",
    "timestamp": "...",
}

POST /paste/api/paste

Expects a JSON body, like the following:

Accept: application/json
Content-Type: application/json
X-PhlyPaste-Token: yourtoken

{
    "language": "txt",
    "private": "false",
    "content": "This is the paste content..."
}

You will get the following response payload:

HTTP/1.0 201 Created
Location: http://paste.local/paste/XYZ12ABC
Content-Type: application/json

{
    "_links": {
        "canonical": {"rel": "canonical", "href": "http://pages.local/paste/XYZ12ABC"},
        "self": {"rel": "self", "href": "http://pages.local/paste/api/paste/XYZ12ABC"}
    }
}

Authorization Tokens for Submitting Pastes

As you may have noticed in the previous example, the POST operation requires an "X-PhlyPaste-Token" header. Tokens are verified against the PhlyPaste\TokenService service, which is simply a PhlyPaste\Model\TokenServiceInterface implementation. By default, a single implementation is provided, PhlyPaste\Model\ArrayTokenService. This implementation expects that the configuration includes tokens:

If you use this approach, make sure that tokens are defined in .local.php files that are stored outside your repository.

Alternately, you may create your own implementation of the TokenServiceInterface that can be used to verify tokens.


All versions of phly-paste with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
zendframework/zend-authentication Version 2.*
zendframework/zend-captcha Version 2.*
zendframework/zend-form Version 2.*
zendframework/zend-mvc Version 2.*
zendframework/zend-view Version 2.*
zendframework/zend-stdlib Version 2.*
doctrine/common Version >=2.1
easybook/geshi Version dev-master
nick4fake/htmlpurifier Version dev-master
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 phly/phly-paste contains the following files

Loading the files please wait ....