1. Club Seiden uses Gitter chat for day to day discussion. If you are a member of Github you just need to ask to join our Github organization: https://github.com/club-seiden and join us on the Gitter.IM chat page!
    Dismiss Notice

CW.PHP call to RPGLE communicate to browser still processing

Discussion in 'PHP Toolkit' started by James R. Martin, Mar 21, 2017.

  1. James R. Martin

    James R. Martin New Member

    iSeries V5R4 PHP call to RPGLE using Toolkit that replaced easycom. Is there a way for the RPGLE program to communicate
    with the browser to avoid timeout while processing? I use Zend Server Version 5.6.0 PHP version 5.3.8 OS Version AIX

    example of current call:
    Code (Text):

      /********** Step 1: set up parameter list description ************/
       /* Create an array that specifies the name of  */
       /* the input, the IO being performed, the variable */
       /* type, and the variable name.  */
       $description = array(
       array(
       "Name"=>"UDCODE",
       "IO"=>I5_IN,
       "Type"=>I5_TYPE_CHAR,
       "Length"=>"1"
       ) ,
       array(
       "Name"=>"NONOTP",
       "IO"=>I5_IN,
       "Type"=>I5_TYPE_CHAR,
       "Length"=>"7"
       ) ,
       array(
       "Name"=>"msg",
       "IO"=>I5_INOUT,
       "Type"=>I5_TYPE_CHAR,
       "Length"=>"100"
       ) ,
       array(
       "Name"=>"libname",
       "IO"=>I5_INOUT,
       "Type"=>I5_TYPE_CHAR,
       "Length"=>"10"
       )
       );  
       $name = $lib . "/" . "CRTRFTRS";
       /********** Step 2: prepare the program for calling **************/
       $pgm = i5_program_prepare($name, $description);
       
       // Check if any errors occurred.
       if (!$pgm)
       {  
         echo "<br>";
         print_r(i5_errormsg());
         
         die("i5_program_prepare");
       }
       
       /********** Step 3: assign the parameter values to send **********/
       /* Create an array with the input names and the  */
       /* corresponding values.  You need to supply the  */
       /* actual parm values.  */
       $in_parameters = array(
       "UDCODE"=>"$UDCODE",
       "NONOTP"=>"$NONOTP",
       "msg" => "$msg",
       "libname" => "$libname"
       );
       
       /********** Step 4: the parameters that will be returned *********/
       /* Create an array with the output parameters  */
       /* returned by the program.  */
       $out_parameters = array(  
       "UDCODE" => "UDCODE",
       "NONOTP" => "NONOTP",
       "msg" => "msg",
       "libname" => "libname"
       );
       //   echo("<&nbsp;/LIBNAME:&nbsp;<font color=red>");
       //   print_r($LIBNAME);
       //   echo("</font><BR>");
       //   exit;
       wrtseg(MainSeg);  
       /********** Step 5: Call the program. ***************************/
       $ret = i5_program_call($pgm, $in_parameters, $out_parameters);  
       // Check if any errors occurred.
       if (!$ret)
       {
         $prgmsg = "Call to CRTRFTRS was not successful";
         $color="red";
         wrtseg(MainSeg);
         wrtseg(ClsSeg);
         wrtseg(FootSeg);
         die("i5_program_call");
       }
     
     
  2. Kim Mitchell

    Kim Mitchell New Member

    James, you may need to increase the timeout in the php.ini or fastcgi.ini file.
     

Share This Page