uawdijnntqw1x1x1
IP : 3.17.71.93
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
arhangelsk.axolotls.ru
/
a537b
/
imap.tar
/
/
bodystructure.php000066400000007401147744407720010217 0ustar00<?php namespace Bitrix\Mail\Imap; /** * https://tools.ietf.org/html/rfc3501#section-7.4.2 * * multipart: * - parts array * - subtype * + params array * + disposition array * + language * + location * * basic: * - type * - subtype * - params array * - content id * - description * - encoding * - size * + body MD5 * + disposition array * + language * + location * * text: * - type * - subtype * - params array * - content id * - description * - encoding * - size * - size in text lines * + body MD5 * + disposition array * + language * + location * * message/rfc822: * - type * - subtype * - params array * - content id * - description * - encoding * - size * - envelope structure * - body structure * - size in text lines * + body MD5 * + disposition array * + language * + location */ class BodyStructure { protected $number; protected $data = array(); protected $isMultipart = false, $partsCount = 0; public function __construct(array $bodystructure, $number = null) { $this->number = $number; $this->data = &$bodystructure; if (is_array($bodystructure[0])) { $this->isMultipart = true; $this->partsCount = count($bodystructure[0]); for ($i = 0; $i < $this->partsCount; $i++) { $bodystructure[0][$i] = new static( $bodystructure[0][$i], (string) (!is_null($number) ? sprintf('%s.%u', $number, $i + 1) : $i + 1) ); } } else { if (is_null($number)) { $this->number = 1; } $bodystructure[0] = strtolower($bodystructure[0]); $bodystructure[5] = strtolower($bodystructure[5]); } $bodystructure[1] = strtolower($bodystructure[1]); if (!empty($bodystructure[2]) && is_array($bodystructure[2])) { $params = array(); $count = count($bodystructure[2]); for ($i = 0; $i < $count; $i += 2) { $params[strtolower($bodystructure[2][$i])] = $bodystructure[2][$i + 1]; } $bodystructure[2] = $params; } $disposition = &$bodystructure[$this->getDispositionIndex()]; $disposition[0] = strtolower($disposition[0]); if (!empty($disposition[1]) && is_array($disposition[1])) { $params = array(); $count = count($disposition[1]); for ($i = 0; $i < $count; $i += 2) { $params[strtolower($disposition[1][$i])] = $disposition[1][$i + 1]; } $disposition[1] = $params; } } public function getNumber() { return $this->number; } public function getType() { return ($this->isMultipart ? 'multipart' : $this->data[0]); } public function getSubtype() { return $this->data[1]; } public function getParams() { return $this->data[2]; } public function getId() { return $this->isMultipart ? false : $this->data[3]; } public function getEncoding() { return ($this->isMultipart ? false : $this->data[5]); } protected function getDispositionIndex() { switch ($this->getType()) { case 'multipart': return 3; case 'message': return 'rfc822' === $this->getSubtype() ? 11 : 8; case 'text': return 9; default: return 8; } } public function getDisposition() { return $this->data[$this->getDispositionIndex()]; } public function isMultipart() { return $this->isMultipart; } public function isText() { return $this->getType() === 'text'; } public function isAttachment() { return $this->getDisposition()[0] === 'attachment'; } public function traverse(callable $callback, $flat = false) { $items = array(); if ($this->isMultipart) { for ($i = 0; $i < $this->partsCount; $i++) { $items[] = $this->data[0][$i]->traverse($callback, $flat); } } $result = array($callback($this, $items)); if ($flat) { $result = array_merge($result, ...$items); } else { $result[] = $items; } return $result; } }
/var/www/axolotl/data/www/arhangelsk.axolotls.ru/a537b/imap.tar