Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.41
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
src /
php-7.4.33 /
sapi /
fpm /
tests /
Delete
Unzip
Name
Size
Permission
Date
Action
CONFLICTS
102
B
-rw-rw-r--
2022-10-31 11:36
bug68381-log-level-warning.phpt
687
B
-rw-rw-r--
2022-10-31 11:36
bug68391-conf-include-order.phpt
1.02
KB
-rw-rw-r--
2022-10-31 11:36
bug68420-ipv4-all-addresses.phpt
642
B
-rw-rw-r--
2022-10-31 11:36
bug68421-ipv6-access-log.phpt
843
B
-rw-rw-r--
2022-10-31 11:36
bug68423-multi-pool-all-pms.phpt
1.08
KB
-rw-rw-r--
2022-10-31 11:36
bug68428-ipv6-allowed-clients.phpt
802
B
-rw-rw-r--
2022-10-31 11:36
bug68442-signal-reload.phpt
915
B
-rw-rw-r--
2022-10-31 11:36
bug68458-pm-no-start-server.phpt
665
B
-rw-rw-r--
2022-10-31 11:36
bug69625-no-script-filename.phpt
761
B
-rw-rw-r--
2022-10-31 11:36
bug72573-http-proxy.phpt
1.05
KB
-rw-rw-r--
2022-10-31 11:36
bug73342-nonblocking-stdio.phpt
795
B
-rw-rw-r--
2022-10-31 11:36
bug74083-concurrent-reload.phpt
1.73
KB
-rw-rw-r--
2022-10-31 11:36
bug75212-php-value-in-user-ini.phpt
977
B
-rw-rw-r--
2022-10-31 11:36
bug76601-reload-child-signals.phpt
2.63
KB
-rw-rw-r--
2022-10-31 11:36
bug77934-reload-process-control.phpt
959
B
-rw-rw-r--
2022-10-31 11:36
bug78323.phpt
683
B
-rw-rw-r--
2022-10-31 11:36
bug78599-path-info-underflow.phpt
1.04
KB
-rw-rw-r--
2022-10-31 11:36
bug80024-socket-reduced-inherit.phpt
897
B
-rw-rw-r--
2022-10-31 11:36
bug80849-fpm.phpt
706
B
-rw-rw-r--
2022-10-31 11:36
fastcgi_finish_request_basic.phpt
734
B
-rw-rw-r--
2022-10-31 11:36
fcgi.inc
19.84
KB
-rw-rw-r--
2022-10-31 11:36
fpm_get_status_basic.phpt
1.84
KB
-rw-rw-r--
2022-10-31 11:36
getallheaders.phpt
1.02
KB
-rw-rw-r--
2022-10-31 11:36
log-bm-in-shutdown-fn.phpt
886
B
-rw-rw-r--
2022-10-31 11:36
log-bm-limit-1024-msg-80.phpt
860
B
-rw-rw-r--
2022-10-31 11:36
log-bm-limit-2048-msg-4000.phpt
876
B
-rw-rw-r--
2022-10-31 11:36
log-bwd-limit-1050-msg-2048.phpt
848
B
-rw-rw-r--
2022-10-31 11:36
log-bwd-limit-1050-msg-2900.phpt
818
B
-rw-rw-r--
2022-10-31 11:36
log-bwd-limit-64-too-low-error.phpt
736
B
-rw-rw-r--
2022-10-31 11:36
log-bwd-limit-8000-msg-4096.phpt
818
B
-rw-rw-r--
2022-10-31 11:36
log-bwd-msg-with-nl.phpt
869
B
-rw-rw-r--
2022-10-31 11:36
log-bwd-multiple-msgs-stdout-stderr.phpt
1018
B
-rw-rw-r--
2022-10-31 11:36
log-bwd-multiple-msgs.phpt
972
B
-rw-rw-r--
2022-10-31 11:36
log-bwp-limit-1024-msg-120.phpt
846
B
-rw-rw-r--
2022-10-31 11:36
log-bwp-limit-1500-msg-3300.phpt
849
B
-rw-rw-r--
2022-10-31 11:36
log-bwp-msg-flush-split-fallback.phpt
959
B
-rw-rw-r--
2022-10-31 11:36
log-bwp-msg-flush-split-real.phpt
855
B
-rw-rw-r--
2022-10-31 11:36
log-bwp-realloc-buffer.phpt
1.07
KB
-rw-rw-r--
2022-10-31 11:36
log-dwd-limit-1050-msg-2048.phpt
845
B
-rw-rw-r--
2022-10-31 11:36
log-dwd-limit-1050-msg-2900.phpt
815
B
-rw-rw-r--
2022-10-31 11:36
log-dwd-limit-8000-msg-4096.phpt
815
B
-rw-rw-r--
2022-10-31 11:36
log-dwp-limit-1000-msg-2000.phpt
846
B
-rw-rw-r--
2022-10-31 11:36
logtool.inc
14.82
KB
-rw-rw-r--
2022-10-31 11:36
main-global-prefix.phpt
1.05
KB
-rw-rw-r--
2022-10-31 11:36
main-version.phpt
330
B
-rw-rw-r--
2022-10-31 11:36
pool-apparmor-basic.phpt
1.23
KB
-rw-rw-r--
2022-10-31 11:36
pool-prefix.phpt
1
KB
-rw-rw-r--
2022-10-31 11:36
proc-idle-timeout.phpt
877
B
-rw-rw-r--
2022-10-31 11:36
proc-no-start-server.phpt
742
B
-rw-rw-r--
2022-10-31 11:36
proc-user-ignored.phpt
795
B
-rw-rw-r--
2022-10-31 11:36
reload-uses-sigkill-as-last-measure.phpt
1.33
KB
-rw-rw-r--
2022-10-31 11:36
response.inc
6.62
KB
-rw-rw-r--
2022-10-31 11:36
skipif.inc
377
B
-rw-rw-r--
2022-10-31 11:36
socket-invalid-allowed-clients.phpt
1022
B
-rw-rw-r--
2022-10-31 11:36
socket-ipv4-allowed-clients.phpt
808
B
-rw-rw-r--
2022-10-31 11:36
socket-ipv4-basic.phpt
577
B
-rw-rw-r--
2022-10-31 11:36
socket-ipv4-fallback.phpt
910
B
-rw-rw-r--
2022-10-31 11:36
socket-ipv6-any.phpt
749
B
-rw-rw-r--
2022-10-31 11:36
socket-ipv6-basic.phpt
617
B
-rw-rw-r--
2022-10-31 11:36
socket-uds-acl.phpt
1.64
KB
-rw-rw-r--
2022-10-31 11:36
socket-uds-basic.phpt
649
B
-rw-rw-r--
2022-10-31 11:36
socket-uds-numeric-ugid-nonroot.phpt
1.26
KB
-rw-rw-r--
2022-10-31 11:36
socket-uds-numeric-ugid.phpt
1.13
KB
-rw-rw-r--
2022-10-31 11:36
status-basic.phpt
970
B
-rw-rw-r--
2022-10-31 11:36
status.inc
5.34
KB
-rw-rw-r--
2022-10-31 11:36
tester.inc
37.09
KB
-rw-rw-r--
2022-10-31 11:36
Save
Rename
<?php namespace FPM; class Response { const HEADER_SEPARATOR = "\r\n\r\n"; /** * @var array */ private $data; /** * @var string */ private $rawData; /** * @var string */ private $rawHeaders; /** * @var string */ private $rawBody; /** * @var array */ private $headers; /** * @var bool */ private $valid; /** * @var bool */ private $expectInvalid; /** * @param string|array|null $data * @param bool $expectInvalid */ public function __construct($data = null, $expectInvalid = false) { if (!is_array($data)) { $data = [ 'response' => $data, 'err_response' => null, 'out_response' => $data, ]; } $this->data = $data; $this->expectInvalid = $expectInvalid; } /** * @param mixed $body * @param string $contentType * @return Response */ public function expectBody($body, $contentType = 'text/html') { if ($multiLine = is_array($body)) { $body = implode("\n", $body); } if ( $this->checkIfValid() && $this->checkDefaultHeaders($contentType) && $body !== $this->rawBody ) { if ($multiLine) { $this->error( "==> The expected body:\n$body\n" . "==> does not match the actual body:\n$this->rawBody" ); } else { $this->error( "The expected body '$body' does not match actual body '$this->rawBody'" ); } } return $this; } /** * @return Response */ public function expectEmptyBody() { return $this->expectBody(''); } /** * @param string $name * @param string $value * @return Response */ public function expectHeader($name, $value) { $this->checkHeader($name, $value); return $this; } /** * @param string $errorMessage * @return Response */ public function expectError($errorMessage) { $errorData = $this->getErrorData(); if ($errorData !== $errorMessage) { $this->error( "The expected error message '$errorMessage' is not equal to returned error '$errorData'" ); } return $this; } /** * @param string $contentType * @return string|null */ public function getBody($contentType = 'text/html') { if ($this->checkIfValid() && $this->checkDefaultHeaders($contentType)) { return $this->rawBody; } return null; } /** * Print raw body */ public function dumpBody() { var_dump($this->getBody()); } /** * Print raw body */ public function printBody() { echo $this->getBody() . "\n"; } /** * Debug response output */ public function debugOutput() { echo "-------------- RESPONSE: --------------\n"; echo "OUT:\n"; echo $this->data['out_response']; echo "ERR:\n"; echo $this->data['err_response']; echo "---------------------------------------\n\n"; } /** * @return string|null */ public function getErrorData() { return $this->data['err_response']; } /** * Check if the response is valid and if not emit error message * * @return bool */ private function checkIfValid() { if ($this->isValid()) { return true; } if (!$this->expectInvalid) { $this->error("The response is invalid: $this->rawData"); } return false; } /** * @param string $contentType * @return bool */ private function checkDefaultHeaders($contentType) { // check default headers return ( $this->checkHeader('X-Powered-By', '|^PHP/7|', true) && $this->checkHeader('Content-type', '|^' . $contentType . '(;\s?charset=\w+)?|', true) ); } /** * @param string $name * @param string $value * @param bool $useRegex * @return bool */ private function checkHeader(string $name, string $value, $useRegex = false) { $lcName = strtolower($name); $headers = $this->getHeaders(); if (!isset($headers[$lcName])) { return $this->error("The header $name is not present"); } $header = $headers[$lcName]; if (!$useRegex) { if ($header === $value) { return true; } return $this->error("The header $name value '$header' is not the same as '$value'"); } if (!preg_match($value, $header)) { return $this->error("The header $name value '$header' does not match RegExp '$value'"); } return true; } /** * @return array|null */ private function getHeaders() { if (!$this->isValid()) { return null; } if (is_array($this->headers)) { return $this->headers; } $headerRows = explode("\r\n", $this->rawHeaders); $headers = []; foreach ($headerRows as $headerRow) { $colonPosition = strpos($headerRow, ':'); if ($colonPosition === false) { $this->error("Invalid header row (no colon): $headerRow"); } $headers[strtolower(substr($headerRow, 0, $colonPosition))] = trim( substr($headerRow, $colonPosition + 1) ); } return ($this->headers = $headers); } /** * @return bool */ private function isValid() { if ($this->valid === null) { $this->processData(); } return $this->valid; } /** * Process data and set validity and raw data */ private function processData() { $this->rawData = $this->data['out_response']; $this->valid = ( !is_null($this->rawData) && strpos($this->rawData, self::HEADER_SEPARATOR) ); if ($this->valid) { list ($this->rawHeaders, $this->rawBody) = array_map( 'trim', explode(self::HEADER_SEPARATOR, $this->rawData) ); } } /** * Emit error message * * @param string $message * @return bool */ private function error($message) { echo "ERROR: $message\n"; return false; } }