You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 17, 2025. It is now read-only.
Normal pastebin features: syntax highlighting by language, short URLs, abilityto mark pastes as "private" (meaning they do not show up in listings).
Ability to specify "markdown" as the language; this will pass the pastethrough the markdown parser to generate markup.
Ability to specify "sections" of code, and thus paste multiple "files" in thesame paste. Any line starting with "##" signifies a section. The section willcontain any text following "##" as the title:
test.txt
This is the first section.
test2.txt
This is the second section.
Additionally, if you place a language name in brackets, that language will beused for syntax highlighting for that section:
test.js [javascript]
{"text": "highlighted as javascript"}
test.php [php]
echo "This is highlighted as PHP";
Developers familiar with pastie.org will find the above syntax familiar.
An API for listing pastes, retrieving individual paste details, and submittingpastes. The paste retrieval portion of the API does not require authorization,but submitting a paste requires an authorization token. (See the sectiontitled "API" below for details.
After runningphp composer.phar update, you'll also need to configure yourapplication to use Mongo. One easy way to do this is in your site's primarymodule (usually "Application"):
Alternately, you can simply configure a service returning aMongoCollection,and pass that to theMongoPasteService constructor.
Make sure to create indices on each of the "hash" and "timestamp" fields:
// Create a unique index on the "hash" field$collection->ensureIndex(array('hash' =>1),array('unique' =>true));// Create an index on "timestamp" descending$collection->ensureIndex(array('timestamp' => -1));
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 followingfrom your application root:
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 oneby providing either global or local configuration under the "phly_paste" key's"captcha" subkey. Configuration is consistent withZend\Captcha\Factory:
You can disable CAPTCHA for authenticated users. To do this, you need to definean alias namedPhlyPaste\AuthService that points to a service returning aZend\Authentication\AuthenticationService instance. Once enabled, CAPTCHAswill no longer be displayed for currently authenticated users.
API
An API is also enabled for this module. By default, it goes to the routedescribed by the path '/paste/api/paste'. The API is JSON only, and expects thatthe Accept header matches against the media type 'application/hal+json' (it alsoallows '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 thefollowing:
As you may have noticed in the previous example, the POST operation requires an"X-PhlyPaste-Token" header. Tokens are verified against thePhlyPaste\TokenService service, which is simply aPhlyPaste\Model\TokenServiceInterface implementation. By default, a singleimplementation is provided,PhlyPaste\Model\ArrayTokenService. Thisimplementation expects that the configuration includes tokens: