for those who has problem getting the token, this worked for me:
$request = new PSRequest();
$request->setCookiFileLocation(DIR.'/PScookie.txt');
$request->setPost(array("email" => $adminLoginEmail,"passwd" => $adminLoginPass, "submitLogin" => "Connexion")); // you must be a super admin
$request->call($adminUrl."index.php?controller=AdminLogin");
$request->call($adminUrl."index.php?controller=AdminImport");
pregmatch("/token=([a-z0-9]+)/", $request->webpage, $matches);
$token = $matches[1];
for those who has problem getting the token, this worked for me:
$request = new PSRequest();
$request->setCookiFileLocation(DIR.'/PScookie.txt');
$request->setPost(array("email" => $adminLoginEmail,"passwd" => $adminLoginPass, "submitLogin" => "Connexion")); // you must be a super admin
$request->call($adminUrl."index.php?controller=AdminLogin");
$request->call($adminUrl."index.php?controller=AdminImport");
pregmatch("/token=([a-z0-9]+)/", $request->webpage, $matches);
$token = $matches[1];