#!/usr/local/bin/php -q
<?php
/**
 * This Software is the property of OXID eSales and is protected
 * by copyright law - it is NOT Freeware.
 *
 * Any unauthorized use of this software without a valid license key
 * is a violation of the license agreement and will be prosecuted by
 * civil and criminal law.
 *
 * @link http://www.oxid-esales.com
 * @package ERP
 * @copyright (c) OXID eSales AG 2003-2009
 */

// Modify the "shebang" to whatever it need to be on your server
// or remove it and call the php file directly


// set this to the right path
$sShopPath = "/htdocs/testshops/EE/";


// security check, don't start over http
foreach ($_SERVER as $key => $sValue) {
    if (stristr( $key, "HTTP")) {
        die( "HTTP call not allowed!");
    }
}


if (!function_exists('getShopBasePath')) {
    /**
     * Returns path to main stript files.
     * @return string
     */
    function getShopBasePath()
    {
        global $sShopPath;
        return $sShopPath;
    }
}


// Generic utility method file
require_once getShopBasePath() . 'core/oxfunctions.php';

// Including main ADODB include
require_once getShopBasePath() . 'core/adodblite/adodb.inc.php';

// initializes singleton config class
$myConfig = oxConfig::getInstance();

// create ERP Object using shop's Factory
$oERP = oxNew( "oxerpinterface", "core");

$sMessage = $oERP->doImport("/htdocs/testshops/EE/import/importfile.csv", "admin", "admin", 1, 0);

echo($sMessage . PHP_EOL);
?>
