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.

eZ debug

Timing: Jan 18 2025 22:29:44
Script start
Timing: Jan 18 2025 22:29:44
Module start 'layout'
Timing: Jan 18 2025 22:29:44
Module start 'content'
Timing: Jan 18 2025 22:29:45
Module end 'content'
Timing: Jan 18 2025 22:29:45
Script end

Main resources:

Total runtime0.7604 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.9219152.6094
Module start 'layout' 0.00470.0028 741.531339.4141
Module start 'content' 0.00750.7517 780.9453553.5625
Module end 'content' 0.75910.0012 1,334.507812.1953
Script end 0.7603  1,346.7031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00280.3701160.0002
Check MTime0.00120.1560160.0001
Mysql Total
Database connection0.00050.062310.0005
Mysqli_queries0.710293.4019570.0125
Looping result0.00050.0593550.0000
Template Total0.730296.020.3651
Template load0.00180.238420.0009
Template processing0.728495.787420.3642
Template load and register function0.00010.013710.0001
states
state_id_array0.00150.199810.0015
state_identifier_array0.00130.168320.0006
Override
Cache load0.00150.1931260.0001
Sytem overhead
Fetch class attribute can translate value0.00040.048120.0002
Fetch class attribute name0.00100.125550.0002
XML
Image XML parsing0.00180.242120.0009
class_abstraction
Instantiating content class attribute0.00000.001860.0000
General
dbfile0.00190.2496220.0001
String conversion0.00000.002140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs