| Monday 10 July 2006 2:03:40 am 
                                                                
                                                                 Hi, 
I am using CLI scripts to import or update objects in Exponential like explained in this post :http://ez.no/community/forum/developer/importing_update_entry_if_it_already_exists
 
What I want to do is read an object in one site (one siteaccess, one db) and update the object in anothersite (other siteaccess, other db). But I can't change the siteaccess within the script.
 I use a script object and when I want to change the siteaccess, it does not work :  
$script =& eZScript::instance(...);
$script->setUseSiteAccess('siteaccess1');
I also tried with the method in Exponential's index.php : 
include_once( "access.php" );
$access = array('name'=> 'siteaccess1',"type"=> EZ_ACCESS_TYPE_HTTP_HOST);
$access = changeAccess( $access );
eZDebugSetting::writeDebug( 'kernel-siteaccess', $access, 'current siteaccess' );
$GLOBALS['eZCurrentAccess'] =& $access;
and I tried also with 2 eZScript instances : 
$script2 =& eZScript::instance(...);
$script2->setUseSiteAccess('siteaccess2');
but always no successmy first question is : is it possible ?
 if it is, does somebody did it and can help me ? if not, does somebody knows a workaround ?
 Thanks for help |