<?php

 namespace Informunity; class Log { private $callID = null; private $Header = null; private $logfiles; private $version = ''; private $ID = ''; public function __construct($array = false) { goto jWrEl; kOliK: $this->callID = $array["\x61\163\x74\145\x72\151\x73\x6b\137\x63\141\154\x6c\x69\x64"]; goto Ed5_T; Ed5_T: $this->Header = $array["\150\x65\x61\x64\145\x72"]; goto DVYK3; XiPTT: goto EHFNj; goto G_9v7; J93N6: $modulef = \FreePBX::module_functions(); goto jG6RX; jG6RX: $ver = $modulef->getinfo("\151\x75\x62\62\64"); goto tHN38; UfyRh: $this->logfiles = $this->getFiles(); goto LHrYF; QJu3w: $this->callID = $array; goto XiPTT; tHN38: $this->version = $ver["\151\165\x62\62\64"]["\x76\x65\162\163\x69\x6f\156"]; goto tbybC; G_9v7: OlhSX: goto kOliK; DVYK3: EHFNj: goto J93N6; rNzqj: $this->ID = $date->getTimestamp() . "\x2d" . rand(1000, 2000); goto UfyRh; LHrYF: if (is_array($array)) { goto OlhSX; } goto QJu3w; jWrEl: $date = new \DateTime(); goto rNzqj; tbybC: } private function getFiles() { goto pUeUR; zlf0b: return $name; goto MiPns; pUeUR: $name = false; goto jF3CB; OTUx_: $status = $q->fetchAll(); goto ODjf7; XGzE6: $sql = "\x53\105\x4c\105\103\x54\40\156\x61\x6d\x65\xa\x20\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\40\40\x20\x46\x52\x4f\x4d\x20\154\157\147\146\151\154\145\137\x6c\x6f\x67\x66\151\x6c\x65\163\40\12\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\127\110\105\x52\105\x20\156\141\155\145\40\x21\75\x20\47\143\x6f\156\163\x6f\x6c\145\47\40\101\x4e\x44\x20\166\145\x72\x62\157\163\145\x20\41\x3d\40\x27\157\146\146\47\73\12\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\40"; goto aJU0s; jF3CB: $db = \FreePBX::Database(); goto XGzE6; ODjf7: if (empty($status)) { goto awKBE; } goto LRjSX; as1M4: $q->execute(); goto OTUx_; KyvkT: Q7NuI: goto xxZgq; LRjSX: foreach ($status as $names) { $name[] = $names[0]; RmFBc: } goto KyvkT; xxZgq: awKBE: goto zlf0b; aJU0s: $q = $db->prepare($sql); goto as1M4; MiPns: } public static function toOutput($var) { goto bOpl5; bOpl5: $date = date("\131\x2d\x6d\55\144\x20\110\72\x69\x3a\163"); goto dPeqm; dPeqm: echo "\133" . $date . "\135\x3c\x62\162\x3e\57"; goto C5Fyk; C5Fyk: var_export($var, true); goto CEfcX; CEfcX: } public function toFile1($data, $logType = "\116\117\x54\111\103\x45") { $date = date("\131\55\155\55\144\40\x48\72\x69\72\163"); $this->FileWrite("\x5b" . $date . "\135\40" . $this->callID . "\x5b" . $this->ID . "\x5d\40" . $logType . "\40" . json_encode($data) . "\xa"); } public function toFile($data) { goto TR1OH; VhGIL: $this->FileWrite("\133" . $date . "\x5d" . $this->callID . "\133" . $this->ID . "\x5d\133" . $this->Header . "\x5d\133" . $this->version . "\135\x5b\x2d\102\x65\x67\151\156\55\x5d\xa"); goto Iduqz; mpR5Z: $this->FileWrite("\133" . $date . "\x5d" . $this->callID . "\x5b" . $this->ID . "\135\133" . $this->Header . "\135\x5b\55\105\x6e\144\55\135\12"); goto wIOLV; Iduqz: $this->parseLogArray($data, $date); goto mpR5Z; TR1OH: $date = date("\131\x2d\155\55\x64\x20\x48\x3a\x69\x3a\x73"); goto VhGIL; wIOLV: } protected function parseLogArray($data = false, $date) { goto t8Za7; QZ8ZH: unset($data["\146\151\x6c\145\104\x61\164\x61"][1]); goto m9vNg; fNb4Q: goto zHD3e; goto Vs_wk; p7ZZs: zHD3e: goto VDz2_; VZYlN: I8Obt: goto p7ZZs; xFDBQ: $this->FileWrite("\133" . $date . "\135" . $this->callID . "\x5b" . $this->ID . "\x5d\x20" . $data . "\12"); goto fNb4Q; t8Za7: if (is_array($data)) { goto iJ9Df; } goto xFDBQ; o8czW: if (!(!empty($data["\146\x69\x6c\145\104\x61\164\x61"]) && !is_string($data["\146\x69\x6c\x65\x44\x61\164\141"]))) { goto mmUq3; } goto QZ8ZH; Vs_wk: iJ9Df: goto o8czW; m9vNg: mmUq3: goto HqWSB; HqWSB: foreach ($data as $str => $val) { goto Bnkk2; HPLbR: x0eGC: goto dgT4b; FAhpp: YdJM7: goto y_OeM; VFx5P: if (!($str != "\106\111\114\105\137\103\x4f\116\124\x45\116\x54\x3a")) { goto x0eGC; } goto IsyJb; v1nYv: gFi3I: goto EIwgU; dgT4b: goto YdJM7; goto v1nYv; Bnkk2: if (is_array($val)) { goto gFi3I; } goto VFx5P; IsyJb: $this->FileWrite("\133" . $date . "\x5d" . $this->callID . "\133" . $this->ID . "\135\x20" . $str . "\40\75\x3e\40" . $val . "\xa"); goto HPLbR; y_OeM: AXcKI: goto aBR1F; EIwgU: $this->parseLogArray($val, $date); goto FAhpp; aBR1F: } goto VZYlN; VDz2_: } protected function FileWrite($data) { goto MJ9B5; V0ZXm: i5jaG: goto fVcO9; AZ3NC: foreach ($this->logfiles as $file) { try { file_put_contents("\57\166\x61\x72\x2f\x6c\157\x67\x2f\x61\163\164\x65\x72\x69\x73\153\x2f" . $file, $data, FILE_APPEND); } catch (\Exception $e) { } iHIWX: } goto V0ZXm; Uylar: j0tE7: goto X2aiK; MJ9B5: if (empty($data)) { goto j0tE7; } goto mPdEo; mPdEo: if (!$this->logfiles) { goto rXKNt; } goto AZ3NC; fVcO9: rXKNt: goto Uylar; X2aiK: } }
