Your IP : 216.73.216.180
<?php
use Bitrix\Main\Application;
use Bitrix\Main\Loader;
use Korus\Main\Demo\DataManager\IblockElement;
use Korus\Main\Demo\Generator\History;
use Korus\Main\Orm\Iblock\Manager;
define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS", true);
define("BX_CRONTAB", true);
define('BX_WITH_ON_AFTER_EPILOG', true);
define('BX_NO_ACCELERATOR_RESET', true);
define("CRON_RUN", true);
if (empty($_SERVER["DOCUMENT_ROOT"])) {
$_SERVER["DOCUMENT_ROOT"] = realpath(dirname(__DIR__));
}
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
@set_time_limit(0);
@ignore_user_abort(true);
Loader::includeModule('korus.main');
$csvFile = new \CCSVData();
$csvFile->SetFirstHeader(true);
$csvFile->SetDelimiter(',');
$csvFile->LoadFile(Application::getDocumentRoot() . '/demo/src/history.csv');
$upload = new \Bitrix\Main\IO\Directory(Application::getDocumentRoot() . '/demo/src/upload/history');
$iblockManager = Manager::getInstance()->getProviderByCode('COMPANY_HISTORY', 'ABOUT_COMPANY');
$dataManager = new IblockElement(new History($csvFile, $upload), $iblockManager);
$success = $dataManager->produce();
if (!$success) {
foreach ($dataManager->getErrors() as $error) {
ShowError($error->getMessage());
}
}