Page 1
Running an Open-Source CodeIgniter projectThe tale of PyroCMS - an open-source Content Management System built with CodeIgniter. What, why and how!
Phil [email protected]
http://philsturgeon.co.uk
http://twitter.com/philsturgeon
http://github.com/philsturgeon
Page 2
IntroductionMy history in open-source
Page 3
IntroductionMy history in open-source
Page 4
IntroductionMy history in open-source
Page 5
Work for Mizu Design Ltd
IntroductionWhat do I do these days?
Page 6
Work for Mizu Design Ltd
Creating internal CodeIgniter applications
IntroductionWhat do I do these days?
Page 7
Work for Mizu Design Ltd
Creating internal CodeIgniter applications
MojoMotor Plugins
IntroductionWhat do I do these days?
Page 8
Work for Mizu Design Ltd
Creating internal CodeIgniter applications
MojoMotor plugins
ExpressionEngine modules
IntroductionWhat do I do these days?
Page 9
Work for Mizu Design Ltd
Creating internal CodeIgniter applications
MojoMotor plugins
ExpressionEngine modules
PyroCMS development
IntroductionWhat do I do these days?
Page 10
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 PyroCMSStyleDNA produces StyleCMS
Page 11
Brief history of PyroCMSTurns out, looks matter!
Page 12
Brief history of PyroCMSTurns out, looks matter!
Page 14
Basic Principles
Clients are stupid
Page 15
“Can you put a redirect on Amazon to our homepage?”
Basic PrinciplesClients are stupid
Page 16
Basic PrinciplesClients are stupid
"Why does 'N' come after 'L' in this alphabetical listing?!"
Page 17
"We refuse to use this font 'Century GOTHIC Bold'. This is a family-friendly site!"
Basic PrinciplesClients are stupid
Page 18
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 PrinciplesClients are stupid
Page 19
Clients are stupid
Developers are lazy
Basic Principles
Page 20
Documentation
Easy upgrades
Use a logical folder structureaddons
libraries
modules
themes
system
codeigniter
pyrocms
uploads
Basic PrinciplesDevelopers are lazy
Page 21
system
codeigniter
pyrocms
controllers
libraries
models
modules
views
Basic PrinciplesFolder Structure
Page 22
addons
helpers
libraries
modules
themes
widgets
Basic PrinciplesDevelopers are lazy
Page 23
addons
helpers
libraries
modules
themes
widgets
Basic PrinciplesDevelopers are lazy
Packages available in CodeIgniter 2.0
Page 24
addons
helpers
libraries
modules
themes
widgets
Basic PrinciplesDevelopers are lazy
Packages available in CodeIgniter 2.0
Modular Separation (BitBucket)
Page 25
addons
helpers
libraries
modules
themes
widgets
Basic PrinciplesDevelopers are lazy
Packages available in CodeIgniter 2.0
Modular Separation (BitBucket)
Template library (BitBucket)
Page 26
addons
helpers
libraries
modules
themes
widgets
Basic PrinciplesDevelopers are lazy
Packages available in CodeIgniter 2.0
Modular Separation (BitBucket)
Template library (BitBucket)
Crazy code, not available
Page 27
Clients are stupid
Developers are lazy
Designers are control freaks
Basic Principles
Page 28
Themes
Don’t mess with their HTML
Let them mess with your HTML
Don’t give them enough rope!
Basic PrinciplesDesigners are control freaks
Page 29
Clients are stupid
Developers are lazy
Designers are control freaks
EllisLab are always “right”
Basic Principles
Page 30
Never modify the core of CodeIgniter
Basic PrinciplesEllisLab are always “right”
Page 31
Basic PrinciplesEllisLab are always “right”
Never modify the core of CodeIgniter
Not enough PHP 5?
Page 32
Basic PrinciplesEllisLab 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’);
Page 33
Never modify the core of CodeIgniter
Not enough PHP 5?
Extend for the win
Basic PrinciplesEllisLab are always “right”
Page 34
Basic PrinciplesEllisLab are always “right”
MY_Exceptions - Custom 404 messages
Page 35
Basic PrinciplesEllisLab are always “right”
MY_Form_validation - Extra Validation
Page 36
Basic PrinciplesEllisLab are always “right”
MY_Security - Allow some naughty tags through
Page 37
Basic PrinciplesEllisLab 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
Page 38
Clients are stupid
Developers are lazy
Designers are control freaks
EllisLab are always “right”
Basic Principles
Page 39
Managing the Code
Page 40
Managing the Code
Page 41
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 CodeMaster, Branches, Tags
Master
Page 42
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 CodeMaster, Branches, Tags
Branches
Page 43
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 CodeMaster, Branches, Tags
Tags
Page 44
User owned copy of your repository
People do your work for you
Use it to trial new contributors
Managing the CodeMaster, Branches, Tags
Forks