uawdijnntqw1x1x1
IP : 3.137.161.247
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
/
kirov.axolotls.ru
/
bitrix
/
modules
/
sender
/
lib
/
internals
/
dataexport.php
/
/
<?php /** * Bitrix Framework * @package bitrix * @subpackage sender * @copyright 2001-2012 Bitrix */ namespace Bitrix\Sender\Internals; use Bitrix\Main\DB\Result; /** * Class DataExport * @package Bitrix\Sender\Internals */ class DataExport { /** * Export to csv. * * @param array $columns Columns. * @param array|Result $list Data list. * @param callable|null $rowCallback Row callback. * @return void */ public static function toCsv(array $columns, $list, $rowCallback = null) { self::flushHeaders(); $eol = "\n"; $columnNames = []; $isFirstLinePrinted = false; if (defined('BX_UTF') && BX_UTF) { echo chr(239) . chr(187) . chr(191); } foreach ($list as $item) { if ($rowCallback) { $item = call_user_func_array($rowCallback, [$item]); } $row = []; foreach ($columns as $column) { if (!array_key_exists($column['id'], $item)) { continue; } if (!$isFirstLinePrinted) { $columnNames[] = str_replace('"', '""', $column['name']); } $row[] = str_replace('"', '""', trim($item[$column['id']])); } if (!$isFirstLinePrinted) { echo '"' . implode('";"', $columnNames) . '"'; $isFirstLinePrinted = true; } echo $eol; echo '"' . implode('";"', $row) . '"'; } exit; } protected static function flushHeaders() { /** @var $GLOBALS['APPLICATION'] \CAllMain */ $GLOBALS['APPLICATION']->RestartBuffer(); header('Content-Description: File Transfer'); header('Content-Type: text/csv; charset='.LANG_CHARSET); header('Content-Disposition: attachment; filename=address_list.csv'); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); } }
/var/www/axolotl/data/www/kirov.axolotls.ru/bitrix/modules/sender/lib/internals/dataexport.php