• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
 

Joomla! Day Chicago 2011 Presentation - Steven Pignataro

on

  • 994 views

Joomla! Day Chicago Development, Tips and Tricks presented by Steven Pignataro

Joomla! Day Chicago Development, Tips and Tricks presented by Steven Pignataro

Statistics

Views

Total Views
994
Views on SlideShare
814
Embed Views
180

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 180

http://joomladaychicago.com 169
http://www.joomladaychicago.com 11

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Joomla! Day Chicago 2011 Presentation - Steven Pignataro Joomla! Day Chicago 2011 Presentation - Steven Pignataro Presentation Transcript

    • Joomla Development
      Steven Pignataro – CEO/Partner ‘corePHP’
    • Intro
    • Quick Questions first
      • How many here work as a team developing projects?
      • How many have used SVN or GIT?
      • How many of you are developers?
      • How many of you are experts?
      • How many of you would like to make more money by working faster?
    • Coding Standards
      • What is a coding standards?
      • Have higher quality / improved standards of released products / web sites
      • Easier to maintain from developer to developer
    • Naming Conventions
      • Classes:
      • Classes should be given descriptive names. Avoid using abbreviations where possible.
      • Separate each word with underscore.
      • We use underscores instead of Camel Case (like Joomla!)
      • Private Class members are preceded with _
      • Example: _init_tree()
    • Function Definitions
      • This example is based on the K&R style
    • Descriptions
      • Descriptions are important as it helps other developers determine what is going on in the code itself
    • Coding Standards Example
    • Coding Standards Tricks
      • Make sure all coding is done with Maximum Error Reporting or E_STRICT
      • Make sure all your developers use the same patterns and have there IDE or favorite text editor setup properly to interpret the code.
      • Some example references:
      • http://pear.php.net/manual/en/standards.php
      • http://area51.phpbb.com/docs/30x/coding-guidelines.html
      • http://docs.joomla.org/Coding_style_and_standards
    • SVN vs GIT
      • Speed
      • Handling of the repository
      • Size of repositories
      • Maturity of the repository
      • Ability to move to different versions
    • Why use SVN or GIT?
      • Ability to work with code with a team of developers
      • Copy of revision code
      • Apply immediate backups to a last known working revision
      • See who performed the update
      • Version control allows you to bring your new member up to speed with branches for testing instead of using actual live code to test.
    • Which is betters?
      • GIT of course!
      • You can use GIT off the grid – instead of being connected to the network
      • GIT is fast and leaner then other systems
      • Easy to use
    • References
      • http://svnbook.red-bean.com/
      • http://book.git-scm.com/
    • Code Review
      • Peer Code Review
      • Software based code review
      • Blame
      • Comments
      • Diff Tools
    • Team Development Software
      • Beanstalk App
      • Cornerstone (mac)
      • Eclipse / Zend Studio
      • Assembla
    • Development Tricks
      • The following are tips and tricks of developing that will enhance and make Joomla! development more focused.
    • Don’t use die for debug
      • $mainframe->close();
      • Because of how PHP5 handles code database connection errors can occur similar to the following if using a die();
      • Warning: mysqli_query() [<a href='function.mysqli-query'>function.mysqli-query</a>]: Couldn't fetch mysqli in /home/corephptest/public_html/libraries/joomla/database/database/mysqli.php on line 147
    • Use the Joomla! framework elsewhere
      • With Joomla! you can extract the framework and use inside of applications out side of the CMS
      • Example would be http://www.corephp.com/members
      • This is a complete system that pulls in Joomla! modules / data into a 3rd party system WHMCS natively.
    • How do you?
      /* Initialize Joomla framework */ define( '_JEXEC', 1 ); define( 'JPATH_BASE', dirname( __FILE__ ) ); define( 'DS', DIRECTORY_SEPARATOR ); /* Required Files */ require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); /* To use Joomla's Database Class */ require_once ( JPATH_BASE .DS.'libraries'.DS.'joomla'.DS.'factory.php' ); /* Create the Application */ $mainframe = JFactory::getApplication( 'site’ );// Your code starts here...
    • Move a site with ease
      • Akeeba Backup
      • Configure to use FTP for backup
      • Will backup to the new server that all the data was backed up to
      • Execute installation on new server.
    • Quick Debugging
      • Here is a nifty example of doing quick debug – lets assume we have a lot of logic in our debug output:/* */print_r($var);// Other logic printing// Other debug code here// Blah blah blah/* */
      • Note how /* */ starts at the top and bottom
      • Add a space to the first one /* * / and the code is now commented out. Uncomment to have execute.
    • Quick Debugging
      • Are you having an issue with trying to find where the code is located that is causing the issue?
      • Load the following code at the bottom of your index.php (last line)
      • debug_print_backtrace();
    • Single or Double Quote
      • In PHP there is a difference when using either single or double quotes, either ‘ or “. If you use double quotes ” then you are telling the code to check for a variable. If you are using single quotes ‘ then you are telling it to print whatever is between them. This might seem a bit trivial, but if you use the double quotes instead of the single quotes, it will still output correctly, but you will be wasting processer time.
    • Test for SQL Injections
      • Test your code. SQL injections are common in many applications and you can prevent it by testing. Here is a great cheat sheet:
      • http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/#AboutMySQLandPHP
    • Remove MooTools
      • Remove mootools and any unnecessary scripts loading to the page.
      • $user =& JFactory::getUser();if ( $user->get( 'guest' ) == 1 ) { $document =& JFactory::getDocument(); $headerstuff = $document->getHeadData();reset($headerstuff['scripts']);foreach ($headerstuff['scripts'] as $key=>$value){ if (substr_count($key, 'mootools') > 0)unset($headerstuff['scripts'][$key]); } $document->setHeadData( $headerstuff );}
    • Speeding up your sites
      • Using CDN support on your site will increase the speed of the site.
      • Using products like jomCDN or other CDN solutions will help decrease the speed of your site and increase your score.
      • Why?
      • Assets are loaded from servers that are close to you and not directly from the server the data is being served from.
    • Share and work together
      Share development concepts that work
      Got a great idea for Joomla! – lets us know and help improve the platform and CMS
    • Questions?
    • THE END
      There is no end when the beginning is so near!