SlideShare a Scribd company logo
1 of 56
Download to read offline
NO REALLY, IT’S ALL ABOUT
                      YOU

                           Chris Cornutt
                         php|tek 2009 - Chicago, IL


                         ccornutt@phpdeveloper.org
                              http://joind.in/207

                                      1
Saturday, May 23, 2009
GETTING TO KNOW YOU
                         (GETTING TO KNOW ALL ABOUT YOU...)



                                      @enygma
                                   phpdeveloper.org
                                       joind.in
                                   atmosenergy.com




                                          2
Saturday, May 23, 2009
GOOGLE TRENDS




                         PHP5: July 2004       Last PHP4: Aug 2008


                                           3
Saturday, May 23, 2009
DEVELOPERS,
                         LET’S
                         MEET
                         OUR FRAMEWORKS!


                            4
Saturday, May 23, 2009
CAKEPHP
                         WHO LOVES YA, BABY?

                                  5
Saturday, May 23, 2009
CAKEPHP
                                      INTRODUCTION
    • “Simple              is Good”

    • Mental “point              and click” in applications

    • Lays          out an example structure for you

    • Works                for you on two levels - websites and cli

    • bake               puts the “rapid” in RAD



                                                   6
Saturday, May 23, 2009
CAKEPHP
                                          WHAT’S IN THE BOX

                         •   Access control                           •   Cookie Handling

                         •   Ajax integration (Prototype)             •   Email Support

                         •   HTML generation                          •   Request Handling

                         •   XML handling (including RSS feeds)       •   Javascript Integration

                         •   Caching                                  •   Data Pagination

                         •   Session Handling                         •   Text Manipulation

                         •   Security (request filtering)              •   Date/Time Support

                         •   Command-line functionality (build        •   Inflection
                             scaffolding/models/etc)

                                                                  7
Saturday, May 23, 2009
CAKEPHP
                                          RESOURCES
    • Manual             at CakePHP.org (aka The Cookbook)

    • The           Forge - project management for CakePHP applications

    • The           Bakery - all things CakePHP (Tutorials/Behaviors/Case Studies/Plugins/
        Helpers/Snippets)


    • Extensions             for other software like Komodo, Selenium, Firefox

    • #cakephp             on Freenode (irc)

    • The           Show - http://live.cakephp.org
                                                    8
Saturday, May 23, 2009
CAKEPHP
                              WHAT THE CRITICS SAY

    • Wrappers              around simple data types

    • Claims             of bad markup in HTML helpers

    • It’s      not “Enterprise Capable”

    • Poor/confusing            documentation




                                              9
Saturday, May 23, 2009
CODEIGNITER
                          SIMPLE AND SPEEDY


                                  10
Saturday, May 23, 2009
CODEIGNITER
                                     INTRODUCTION

    • Focuses             on simplicity (doesn’t get in the way)

    • Small, light          and easy

    • “Install           and Go”

    • Product             of EllisLabs

    • Originally           for PHP4, changes have been made for PHP5

    • Kohana             is a PHP5-based fork
                                                11
Saturday, May 23, 2009
CODEIGNITER
                                          WHAT’S IN THE BOX

                         •   Database integration    •   FTP Support

                         •   Encryption              •   Pagination

                         •   Form validation         •   Image Manipulation

                         •   HTML rendering          •   Calendars

                         •   Session handling        •   Input/Output Filtering

                         •   Locale support          •   Trackbacks

                         •   Templating              •   Text Formatting (Typography)

                         •   XML-RPC                 •   Custom Configuration

                         •   Zip/Compression         •   Language/Locale Support

                                                    12
Saturday, May 23, 2009
CODEIGNITER
                                         RESOURCES

    • User               Guide at the main site: CodeIgniter.com

    • CodeIgniter              Forums: CodeIgniter.com/forums

    • Community Wiki: CodeIgniter.com/wiki

    • Extension               for Firefox (user guide)

    • TextMate               bundle


                                                 13
Saturday, May 23, 2009
CODEIGNITER
                                WHAT THE CRITICS SAY

    • Difficult            to have any sort of “sub applications” in your code

    • Lazy           loading could cause overhead as libraries grow larger

    • Simple             included libraries lose some advanced features

    • Fewer              bundled libraries (no repository like the Bakery to get
        more)


                                                14
Saturday, May 23, 2009
This one’s for you, Ed



                                   15
Saturday, May 23, 2009
SOLAR
                         STRONG AND CONSISTENT


                                   16
Saturday, May 23, 2009
SOLAR
                                       INTRODUCTION

    • PHP5-only               from the start

    • Fully-namespaced

    • Focus              on structure and elegance

    • Uses               several enterprise development patterns
                                  Data Mapper, ServiceLocator, Query Object, Registry, Lazy Load


    • Smaller              user base, close-knit development community

                                                              17
Saturday, May 23, 2009
SOLAR
                                        WHAT’S IN THE BOX

                         •   Access control              •   Documentation Generation

                         •   Caching                     •   Inflection

                         •   JSON Support                •   MIME Support

                         •   Logging                     •   SMTP

                         •   Markdown                    •   Database Support

                         •   Web Services                •   Request Handling

                         •   Input/Output Filtering      •   Locale Support

                         •   Unit testing                •   Registry

                                                        18
Saturday, May 23, 2009
SOLAR
                                        RESOURCES

    • Main               site at SolarPHP.com

    • Community                Blog at SolarPHP.com/blog

    • Solar              Wiki at SolarPHP.org

    • Solar              Manual at SolarPHP.org/manual

    • #solarphp               on the Freenode (irc)


                                                19
Saturday, May 23, 2009
SOLAR
                                WHAT THE CRITICS SAY


    • Poor               documentation

    • Not           enough unit testing coverage

    • Different             sort of structure (controller/view and model)

    • Slower              release cycle

    • Much               lower adoption

                                                20
Saturday, May 23, 2009
ZEND FRAMEWORK
                         YOU WANT IT? WE GOT IT



                                   21
Saturday, May 23, 2009
ZEND FRAMEWORK
                                    INTRODUCTION

    • Standards-oriented             & strong

    • Targets  itself towards both the casual developer and
        Enterprise level users

    • Defined               control over source (CLA)

    • Only MVC by convention, really a set of components (with
        MVC tendencies)

    • Large              community of developers and users
                                                22
Saturday, May 23, 2009
ZEND FRAMEWORK
                               WHAT’S IN THE BOX

      •   Flex integration      •   Authentication            •   Infocard support

      •   Exception handling    •   Caching                   •   MIME Handling

      •   Form Validation       •   Code Generation           •   PDF

      •   LDAP Interface        •   Date Handling             •   REST Interface

      •   OpenID                •   Feed Parsing              •   Akismet Integration

      •   Dojo Integration      •   Input/Output Filtering    •   Popular Web Service Interfaces

      •   Unit Testing          •   Google Apps Integration   •   XML-RPC

      •   Translation           •   Currency formatting       •   Progess Bar

                                                     23
Saturday, May 23, 2009
ZEND FRAMEWORK
                                                   RESOURCES

    • Main               site at framework.zend.com*

    • Manual               at framework.zend.com/manual/en

    • Quickstart               at framework.zend.com/docs/quickstart

    • Contributor’s                 wiki at framework.zend.com/wiki

    • #zftalk             on Freenode (irc)

                             * Framework site also includes: case studies, video tutorials and bug tracker
                                                                  24
Saturday, May 23, 2009
ZEND FRAMEWORK
                                 WHAT THE CRITICS SAY

    • Technically*              not a framework

    • Tries              to do it all without focusing on certain strengths

    • Too           much object abstraction

    • Loosely              coupled components can force you to make links


                                    * Don’t send the Zend Goon Squad for me

                                                        25
Saturday, May 23, 2009
THE FRAMEWORKS
                                            AT A GLANCE

                         Framework           Components   Helpers
                           CakePHP               7          12

                          CodeIgniter            25         21

                             Solar               34         49

                           Zend Framework        75         22




                                                  26
Saturday, May 23, 2009
A CLOSER LOOK
                         INSTALL & DEVELOPMENT

                                   27
Saturday, May 23, 2009
INSTALLATION
                                                  CAKEPHP

    • Load               & Go

    • Change              configuration options
                  In /app/config:
                  Database connections, routing, session handling, caching options, access control

    • No          need to make directories, it’s all included

    • Bootstrap             and front controller included


                                                           28
Saturday, May 23, 2009
INSTALLATION
                                            CODEIGNITER

    • Dead               simple
              Sets up controller, helper, model, view, etc directories for you

    • Update              configuration for your site

    • Set         up database connection information

    • Change               any autoloads you might want
              Libraries/components loaded for every connection -
                useful for things like validation or certain models




                                                           29
Saturday, May 23, 2009
INSTALLATION
                                                     SOLAR
    • Not    quite as “beginner friendly” as CakePHP/CodeIgniter for
        setup

    • Requires            some manual setup to get the ball rolling
                            has the “Solar System”

    • Unpack             the libraries in one place, make the site in another

    • Create             directories for site/vendor/controllers & related files
                 /www/htdocs/project/vendor/App
                 /www/htdocs/project/vendor/External
                 /www/htdocs/project/vendor/<Controller Name>


                                                       30
Saturday, May 23, 2009
INSTALLATION
                               SOLAR - BOOTSTRAP

            <?php
            session_start();

            set_include_path('/www/htdocs/Solar:/www/htdocs/project:/www/htdocs/project/
            Test:/www/htdocs/project/Test/External');

            require_once('Solar.php');
            Solar::start('/www/htdocs/Test.config.php');
            $front=Solar::factory('Solar_Controller_Front');
            $front->display();

            Solar::stop();
            ?>




                                                  31
Saturday, May 23, 2009
INSTALLATION
                                           SOLAR - CONFIG
                         <?php
                         $config=array();
                         $config['Solar_Uri_Action']['path']='/';
                         $config['Solar_Uri_Public']['path']='/Test/public';
                         $config['Solar_Controller_Front']['default']='index';

                         $config['Solar_Controller_Front']['classes']=array(
                                 'Solar_App',
                                 'Test_App'
                         );
                         $config['Solar_Sql']=array(
                                 'adapter'       => 'Solar_Sql_Adapter_Mysql',
                                 'host'          => 'localhost',
                                 'user'          => 'dbuser',
                                 'pass'          => 'dbpass',
                                 'name'          => 'testdb'
                         );

                         //Done!
                         return $config;
                         ?>




                                                          32
Saturday, May 23, 2009
INSTALLATION
                                   ZEND FRAMEWORK


    • Similar             in setup to Solar

    • A “Do              It Yourself ” Framework

    • Unpack               the framework

    • Application             can be built wherever

    • Make               a boostrap

                                               33
Saturday, May 23, 2009
INSTALLATION
                         ZEND FRAMEWORK - BOOTSTRAP
          <?php
          defined('APPLICATION_PATH') or define('APPLICATION_PATH', dirname(__FILE__));
          defined('APPLICATION_ENVIRONMENT') or define('APPLICATION_ENVIRONMENT',
          'development');

          Zend_Layout::startMvc(APPLICATION_PATH . '/layouts/scripts');
          $view = Zend_Layout::getMvcInstance()->getView();
          $view->doctype('XHTML1_STRICT');
          unset($view);

          $frontController = Zend_Controller_Front::getInstance();
          $frontController->setControllerDirectory(APPLICATION_PATH . '/controllers');
          $frontController->setParam('env', APPLICATION_ENVIRONMENT);
          unset($frontController);
          ?>




                                                 34
Saturday, May 23, 2009
MY FIRST PAGE
                         FROM ZERO TO “HELLO WORLD”


                                     35
Saturday, May 23, 2009
CAKEPHP
                                        THE CONFIG
                                    DB Config - /app/config/database.php
                         <?php
                         class DATABASE_CONFIG
                         {
                            var $default = array('driver'     =>   'mysql',
                                                 'connect'    =>   'mysql_pconnect',
                                                 'host'       =>   'localhost',
                                                 'login'      =>   'myuser',
                                                 'password'   =>   'mypassword',
                                                 'database'   =>   'mydb' );
                         }



                                          Example Database Table
                         create table notes (
                             note_title VARCHAR(100),
                             note_detail VARCHAR(200),
                             note_owner VARCHAR(10)
                         );




                                                    36
Saturday, May 23, 2009
CAKEPHP
                                               THE CODE
                              Controller - /app/application/controllers/my_controller.php
                         <?php
                         class MyController extends AppController {

                                   var $name = 'MyController';

                                   function index(){
                                           $allNotes=$this->Notes->find(‘all’,
                                                  array(‘conditions’=>array(
                                                      ‘Notes.note_owner’=>‘ccornutt’
                                                  ))
                                           );
                                           $this->set(array(
                                              'title'    => 'My First Controller',
                                              ‘notes’ => $allNotes
                                           );
                                   }
                         }
                         ?>


                                       View - /app/views/my_controller/index.ctp
                         <?php echo $title.”<br>n”;
                         foreach($notes as $v){
                             echo $v[‘note_title’]' '.$v[‘note_detail’];
                         }
                         ?>

                                                          37
Saturday, May 23, 2009
CODEIGNITER
                                          THE CONFIG
                              DB Config - /system/application/config/database.php
                         $db['default']['hostname']   =   quot;localhostquot;;
                         $db['default']['username']   =   quot;myuserquot;;
                         $db['default']['password']   =   quot;mypassquot;;
                         $db['default']['database']   =   quot;mydbquot;;
                         $db['default']['dbdriver']   =   quot;mysqlquot;;
                         $db['default']['dbprefix']   =   quot;quot;;
                         $db['default']['pconnect']   =   TRUE;
                         $db['default']['db_debug']   =   TRUE;
                         $db['default']['cache_on']   =   FALSE;
                         $db['default']['cachedir']   =   quot;quot;;
                         $db['default']['char_set']   =   quot;utf8quot;;
                         $db['default']['dbcollat']   =   quot;utf8_general_ciquot;;



                                             Example Database Table
                         create table notes (
                             note_title VARCHAR(100),
                             note_detail VARCHAR(200),
                             note_owner VARCHAR(10)
                         );




                                                            38
Saturday, May 23, 2009
CODEIGNITER
                                             THE CODE
                         Controller - /system/application/controllers/FirstController.php
                         <?php
                         class First extends Controller {
                            function index(){
                                $this->library->load(‘database’);
                                $notes=$this->db->get_where(‘notes’,
                                   array(‘note_owner’=>‘ccornutt’));

                                  $to_view=array(
                                     ‘title’ => ’My First Controller’,
                                     ‘notes’ => $notes;
                                  );
                                  $this->load->view('first_page',$to_view);
                              }
                         }
                         ?>


                                  View - /system/application/views/first_page.php
                         <?php echo $title.”<br>n”;
                         foreach($notes as $v){
                              echo $v[‘note_title’]' '.$v[‘note_detail’];
                         }
                         ?>

                                                        39
Saturday, May 23, 2009
SOLAR
                                          THE CONFIG
                                        DB Config - Appname.config.php
                         <?php
                         $config['Solar_Sql'][‘adapter’]=Solar_Sql_Adapter_Mysql';
                         $config['Solar_Sql_Adapter_Mysql'] = array(
                             'host' => 'localhost',
                             'user' => 'myuser',
                             'pass' => 'mypass',
                             'name' => 'mydb',
                         );
                         ?>




                                             Example Database Table
                         create table notes (
                             note_title VARCHAR(100),
                             note_detail VARCHAR(200),
                             note_owner VARCHAR(10)
                         );




                                                        40
Saturday, May 23, 2009
SOLAR
                                               THE CODE
                                  Controller - source/example/MyApp/App/First.php
                         <?php
                         class MyApp_App_First Extends Solar_App_Base {
                             protected $_action_default = 'index';

                              function actionIndex(){
                                  $db   = Solar::factory('Solar_Sql');
                                  $bind = array(‘owner’=>‘ccornutt’);
                                  $notes= $db->query(‘select * from notes where note_owner
                                  = :owner’,$bind);

                                  $this->to_view=array(
                                      ‘title’ => ’My First Controller’,
                                      ‘notes’ => $notes;
                                  );
                              }
                         }
                         ?>


                                  View - source/example/MyApp/First/View/index.php
                         <?php echo $this->title.”<br>n”;
                         foreach($this->notes as $v){
                              echo $v[‘note_title’]' '.$v[‘note_detail’];
                         }
                         ?>

                                                          41
Saturday, May 23, 2009
ZEND FRAMEWORK
                                          THE CONFIG
                                 DB Config - /application/configs/application.ini
                         ; Uses an ini file instead of a .php
                         [production]
                         database.adapter = PDO_MYSQL
                         database.params.dbname = quot;mydbquot;
                         database.params.username = quot;myuserquot;
                         database.params.password = quot;mypassquot;
                         database.params.hostname = quot;localhostquot;




                                             Example Database Table
                         create table notes (
                             note_title VARCHAR(100),
                             note_detail VARCHAR(200),
                             note_owner VARCHAR(10)
                         );




                                                        42
Saturday, May 23, 2009
ZEND FRAMEWORK
                                              THE CODE
                             Controller - /application/controllers/indexController.php
                         <?php
                         class IndexController extends Zend_Controller_Action {
                             public function indexAction(){
                                $cfg=new Zend_Config_Ini(‘../application/
                         app.ini’,‘production’);

                                  $db=Zend_Db::factory($cfg->database);
                                  $result=$db->fetchAll(‘select * from notes’);
                                  $this->view->to_view=array(
                                     ‘title’=>'My First Controller',
                                     ‘notes’=>$result
                                  );
                              }
                         }
                         ?>



                                  View - /application/views/scripts/index/index.phtml
                         <?php echo $this->title.”<br>n”;
                         foreach($this->notes as $v){
                               echo $v[‘note_title’]' '.$v[‘note_detail’];
                         }
                         ?>


                                                         43
Saturday, May 23, 2009
COMPARING THE FIRST STEPS
                                                Steps to                      Steps to
                 Framework                                                                                 Total Steps
                                                 Install*                   “First Page”
                         CakePHP                        2                             3                              5
                         CodeIgniter                    2                             2                              4

                          Solar                         5                             3                              8
                            Zend
                         Framework                      4                             2                              6

                           * Install can include: unpacking, creating directories and making changes to configuration files.


                                                                       44
Saturday, May 23, 2009
HOW FRIENDLY IS YOUR
                     FRAMEWORK?
                         C’MON, SHOW US THE LOVE
                                    45
Saturday, May 23, 2009
CAKEPHP
                          WANTS TO BE YOUR FRIEND

    • Installation’s        as easy as one, two....well, just two

    • Code-based             database relationships help keep things straight
                              hasMany, hasOne, belongsTo, hasAndBelongsToMany

    • CLI         app of schemas, db dumps and migrations

    • Naming             conventions keep you out of trouble



                                                    46
Saturday, May 23, 2009
CODEIGNITER
                            WANTS TO BE YOUR FRIEND


    • Lazy           loading lets you chose when & what

    • Libraries            = add, hooks = change, custom core = replacing

    • Keeps              you safe with URI restrictions and super-global resets

    • Easy           upgrading (over-write)



                                                47
Saturday, May 23, 2009
SOLAR
                             WANTS TO BE YOUR FRIEND

    • Solar              System (cli) gets you up and running fast

    • Easy           to develop on and for

    • Friendly             wiki manual keeps the community keep up-to-date




                                                 48
Saturday, May 23, 2009
ZEND FRAMEWORK
                              WANTS TO BE YOUR FRIEND

    • It     loves giving you just what you need

    • Customizable               everything

    • Plays              well with others

    • It  has plenty of other friends out there to help you out (over
        10 million and counting)



                                              49
Saturday, May 23, 2009
WANNA KNOW WHAT I
                       THINK?
                           DISCLAIMER: THESE SUGGESTIONS ARE BASED ON MY PERSONAL EXPERIENCE, ARTICLES, RANDOM PEOPLE ON THE
                         STREET AND A FEW OTHER BLOGS OUT THERE. THEY MIGHT HAVE BEEN MAKING IT UP FOR ALL I KNOW, BUT THAT’S A
                             RISK I’M WILLING TO TAKE. AFTER ALL, OPINIONS ARE LIKE...WELL, YOU KNOW. THAT BEING SAID, ENJOY THE LIST!



                                                                            50
Saturday, May 23, 2009
WANT A ROCK SOLID, WELL DEVELOPED
              FRAMEWORK THAT ISN’T GOING
                 ANYWHERE? GO ZEND.

    • Standards              for the code (CLA)

    • Emphasis              on strong, well-planned, well-tested code

    • Large              component base

    • Zend               as a backer (corporate)

    • Strong              developer community/strong user community

    • Grown               exponentially in just a few years
                                                   51
Saturday, May 23, 2009
NEW TO THE WHOLE MVC THING & WANT A
       FRAMEWORK TO HOLD YOUR HAND?
        CODEIGNITER’S THE WAY TO GO


    • Does               what you need without getting in the way

    • User               guide offers easy, complete documentation

    • Pre-provided  structure helps you get a handle on where each
        part of MVC ends up

    • Helpful, active            community (forums/wiki)

                                                52
Saturday, May 23, 2009
LOOKING FOR POWER WITHOUT A LOT OF
        THE HASSLE? CAKEPHP’S YOUR GUY


    • Friendly             framework with helpful hints

    • Pre-built             structure let’s you hit the ground running

    • Solid              base components/tools

    • Command-line                rounds out feature set



                                                 53
Saturday, May 23, 2009
WANT SOMETHING TO APPEAL TO THE
     PLANNER INSIDE THAT NEEDS BOTH POWER
      & STRUCTURE? SHINE A LIGHT ON SOLAR

    • Strong              and standardized

    • Similar             interfaces found through out the code

    • Uses               well-practiced (enterprise) design patterns

    • Command                 line builds project structures



                                                 54
Saturday, May 23, 2009
THAT’S ALL, GO HOME
                          JUST KIDDING, YOU CAN STAY FOR THE Q&A




                                            55
Saturday, May 23, 2009
ADDITIONAL INFORMATION
                Frameworks:
                CakePHP - cakephp.org
                CodeIgniter - codeigniter.org
                Solar - solarphp.com
                Zend Framework - framework.zend.com


                Contact Information:
                ccornutt@phpdeveloper.org
                @enygma



                Joind.in                    PHPDeveloper.org
                http://joind.in/207         http://phpdeveloper.org


                Atmos Energy
                http://atmosenergy.com


                                                            56
Saturday, May 23, 2009

More Related Content

Similar to No Really, It's All About You

CouchDB to the Edge ApacheCon EU
CouchDB to the  Edge ApacheCon EUCouchDB to the  Edge ApacheCon EU
CouchDB to the Edge ApacheCon EUChris Anderson
 
Best Practices in Migrating to MySQL - Part 1
Best Practices in Migrating to MySQL - Part 1Best Practices in Migrating to MySQL - Part 1
Best Practices in Migrating to MySQL - Part 1Ronald Bradford
 
Software Engineering In PHP
Software Engineering In PHPSoftware Engineering In PHP
Software Engineering In PHPRalph Schindler
 
Drupal CDN integration: easier, more flexible and faster!
Drupal CDN integration: easier, more flexible and faster!Drupal CDN integration: easier, more flexible and faster!
Drupal CDN integration: easier, more flexible and faster!Wim Leers
 
What is Ruby on Rails?
What is Ruby on Rails?What is Ruby on Rails?
What is Ruby on Rails?Karmen Blake
 
Bay Area Drupal Camp Efficiency
Bay Area Drupal Camp EfficiencyBay Area Drupal Camp Efficiency
Bay Area Drupal Camp Efficiencysmattoon
 
Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]Ajax Experience 2009
 
Running The Show Configuration Management With Chef Presentation
Running The Show  Configuration Management With Chef PresentationRunning The Show  Configuration Management With Chef Presentation
Running The Show Configuration Management With Chef Presentationrailsconf
 
Foundation of Web Application Developmnet - XHTML
Foundation of Web Application Developmnet - XHTMLFoundation of Web Application Developmnet - XHTML
Foundation of Web Application Developmnet - XHTMLVashira Ravipanich
 
Catalyst And Chained
Catalyst And ChainedCatalyst And Chained
Catalyst And ChainedJay Shirley
 
Improving Drupal's Page Loading Performance
Improving Drupal's Page Loading PerformanceImproving Drupal's Page Loading Performance
Improving Drupal's Page Loading PerformanceWim Leers
 
457 WWDC08 Student Welcome
457 WWDC08 Student Welcome457 WWDC08 Student Welcome
457 WWDC08 Student Welcomerentzsch
 
Content Management Selection and Strategy
Content Management Selection and StrategyContent Management Selection and Strategy
Content Management Selection and StrategyIvo Jansch
 
Ibuildings Cms Talk
Ibuildings Cms TalkIbuildings Cms Talk
Ibuildings Cms Talkdean1985
 
iPhone Development For .Net Dev
iPhone Development For .Net DeviPhone Development For .Net Dev
iPhone Development For .Net DevAlex Hung
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
Itag Jan09 Agile Coclarity
Itag Jan09 Agile CoclarityItag Jan09 Agile Coclarity
Itag Jan09 Agile CoclarityGerard Hartnett
 

Similar to No Really, It's All About You (20)

CouchDB to the Edge ApacheCon EU
CouchDB to the  Edge ApacheCon EUCouchDB to the  Edge ApacheCon EU
CouchDB to the Edge ApacheCon EU
 
Best Practices in Migrating to MySQL - Part 1
Best Practices in Migrating to MySQL - Part 1Best Practices in Migrating to MySQL - Part 1
Best Practices in Migrating to MySQL - Part 1
 
Software Engineering In PHP
Software Engineering In PHPSoftware Engineering In PHP
Software Engineering In PHP
 
Drupal CDN integration: easier, more flexible and faster!
Drupal CDN integration: easier, more flexible and faster!Drupal CDN integration: easier, more flexible and faster!
Drupal CDN integration: easier, more flexible and faster!
 
What is Ruby on Rails?
What is Ruby on Rails?What is Ruby on Rails?
What is Ruby on Rails?
 
Bay Area Drupal Camp Efficiency
Bay Area Drupal Camp EfficiencyBay Area Drupal Camp Efficiency
Bay Area Drupal Camp Efficiency
 
Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]
 
Running The Show Configuration Management With Chef Presentation
Running The Show  Configuration Management With Chef PresentationRunning The Show  Configuration Management With Chef Presentation
Running The Show Configuration Management With Chef Presentation
 
Foundation of Web Application Developmnet - XHTML
Foundation of Web Application Developmnet - XHTMLFoundation of Web Application Developmnet - XHTML
Foundation of Web Application Developmnet - XHTML
 
Intro To Git
Intro To GitIntro To Git
Intro To Git
 
Catalyst And Chained
Catalyst And ChainedCatalyst And Chained
Catalyst And Chained
 
Improving Drupal's Page Loading Performance
Improving Drupal's Page Loading PerformanceImproving Drupal's Page Loading Performance
Improving Drupal's Page Loading Performance
 
457 WWDC08 Student Welcome
457 WWDC08 Student Welcome457 WWDC08 Student Welcome
457 WWDC08 Student Welcome
 
Content Management Selection and Strategy
Content Management Selection and StrategyContent Management Selection and Strategy
Content Management Selection and Strategy
 
Ibuildings Cms Talk
Ibuildings Cms TalkIbuildings Cms Talk
Ibuildings Cms Talk
 
iPhone Development For .Net Dev
iPhone Development For .Net DeviPhone Development For .Net Dev
iPhone Development For .Net Dev
 
Scaling Django Dc09
Scaling Django Dc09Scaling Django Dc09
Scaling Django Dc09
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
All The Little Pieces
All The Little PiecesAll The Little Pieces
All The Little Pieces
 
Itag Jan09 Agile Coclarity
Itag Jan09 Agile CoclarityItag Jan09 Agile Coclarity
Itag Jan09 Agile Coclarity
 

Recently uploaded

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 

Recently uploaded (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 

No Really, It's All About You

  • 1. NO REALLY, IT’S ALL ABOUT YOU Chris Cornutt php|tek 2009 - Chicago, IL ccornutt@phpdeveloper.org http://joind.in/207 1 Saturday, May 23, 2009
  • 2. GETTING TO KNOW YOU (GETTING TO KNOW ALL ABOUT YOU...) @enygma phpdeveloper.org joind.in atmosenergy.com 2 Saturday, May 23, 2009
  • 3. GOOGLE TRENDS PHP5: July 2004 Last PHP4: Aug 2008 3 Saturday, May 23, 2009
  • 4. DEVELOPERS, LET’S MEET OUR FRAMEWORKS! 4 Saturday, May 23, 2009
  • 5. CAKEPHP WHO LOVES YA, BABY? 5 Saturday, May 23, 2009
  • 6. CAKEPHP INTRODUCTION • “Simple is Good” • Mental “point and click” in applications • Lays out an example structure for you • Works for you on two levels - websites and cli • bake puts the “rapid” in RAD 6 Saturday, May 23, 2009
  • 7. CAKEPHP WHAT’S IN THE BOX • Access control • Cookie Handling • Ajax integration (Prototype) • Email Support • HTML generation • Request Handling • XML handling (including RSS feeds) • Javascript Integration • Caching • Data Pagination • Session Handling • Text Manipulation • Security (request filtering) • Date/Time Support • Command-line functionality (build • Inflection scaffolding/models/etc) 7 Saturday, May 23, 2009
  • 8. CAKEPHP RESOURCES • Manual at CakePHP.org (aka The Cookbook) • The Forge - project management for CakePHP applications • The Bakery - all things CakePHP (Tutorials/Behaviors/Case Studies/Plugins/ Helpers/Snippets) • Extensions for other software like Komodo, Selenium, Firefox • #cakephp on Freenode (irc) • The Show - http://live.cakephp.org 8 Saturday, May 23, 2009
  • 9. CAKEPHP WHAT THE CRITICS SAY • Wrappers around simple data types • Claims of bad markup in HTML helpers • It’s not “Enterprise Capable” • Poor/confusing documentation 9 Saturday, May 23, 2009
  • 10. CODEIGNITER SIMPLE AND SPEEDY 10 Saturday, May 23, 2009
  • 11. CODEIGNITER INTRODUCTION • Focuses on simplicity (doesn’t get in the way) • Small, light and easy • “Install and Go” • Product of EllisLabs • Originally for PHP4, changes have been made for PHP5 • Kohana is a PHP5-based fork 11 Saturday, May 23, 2009
  • 12. CODEIGNITER WHAT’S IN THE BOX • Database integration • FTP Support • Encryption • Pagination • Form validation • Image Manipulation • HTML rendering • Calendars • Session handling • Input/Output Filtering • Locale support • Trackbacks • Templating • Text Formatting (Typography) • XML-RPC • Custom Configuration • Zip/Compression • Language/Locale Support 12 Saturday, May 23, 2009
  • 13. CODEIGNITER RESOURCES • User Guide at the main site: CodeIgniter.com • CodeIgniter Forums: CodeIgniter.com/forums • Community Wiki: CodeIgniter.com/wiki • Extension for Firefox (user guide) • TextMate bundle 13 Saturday, May 23, 2009
  • 14. CODEIGNITER WHAT THE CRITICS SAY • Difficult to have any sort of “sub applications” in your code • Lazy loading could cause overhead as libraries grow larger • Simple included libraries lose some advanced features • Fewer bundled libraries (no repository like the Bakery to get more) 14 Saturday, May 23, 2009
  • 15. This one’s for you, Ed 15 Saturday, May 23, 2009
  • 16. SOLAR STRONG AND CONSISTENT 16 Saturday, May 23, 2009
  • 17. SOLAR INTRODUCTION • PHP5-only from the start • Fully-namespaced • Focus on structure and elegance • Uses several enterprise development patterns Data Mapper, ServiceLocator, Query Object, Registry, Lazy Load • Smaller user base, close-knit development community 17 Saturday, May 23, 2009
  • 18. SOLAR WHAT’S IN THE BOX • Access control • Documentation Generation • Caching • Inflection • JSON Support • MIME Support • Logging • SMTP • Markdown • Database Support • Web Services • Request Handling • Input/Output Filtering • Locale Support • Unit testing • Registry 18 Saturday, May 23, 2009
  • 19. SOLAR RESOURCES • Main site at SolarPHP.com • Community Blog at SolarPHP.com/blog • Solar Wiki at SolarPHP.org • Solar Manual at SolarPHP.org/manual • #solarphp on the Freenode (irc) 19 Saturday, May 23, 2009
  • 20. SOLAR WHAT THE CRITICS SAY • Poor documentation • Not enough unit testing coverage • Different sort of structure (controller/view and model) • Slower release cycle • Much lower adoption 20 Saturday, May 23, 2009
  • 21. ZEND FRAMEWORK YOU WANT IT? WE GOT IT 21 Saturday, May 23, 2009
  • 22. ZEND FRAMEWORK INTRODUCTION • Standards-oriented & strong • Targets itself towards both the casual developer and Enterprise level users • Defined control over source (CLA) • Only MVC by convention, really a set of components (with MVC tendencies) • Large community of developers and users 22 Saturday, May 23, 2009
  • 23. ZEND FRAMEWORK WHAT’S IN THE BOX • Flex integration • Authentication • Infocard support • Exception handling • Caching • MIME Handling • Form Validation • Code Generation • PDF • LDAP Interface • Date Handling • REST Interface • OpenID • Feed Parsing • Akismet Integration • Dojo Integration • Input/Output Filtering • Popular Web Service Interfaces • Unit Testing • Google Apps Integration • XML-RPC • Translation • Currency formatting • Progess Bar 23 Saturday, May 23, 2009
  • 24. ZEND FRAMEWORK RESOURCES • Main site at framework.zend.com* • Manual at framework.zend.com/manual/en • Quickstart at framework.zend.com/docs/quickstart • Contributor’s wiki at framework.zend.com/wiki • #zftalk on Freenode (irc) * Framework site also includes: case studies, video tutorials and bug tracker 24 Saturday, May 23, 2009
  • 25. ZEND FRAMEWORK WHAT THE CRITICS SAY • Technically* not a framework • Tries to do it all without focusing on certain strengths • Too much object abstraction • Loosely coupled components can force you to make links * Don’t send the Zend Goon Squad for me 25 Saturday, May 23, 2009
  • 26. THE FRAMEWORKS AT A GLANCE Framework Components Helpers CakePHP 7 12 CodeIgniter 25 21 Solar 34 49 Zend Framework 75 22 26 Saturday, May 23, 2009
  • 27. A CLOSER LOOK INSTALL & DEVELOPMENT 27 Saturday, May 23, 2009
  • 28. INSTALLATION CAKEPHP • Load & Go • Change configuration options In /app/config: Database connections, routing, session handling, caching options, access control • No need to make directories, it’s all included • Bootstrap and front controller included 28 Saturday, May 23, 2009
  • 29. INSTALLATION CODEIGNITER • Dead simple Sets up controller, helper, model, view, etc directories for you • Update configuration for your site • Set up database connection information • Change any autoloads you might want Libraries/components loaded for every connection - useful for things like validation or certain models 29 Saturday, May 23, 2009
  • 30. INSTALLATION SOLAR • Not quite as “beginner friendly” as CakePHP/CodeIgniter for setup • Requires some manual setup to get the ball rolling has the “Solar System” • Unpack the libraries in one place, make the site in another • Create directories for site/vendor/controllers & related files /www/htdocs/project/vendor/App /www/htdocs/project/vendor/External /www/htdocs/project/vendor/<Controller Name> 30 Saturday, May 23, 2009
  • 31. INSTALLATION SOLAR - BOOTSTRAP <?php session_start(); set_include_path('/www/htdocs/Solar:/www/htdocs/project:/www/htdocs/project/ Test:/www/htdocs/project/Test/External'); require_once('Solar.php'); Solar::start('/www/htdocs/Test.config.php'); $front=Solar::factory('Solar_Controller_Front'); $front->display(); Solar::stop(); ?> 31 Saturday, May 23, 2009
  • 32. INSTALLATION SOLAR - CONFIG <?php $config=array(); $config['Solar_Uri_Action']['path']='/'; $config['Solar_Uri_Public']['path']='/Test/public'; $config['Solar_Controller_Front']['default']='index'; $config['Solar_Controller_Front']['classes']=array( 'Solar_App', 'Test_App' ); $config['Solar_Sql']=array( 'adapter' => 'Solar_Sql_Adapter_Mysql', 'host' => 'localhost', 'user' => 'dbuser', 'pass' => 'dbpass', 'name' => 'testdb' ); //Done! return $config; ?> 32 Saturday, May 23, 2009
  • 33. INSTALLATION ZEND FRAMEWORK • Similar in setup to Solar • A “Do It Yourself ” Framework • Unpack the framework • Application can be built wherever • Make a boostrap 33 Saturday, May 23, 2009
  • 34. INSTALLATION ZEND FRAMEWORK - BOOTSTRAP <?php defined('APPLICATION_PATH') or define('APPLICATION_PATH', dirname(__FILE__)); defined('APPLICATION_ENVIRONMENT') or define('APPLICATION_ENVIRONMENT', 'development'); Zend_Layout::startMvc(APPLICATION_PATH . '/layouts/scripts'); $view = Zend_Layout::getMvcInstance()->getView(); $view->doctype('XHTML1_STRICT'); unset($view); $frontController = Zend_Controller_Front::getInstance(); $frontController->setControllerDirectory(APPLICATION_PATH . '/controllers'); $frontController->setParam('env', APPLICATION_ENVIRONMENT); unset($frontController); ?> 34 Saturday, May 23, 2009
  • 35. MY FIRST PAGE FROM ZERO TO “HELLO WORLD” 35 Saturday, May 23, 2009
  • 36. CAKEPHP THE CONFIG DB Config - /app/config/database.php <?php class DATABASE_CONFIG { var $default = array('driver' => 'mysql', 'connect' => 'mysql_pconnect', 'host' => 'localhost', 'login' => 'myuser', 'password' => 'mypassword', 'database' => 'mydb' ); } Example Database Table create table notes ( note_title VARCHAR(100), note_detail VARCHAR(200), note_owner VARCHAR(10) ); 36 Saturday, May 23, 2009
  • 37. CAKEPHP THE CODE Controller - /app/application/controllers/my_controller.php <?php class MyController extends AppController { var $name = 'MyController'; function index(){ $allNotes=$this->Notes->find(‘all’, array(‘conditions’=>array( ‘Notes.note_owner’=>‘ccornutt’ )) ); $this->set(array( 'title' => 'My First Controller', ‘notes’ => $allNotes ); } } ?> View - /app/views/my_controller/index.ctp <?php echo $title.”<br>n”; foreach($notes as $v){ echo $v[‘note_title’]' '.$v[‘note_detail’]; } ?> 37 Saturday, May 23, 2009
  • 38. CODEIGNITER THE CONFIG DB Config - /system/application/config/database.php $db['default']['hostname'] = quot;localhostquot;; $db['default']['username'] = quot;myuserquot;; $db['default']['password'] = quot;mypassquot;; $db['default']['database'] = quot;mydbquot;; $db['default']['dbdriver'] = quot;mysqlquot;; $db['default']['dbprefix'] = quot;quot;; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = quot;quot;; $db['default']['char_set'] = quot;utf8quot;; $db['default']['dbcollat'] = quot;utf8_general_ciquot;; Example Database Table create table notes ( note_title VARCHAR(100), note_detail VARCHAR(200), note_owner VARCHAR(10) ); 38 Saturday, May 23, 2009
  • 39. CODEIGNITER THE CODE Controller - /system/application/controllers/FirstController.php <?php class First extends Controller { function index(){ $this->library->load(‘database’); $notes=$this->db->get_where(‘notes’, array(‘note_owner’=>‘ccornutt’)); $to_view=array( ‘title’ => ’My First Controller’, ‘notes’ => $notes; ); $this->load->view('first_page',$to_view); } } ?> View - /system/application/views/first_page.php <?php echo $title.”<br>n”; foreach($notes as $v){ echo $v[‘note_title’]' '.$v[‘note_detail’]; } ?> 39 Saturday, May 23, 2009
  • 40. SOLAR THE CONFIG DB Config - Appname.config.php <?php $config['Solar_Sql'][‘adapter’]=Solar_Sql_Adapter_Mysql'; $config['Solar_Sql_Adapter_Mysql'] = array( 'host' => 'localhost', 'user' => 'myuser', 'pass' => 'mypass', 'name' => 'mydb', ); ?> Example Database Table create table notes ( note_title VARCHAR(100), note_detail VARCHAR(200), note_owner VARCHAR(10) ); 40 Saturday, May 23, 2009
  • 41. SOLAR THE CODE Controller - source/example/MyApp/App/First.php <?php class MyApp_App_First Extends Solar_App_Base { protected $_action_default = 'index'; function actionIndex(){ $db = Solar::factory('Solar_Sql'); $bind = array(‘owner’=>‘ccornutt’); $notes= $db->query(‘select * from notes where note_owner = :owner’,$bind); $this->to_view=array( ‘title’ => ’My First Controller’, ‘notes’ => $notes; ); } } ?> View - source/example/MyApp/First/View/index.php <?php echo $this->title.”<br>n”; foreach($this->notes as $v){ echo $v[‘note_title’]' '.$v[‘note_detail’]; } ?> 41 Saturday, May 23, 2009
  • 42. ZEND FRAMEWORK THE CONFIG DB Config - /application/configs/application.ini ; Uses an ini file instead of a .php [production] database.adapter = PDO_MYSQL database.params.dbname = quot;mydbquot; database.params.username = quot;myuserquot; database.params.password = quot;mypassquot; database.params.hostname = quot;localhostquot; Example Database Table create table notes ( note_title VARCHAR(100), note_detail VARCHAR(200), note_owner VARCHAR(10) ); 42 Saturday, May 23, 2009
  • 43. ZEND FRAMEWORK THE CODE Controller - /application/controllers/indexController.php <?php class IndexController extends Zend_Controller_Action { public function indexAction(){ $cfg=new Zend_Config_Ini(‘../application/ app.ini’,‘production’); $db=Zend_Db::factory($cfg->database); $result=$db->fetchAll(‘select * from notes’); $this->view->to_view=array( ‘title’=>'My First Controller', ‘notes’=>$result ); } } ?> View - /application/views/scripts/index/index.phtml <?php echo $this->title.”<br>n”; foreach($this->notes as $v){ echo $v[‘note_title’]' '.$v[‘note_detail’]; } ?> 43 Saturday, May 23, 2009
  • 44. COMPARING THE FIRST STEPS Steps to Steps to Framework Total Steps Install* “First Page” CakePHP 2 3 5 CodeIgniter 2 2 4 Solar 5 3 8 Zend Framework 4 2 6 * Install can include: unpacking, creating directories and making changes to configuration files. 44 Saturday, May 23, 2009
  • 45. HOW FRIENDLY IS YOUR FRAMEWORK? C’MON, SHOW US THE LOVE 45 Saturday, May 23, 2009
  • 46. CAKEPHP WANTS TO BE YOUR FRIEND • Installation’s as easy as one, two....well, just two • Code-based database relationships help keep things straight hasMany, hasOne, belongsTo, hasAndBelongsToMany • CLI app of schemas, db dumps and migrations • Naming conventions keep you out of trouble 46 Saturday, May 23, 2009
  • 47. CODEIGNITER WANTS TO BE YOUR FRIEND • Lazy loading lets you chose when & what • Libraries = add, hooks = change, custom core = replacing • Keeps you safe with URI restrictions and super-global resets • Easy upgrading (over-write) 47 Saturday, May 23, 2009
  • 48. SOLAR WANTS TO BE YOUR FRIEND • Solar System (cli) gets you up and running fast • Easy to develop on and for • Friendly wiki manual keeps the community keep up-to-date 48 Saturday, May 23, 2009
  • 49. ZEND FRAMEWORK WANTS TO BE YOUR FRIEND • It loves giving you just what you need • Customizable everything • Plays well with others • It has plenty of other friends out there to help you out (over 10 million and counting) 49 Saturday, May 23, 2009
  • 50. WANNA KNOW WHAT I THINK? DISCLAIMER: THESE SUGGESTIONS ARE BASED ON MY PERSONAL EXPERIENCE, ARTICLES, RANDOM PEOPLE ON THE STREET AND A FEW OTHER BLOGS OUT THERE. THEY MIGHT HAVE BEEN MAKING IT UP FOR ALL I KNOW, BUT THAT’S A RISK I’M WILLING TO TAKE. AFTER ALL, OPINIONS ARE LIKE...WELL, YOU KNOW. THAT BEING SAID, ENJOY THE LIST! 50 Saturday, May 23, 2009
  • 51. WANT A ROCK SOLID, WELL DEVELOPED FRAMEWORK THAT ISN’T GOING ANYWHERE? GO ZEND. • Standards for the code (CLA) • Emphasis on strong, well-planned, well-tested code • Large component base • Zend as a backer (corporate) • Strong developer community/strong user community • Grown exponentially in just a few years 51 Saturday, May 23, 2009
  • 52. NEW TO THE WHOLE MVC THING & WANT A FRAMEWORK TO HOLD YOUR HAND? CODEIGNITER’S THE WAY TO GO • Does what you need without getting in the way • User guide offers easy, complete documentation • Pre-provided structure helps you get a handle on where each part of MVC ends up • Helpful, active community (forums/wiki) 52 Saturday, May 23, 2009
  • 53. LOOKING FOR POWER WITHOUT A LOT OF THE HASSLE? CAKEPHP’S YOUR GUY • Friendly framework with helpful hints • Pre-built structure let’s you hit the ground running • Solid base components/tools • Command-line rounds out feature set 53 Saturday, May 23, 2009
  • 54. WANT SOMETHING TO APPEAL TO THE PLANNER INSIDE THAT NEEDS BOTH POWER & STRUCTURE? SHINE A LIGHT ON SOLAR • Strong and standardized • Similar interfaces found through out the code • Uses well-practiced (enterprise) design patterns • Command line builds project structures 54 Saturday, May 23, 2009
  • 55. THAT’S ALL, GO HOME JUST KIDDING, YOU CAN STAY FOR THE Q&A 55 Saturday, May 23, 2009
  • 56. ADDITIONAL INFORMATION Frameworks: CakePHP - cakephp.org CodeIgniter - codeigniter.org Solar - solarphp.com Zend Framework - framework.zend.com Contact Information: ccornutt@phpdeveloper.org @enygma Joind.in PHPDeveloper.org http://joind.in/207 http://phpdeveloper.org Atmos Energy http://atmosenergy.com 56 Saturday, May 23, 2009

Editor's Notes