Monday 22 June 2009 1:24:56 am
Hi, I made a script to import some data from a CSV file to eZPublish database. There is the PHP script, very basic without filling attribute content :
$class = eZContentClass::fetchByIdentifier( 'model' );
while ( ($data = fgets($f, $bufferSize)) !== false){
$res = explode(';',$data);
$object = $class->instantiate();
$object->setAttribute('remote_id', $refid);
$assignment = eZNodeAssignment::create( array( 'contentobject_id' => $object->attribute( 'id' ), 'contentobject_version' => 1, 'parent_node' => $parentId, sort_order' => 0, 'is_main' => 1 ) );
$assignment->store();
$object->store();
eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $object->attribute( 'id' ), 'version' => $object->attribute( 'current_version' ) ) );
}
And, nearby 300 objects inserted, I've got a problem of memory usage overflow. I'm using Wamp and in my php.ini file memory capacity is limited to 128 Mb. I need to import near 3000 products, and I don't think I can change on the production server the capacity to 1,25 Gb! eZPublish version: 4.0 Do you have any idea of how to solve this problem? Is there existing some script that made my script? Thanks for your help!
|