SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Rapid Application Development

        With CakePHP 1.3
Who am I


      • Brad Hancock
   • Twitter @braddhancock
  • braddhancock@gmail.com
  • Network Security Engineer
• Part-time CakePHP developer.
Goals for tonight

• Identify Cake.
• To demonstrate CakePHP’s ability to rapidly
  deploy an application.
• Build an application in under 1 hour.
What is CakePHP

• Free open-source rapid development framework.

• MVC Architecture.

• Application scaffolding.

• Code Generation.

• Convention over configuration.
Steps for prototyping an Application in
               CakePHP

• LAMP Installation.
  Linux Apache Mysql & PHP


• Build the database.

• Bake the application.
                             Just that easy

• Run the application.
Pre-configuration

Apache 2.2 Web server needs modrewrite enabled
                  # a2enmod rewrite (debian)
                       Mysql
           Latest CakePHP 1.3 installation from
                    CakePHP.
Steps

•   Extract Cake to your apache document root.
•   Test that the framework starts.
•   Ensure rewrite is enabled.
•   Create your database -- mysql
•   Create the database tables.
         tables names plural
         foreign key columns named as tablename_id
                 (convention over configuration)
Bake time.
• ../cake/console/cake bake project – create salt
    Hashing in Cake defaults to Sha1. The Salt prevents dictionary attacks on the hash.

• ../cake/console/cake bake db_config -create db con.
                                 Connect Cake to MySQL

• ../cake/console/cake bake model all --models
• ../cake/console/cake bake controller all --controllers
• ../cake/console/cake bake view all -- views
See the application


• Automatic generation of CSS and HTML for views.
• Notice associations are automatically created based
  on column names.
• Notice Friendly URLs.
Validation and Automatic creation of
              Form fields.


• Based on user input we can bake model
  validation right into the application.
• Quickly rebuilding our model and view if
  necessary.
Enable Auth Component
• Create User Table
   – Must have username and password columns.
   – Password Type must be Varchar(40) for hash.

   CREATE TABLE users (
   id integer auto_increment,
   username char(50),
   password char(40),
   admin int(1),
   PRIMARY KEY (id));
Add a user and create login view
•   Bake the Model, Controller, & View.
•   var $components = array('Auth', 'Session');
    – Add to the App_Controller.php Parent Controller for all
       others.
    Modify the User Controller to add the Login and logout
    method.
Modify the User Controller


 class UsersController extends AppController {
  var $name = 'Users';

       function beforeFilter() {
                            $this->Auth->allow('*');
                 }

      function login() {

               }

     function logout() {
                           $this->redirect($this->Auth->logout());
               }
 }
Create the Login.ctp View
 <?php

         echo $this->Html->div('',null,array('id'=>'login'));

         echo $session->flash('auth');

         echo $this->Form->create('User', array(
         'action' =>'login',
         'autocomplete'=>'off‘
                       )
         );

         echo $this->Form->input('username');

         echo $this->Form->input('password');

         echo $this->Form->end('Login');

 ?>
Customize your app

• Build a menu or modify your opening page.
  – app/views/pages/home.ctp
• Modify the CSS styles.
  – app/webroot/css
• Customize your views, controllers, &models
  – app/views, app/controllers, app/models
Learning More
• book.cakephp.org website cookbook
• Books:
  – Beginning CakePHP:From Novice to Professional
    David Golding. Kindle $18. On Cake 1.2
  - Super Awesome Advanced CakePHP tips
    Matt Curry. Free www.pseudocoder.com
  - CakePHP 1.3 Application Development Cookbook
    Mariano Iglesias
• IRC:
  – Freenode channel #cakephp
IRC
<Ceeram> what do you mean with this then?:
<kidtangerine> he adds public in front of his
functions
> Does that have a question mark on the
end, asshole?

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to VueJS & The WordPress REST API
Introduction to VueJS & The WordPress REST APIIntroduction to VueJS & The WordPress REST API
Introduction to VueJS & The WordPress REST APICaldera Labs
 
WordPress Security & Backup
WordPress Security & Backup WordPress Security & Backup
WordPress Security & Backup Randy Barnes
 
WordCamp SF 2011: Debugging in WordPress
WordCamp SF 2011: Debugging in WordPressWordCamp SF 2011: Debugging in WordPress
WordCamp SF 2011: Debugging in WordPressandrewnacin
 
SINATRA + HAML + TWITTER
SINATRA + HAML + TWITTERSINATRA + HAML + TWITTER
SINATRA + HAML + TWITTERElber Ribeiro
 
Cooking with Chef on Windows
Cooking with Chef on WindowsCooking with Chef on Windows
Cooking with Chef on WindowsJulian Dunn
 
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Software, Inc.
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Software, Inc.
 
Cooking on Windows without the Windows Cookbook
Cooking on Windows without the Windows CookbookCooking on Windows without the Windows Cookbook
Cooking on Windows without the Windows CookbookChef Software, Inc.
 
Cooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 EditionCooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 EditionJulian Dunn
 
Automating That "Other" OS
Automating That "Other" OSAutomating That "Other" OS
Automating That "Other" OSJulian Dunn
 
Chef and PowerShell Desired State Configuration
Chef and PowerShell Desired State ConfigurationChef and PowerShell Desired State Configuration
Chef and PowerShell Desired State ConfigurationJulian Dunn
 
Dirtless Databases - How to Keep Your WordPress Database Squeaky Clean
Dirtless Databases - How to Keep Your WordPress Database Squeaky CleanDirtless Databases - How to Keep Your WordPress Database Squeaky Clean
Dirtless Databases - How to Keep Your WordPress Database Squeaky CleanAdam Soucie
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSencha
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with CucumberBen Mabey
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode ChefSri Ram
 
Introduccion app engine con python
Introduccion app engine con pythonIntroduccion app engine con python
Introduccion app engine con pythonsserrano44
 
The Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web appsThe Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web appsJohn Anderson
 
Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)Mindfire Solutions
 
Introduction to Selenium and Ruby
Introduction to Selenium and RubyIntroduction to Selenium and Ruby
Introduction to Selenium and RubyYnon Perek
 

Was ist angesagt? (20)

Introduction to VueJS & The WordPress REST API
Introduction to VueJS & The WordPress REST APIIntroduction to VueJS & The WordPress REST API
Introduction to VueJS & The WordPress REST API
 
WordPress Security & Backup
WordPress Security & Backup WordPress Security & Backup
WordPress Security & Backup
 
WordCamp SF 2011: Debugging in WordPress
WordCamp SF 2011: Debugging in WordPressWordCamp SF 2011: Debugging in WordPress
WordCamp SF 2011: Debugging in WordPress
 
SINATRA + HAML + TWITTER
SINATRA + HAML + TWITTERSINATRA + HAML + TWITTER
SINATRA + HAML + TWITTER
 
Cooking with Chef on Windows
Cooking with Chef on WindowsCooking with Chef on Windows
Cooking with Chef on Windows
 
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
 
The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of Chef
 
Cooking on Windows without the Windows Cookbook
Cooking on Windows without the Windows CookbookCooking on Windows without the Windows Cookbook
Cooking on Windows without the Windows Cookbook
 
Cooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 EditionCooking with Chef on Windows: 2015 Edition
Cooking with Chef on Windows: 2015 Edition
 
Automating That "Other" OS
Automating That "Other" OSAutomating That "Other" OS
Automating That "Other" OS
 
Chef and PowerShell Desired State Configuration
Chef and PowerShell Desired State ConfigurationChef and PowerShell Desired State Configuration
Chef and PowerShell Desired State Configuration
 
Dirtless Databases - How to Keep Your WordPress Database Squeaky Clean
Dirtless Databases - How to Keep Your WordPress Database Squeaky CleanDirtless Databases - How to Keep Your WordPress Database Squeaky Clean
Dirtless Databases - How to Keep Your WordPress Database Squeaky Clean
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
Introduccion app engine con python
Introduccion app engine con pythonIntroduccion app engine con python
Introduccion app engine con python
 
The Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web appsThe Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web apps
 
Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)Introduction To Ruby Watir (Web Application Testing In Ruby)
Introduction To Ruby Watir (Web Application Testing In Ruby)
 
Introduction to Selenium and Ruby
Introduction to Selenium and RubyIntroduction to Selenium and Ruby
Introduction to Selenium and Ruby
 

Ähnlich wie Rapid Application Development with CakePHP 1.3

Intro to CakePHP 1.3
Intro to CakePHP 1.3Intro to CakePHP 1.3
Intro to CakePHP 1.3Adam Culp
 
Synapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephpSynapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephpSynapseindiaComplaints
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Drupalcon Paris
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Jennifer Davis
 
2011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 52011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 5Daniel Fisher
 
Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Chef
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefNathen Harvey
 
MVCL pattern, web flow, code flow, request and response in OpenCart
MVCL pattern, web flow, code flow, request and response in OpenCartMVCL pattern, web flow, code flow, request and response in OpenCart
MVCL pattern, web flow, code flow, request and response in OpenCartSelf
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Chef
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Timothy Fisher
 
When Smalltalk Meets the Web
When Smalltalk Meets the WebWhen Smalltalk Meets the Web
When Smalltalk Meets the WebESUG
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Anupam Ranku
 
Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011Opevel
 

Ähnlich wie Rapid Application Development with CakePHP 1.3 (20)

Intro to CakePHP 1.3
Intro to CakePHP 1.3Intro to CakePHP 1.3
Intro to CakePHP 1.3
 
Synapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephpSynapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephp
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
CakePHP REST Plugin
CakePHP REST PluginCakePHP REST Plugin
CakePHP REST Plugin
 
Codegnitorppt
CodegnitorpptCodegnitorppt
Codegnitorppt
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
CakePHP
CakePHPCakePHP
CakePHP
 
Dancing with websocket
Dancing with websocketDancing with websocket
Dancing with websocket
 
2011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 52011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 5
 
Introduction to CakePHP
Introduction to CakePHPIntroduction to CakePHP
Introduction to CakePHP
 
Introduction to CakePHP
Introduction to CakePHPIntroduction to CakePHP
Introduction to CakePHP
 
Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1
 
Cake php
Cake phpCake php
Cake php
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
MVCL pattern, web flow, code flow, request and response in OpenCart
MVCL pattern, web flow, code flow, request and response in OpenCartMVCL pattern, web flow, code flow, request and response in OpenCart
MVCL pattern, web flow, code flow, request and response in OpenCart
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 
When Smalltalk Meets the Web
When Smalltalk Meets the WebWhen Smalltalk Meets the Web
When Smalltalk Meets the Web
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
 
Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011
 

Kürzlich hochgeladen

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Rapid Application Development with CakePHP 1.3

  • 1. Rapid Application Development With CakePHP 1.3
  • 2. Who am I • Brad Hancock • Twitter @braddhancock • braddhancock@gmail.com • Network Security Engineer • Part-time CakePHP developer.
  • 3. Goals for tonight • Identify Cake. • To demonstrate CakePHP’s ability to rapidly deploy an application. • Build an application in under 1 hour.
  • 4. What is CakePHP • Free open-source rapid development framework. • MVC Architecture. • Application scaffolding. • Code Generation. • Convention over configuration.
  • 5. Steps for prototyping an Application in CakePHP • LAMP Installation. Linux Apache Mysql & PHP • Build the database. • Bake the application. Just that easy • Run the application.
  • 6. Pre-configuration Apache 2.2 Web server needs modrewrite enabled # a2enmod rewrite (debian) Mysql Latest CakePHP 1.3 installation from CakePHP.
  • 7. Steps • Extract Cake to your apache document root. • Test that the framework starts. • Ensure rewrite is enabled. • Create your database -- mysql • Create the database tables. tables names plural foreign key columns named as tablename_id (convention over configuration)
  • 8. Bake time. • ../cake/console/cake bake project – create salt Hashing in Cake defaults to Sha1. The Salt prevents dictionary attacks on the hash. • ../cake/console/cake bake db_config -create db con. Connect Cake to MySQL • ../cake/console/cake bake model all --models • ../cake/console/cake bake controller all --controllers • ../cake/console/cake bake view all -- views
  • 9. See the application • Automatic generation of CSS and HTML for views. • Notice associations are automatically created based on column names. • Notice Friendly URLs.
  • 10. Validation and Automatic creation of Form fields. • Based on user input we can bake model validation right into the application. • Quickly rebuilding our model and view if necessary.
  • 11. Enable Auth Component • Create User Table – Must have username and password columns. – Password Type must be Varchar(40) for hash. CREATE TABLE users ( id integer auto_increment, username char(50), password char(40), admin int(1), PRIMARY KEY (id));
  • 12. Add a user and create login view • Bake the Model, Controller, & View. • var $components = array('Auth', 'Session'); – Add to the App_Controller.php Parent Controller for all others. Modify the User Controller to add the Login and logout method.
  • 13. Modify the User Controller class UsersController extends AppController { var $name = 'Users'; function beforeFilter() { $this->Auth->allow('*'); } function login() { } function logout() { $this->redirect($this->Auth->logout()); } }
  • 14. Create the Login.ctp View <?php echo $this->Html->div('',null,array('id'=>'login')); echo $session->flash('auth'); echo $this->Form->create('User', array( 'action' =>'login', 'autocomplete'=>'off‘ ) ); echo $this->Form->input('username'); echo $this->Form->input('password'); echo $this->Form->end('Login'); ?>
  • 15. Customize your app • Build a menu or modify your opening page. – app/views/pages/home.ctp • Modify the CSS styles. – app/webroot/css • Customize your views, controllers, &models – app/views, app/controllers, app/models
  • 16. Learning More • book.cakephp.org website cookbook • Books: – Beginning CakePHP:From Novice to Professional David Golding. Kindle $18. On Cake 1.2 - Super Awesome Advanced CakePHP tips Matt Curry. Free www.pseudocoder.com - CakePHP 1.3 Application Development Cookbook Mariano Iglesias • IRC: – Freenode channel #cakephp
  • 17. IRC <Ceeram> what do you mean with this then?: <kidtangerine> he adds public in front of his functions > Does that have a question mark on the end, asshole?

Hinweis der Redaktion

  1. Describe Framework A framework is collection of libraries, all ready setup to do the generic functions of an application. It provides pre-existing code so you can focus on the logic of your program.Descrbe Rapid Development Framework. A framework focused on creating applications quickly.Describe MVC Architecture Model – Talks to the database View – HTML, Users sees Controller – Regulates between the two. All files are organized between these components. Makes things very organized. Bank anology: Safe is the database, and only the bankers (models) are allowed in there. Bankers are fat and lazy but make most of decisions. The tellers (controllers) take all the info from the customers (views). The bankers never talk to the customer, they are too good for that, they let the tellers bring the information back and forth to the idiot customers. Convention over Configure, has to do with how things are named in the framework, by naming things in a certain syntax or notation Cake can use those names to preconfigured the application. We will discuss convention over configuration in naming tables and columns for our mysql db. Why use MVC? Because it is a tried and true software design pattern that turns an application into a maintainable, modular, rapidly developed package. Crafting application tasks into separate models, views, and controllers makes your application very light on its feet. New features are easily added, and new faces on old features are a snap. The modular and separate design also allows developers and designers to work simultaneously, including the ability to rapidly prototype. Separation also allows developers to make changes in one part of the application without affecting others.If you&apos;ve never built an application this way, it takes some time getting used to, but we&apos;re confident that once you&apos;ve built your first application using CakePHP, you won&apos;t want to do it any other way.
  2. To rapidly deploy an application in cake, first we need to build the database and all of its tables. Does anyone not familiar with LAMP.
  3. Unzip –dmemphisphp cake.1.3.zipMv ./memphisphp/cake/* ./memphisphp/(convention over configuration)You need to create your database first. All table names are plural. members, member_details, and member_skillsYou want to use InnoDB due to CakePHP only supporting transactions with that engine. ~$ mysql -u root -pPaste fileTalk briefly about db setup and phpmyadmin
  4. Cake has libraries for built in hashing of passwords for its Auth Component. It can support Sha2 256and MD5 Show what the cake bake looks like without all.
  5. var $components = array(&apos;Auth&apos;, &apos;Session&apos;); Actual code for the controller. Need to test.
  6. Add the customize method in the user controller. Add beforeFilter() { $this-&gt;Auth-&gt;allow(‘add’); }
  7. Generates our HTML output on the next slide. Form Helper.