Merge pull request #1280 from PrivateBin/doc-n-test-mopup

Doc'n'test mopup
This commit is contained in:
El RIDO 2024-05-04 08:38:12 +02:00 committed by GitHub
commit 1d755d8046
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 26 additions and 17 deletions

View file

@ -37,9 +37,12 @@ defaultformatter = "plaintext"
; size limit per paste or comment in bytes, defaults to 10 Mebibytes ; size limit per paste or comment in bytes, defaults to 10 Mebibytes
sizelimit = 10485760 sizelimit = 10485760
; template to include, default is "bootstrap" (tpl/bootstrap.php) ; template to include, default is "bootstrap" (tpl/bootstrap.php), also
; Also available is a dark version ("bootstrap-dark",) and ; available are "page" (tpl/page.php), the classic ZeroBin style and several
; a theme that resembles the classic ZeroBin style ("page".) ; bootstrap variants: "bootstrap-dark", "bootstrap-compact", "bootstrap-page",
; which can be combined with "-dark" and "-compact" for "bootstrap-dark-page"
; and finally "bootstrap-compact-page" - previews at:
; https://privatebin.info/screenshots.html
template = "bootstrap" template = "bootstrap"
; (optional) info text to display ; (optional) info text to display
@ -242,7 +245,7 @@ dir = PATH "data"
; - AWS_ACCESS_KEY_ID ; - AWS_ACCESS_KEY_ID
; - AWS_SECRET_ACCESS_KEY ; - AWS_SECRET_ACCESS_KEY
; - AWS_SESSION_TOKEN (if needed) ; - AWS_SESSION_TOKEN (if needed)
; for more details, see https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html#default-credential-chain ; for more details, see https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html#default-credential-chain
;class = S3Storage ;class = S3Storage
;[model_options] ;[model_options]
;region = "eu-central-1" ;region = "eu-central-1"
@ -264,4 +267,4 @@ dir = PATH "data"
; (optional) the "signature" (access key) issued by YOURLS for the using account ; (optional) the "signature" (access key) issued by YOURLS for the using account
; signature = "" ; signature = ""
; (optional) the URL of the YOURLS API, called to shorten a PrivateBin URL ; (optional) the URL of the YOURLS API, called to shorten a PrivateBin URL
; apiurl = "https://yourls.example.com/yourls-api.php" ; apiurl = "https://yourls.example.com/yourls-api.php"

View file

@ -30,8 +30,8 @@
"yzalis/identicon": "2.0.0" "yzalis/identicon": "2.0.0"
}, },
"suggest" : { "suggest" : {
"google/cloud-storage" : "1.32.0", "google/cloud-storage" : "1.41.0",
"aws/aws-sdk-php" : "3.275.1" "aws/aws-sdk-php" : "3.302.0"
}, },
"require-dev" : { "require-dev" : {
"phpunit/phpunit" : "^9" "phpunit/phpunit" : "^9"

View file

@ -22,6 +22,7 @@ for more information.
### Minimal Requirements ### Minimal Requirements
- PHP version 7.3 or above - PHP version 7.3 or above
- ctype extension
- GD extension (when using identicon or vizhash icons, jdenticon works without it) - GD extension (when using identicon or vizhash icons, jdenticon works without it)
- zlib extension - zlib extension
- some disk space or a database supported by [PDO](https://php.net/manual/book.pdo.php) - some disk space or a database supported by [PDO](https://php.net/manual/book.pdo.php)

View file

@ -109,9 +109,9 @@ class Vizhash16x16
for ($i = 0; $i < 7; ++$i) { for ($i = 0; $i < 7; ++$i) {
$action = $this->getInt(); $action = $this->getInt();
$color = imagecolorallocate($image, $r, $g, $b); $color = imagecolorallocate($image, $r, $g, $b);
$r = $r0 = ($r0 + $this->getInt() / 25) % 256; $r = $r0 = ((int) $r0 + $this->getInt() / 25) % 256;
$g = $g0 = ($g0 + $this->getInt() / 25) % 256; $g = $g0 = ((int) $g0 + $this->getInt() / 25) % 256;
$b = $b0 = ($b0 + $this->getInt() / 25) % 256; $b = $b0 = ((int) $b0 + $this->getInt() / 25) % 256;
$this->drawshape($image, $action, $color); $this->drawshape($image, $action, $color);
} }
@ -136,7 +136,7 @@ class Vizhash16x16
{ {
$v = $this->VALUES[$this->VALUES_INDEX]; $v = $this->VALUES[$this->VALUES_INDEX];
++$this->VALUES_INDEX; ++$this->VALUES_INDEX;
$this->VALUES_INDEX %= count($this->VALUES); // Warp around the array $this->VALUES_INDEX %= count($this->VALUES); // Wrap around the array
return $v; return $v;
} }
@ -148,7 +148,7 @@ class Vizhash16x16
*/ */
private function getX() private function getX()
{ {
return $this->width * $this->getInt() / 256; return (int) $this->width * $this->getInt() / 256;
} }
/** /**
@ -159,7 +159,7 @@ class Vizhash16x16
*/ */
private function getY() private function getY()
{ {
return $this->height * $this->getInt() / 256; return (int) $this->height * $this->getInt() / 256;
} }
/** /**
@ -190,9 +190,9 @@ class Vizhash16x16
($color2[2] - $color1[2]) / $size, ($color2[2] - $color1[2]) / $size,
); );
for ($i = 0; $i < $size; ++$i) { for ($i = 0; $i < $size; ++$i) {
$r = $color1[0] + ($diffs[0] * $i); $r = $color1[0] + ((int) $diffs[0] * $i);
$g = $color1[1] + ($diffs[1] * $i); $g = $color1[1] + ((int) $diffs[1] * $i);
$b = $color1[2] + ($diffs[2] * $i); $b = $color1[2] + ((int) $diffs[2] * $i);
if ($direction == 'h') { if ($direction == 'h') {
imageline($img, $i, 0, $i, $sizeinv, imagecolorallocate($img, $r, $g, $b)); imageline($img, $i, 0, $i, $sizeinv, imagecolorallocate($img, $r, $g, $b));
} else { } else {
@ -222,7 +222,7 @@ class Vizhash16x16
break; break;
case 3: case 3:
$points = array($this->getX(), $this->getY(), $this->getX(), $this->getY(), $this->getX(), $this->getY(), $this->getX(), $this->getY()); $points = array($this->getX(), $this->getY(), $this->getX(), $this->getY(), $this->getX(), $this->getY(), $this->getX(), $this->getY());
imagefilledpolygon($image, $points, 4, $color); version_compare(PHP_VERSION, '8.1', '<') ? imagefilledpolygon($image, $points, 4, $color) : imagefilledpolygon($image, $points, $color);
break; break;
default: default:
$start = $this->getInt() * 360 / 256; $start = $this->getInt() * 360 / 256;

View file

@ -508,6 +508,11 @@ class ConnectionInterfaceStub implements ConnectionInterface
throw new BadMethodCallException('not supported by this stub'); throw new BadMethodCallException('not supported by this stub');
} }
public function restoreObject(array $args = array())
{
throw new BadMethodCallException('not supported by this stub');
}
public function copyObject(array $args = array()) public function copyObject(array $args = array())
{ {
throw new BadMethodCallException('not supported by this stub'); throw new BadMethodCallException('not supported by this stub');