dr bigno z e or: how i learned to stop worrying and love the syd-phpug

22
Dr BigNoZe or: How I Learned to Stop Worrying and Love the SYD-PHPUG BigNoZePick(et)s By BigNoZe

Upload: natane

Post on 17-Jan-2016

41 views

Category:

Documents


0 download

DESCRIPTION

BigNo Z ePick(et)s By BigNo Z e. Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG. BigNo Z e is / I am. An ImPHPostor – ie. I have never been employed to write PHP I work alone ...... - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

Dr BigNoZe or:How I Learned to Stop Worrying

and Love the SYD-PHPUG

BigNoZePick(et)sBy BigNoZe

Page 2: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

BigNoZe is / I am

An ImPHPostor – ie. I have never been employed to write PHP

I work alone ...... BUT I am not a SPHPY – I attend PHP-UG

cause I expect to mentor/work in a PHP project one day

And I have written some PHP systems – one of which started during the Great War of 1997

Page 3: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

The Super League War

1997 Super League goes to war – and VP Porker says “It's too much to try and run the tipping comp this year with pen and paper! Two draws – all sorts of teams and dates??”

Page 4: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

The BigNoZe Team steps up to the plate

We designed and wrote a Nix based Footy Tipping system in Dataflex

Page 5: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

An NRL/Super League Round

+----------------------------+--------   Home ----------------- Away ---------+ | Punter*: STEVEJ            |   X  Manly            vs   St George           | | Sport *: RUGBY LEAGUE      |   X  Western Subs     vs   Sydney City         | | Round *: 16                |   X  Newcastle        vs   North Sydney        | | Date   : 13/06/97          |   X  ADELAIDE         vs   LEEDS               | | Journal:    360            |      CASTLEFORD       vs   HUNTER          X   | | Posted :                   |   X  NTH QUEENSLAND   vs   OLDHAM              | |                            |      BRADFORD         vs   AUCKLAND        X   | |                            |   X  CANTERBURY       vs   HALIFAX             | |                            |   X  CANBERRA         vs   LONDON              | |                            |   X  BRISBANE         vs   WIGAN               | |                            |      WARRINGTON       vs   PENRITH         X   | |                            |      SHEFFIELD        vs   PERTH           X   | |                            |      ST HELENS        vs   CRONULLA        X   | |                            |                       vs                       | |                            |                       vs                       | |                            |                       vs                       | |                            |                       vs                       | |                            |                       vs                       | |                            |                       vs                       | |                            |                       vs                       | |                            |                                                | +- F9 to Create Punters Forms+----------------------------------- F3 to Save -+

Page 6: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

Tipsters are Tabulated

+-----------------------------------------------------------------------------+ | Punter        Rounds -->   1 ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | |                                                                             | | BRIAN                  7   7 ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | SIMON                  7   7 ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | TONY                   7   7 ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ANNE                   3   3 ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | MERAL                  3   3 ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | PAUL                   3   3 ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | | ____________________ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___    | +------------------------Do you want a hard copy ???-N------------------------+ 

Page 7: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

For fun and education we rewrote the system in

VB6 – using Distributed COM for the office ASP – for the web when people left the office PHP – for when we realised ASP (and

Windoze in general) sucked and Linux rules.

Page 8: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

The original PHP BigNoZePicks

Was pretty awful because it was basically ASP with a '$' sign prepended to the variable names

There were no functions – no separation of HTML from code etc etc etc.

There were some include files for screen drawing etc.

I abstracted out a few lines of code and wrote some functions but essentially thought ”I should rewrite this one day – 2000? Last used 2002 Soccer World Cup”

Page 9: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

>> to 2008 Australia Day – Social Cricket Match

Tikal

Page 10: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

What are those guys doing?

I ask “What are those guys doing?” VP says “They're scoring” I say “Where's the laptop” He says “I think it's all done on paper” I go “Really? Why?” Everyone just looks at me like I am stupid.

They say nothing. Boy did I feel stupid!

Page 11: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

BigNoZePick(et)s is Born

So I determined then and there that no Australian cricketer need live without a wagonwheel by 2010

I also determine this is a chance to pull together all the bits and pieces I have gleaned from the SYD PHP-UG over all those years.

A new, clean project! A living document ? An education resource?

Page 12: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

My Education/Honour Role

There's a copy of the code here www.bignozepicks.com Downloads

I started with ADO-DB – I ditched it for PDO

thankyou Kevin – see /includes/dbsetup.inc.php /includes/competition.oop.php /includes/tipster.oop.php

Page 13: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

SPL - Iterators

Calls to the file system thankyou Kevin – SPL/ Directory Iterator

/includes/listdir.inc.php

Page 14: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

Internationalisation

Remember the Milk presentation recommended to plan for Internationalisation and Scalability no matter what the project

Smarty templates provides a simple international option – come on PHP6?

See /smarty.tpl/configs/*.conf PHP handles time zones – but I think I do

this at the user experience with a chunk of Javascript.

Page 15: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

Emails and PDF

Thankyou to Brent who presented phpMailer FPDF see selections.php for both of these

Page 16: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

Security

The GeekGuys presentation – I tried to remember the simple stuff

Fingerprint Session variables see /includes/config.php and logout.php Be wary of filename extensions Use a honey pot to stop robot logins/posting see index.php and form_token Hoover all $_POST /whatever variables see /includes/hoover.oop.inc Encrypt passwords

Page 17: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

Smarty Templates

I had already been using them a bit but Geoffs presentation gave me some extra insights. Not for everyone apparently. BigNoZePick(et)s is Smarty gone a bit crazy.

start at /smarty.tpl/templates/main.classic.tpl

Page 18: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

Documentation

Thankyou Dean and Tim phpDocumentor I used this to create both the PHP

documentation and the HELP screens via the DocBook format

Page 19: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

Other Bits and Pieces

I use phpThumb to handle images http://phpthumb.sourceforge.net/

I use a backup routine from http://www.oldguy.us/

I currently support MySQL and SQLite thanks to PDO.

Demo databases are generated from live data via masking User information see backuppicks.php

Page 20: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

Project Stuff

Code repository is Subversion - thankyou Rich

Project Tracking Management is Trac – thankyou Rich

Page 21: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

Outstanding ?

Session handling via MySQL - James PHPUnit for regression testing – thankyou

Sebastian Phar(JAR) release with SQLite – thankyou

Tim. Move code repository to Bazaar – thankyou

James Finish and hand off the project to Google or

Yahoo – watch for the BigNoZePick(et)s media kit next PHP meeting – thankyou Steve

Page 22: Dr BigNo Z e or: How I Learned to Stop Worrying and Love the SYD-PHPUG

Quick Demo? Fin!Any Questions?