Skip to content

Instantly share code, notes, and snippets.

@phpdave
Last active September 15, 2015 20:40
Show Gist options
  • Save phpdave/4c30c7aeead88ac9bfcc to your computer and use it in GitHub Desktop.
Save phpdave/4c30c7aeead88ac9bfcc to your computer and use it in GitHub Desktop.
Notes: PHP and RPG comparison

###Invoke Program

PHP:

1.create myscript.php source file

2./usr/local/zendsvr/bin/php-cli myscript.php

RPG:

1.create member/QRPGLESRC source file

2.CRTPGM PGM(MYLIB/PROGRAMNAME) MODULE(MODULE1 MODULE2) ENTMOD(*FIRST) ACTGRP(ACTIVATIONGROUPNAME) - Compiles the program

3.CALL MYLIB/PROGRAMNAME

###Libraries of commonly used business rules or functions or 3rd party libaries PHP:

Autoloaders, include, require

Example:

include('/includes/PHPExcel.php');

$inputFileType = PHPExcel_IOFactory::identify($inputFileName);

RPG:

Modules

Example:

CRTRPGMOD MODULE(MYLIB/MODULENAME) SRCFILE(MYLIB/QRPGLESRC) - Compiles into a module - if you plan to reuse this code in multiple programs (PHP library)

CRTPGM PGM(MYLIB/PROGRAMNAME) MODULE(MODULE1 MODULE2) ENTMOD(*FIRST) ACTGRP(ACTIVATIONGROUPNAME) - Compiles the program

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment