Skip to content

Commit

Permalink
Merge pull request #204 from zendtech/alanseiden-patch-12
Browse files Browse the repository at this point in the history
Update local-transport.php with additional comments
  • Loading branch information
alanseiden authored Sep 27, 2024
2 parents 7095309 + d7dff96 commit 8096679
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions samples/local-transport.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<?php
// The local transport calls a command on the system to talk to XMLSERVICE.
// This has the advantage of not needing any credentials or database overhead.
// On IBM i, install the "itoolkit-utils" package from Yum.
/* The "local" transport is talks to XMLSERVICE by calling a command on the IBM i.
Rather than connecting via a database connection, it will fork a QP0ZSPWP job (by default) under the current user profile.
Prerequisite: Install the "itoolkit-utils" package from Yum on your IBM i server.
Advantages: Simple to use; no database connection needed; no additional user/pw authentication.
Disadvantages: Runs under web server user (QTMHHTTP by default), which you may or may not want; forks a new job; only works locally on the same IBM i as XMLSERVICE.
Note: If you already have a database connection, it would be more efficient to pass that in than to use local.
*/
// Example (the parameters of getInstance are the parts to look at)
require_once('ToolkitApi/ToolkitService.php');
try {
$tkobj = ToolkitService::getInstance("", "", "", "local");
$res = $tkobj->CLInteractiveCommand("DSPLIBL");
$res = $tkobj->CLInteractiveCommand("DSPLIBL"); // just one type of command to run
var_dump($res);
} catch (Exception $e) {
echo $e->getMessage(), "\n";
Expand Down

0 comments on commit 8096679

Please sign in to comment.