Guest User

Untitled

a guest
Mar 16th, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.35 KB | None | 0 0
  1.   public function copy($key){
  2.     // return;
  3.     $db = '';
  4.     $user = '';
  5.     $pass = '';
  6.     $whtree = '';
  7.     try {
  8.         $ToolkitServiceObj = ToolkitService::getInstance($db, $user, $pass, $extension);
  9.     }catch (Exception $e) {
  10.         echo  $e->getMessage(), "\n";
  11.         exit();
  12.     }
  13.  
  14.     $ToolkitServiceObj->setToolkitServiceParams(array('stateless'=>true));
  15.     $ToolkitServiceObj->setToolkitServiceParams(array('debug'=>true));
  16.     $cmd = "addlible " .DB_FILELIB;
  17.     $ToolkitServiceObj->CLCommand($cmd);
  18.     $cmd = "addlible WCPLIB";
  19.     $ToolkitServiceObj->CLCommand($cmd);
  20.     $cmd = "addlible WCPWEB";
  21.     $ToolkitServiceObj->CLCommand($cmd);
  22.     $cmd = "addlible APLUS10M";
  23.     $ToolkitServiceObj->CLCommand($cmd);
  24.     $cmd = "addlible APLUS10";
  25.     $ToolkitServiceObj->CLCommand($cmd);
  26.     $param[] = $ToolkitServiceObj->AddParameterChar('both', 21,'KEY', 'KEY', $key);
  27.  
  28.     $result = $ToolkitServiceObj->PgmCall("CPYSHPLST", "WCPLIB", $param, null, null);
  29.         $message = "";
  30.         if($result){
  31.             $message =  $result['io_param']['RETMESSAGE'];
  32.         }else{
  33.             $code = $ToolkitServiceObj->getErrorCode();
  34.             $msg = $ToolkitServiceObj->getErrorMsg();
  35.             // return "Execution failed.".$code.'-'.$msg;
  36.         }
  37.         /* Do not use the disconnect() function for "state full" connection */
  38.         $ToolkitServiceObj->disconnect();
  39.         return $message;
  40.   }
Add Comment
Please, Sign In to add comment