100% found this document useful (11 votes)
623 views

PHP in The Enterprise

The document discusses PHP, a scripting language used for web development. It provides a brief history, noting that PHP started in 1995 and underwent a rewrite in 1997 to become more powerful. It also outlines some key benefits of PHP, such as being easy to learn and code, free to use, and ubiquitous on web servers. The document appears to be from a PHP user group discussing using PHP in enterprise applications.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (11 votes)
623 views

PHP in The Enterprise

The document discusses PHP, a scripting language used for web development. It provides a brief history, noting that PHP started in 1995 and underwent a rewrite in 1997 to become more powerful. It also outlines some key benefits of PHP, such as being easy to learn and code, free to use, and ubiquitous on web servers. The document appears to be from a PHP user group discussing using PHP in enterprise applications.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 56

Ph.

P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 1


PHP
in the Enterprise

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 2


Michael Cheng
President / Founder,
Philosophy in Programming Society
[email protected]

(Zend Certified Engineer)

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 3


What is PHP?
• PHP is a scripting language designed for producing
dynamic web pages.

• It has evolved to include a command line interface


capability and can be used in standalone graphical
applications.

• PHP is a widely-used general-purpose scripting


language that is especially suited for web
development and can be embedded into HTML.

• It generally runs on a web server.

• Current Version: 5.2.8 - www.php.net

Source: Wikipedia - http://en.wikipedia.org/wiki/Php Ph.P


SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 4


History
• PHP started in 1995: Rasmus Lerdorf

• 1997: Zeev Suraski and Andi Gutmans


began a complete rewrite of PHP to
make the language more powerful.

• PHP has come of age.

• Maturity in the language's syntax &


features - perfect balance of ease of use
and performance.

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 5


Building Blocks of WWW

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 6


Easy to Learn & Code

Its Free to Use!


Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 7


Its Everywhere!

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 8


Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 9


The Thinking Man

Start Thinking...
Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 10


Iron Thinking

Be Iron Man? Or Sit Pretty?


Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 11


Let’s Start with a Smile.

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 12


One of the Greatest Minds

2
E=MC

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 13


Some of the Possibilities...

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 14


Time To Move Up...

Let’s Build Skyscrapers Ph.P


SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 15


Wednesday, February 18, 2009 16
Wednesday, February 18, 2009 17
Wednesday, February 18, 2009 18
Wednesday, February 18, 2009 19
Wednesday, February 18, 2009 20
Wednesday, February 18, 2009 21
Wednesday, February 18, 2009 22
Wednesday, February 18, 2009 23
Wednesday, February 18, 2009 24
Wednesday, February 18, 2009 25
Wednesday, February 18, 2009 26
Wednesday, February 18, 2009 27
Wednesday, February 18, 2009 28
Benefits
• Easy to pick-up. Syntax close to C.

• Motto: “Get Stuff Done Now”.

• Simplicity & Versatility.

• Interpreted not compiled.

• Just upload and its done!

• Support rapid & agile development.

• Ubiquity of web servers that supports PHP.

• Lower TCO.

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 29


Syntax

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 30


SOAP Client
try
{
$client = new SoapClient(’http://api.google.com/GoogleSearch.wsdl’);
$results = $client->doGoogleSearch($key, $query, 0, 10, FALSE, ’’,
FALSE, ’’, ’’, ’’);
foreach ($results->resultElements as $result)
{
echo ’<a href="’ . htmlentities($result->URL) . ’">’;
echo htmlentities($result->title, ENT_COMPAT, ’UTF-8’);
echo ’</a><br/>’;
}
}
catch (SoapFault $e)
{
echo $e->getMessage();
}

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 31


10 Point Plan:
PHP in the Enterprise
How to successful roll-out PHP in your company.

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 32


10-Point Plan
• The Team • Design Patterns
• Requirements • Testing
• Architecture • Optimization
• Tools • Deployment
• Foundation • Operations
Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 33


1. The Team
• Get a team together.

• Build up knowledge on PHP.

• OOP in PHP.

• Extensions available.

• Consider PHP Certification to fast-track your


learning process.

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 34


2. Requirements
• Gather requirements.

• What does the customer want?

• What will visitors want?

• What does the customer really need?

• Functional design.

• Application flow diagrams

• Wire frames.

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 35


3. Architecture
• Don’t be so Step 3 jump
eager to - Architecture
into coding.

• Data modeling.
Technical Design
• • Modeling
Class diagrams.
• Class Diagrams
• • ER Diagramsdiagram.
Collaboration (data model)
• Collaboration Diagrams
• Use •cases.
Use Cases etc.


Tools:
High Level Architectures
• UML

• Design Patterns
Whiteboards

• SOA

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 36


4. Tools
• The right tools help you get productive fast.
Step 4 - Tools
• Development Tools:
Development:
• Eclipse• PDT
Eclipse/ PDT
PHPClipse

• •
Komodo
Zend Studio
• PhpEd
• • Vim
Zend Studio
• Komodo
• Full IDE or Text Editor?
IDE’s versus Editors
• • Debugging
Debugging / Profiling
& Profiling
• Syntax Check
• Syntax•checking
Cross-Referencing / Navigation

• Cross Referencing / Navigation


Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 37


4. Tools
• Version Control

• Subversion

• CVS

• Documentation Tools

• PHP Documentor (http://phpdoc.org)

• PHPXRef (http://phpxref.sourceforge.net)

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 38


5. Foundation
• Good foundation will help in making your code
more maintainable and scalable.

• SOP & Best Practices

• Use a framework

• Zend Framework (http://framework.zend.com)

• CakePHP (http://cakephp.org)

• Symfony (http://www.symfony-project.org)

• Code Ignitor (http://codeigniter.com/)

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 39


6. Design Patterns
• Best practice way of solving a particular problem.

• Patterns:

• Model-View-Controller

• Factory

• Singleton

• Registry

• Decorator

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 40


7. Testing
• Various types of testing:

• Developer testing

• Functional testing

• Environment testing

• Performance testing

• Usability testing

• Solution: Unit Tests

• Automated testing after each change

• Prevents regressions
Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 41


7. Testing
• Testing for PHP applications:

• PHPUnit http://www.phpunit.de/

• SimpleTest http://www.lastcraft.com/simple_test.php

• Continuous Integration:

• CruiseControl http://cruisecontrol.sourceforge.net/

• phpUnderControl http://www.phpundercontrol.org/

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 42


8. Optimization
• Accelerators for PHP:

• APC http://pecl.php.net/package/APC

• eAccelerator http://eaccelerator.net/

• Zend Platform http://www.zend.com/products/


zend_platform

• PHP Caching solutions:

• Zend_Cache http://framework.zend.com

• Zend Platform http://www.zend.com/products/


zend_platform

• Memcached http://danga.com/memcached/
Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 43


9. Deployment
• Lifecycle:

• Develop

• Test

• Deploy to acceptance test environment

• Deploy to production server

• Use Subversion or Capistrano

• Remember the database

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 44


9. Deployment
• Basic server installation.

Linux Windows
Apache IIS
Database

PHP
Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 45


Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 46


10. Operations
• Monitoring Performance

• Logs

• Debugging

• A ‘root cause’ & analysis tool

• Context Capture

• Change management:

• Ticket system

• Stick to your deployment - use the DRP

• DON'T TOUCH THE LIVE ENVIRONMENT.


Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 47


10-Point Plan
• The Team • Design Patterns
• Requirements • Testing
• Architecture • Optimization
• Tools • Deployment
• Foundation • Operations

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 48


There’s More...
• Planning

• Development methodology (Waterfall / Agile)

• Software Development Life Cycle (SDLC)

• Coding best practices

• Security

• Implementation

• Good luck!

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 49


About Michael
• Web development business for 10+ years.

• Currently running a small web development &


consulting business.

• Started Singapore PHP User Group in 2006

• Regular monthly meetups since November 2007


(average turn out of 50 members); 480+ members
to date.

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 50


History
• 2nd Facebook Developer Garage at Microsoft Singapore
Auditorium (5 March 2008).

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 51


History
• BarCamp II - Maps & Mobile Unconference (21 May 2008).

Wed, 21 May 2008 NUS Extension, Park Mall

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 52


The Philosophy in
Programming Society
• Registered as Ph.P Society in July 2008.

• Endorsed By:

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 53


Upcoming Events
• PHP Meetup (26 Feb - Oracle Singapore)

• Zend-PHP Certification Course (7 March)

• Enrichment Workshops (March 2009)

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 54


Workshops
• Intro to PHP CMSs

• PHP Frameworks: A Primer

• Drupal, WordPress, Joomla Extensions Development

• Web 2.0 Mastery Foundation Course

• Building Rich Internet Apps: Javascript Frameworks

• Visit http://www.php.org.sg for more details.

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 55


Michael Cheng
[email protected]

http://www.php.com.sg
http://www.php.org.sg
http://facebook.php.org.sg

Ph.P
SOCIETY
Philosophy in Programming Society

Wednesday, February 18, 2009 56

You might also like