コード例 #1
0
 function actImportFile()
 {
     global $ST, $post;
     $data = LibCatsrv::import($post->get('file'), $post->get('offer'));
     echo printJSON($data);
     exit;
     echo printJSON(array('msg' => 'Импорт потерпел неудачу'));
     exit;
 }
コード例 #2
0
ファイル: import1c.php プロジェクト: AlexanderWhi/tplshop2
<?php

ini_set('memory_limit', '64M');
ini_set('log_errors', 'On');
ini_set('error_log', dirname(__FILE__) . '/php_errors_imp.log');
include dirname(__FILE__) . "/../../config.php";
include dirname(__FILE__) . "/../../core/function.php";
file_put_contents(dirname(__FILE__) . '/last_start.txt', date('Y-m-d H:i;s') . "\n", FILE_APPEND);
?>
Импорт каталога
<?php 
set_time_limit(1000);
include dirname(__FILE__) . "/../../core/lib/SQL.class.php";
include_once dirname(__FILE__) . '/../../modules/catsrv/catsrv.properties.php';
include dirname(__FILE__) . "/../../modules/catsrv/LibCatsrv.class.php";
chdir(ROOT);
$ST = new SQL(DB_HOST, DB_LOGIN, DB_PASSWORD, DB_BASE);
$r = $ST->select("SELECT UPPER(name) AS name,value FROM sc_config WHERE name LIKE 'SHOP_%'");
while ($r->next()) {
    if ($r->get('value')) {
        $CONFIG[$r->get('name')] = $r->get('value');
    }
}
//echo LibCatsrv::import1c();
//LibCatsrv::makeYandexYML();
$res = LibCatsrv::import('import', 11);
echo print_r($res, true);
file_put_contents('import.log', "GET-" . print_r($res, true), FILE_APPEND);
//33fecdef-0baa-11e2-bc36-00241d3e9178/7858
コード例 #3
0
ファイル: import.php プロジェクト: AlexanderWhi/tplshop2
<?php

include_once "../config.php";
include_once "../core/function.php";
file_put_contents(dirname(__FILE__) . '/import.log', date('Y-m-d H:i:s') . "\r\n", FILE_APPEND);
$filename = date('Ymd_His') . ".xml";
file_put_contents($filename, file_get_contents("php://input"));
set_time_limit(1000);
include_once "../core/lib/SQL.class.php";
include_once '../modules/catsrv/catsrv.properties.php';
include_once "../modules/catsrv/LibCatsrv.class.php";
chdir(ROOT);
$ST = new SQL(DB_HOST, DB_LOGIN, DB_PASSWORD, DB_BASE);
$r = $ST->select("SELECT UPPER(name) AS name,value FROM sc_config");
while ($r->next()) {
    if ($r->get('value')) {
        $CONFIG[$r->get('name')] = $r->get('value');
    }
}
$res = LibCatsrv::import('import/' . $filename, 4);
file_put_contents(dirname(__FILE__) . '/import.log', print_r($res, true), FILE_APPEND);
echo print_r($res, true);