-
Notifications
You must be signed in to change notification settings - Fork 3
Home
cyvax edited this page Jul 18, 2021
·
4 revisions
-
example — example to how to use Privatebin_PHP
-
set_password() — set paste password
-
set_url() — set privatebin instance url
-
set_formatter() — set paste formatter
-
set_attachment() — set the attachment, use file_location as url or path, use filename to force a filename
-
set_text() — set the text of the paste!
-
set_compression() — set compression method
-
set_discussion() — set discussion
-
set_burn() — set burn
-
set_debug() — set debug
-
set_expire() — set expire time
-
encode() — Encode string to a paste, return ready to post data with b58 key.
-
post() — post data generated by encode().
-
encode_and_post() — encode and post data.
- $options() — possible options...
- first method
use Cyvax\PrivatebinPHP;
$private =new PrivatebinPHP();
$private->set_url("https://privatebin.net/");
$private->set_expire("5min");
$private->set_password("Privatebin_PHP");
$private->set_formatter("plaintext");
$private->set_burn(true);
$private->set_text("Because ignorance is bliss!");
$encoded = $private->encode();
$posted = $private->post($encoded);
$posted = $private->encode_and_post();
- second method
use Cyvax\PrivatebinPHP;
$private =new PrivatebinPHP(array(
"url" => "https://privatebin.net/",
"text" => "Because ignorance is bliss!",
));
$posted = $private->encode_and_post();
- @param string $password
- @param string $url
- @param string $formatter
- @param bool $bypass
- @throws PrivatebinException
- @param string $file_location
- @param string $filename
- @param string $text
- @param string $compression : zlib or none
- @throws PrivatebinException
- @param bool $discussion
- @param bool $burn
- @param bool $debug
use bypass for value not in ["5min", "10min", "1hour", "1day", "1week", "1month", "1year", "never"]. (default : false)
- @param string $expire
- @param bool $bypass
- @throws PrivatebinException
- @return array|Exception[]
- @throws PrivatebinException
- @param array $data
- @return array
- @throws PrivatebinException
- @return array
- @throws PrivatebinException
{
"url": "https://paste.i2pd.xyz/",
"compression": "zlib",
"formatter": "plaintext",
"attachment": null,
"attachment_name": null,
"password": null,
"expire": "1day",
"discussion": false,
"burn": false,
"text": "",
"debug": false,
}