SlideShare a Scribd company logo
@asgrim
Bringing Modern PHP
Development to IBM i
James Titcumb
ZendCon 2016
Who is this guy?
James Titcumb
www.jamestitcumb.com
www.roave.com
www.phphants.co.uk
www.phpsouthcoast.co.uk
@asgrim
@asgrim
ZendCon 2015.
@asgrim
Hey James!
@asgrim
Sure...
@asgrim
...
@asgrim
IBM i
@asgrim
Let’s get comfortable.
@asgrim
RPG
@asgrim
RPG !== Rocket Propelled Grenade
@asgrim
The preconception...
@asgrim
@asgrim
Image: http://www.gregdonner.org/workbench/wb_10.html
@asgrim
But.
@asgrim
tn5250
@asgrim
CALL QP2TERM
@asgrim
@asgrim
SSH
@asgrim
BASH
@asgrim
~/.profile
SHELL=/bin/bash exec /bin/bash
# or /QOpenSys/QIBM/ProdData/OPS/tools/bin/bash
@asgrim
~/.bashrc
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
PS1='${debian_chroot:+($debian_chroot)}[033[01;32m]u' 
'@h[033[00m]:[033[01;34m]w[033[00m]$ '
export PATH=$PATH:/usr/local/zendsvr6/bin
@asgrim
vi
$ vi <filename>
xterm-256color: Unknown terminal type
[Hit return to continue]
@asgrim
vi
$ export TERM=xterm
$ vi <filename>
@asgrim
Permissions
@asgrim
git
@asgrim
GitHub
@asgrim
http://yips.idevcloud.com/wiki/index.php/PASE/Git
@asgrim
PHP !!!
@asgrim
@asgrim
Composer
@asgrim
Composer installation
$ php -r "copy('https://getcomposer.org/installer',
'composer-setup.php');"
$ php -r "if (hash_file('SHA384', 'composer-setup.php') ===
'...') { echo 'Installer verified'; } else { echo
'Installer corrupt'; unlink('composer-setup.php'); } echo
PHP_EOL;"
$ php composer-setup.php
$ php -r "unlink('composer-setup.php');"
@asgrim
Composer installation
$ mv composer.phar /usr/local/zendsvr6/bin/composer
$ composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ / __ `__ / __ / __ / ___/ _ / ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
____/____/_/ /_/ /_/ .___/____/____/___/_/
/_/
Composer version 1.2.1 2016-09-12 11:27:19
$
@asgrim
GitHub Flow
@asgrim
master
@asgrim
my-feature
master
@asgrim
my-feature
master
@asgrim
my-feature
master
@asgrim
Rebasing
@asgrim
my-feature
A
master
B
@asgrim
my-feature
A
master
B
A
@asgrim
my-feature
A
master
B
A
B
@asgrim
my-feature
master
A
B
@asgrim
master
A
B
!
my-feature
A
B
@asgrim
my-feature
master
A
B
A
B
!
@asgrim
Development Practices
@asgrim
Code Defensively
@asgrim
SOLID
@asgrim
Composition over Inheritance
@asgrim
Composition over Inheritance
final class Thing implements ThingInterface
{
public function foo()
{
// (does something)
}
}
final class CachingThing implements ThingInterface
{
public function __construct(ThingInterface $real, CacheInterface $cache)
{
$this->real = $real;
$this->cache = $cache;
}
public function foo()
{
if (!$this->cache->has('foo')) {
$this->cache->put('foo', $this->real->foo());
}
return $this->cache->get('foo');
}
}
@asgrim
Testing
@asgrim
Naming things
@asgrim
Separation of concerns
@asgrim
Use PHP 7 (when it’s out)
@asgrim
Automate all the things!
@asgrim
phpunit
@asgrim
xdebug
@asgrim
phpcs
@asgrim
phpmd
@asgrim
Your favourite IDE
@asgrim
phpcpd
@asgrim
php -l <filename>
@asgrim
Behat
@asgrim
Continuous Integration
@asgrim
Jenkins
@asgrim
jenkins-php.org
@asgrim
Bamboo
@asgrim
TeamCity + Upsource
@asgrim
Run it on IBM i
@asgrim
Integrate with GitHub
@asgrim
@asgrim
Code Review
@asgrim
Code Reviews
@asgrim
Good design
@asgrim
Semantics & Readability
@asgrim
Does it actually work?
@asgrim
Security
@asgrim
Performance
@asgrim
@asgrim
Behat on IBM i
@asgrim
Local Development
@asgrim
Vagrant
@asgrim
What about Docker?
@asgrim
Database
@asgrim
DB2 for LUW vs DB2 for i
@asgrim
https://github.com/alanseiden/doctrine-dbal-ibmi
@asgrim
Doctrine ORM
@asgrim
Migrations
@asgrim
Deployment
@asgrim
Deployment Automation
@asgrim
Rollback
@asgrim
Summary
● Set up a familiar working environment
● Git + GitHub
● Use Zend Server for PHP
● Composer for dependencies
● GitHub Flow + rebasing branching strategy
● Use good development practices
● Automate testing, coverage, coding standards, etc.
● Set up Continuous Integration builds
● Code Review every change (PR)
● Local development makes things easier
● Use a good DBAL
● One-click-deployments are mandatory
Any questions?
http://joind.in/
James Titcumb @asgrim

More Related Content

PDF
Demystifying Object-Oriented Programming - ZendCon 2016
PDF
Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)
PDF
Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)
PDF
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
PDF
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
PDF
Zend expressive workshop
ODP
Modern Perl
PPTX
PSGI and Plack from first principles
Demystifying Object-Oriented Programming - ZendCon 2016
Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)
Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Zend expressive workshop
Modern Perl
PSGI and Plack from first principles

What's hot (20)

KEY
KEY
Plack - LPW 2009
KEY
Intro to PSGI and Plack
PPTX
Php 7 hhvm and co
KEY
Plack at YAPC::NA 2010
PDF
Information security programming in ruby
KEY
Perl: Hate it for the Right Reasons
PPT
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
PDF
TDD with PhpSpec
PDF
はじめてのSymfony2
KEY
PSGI/Plack OSDC.TW
ODP
Modern Web Development with Perl
KEY
Introducing Command Line Applications with Ruby
PDF
A reviravolta do desenvolvimento web
KEY
Plack perl superglue for web frameworks and servers
PPT
Create a web-app with Cgi Appplication
PPTX
Zephir - A Wind of Change for writing PHP extensions
ODP
Advanced Perl Techniques
PDF
"Swoole: double troubles in c", Alexandr Vronskiy
PPT
Introduction To Moco
Plack - LPW 2009
Intro to PSGI and Plack
Php 7 hhvm and co
Plack at YAPC::NA 2010
Information security programming in ruby
Perl: Hate it for the Right Reasons
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
TDD with PhpSpec
はじめてのSymfony2
PSGI/Plack OSDC.TW
Modern Web Development with Perl
Introducing Command Line Applications with Ruby
A reviravolta do desenvolvimento web
Plack perl superglue for web frameworks and servers
Create a web-app with Cgi Appplication
Zephir - A Wind of Change for writing PHP extensions
Advanced Perl Techniques
"Swoole: double troubles in c", Alexandr Vronskiy
Introduction To Moco
Ad

Similar to Bringing modern PHP development to IBM i (ZendCon 2016) (20)

PDF
Best practices for crafting high quality PHP apps (php[world] 2019)
PDF
Best practices for crafting high quality PHP apps (Bulgaria 2019)
PDF
Crafting Quality PHP Applications (PHP Joburg Oct 2019)
PDF
Best practices for crafting high quality PHP apps (PHP South Africa 2018)
PDF
Best practices for crafting high quality PHP apps (ScotlandPHP 2018)
PDF
Diving into HHVM Extensions (php[tek] 2016)
PDF
Great Developers Steal
PDF
Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)
PDF
Crafting Quality PHP Applications (PHP Benelux 2018)
PDF
Best practices for crafting high quality PHP apps - PHP UK 2019
PDF
Crafting Quality PHP Applications (Bucharest Tech Week 2017)
PDF
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHP Oxford June Meetup 2...
PDF
Crafting Quality PHP Applications (ConFoo YVR 2017)
PDF
Crafting Quality PHP Applications: an overview (PHPSW March 2018)
PDF
Dip Your Toes in the Sea of Security (ConFoo YVR 2017)
PDF
Crafting Quality PHP Applications (PHPkonf 2018)
PDF
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
PPT
Demystifying Maven
PDF
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
PDF
Symfony2 - OSIDays 2010
Best practices for crafting high quality PHP apps (php[world] 2019)
Best practices for crafting high quality PHP apps (Bulgaria 2019)
Crafting Quality PHP Applications (PHP Joburg Oct 2019)
Best practices for crafting high quality PHP apps (PHP South Africa 2018)
Best practices for crafting high quality PHP apps (ScotlandPHP 2018)
Diving into HHVM Extensions (php[tek] 2016)
Great Developers Steal
Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)
Crafting Quality PHP Applications (PHP Benelux 2018)
Best practices for crafting high quality PHP apps - PHP UK 2019
Crafting Quality PHP Applications (Bucharest Tech Week 2017)
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHP Oxford June Meetup 2...
Crafting Quality PHP Applications (ConFoo YVR 2017)
Crafting Quality PHP Applications: an overview (PHPSW March 2018)
Dip Your Toes in the Sea of Security (ConFoo YVR 2017)
Crafting Quality PHP Applications (PHPkonf 2018)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Demystifying Maven
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Symfony2 - OSIDays 2010
Ad

More from James Titcumb (17)

PDF
Living the Best Life on a Legacy Project (phpday 2022).pdf
PDF
Tips for Tackling a Legacy Codebase (ScotlandPHP 2021)
PDF
Climbing the Abstract Syntax Tree (Midwest PHP 2020)
PDF
Climbing the Abstract Syntax Tree (php[world] 2019)
PDF
Climbing the Abstract Syntax Tree (PHP Russia 2019)
PDF
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)
PDF
Kicking off with Zend Expressive and Doctrine ORM (PHP South Africa 2018)
PDF
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
PDF
Climbing the Abstract Syntax Tree (Southeast PHP 2018)
PDF
Kicking off with Zend Expressive and Doctrine ORM (PHP MiNDS March 2018)
PDF
Climbing the Abstract Syntax Tree (PHP UK 2018)
PDF
Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)
PDF
Climbing the Abstract Syntax Tree (Forum PHP 2017)
PDF
Dip Your Toes in the Sea of Security (IPC Fall 2017)
PDF
Climbing the Abstract Syntax Tree (IPC Fall 2017)
PDF
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
PDF
Get Started with RabbitMQ (CoderCruise 2017)
Living the Best Life on a Legacy Project (phpday 2022).pdf
Tips for Tackling a Legacy Codebase (ScotlandPHP 2021)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)
Climbing the Abstract Syntax Tree (php[world] 2019)
Climbing the Abstract Syntax Tree (PHP Russia 2019)
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)
Kicking off with Zend Expressive and Doctrine ORM (PHP South Africa 2018)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
Climbing the Abstract Syntax Tree (Southeast PHP 2018)
Kicking off with Zend Expressive and Doctrine ORM (PHP MiNDS March 2018)
Climbing the Abstract Syntax Tree (PHP UK 2018)
Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)
Climbing the Abstract Syntax Tree (Forum PHP 2017)
Dip Your Toes in the Sea of Security (IPC Fall 2017)
Climbing the Abstract Syntax Tree (IPC Fall 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Get Started with RabbitMQ (CoderCruise 2017)

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
A Presentation on Artificial Intelligence
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
KodekX | Application Modernization Development
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Unlocking AI with Model Context Protocol (MCP)
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Empathic Computing: Creating Shared Understanding
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Electronic commerce courselecture one. Pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
NewMind AI Monthly Chronicles - July 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
MYSQL Presentation for SQL database connectivity
A Presentation on Artificial Intelligence
Per capita expenditure prediction using model stacking based on satellite ima...
The AUB Centre for AI in Media Proposal.docx
Machine learning based COVID-19 study performance prediction
Diabetes mellitus diagnosis method based random forest with bat algorithm
KodekX | Application Modernization Development
Digital-Transformation-Roadmap-for-Companies.pptx

Bringing modern PHP development to IBM i (ZendCon 2016)