SlideShare une entreprise Scribd logo
1  sur  44
Running an Open-Source CodeIgniter project
The tale of PyroCMS - an open-source Content Management
System built with CodeIgniter. What, why and how!


                                  Phil Sturgeon
      email@philsturgeon.co.uk                http://twitter.com/philsturgeon
      http://philsturgeon.co.uk               http://github.com/philsturgeon
Introduction
My history in open-source
Introduction
My history in open-source
Introduction
My history in open-source
Introduction
What do I do these days?
 Work for Mizu Design Ltd
Introduction
What do I do these days?
 Work for Mizu Design Ltd
   Creating internal CodeIgniter applications
Introduction
What do I do these days?
 Work for Mizu Design Ltd
   Creating internal CodeIgniter applications

 MojoMotor Plugins
Introduction
What do I do these days?
 Work for Mizu Design Ltd
   Creating internal CodeIgniter applications

 MojoMotor plugins
 ExpressionEngine modules
Introduction
What do I do these days?
 Work for Mizu Design Ltd
   Creating internal CodeIgniter applications

 MojoMotor plugins
 ExpressionEngine modules
 PyroCMS development
Brief history of PyroCMS
StyleDNA produces StyleCMS

 We realise we need a CMS
 Back in 2007 PyroCMS was first born as
 StyleCMS, a basic CMS for small sites
 StyleDNA fails and burns horribly
 PyroCMS rises from the ashes
Brief history of PyroCMS
Turns out, looks matter!
Brief history of PyroCMS
Turns out, looks matter!
Basic Principles
Basic Principles

Clients are stupid
Basic Principles
Clients are stupid




“Can you put a redirect on Amazon to our
              homepage?”
Basic Principles
Clients are stupid




   "Why does 'N' come after 'L' in this
         alphabetical listing?!"
Basic Principles
 Clients are stupid




  "We refuse to use this font 'Century
GOTHIC Bold'. This is a family-friendly site!"
Basic Principles
Clients are stupid

 Hide confusing things
 Make it hard for them to break the site
 Control, sanitise and correct their input
   WYSIWYG

   MS Word!!!!

   XSS Clean

   CSRF protection
Basic Principles

Clients are stupid
Developers are lazy
Basic Principles
Developers are lazy
 Documentation
 Easy upgrades
 Use a logical folder structure
   addons
      libraries
      modules
      themes
   system
      codeigniter
      pyrocms
   uploads
Basic Principles
Folder Structure

  system
    codeigniter
    pyrocms
       controllers
       libraries
       models
       modules
       views
Basic Principles
Developers are lazy


   addons
     helpers
     libraries
     modules
     themes
     widgets
Basic Principles
Developers are lazy

                      Packages available in CodeIgniter 2.0
   addons
     helpers
     libraries
     modules
     themes
     widgets
Basic Principles
Developers are lazy

                      Packages available in CodeIgniter 2.0
   addons
     helpers           Modular Separation (BitBucket)
     libraries
     modules
     themes
     widgets
Basic Principles
Developers are lazy

                      Packages available in CodeIgniter 2.0
   addons
     helpers           Modular Separation (BitBucket)
     libraries
     modules
                       Template library (BitBucket)
     themes
     widgets
Basic Principles
Developers are lazy

                      Packages available in CodeIgniter 2.0
   addons
     helpers           Modular Separation (BitBucket)
     libraries
     modules
                       Template library (BitBucket)
     themes
     widgets
                       Crazy code, not available
Basic Principles

Clients are stupid
Developers are lazy
Designers are control freaks
Basic Principles
Designers are control freaks


 Themes
 Don’t mess with their HTML
 Let them mess with your HTML
 Don’t give them enough rope!
Basic Principles

Clients are stupid
Developers are lazy
Designers are control freaks
EllisLab are always “right”
Basic Principles
EllisLab are always “right”


 Never modify the core of CodeIgniter
Basic Principles
EllisLab are always “right”


 Never modify the core of CodeIgniter
 Not enough PHP 5?
Basic Principles
   EllisLab are always “right”

    Library autoload

   Call more than singletons:

   $foo = new Something(‘bar’);
   $bar = new Something(‘baz’);


Use some kick-ass PHP 5 syntax:

    $foo = Settings::item(‘bar’);
Basic Principles
EllisLab are always “right”


 Never modify the core of CodeIgniter
 Not enough PHP 5?
 Extend for the win
Basic Principles
EllisLab are always “right”

         MY_Exceptions - Custom 404 messages
Basic Principles
EllisLab are always “right”
          MY_Form_validation - Extra Validation
Basic Principles
EllisLab are always “right”
      MY_Security - Allow some naughty tags through
Basic Principles
EllisLab are always “right”
            MY_Parser - Dwoo it!

 Template parser in CI blows for... pretty much everything.

                       {$message}

            {anchor(‘controller’, ‘Some page’)}

                        {lang($foo)}

               {if $user->group == ‘admin’)}

                      http://dwoo.org/
    http://bitbucket.org/philsturgeon/codeigniter-dwoo
Basic Principles

Clients are stupid
Developers are lazy
Designers are control freaks
EllisLab are always “right”
Managing the Code
Managing the Code
Managing the Code
Master, Branches, Tags
Master

 Same as Subversion trunk
 Default “branch” of the repository
 $ git clone git://github.com/pyrocms/pyrocms.git
 Should always be ready to tag or download, keep it stable!
Managing the Code
Master, Branches, Tags
Branches

 Keep code out of the way
 v1.0-dev is relatively stable
 v2.0-dev seriously fucked
 Work on X feature independent of version Y
 $ git checkout v1.0-dev
Managing the Code
Master, Branches, Tags
Tags

 Tag each version
 Marks a specific commit as a version
 Automatic “Downloads” entry on GitHub
 http://github.com/pyrocms/pyrocms/zipball/v0.9.9.7
 http://github.com/pyrocms/pyrocms/zipball/{$variable.cms_version}
Managing the Code
Master, Branches, Tags
Forks

 User owned copy of your repository
 People do your work for you
 Use it to trial new contributors

Contenu connexe

Similaire à Running an Open-Source CodeIgniter project

Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard WorkTaming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard WorkJoseph Yoder
 
Secure Your Open Source Projects For Free
Secure Your Open Source Projects For FreeSecure Your Open Source Projects For Free
Secure Your Open Source Projects For FreeDavide Benvegnù
 
How to write good quality code
How to write good quality codeHow to write good quality code
How to write good quality codeHayden Bleasel
 
20140819 Framework
20140819 Framework20140819 Framework
20140819 Frameworktijsverkoyen
 
Writing Code for Humans, not Computers
Writing Code for Humans, not ComputersWriting Code for Humans, not Computers
Writing Code for Humans, not ComputersRené Cacheaux
 
WordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress OptimizationWordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress OptimizationJoost de Valk
 
Become a better UX designer through code
Become a better UX designer through codeBecome a better UX designer through code
Become a better UX designer through codeRamon Lapenta
 
Old code doesn't stink - Detroit
Old code doesn't stink - DetroitOld code doesn't stink - Detroit
Old code doesn't stink - DetroitMartin Gutenbrunner
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainKen Collins
 
HTML5 Is the Future of Book Authorship
HTML5 Is the Future of Book AuthorshipHTML5 Is the Future of Book Authorship
HTML5 Is the Future of Book AuthorshipSanders Kleinfeld
 
Clean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code CampClean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code CampTheo Jungeblut
 
Attacking Pipelines--Security meets Continuous Delivery
Attacking Pipelines--Security meets Continuous DeliveryAttacking Pipelines--Security meets Continuous Delivery
Attacking Pipelines--Security meets Continuous DeliveryJames Wickett
 
DEVNET-2003 Coding 203: Python - User Input, File I/O, Logging and REST API C...
DEVNET-2003	Coding 203: Python - User Input, File I/O, Logging and REST API C...DEVNET-2003	Coding 203: Python - User Input, File I/O, Logging and REST API C...
DEVNET-2003 Coding 203: Python - User Input, File I/O, Logging and REST API C...Cisco DevNet
 
Zend Framework Modular Project Setup
Zend Framework Modular Project SetupZend Framework Modular Project Setup
Zend Framework Modular Project Setupchadrobertson75
 
Listen and look at your PHP code
Listen and look at your PHP codeListen and look at your PHP code
Listen and look at your PHP codeGabriele Santini
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Dutyreedmaniac
 

Similaire à Running an Open-Source CodeIgniter project (20)

Ci2
Ci2Ci2
Ci2
 
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard WorkTaming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
 
Agile toolkit present 2012
Agile toolkit present 2012Agile toolkit present 2012
Agile toolkit present 2012
 
Secure Your Open Source Projects For Free
Secure Your Open Source Projects For FreeSecure Your Open Source Projects For Free
Secure Your Open Source Projects For Free
 
How to write good quality code
How to write good quality codeHow to write good quality code
How to write good quality code
 
20140819 Framework
20140819 Framework20140819 Framework
20140819 Framework
 
Writing Code for Humans, not Computers
Writing Code for Humans, not ComputersWriting Code for Humans, not Computers
Writing Code for Humans, not Computers
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
WordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress OptimizationWordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress Optimization
 
Become a better UX designer through code
Become a better UX designer through codeBecome a better UX designer through code
Become a better UX designer through code
 
Old code doesn't stink - Detroit
Old code doesn't stink - DetroitOld code doesn't stink - Detroit
Old code doesn't stink - Detroit
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 
HTML5 Is the Future of Book Authorship
HTML5 Is the Future of Book AuthorshipHTML5 Is the Future of Book Authorship
HTML5 Is the Future of Book Authorship
 
Clean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code CampClean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code Camp
 
Attacking Pipelines--Security meets Continuous Delivery
Attacking Pipelines--Security meets Continuous DeliveryAttacking Pipelines--Security meets Continuous Delivery
Attacking Pipelines--Security meets Continuous Delivery
 
DEVNET-2003 Coding 203: Python - User Input, File I/O, Logging and REST API C...
DEVNET-2003	Coding 203: Python - User Input, File I/O, Logging and REST API C...DEVNET-2003	Coding 203: Python - User Input, File I/O, Logging and REST API C...
DEVNET-2003 Coding 203: Python - User Input, File I/O, Logging and REST API C...
 
Zend Framework Modular Project Setup
Zend Framework Modular Project SetupZend Framework Modular Project Setup
Zend Framework Modular Project Setup
 
Listen and look at your PHP code
Listen and look at your PHP codeListen and look at your PHP code
Listen and look at your PHP code
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
 
presentation
presentationpresentation
presentation
 

Plus de Phil Sturgeon

API Pain Points (PHPNE)
API Pain Points (PHPNE)API Pain Points (PHPNE)
API Pain Points (PHPNE)Phil Sturgeon
 
PHP-FIG: Past, Present and Future
PHP-FIG: Past, Present and FuturePHP-FIG: Past, Present and Future
PHP-FIG: Past, Present and FuturePhil Sturgeon
 
Become Master of Your Own Universe - DIBI 2013
Become Master of Your Own Universe - DIBI 2013Become Master of Your Own Universe - DIBI 2013
Become Master of Your Own Universe - DIBI 2013Phil Sturgeon
 
Laravel and Composer
Laravel and ComposerLaravel and Composer
Laravel and ComposerPhil Sturgeon
 
Why I <3 Laravel 4
Why I <3 Laravel 4Why I <3 Laravel 4
Why I <3 Laravel 4Phil Sturgeon
 
Introduction to Fuel
Introduction to FuelIntroduction to Fuel
Introduction to FuelPhil Sturgeon
 

Plus de Phil Sturgeon (10)

API Pain Points (PHPNE)
API Pain Points (PHPNE)API Pain Points (PHPNE)
API Pain Points (PHPNE)
 
Api pain points
Api pain pointsApi pain points
Api pain points
 
Api pain points
Api pain pointsApi pain points
Api pain points
 
PHP-FIG: Past, Present and Future
PHP-FIG: Past, Present and FuturePHP-FIG: Past, Present and Future
PHP-FIG: Past, Present and Future
 
Become Master of Your Own Universe - DIBI 2013
Become Master of Your Own Universe - DIBI 2013Become Master of Your Own Universe - DIBI 2013
Become Master of Your Own Universe - DIBI 2013
 
Laravel and Composer
Laravel and ComposerLaravel and Composer
Laravel and Composer
 
Why I <3 Laravel 4
Why I <3 Laravel 4Why I <3 Laravel 4
Why I <3 Laravel 4
 
CodeIgniter 3.0
CodeIgniter 3.0CodeIgniter 3.0
CodeIgniter 3.0
 
Cms expo
Cms expoCms expo
Cms expo
 
Introduction to Fuel
Introduction to FuelIntroduction to Fuel
Introduction to Fuel
 

Running an Open-Source CodeIgniter project

Notes de l'éditeur