importing data

Author Message

gregor de Lijzer

Sunday 17 July 2005 5:52:47 pm

trying to import external data i wrote a script like this

<?php
set_time_limit( 0 );

include_once( "lib/ezutils/classes/ezdebug.php" );

//eZDebug::setHandleType( EZ_HANDLE_FROM_PHP );

include_once( "lib/ezutils/classes/ezmodule.php" );
eZModule::setGlobalPathList( array( "kernel" ) );
include_once( 'lib/ezutils/classes/ezexecution.php' );

include_once( 'kernel/classes/ezcontentobjecttreenode.php' );

eZDebug::setHandleType( EZ_HANDLE_TO_PHP );
eZDebug::setLogFileEnabled( true );
eZINI::setIsCacheEnabled( false );

include_once( "kernel/classes/ezcontentclass.php" );

$parentNodeID=103;
$user_id=14;
$sectionID=1;
//$class_instance=eZContentClass::fetchByIdentifier("icd");
$class_instance=eZContentClass::fetch(29);
echo "<BR>break";
var_dump($class_instance)
...

as you see this i snot the complete script, cause class_instance is NULL. so the rest of the script will fail too. Any suggestions why i can't access my classes? i also tried it with fetchByIdentifier&acute;sameresult. Class with id 29 exists. I'm using ez 2.6 with php 4.3.10 on win XP with Apache 1.3

thanks
greg

Ekkehard Dörre

Monday 18 July 2005 1:49:32 am

Hi,

there are some examples scripts:
http://ez.no/community/contribs/import_export

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

gregor de Lijzer

Monday 18 July 2005 2:48:30 am

thanks for the hint. Unfortunately the link that looks most promising fails.
But i detected why my

 $class_instance=eZContentClass::fetch(29);

didn't work. Deep in the code a ezDB object is created. But this object is created with the db name "nextgen" defined in site.ini. No idea why it is defined there? Correcting to my dbname it worked. Is this a bug? Also defined in site.ini is the language. But this language doesn't correspond to the language i selected during my installation. setting to my default language ger-DE further things worked. But now i get an error like this:

PHP Notice:  Undefined index:  eZCurrentAccess in C:\Programme\Apache Group\Apac
he\htdocs\ez\lib\ezutils\classes\ezsession.php on line 210

the corresponding code line looks like this

$access = $GLOBALS['eZCurrentAccess'];

Where are that $GLOBALS defined?

greg

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.