Forums / Developer / importing data

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

eZ debug

Timing: Jan 19 2025 03:38:04
Script start
Timing: Jan 19 2025 03:38:04
Module start 'content'
Timing: Jan 19 2025 03:38:05
Module end 'content'
Timing: Jan 19 2025 03:38:05
Script end

Main resources:

Total runtime0.9520 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0080 588.8281180.8516
Module start 'content' 0.00800.8251 769.6797558.6250
Module end 'content' 0.83310.1189 1,328.3047336.7656
Script end 0.9520  1,665.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4085210.0002
Check MTime0.00150.1579210.0001
Mysql Total
Database connection0.00120.120910.0012
Mysqli_queries0.885693.02291940.0046
Looping result0.00190.19731920.0000
Template Total0.921896.820.4609
Template load0.00230.239820.0011
Template processing0.919596.584520.4598
Template load and register function0.00010.012010.0001
states
state_id_array0.00130.135810.0013
state_identifier_array0.00140.143420.0007
Override
Cache load0.00190.2003260.0001
Sytem overhead
Fetch class attribute can translate value0.00100.103630.0003
Fetch class attribute name0.00090.091350.0002
XML
Image XML parsing0.00120.123430.0004
class_abstraction
Instantiating content class attribute0.00000.002860.0000
General
dbfile0.00280.2947330.0001
String conversion0.00000.000930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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