0
Managing Applications in
CodeIgniter
Jamshid Hashimi
Trainer, Cresco Solution
http://www.jamshidhashimi.com
jamshid@netlin...
Agenda
• Managing Applications
• Handling Multiple Environments
• Security
• PHP Style Guide
Managing Applications
• By default it is assumed that you only intend
to use CodeIgniter to manage one application,
which ...
Managing Applications
• Renaming application folder – index.php
• Relocating your Application Folder
$application_folder =...
DEMO
Handling Multiple Environments
• Developers often desire different system
behavior depending on whether an
application is ...
Security
• URIs may only contain the following:
– Alpha-numeric text
– Tilde: ~
– Period: .
– Colon: :
– Underscore: _
– D...
Security
• error_reporting
• magic_quotes_runtime
• Best Practices
– Filter the data as if it were tainted.
• XSS Filter -...
PHP Style Guide
• File Format
– UTF8
• PHP Closing Tag
• Class and Method Naming
• Variable Names
• Commenting
• Constants...
PHP Style Guide
• Debugging Code
• Whitespace in Files
• Compatibility
• Class and File Names using Common Words
• Databas...
PHP Style Guide
• Code Indenting
• Bracket and Parenthetic Spacing
• Localized Text
• Private Methods and Variables
• PHP ...
DEMO
QUESTIONS?
Upcoming SlideShare
Loading in...5
×

Managing Applications in CodeIgniter

1,040

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,040
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
36
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Managing Applications in CodeIgniter"

  1. 1. Managing Applications in CodeIgniter Jamshid Hashimi Trainer, Cresco Solution http://www.jamshidhashimi.com jamshid@netlinks.af @jamshidhashimi ajamshidhashimi Afghanistan Workforce Development Program
  2. 2. Agenda • Managing Applications • Handling Multiple Environments • Security • PHP Style Guide
  3. 3. Managing Applications • By default it is assumed that you only intend to use CodeIgniter to manage one application, which you will build in your application/ directory. It is possible, however, to have multiple sets of applications that share a single CodeIgniter installation.
  4. 4. Managing Applications • Renaming application folder – index.php • Relocating your Application Folder $application_folder = "application"; $application_folder = "/Path/to/your/application";
  5. 5. DEMO
  6. 6. Handling Multiple Environments • Developers often desire different system behavior depending on whether an application is running in a development or production environment. – Development – Testing – Production
  7. 7. Security • URIs may only contain the following: – Alpha-numeric text – Tilde: ~ – Period: . – Colon: : – Underscore: _ – Dash: - • Register Globals – During system initialization all global variables are unset, except those found in the $_GET, $_POST, and $_COOKIE arrays. – register_globals = off.
  8. 8. Security • error_reporting • magic_quotes_runtime • Best Practices – Filter the data as if it were tainted. • XSS Filter - CodeIgniter comes with a Cross Site Scripting filter. – Validate the data to ensure it conforms to the correct type, length, size, etc. • CodeIgniter has a Form Validation Class that assists you in validating, filtering, and prepping your data. – Escape the data before submitting it into your database. • Escape all data before database insertion • $this->db->escape() • $this->db->escape_str() • $this->db->escape_like_str()
  9. 9. PHP Style Guide • File Format – UTF8 • PHP Closing Tag • Class and Method Naming • Variable Names • Commenting • Constants • TRUE, FALSE, and NULL • Logical Operators • Comparing Return Values and Typecasting
  10. 10. PHP Style Guide • Debugging Code • Whitespace in Files • Compatibility • Class and File Names using Common Words • Database Table Names • One File per Class • Whitespace • Line Breaks – Unix – Windows
  11. 11. PHP Style Guide • Code Indenting • Bracket and Parenthetic Spacing • Localized Text • Private Methods and Variables • PHP Errors • Short Open Tags • One Statement Per Line • Strings • SQL Queries • Default Function Arguments
  12. 12. DEMO
  13. 13. QUESTIONS?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×