uawdijnntqw1x1x1
IP : 13.58.76.154
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
/
yar.axolotls.ru
/
bitrix
/
modules
/
main
/
lib
/
engine
/
response
/
ajaxjson.php
/
/
<?php namespace Bitrix\Main\Engine\Response; use Bitrix\Main\Error; use Bitrix\Main\ErrorCollection; use Bitrix\Main\Errorable; class AjaxJson extends Json implements Errorable { const STATUS_SUCCESS = 'success'; const STATUS_DENIED = 'denied'; const STATUS_ERROR = 'error'; /** * @var string */ private $status; /** * @var ErrorCollection */ private $errorCollection; public function __construct($data = null, $status = self::STATUS_SUCCESS, ErrorCollection $errorCollection = null) { $this->status = $status?: self::STATUS_SUCCESS; $this->errorCollection = $errorCollection?: new ErrorCollection; parent::__construct($data); } final public static function createSuccess($data = null) { return new static($data, self::STATUS_SUCCESS, null); } final public static function createError(ErrorCollection $errorCollection = null, $data = null) { return new static($data, self::STATUS_ERROR, $errorCollection); } final public static function createDenied(ErrorCollection $errorCollection = null, $data = null) { return new static($data, self::STATUS_DENIED, $errorCollection); } final public function setData($data) { /** * @see \Bitrix\Main\Type\Contract\Arrayable * @see \Bitrix\Main\Type\Contract\Jsonable * todo: we have to add in Json::encode work with Arrayable, Jsonable, to convert this data properly. */ return parent::setData( array( 'status' => $this->status, 'data' => $data, 'errors' => $this->getErrorsToResponse(), ) ); } final protected function getErrorsToResponse() { $errors = array(); foreach ($this->errorCollection as $error) { /** @var Error $error */ $errors[] = $error; } return $errors; } /** * Getting array of errors. * @return Error[] */ final public function getErrors() { return $this->errorCollection->toArray(); } /** * Getting once error with the necessary code. * @param string $code Code of error. * @return Error */ final public function getErrorByCode($code) { return $this->errorCollection->getErrorByCode($code); } }
/var/www/axolotl/data/www/yar.axolotls.ru/bitrix/modules/main/lib/engine/response/ajaxjson.php