SlideShare una empresa de Scribd logo
1 de 30
OVERVIEW
•    Environment configuration
•    Common Magento development problems and how to approach them
•    Using the right tools for the job: PHP debugging and profiling with Magento/
     Eclipse


I won’t be covering everything in minute detail. At the end of the presentation, I’ll
provide a link to slideshow and link to blog posts explaining different sections in more
detail.
AUTO-SET DEVELOPER MODE
•    Enable Mage::isDeveloperMode() on development and staging environments
      •  Preferably, set the MAGE_IS_DEVELOPER_MODE via .htaccess file or server
         configuration. Example:




      •  Alternatively, set the developer mode using conditional code in index.php.
         Example:
SHOW ALL ERRORS IN DEVELOPER MODE
•    Ensure that all errors are displayed when in developer mode:
WHY DETAILED ERROR AND EXCEPTION BACKTRACES ROCK

•    You can see all arguments passed to functions in the call stack
•    You can see all local variables at the location of the error/exception
•    You can customize xdebug to create links that allow you to jump to a specific line/
     file in your favorite editor


HOW DO I GET SUCH DETAIL?
•    Install Xdebug (an Apache module) on your development/staging servers
•    My recommended xdebug configuration values: http://bit.ly/gspkIK
Before
After
                                     Links to the
                                   location the file




                  Fully expanded
                    argument
                     variables




Local variables
HACK MAGENTO (SAFELY) TO ENABLE
BACKTRACES
•    Modify the Mage::run() method to not catch exceptions if developer mode is on
     (blog post explaining how to make this modification: http://bit.ly/feJE2y)
USING MAGE::LOG TO LOG DEBUG DATA
•     Mage::log() allows you to log code to either the default var/logs/system.log file, or
      a custom file.
       •  Mage::log(‘This is a custom message’, Zend_Log::INFO, ‘customfile.log’, true)
•     Pass Varien_Debug::backtrace(true, false) to Mage::log() to log a backtrace. This
      is helpful if you want to know what code is calling a specific section of code. This
      can be helpful when testing methods that are difficult to use a debugger on, such
      as Paypal code.
•     Log the attributes of a model using Mage::log($model->debug()) The debug()
      method prevents Mage::log from logging the dump of all of the nested objects
•      You can monitor the contents of the log files using:
     •  Command-line: tail –f <file_name>
     •  Mac: Console.app (Must have developer tools installed)
     •  Windows: Baretail (http://www.baremetalsoft.com/baretail/ )
CONFIGURE EXCEPTION HANDLER TO EMAIL
REPORTS
•    When a user of a live site encounters an error, Magento shows them a form
     (NOTE: on what conditions will Magento show a form vs a generic exception page)
     allowing them to submit the details that happened that caused that error. That
     exception will also be logged to var/log/exceptions.log
•    If you want to be notified about all exceptions via email, copy errors/
     local.xml.template to errors/local.xml and configure it to send reports via email
     and enter your email.
GET TO THE BOTTOM OF THE SQLSTATE ERRORS

•    What do you do when Magento throws a generic SQLSTATE database error?
•    An “Integrity contraint violation”, or some other SQLSTATE error, doesn’t tell you
     much, unless you can view the error and the backtrace
•    Especially relevant for errors encountered in the admin panel
•    We have to hack two files (these hacks are harmless)…
GET TO THE BOTTOM OF THE SQLSTATE ERRORS
Modify Zend_Db_Adapter_Pdo_Abstract to get backtraces for single queries
GET TO THE BOTTOM OF THE SQLSTATE ERRORS
Modify Zend_Db_Statement_Pdo to get backtraces for transactional query errors
THINGS TO CHECK WHEN A CUSTOM MODULE DOESN’T LOAD

Problem: You’ve created a basic skeleton of a module with a module xml file,
config.xml file, layout file, and block, but the module isn’t showing. Here are some
quick steps you can take to debug the issue:


1.  Ensure that the module’s xml file in app/etc/modules/ is being loaded. Tip: Add
    an error to the module’s config file and then reload the page. If the page throws
    an error, the file is being loaded.
2.  Ensure that the module’s config.xml file is being loaded using same technique
    above
3.  Ensure that the layout file is getting loaded using same technique above
4.  Ensure that caching is disabled and remove the cache directory (var/cache)
    manually if it isn’t
5.  If you’re not working on a case-sensitive partition, ensure the cases of your class
     names and xml references are correct.
DEBUGGING BY PROCESS OF ELIMINATION
Problem: You are working on a site with 5 third-party modules and 4 custom
modules. You’ve heavily modified the way that products work in the system. You run
into an error where products aren’t saving from the admin.
•    You can either:
      •  Start digging into the code to determine the cause of the issue, OR:
      •  Isolate the cause of the issue by progressively disabling the modules on the
         site until you identify which module is causing the error. Most of the time, this
         is the better approach.
•    After you identify the violating module, start commenting out different sections of
     the config.xml file until the issue goes away.
•    After you identify the bad class/file, go through the code, progressively
     eliminating different sections until you narrow it down to a line of code
ESOTERIC ERROR MESSAGE
Problem: Your client tries to place an order in the admin. When doing so, they get a
    generic error message about the product stock quantity not being able to be
    saved (NOTE: replace with real example, preferably one that can be recreated
    easily). You check the error and exception logs, but you have nothing to work
    with. What do you do?
•    Take the error message and search the Magento codebase for the error.
•    Once you locate the error, set a breakpoint and debug the error from there.
DISABLING A MODULE VS DISABLING BLOCK OUTPUT

•    Disabling block output explained
      •  You can access this option in System > Configuration > Advanced
      •  Disabling a module’s block output makes the XXXX class not output the
         contents of any blocks in that module
      •  Why would you disable a modules block output as opposed to disabling it?
           •  NOTE: Fill in details
      •  Core Magento classes that are commonly disabled
           •  Mage_Poll, Mage_Review, Mage_Tag, Mage_Wishlist (NOTE: Need to verify that
              there are no issues disabling these module‘s block output)
•    Disabling a module
      •  Change the <active>true</active> to false
      •  Remove the module’s config file from app/etc/modules
QUICK TIPS: DEBUGGING SHIPPING METHOD RATES

•    Problem: Your shipping rates are configured like they should be, but when you
     add certain items to your cart, the shipping section is showing an error message
     like “No shipping rates found”. Magento provides no easy way to see what errors
     the carriers are returning, and so these errors can be hard to debug.
•    Modify the classes in app/code/core/Mage/Usa/Model/Shipping/Carrier/
     <carrier_name>.php to log XML returned from carrier
      •  UPS: Filename, line number
      •  Fedex: Filename, line number
      •  USPS: Filename, line number
•    Once you have the full XML response data from the carrier, you can determine the
     cause of the error.
•    Common causes:
      •  The products in the cart have 0 weight
      •  NOTE: Add additional items…
DON’T BE AFRAID TO HACK - TEMPORARILY
•    Find the source of the problem
•    Set a debug point, or add a Mage::log() function to log the important data
OVERVIEW OF ECLIPSE DEBUGGING
•    Breakpoints / conditional breakpoints
      •  Stepping through code
•    Inspecting variables in local scope (especially relevant are the _data and _items
     arrays on models and collections)
•    Jumping back through the Call Stack to view variables in scope at that point in the
     stack
•    Watch expressions
•    Tip: Run code in current context using “Inspect”
BREAKPOINTS
•    Purposes
      •  Identify that Magento is hitting a certain section of code (can also use
         Mage::log(__METHOD__ . ‘ ‘ . __LINE); for that)
      •  Determine what a certain section of code does
•    Conditional breakpoints


SWITCH TO ECLIPSE FOR WALKTHROUGH
INSPECTING VARIABLES
•    Inspecting variables in local scope
       •  Many classes in Magento have recursive properties, so if you expand all
          properties, you’ll get an infinite nesting
       •  The _data array stores all of the data present in a model
       •  The _items array contains all of the items loaded in a collection


SWITCH TO ECLIPSE FOR WALKTHROUGH
CALL STACK
•    Shows all code that has been run up to that point
•    Clicking to previous lines in the call stack changes the variables in the local scope




SWITCH TO ECLIPSE FOR WALKTHROUGH
WATCH EXPRESSIONS
•    See what a certain expression would return if it was being run in the code at that
     point. Example: $product->getStatus();
•    Run code in current context using “Inspect”
      •  Use Ctl+Shift+I to run code in local scope


SWITCH TO ECLIPSE FOR WALKTHROUGH
QUESTIONS?
ZEND STUDIO-ONLY FEATURES
•    Comparison between PDT and Zend Studio
•    For debugging, the biggest advantages of Zend Studio are:
      •  Profiling
      •  Tight Zend Server integration (helpful if Magento site is running on Zend
         Server in production)


SWITCH TO Zend Studio FOR WALKTHROUGH

Más contenido relacionado

La actualidad más candente

Magento Attributes - Fresh View
Magento Attributes - Fresh ViewMagento Attributes - Fresh View
Magento Attributes - Fresh ViewAlex Gotgelf
 
Apex 5 plugins for everyone version 2018
Apex 5 plugins for everyone   version 2018Apex 5 plugins for everyone   version 2018
Apex 5 plugins for everyone version 2018Alan Arentsen
 
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2Atwix
 
Meet Magento DE 2016 - Kristof Ringleff - Growing up with Magento
Meet Magento DE 2016 - Kristof Ringleff - Growing up with MagentoMeet Magento DE 2016 - Kristof Ringleff - Growing up with Magento
Meet Magento DE 2016 - Kristof Ringleff - Growing up with MagentoKristof Ringleff
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"GeeksLab Odessa
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On RailsWen-Tien Chang
 
Advanced React Component Patterns - ReactNext 2018
Advanced React Component Patterns - ReactNext 2018Advanced React Component Patterns - ReactNext 2018
Advanced React Component Patterns - ReactNext 2018Robert Herbst
 
Template rendering in rails
Template rendering in rails Template rendering in rails
Template rendering in rails Hung Wu Lo
 
Curso Symfony - Clase 2
Curso Symfony - Clase 2Curso Symfony - Clase 2
Curso Symfony - Clase 2Javier Eguiluz
 
Manipulating Magento - Meet Magento Netherlands 2018
Manipulating Magento - Meet Magento Netherlands 2018Manipulating Magento - Meet Magento Netherlands 2018
Manipulating Magento - Meet Magento Netherlands 2018Joke Puts
 
Beginner’s tutorial (part 2) how to integrate redux-saga in react native app
Beginner’s tutorial (part 2) how to integrate redux-saga in react native appBeginner’s tutorial (part 2) how to integrate redux-saga in react native app
Beginner’s tutorial (part 2) how to integrate redux-saga in react native appKaty Slemon
 
Practical Protocol-Oriented-Programming
Practical Protocol-Oriented-ProgrammingPractical Protocol-Oriented-Programming
Practical Protocol-Oriented-ProgrammingNatasha Murashev
 
Optimization in django orm
Optimization in django ormOptimization in django orm
Optimization in django ormDenys Levchenko
 
td_mxc_rubyrails_shin
td_mxc_rubyrails_shintd_mxc_rubyrails_shin
td_mxc_rubyrails_shintutorialsruby
 

La actualidad más candente (20)

Growing up with Magento
Growing up with MagentoGrowing up with Magento
Growing up with Magento
 
Magento Attributes - Fresh View
Magento Attributes - Fresh ViewMagento Attributes - Fresh View
Magento Attributes - Fresh View
 
Apex 5 plugins for everyone version 2018
Apex 5 plugins for everyone   version 2018Apex 5 plugins for everyone   version 2018
Apex 5 plugins for everyone version 2018
 
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
 
Meet Magento DE 2016 - Kristof Ringleff - Growing up with Magento
Meet Magento DE 2016 - Kristof Ringleff - Growing up with MagentoMeet Magento DE 2016 - Kristof Ringleff - Growing up with Magento
Meet Magento DE 2016 - Kristof Ringleff - Growing up with Magento
 
AngularJs-training
AngularJs-trainingAngularJs-training
AngularJs-training
 
Django design-patterns
Django design-patternsDjango design-patterns
Django design-patterns
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On Rails
 
Get AngularJS Started!
Get AngularJS Started!Get AngularJS Started!
Get AngularJS Started!
 
Advanced React Component Patterns - ReactNext 2018
Advanced React Component Patterns - ReactNext 2018Advanced React Component Patterns - ReactNext 2018
Advanced React Component Patterns - ReactNext 2018
 
Template rendering in rails
Template rendering in rails Template rendering in rails
Template rendering in rails
 
Curso Symfony - Clase 2
Curso Symfony - Clase 2Curso Symfony - Clase 2
Curso Symfony - Clase 2
 
Manipulating Magento - Meet Magento Netherlands 2018
Manipulating Magento - Meet Magento Netherlands 2018Manipulating Magento - Meet Magento Netherlands 2018
Manipulating Magento - Meet Magento Netherlands 2018
 
Beginner’s tutorial (part 2) how to integrate redux-saga in react native app
Beginner’s tutorial (part 2) how to integrate redux-saga in react native appBeginner’s tutorial (part 2) how to integrate redux-saga in react native app
Beginner’s tutorial (part 2) how to integrate redux-saga in react native app
 
Practical Protocol-Oriented-Programming
Practical Protocol-Oriented-ProgrammingPractical Protocol-Oriented-Programming
Practical Protocol-Oriented-Programming
 
Optimization in django orm
Optimization in django ormOptimization in django orm
Optimization in django orm
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Test driven development_for_php
Test driven development_for_phpTest driven development_for_php
Test driven development_for_php
 
td_mxc_rubyrails_shin
td_mxc_rubyrails_shintd_mxc_rubyrails_shin
td_mxc_rubyrails_shin
 

Similar a Best Practices for Magento Debugging

Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama StudiosMagento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama StudiosErik Hansen
 
Introduction to the Magento eCommerce Platform
Introduction to the Magento eCommerce PlatformIntroduction to the Magento eCommerce Platform
Introduction to the Magento eCommerce PlatformJarne W. Beutnagel
 
Virtual Meetup: Mule 4 Error Handling and Logging
Virtual Meetup: Mule 4 Error Handling and LoggingVirtual Meetup: Mule 4 Error Handling and Logging
Virtual Meetup: Mule 4 Error Handling and LoggingJimmy Attia
 
Zendcon magento101
Zendcon magento101Zendcon magento101
Zendcon magento101Mathew Beane
 
php[world] Magento101
php[world] Magento101php[world] Magento101
php[world] Magento101Mathew Beane
 
Debugging MAD lecture june .pptx
Debugging MAD lecture june .pptxDebugging MAD lecture june .pptx
Debugging MAD lecture june .pptxArishaNaz2
 
Chelberg ptcuser 2010
Chelberg ptcuser 2010Chelberg ptcuser 2010
Chelberg ptcuser 2010Clay Helberg
 
Code Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsCode Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsDana Luther
 
Finding Your Way: Understanding Magento Code
Finding Your Way: Understanding Magento CodeFinding Your Way: Understanding Magento Code
Finding Your Way: Understanding Magento CodeBen Marks
 
JavaScript - Chapter 15 - Debugging Techniques
 JavaScript - Chapter 15 - Debugging Techniques JavaScript - Chapter 15 - Debugging Techniques
JavaScript - Chapter 15 - Debugging TechniquesWebStackAcademy
 
Meet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir KalashnikauMeet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir KalashnikauAmasty
 
Handling Database Deployments
Handling Database DeploymentsHandling Database Deployments
Handling Database DeploymentsMike Willbanks
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development Mage Guru
 
Software Qualitiy with Sonar Tool 2013_4
Software Qualitiy with Sonar Tool 2013_4Software Qualitiy with Sonar Tool 2013_4
Software Qualitiy with Sonar Tool 2013_4Max Kleiner
 
The Joy of Subforms with Randy Carey
The Joy of Subforms with Randy CareyThe Joy of Subforms with Randy Carey
The Joy of Subforms with Randy Careyjdaychi
 
Error management
Error managementError management
Error managementdaniil3
 
How to Develop Your First Ever Joomla Template?
How to Develop Your First Ever Joomla Template?How to Develop Your First Ever Joomla Template?
How to Develop Your First Ever Joomla Template?damienwoods
 

Similar a Best Practices for Magento Debugging (20)

Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama StudiosMagento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
 
Introduction to the Magento eCommerce Platform
Introduction to the Magento eCommerce PlatformIntroduction to the Magento eCommerce Platform
Introduction to the Magento eCommerce Platform
 
Virtual Meetup: Mule 4 Error Handling and Logging
Virtual Meetup: Mule 4 Error Handling and LoggingVirtual Meetup: Mule 4 Error Handling and Logging
Virtual Meetup: Mule 4 Error Handling and Logging
 
Zendcon magento101
Zendcon magento101Zendcon magento101
Zendcon magento101
 
Magento++
Magento++Magento++
Magento++
 
php[world] Magento101
php[world] Magento101php[world] Magento101
php[world] Magento101
 
Debugging MAD lecture june .pptx
Debugging MAD lecture june .pptxDebugging MAD lecture june .pptx
Debugging MAD lecture june .pptx
 
Chelberg ptcuser 2010
Chelberg ptcuser 2010Chelberg ptcuser 2010
Chelberg ptcuser 2010
 
Code Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsCode Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application Migrations
 
Mc sl54 051_ (1)
Mc sl54 051_ (1)Mc sl54 051_ (1)
Mc sl54 051_ (1)
 
Finding Your Way: Understanding Magento Code
Finding Your Way: Understanding Magento CodeFinding Your Way: Understanding Magento Code
Finding Your Way: Understanding Magento Code
 
JavaScript - Chapter 15 - Debugging Techniques
 JavaScript - Chapter 15 - Debugging Techniques JavaScript - Chapter 15 - Debugging Techniques
JavaScript - Chapter 15 - Debugging Techniques
 
Meet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir KalashnikauMeet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir Kalashnikau
 
Handling Database Deployments
Handling Database DeploymentsHandling Database Deployments
Handling Database Deployments
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
Hot sos em12c_metric_extensions
Hot sos em12c_metric_extensionsHot sos em12c_metric_extensions
Hot sos em12c_metric_extensions
 
Software Qualitiy with Sonar Tool 2013_4
Software Qualitiy with Sonar Tool 2013_4Software Qualitiy with Sonar Tool 2013_4
Software Qualitiy with Sonar Tool 2013_4
 
The Joy of Subforms with Randy Carey
The Joy of Subforms with Randy CareyThe Joy of Subforms with Randy Carey
The Joy of Subforms with Randy Carey
 
Error management
Error managementError management
Error management
 
How to Develop Your First Ever Joomla Template?
How to Develop Your First Ever Joomla Template?How to Develop Your First Ever Joomla Template?
How to Develop Your First Ever Joomla Template?
 

Más de varien

Driving Business Innovation with Magento
Driving Business Innovation with MagentoDriving Business Innovation with Magento
Driving Business Innovation with Magentovarien
 
Best Practices for Launching an Enterprise Business on Magento
Best Practices for Launching an Enterprise Business on MagentoBest Practices for Launching an Enterprise Business on Magento
Best Practices for Launching an Enterprise Business on Magentovarien
 
Magento Imagine eCommerce, Day 1, Roy Rubin Co-Founder & CEO
Magento Imagine eCommerce, Day 1, Roy Rubin Co-Founder & CEOMagento Imagine eCommerce, Day 1, Roy Rubin Co-Founder & CEO
Magento Imagine eCommerce, Day 1, Roy Rubin Co-Founder & CEOvarien
 
Magento Imagine Conference: With Friends Like These Who Needs Revenue?
Magento Imagine Conference: With Friends Like These Who Needs Revenue?Magento Imagine Conference: With Friends Like These Who Needs Revenue?
Magento Imagine Conference: With Friends Like These Who Needs Revenue?varien
 
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with MagentoMagento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magentovarien
 
Magento Imagine eCommerce Conference 2011: Using Magento's Import Module
Magento Imagine eCommerce Conference 2011: Using Magento's Import ModuleMagento Imagine eCommerce Conference 2011: Using Magento's Import Module
Magento Imagine eCommerce Conference 2011: Using Magento's Import Modulevarien
 
Magento's Imagine eCommerce Conference: Do You Queue?
Magento's Imagine eCommerce Conference: Do You Queue?Magento's Imagine eCommerce Conference: Do You Queue?
Magento's Imagine eCommerce Conference: Do You Queue?varien
 
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...varien
 
Magento performancenbs
Magento performancenbsMagento performancenbs
Magento performancenbsvarien
 
Magento Imagine eCommerce Conference February 2011: Optimizing Magento For Pe...
Magento Imagine eCommerce Conference February 2011: Optimizing Magento For Pe...Magento Imagine eCommerce Conference February 2011: Optimizing Magento For Pe...
Magento Imagine eCommerce Conference February 2011: Optimizing Magento For Pe...varien
 
Magento Imgine eCommerce Conference February 2011: Mashup of Magento and Sale...
Magento Imgine eCommerce Conference February 2011: Mashup of Magento and Sale...Magento Imgine eCommerce Conference February 2011: Mashup of Magento and Sale...
Magento Imgine eCommerce Conference February 2011: Mashup of Magento and Sale...varien
 
Getting from Here to There: How to assess your business, define an overall eC...
Getting from Here to There: How to assess your business, define an overall eC...Getting from Here to There: How to assess your business, define an overall eC...
Getting from Here to There: How to assess your business, define an overall eC...varien
 
Magento Imagine eCommerce, Day 2, Yoav Kutner CTO
Magento Imagine eCommerce, Day 2, Yoav Kutner CTOMagento Imagine eCommerce, Day 2, Yoav Kutner CTO
Magento Imagine eCommerce, Day 2, Yoav Kutner CTOvarien
 
Optimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend ServerOptimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend Servervarien
 
Magento Roy Rubin Amsterdam Presentation
Magento Roy Rubin Amsterdam PresentationMagento Roy Rubin Amsterdam Presentation
Magento Roy Rubin Amsterdam Presentationvarien
 
Maximizing Magento: Getting the Most out of Multi-Store Management
Maximizing Magento: Getting the Most out of Multi-Store ManagementMaximizing Magento: Getting the Most out of Multi-Store Management
Maximizing Magento: Getting the Most out of Multi-Store Managementvarien
 
Maximizing Magento: Getting the Most out of Promotions
Maximizing Magento: Getting the Most out of PromotionsMaximizing Magento: Getting the Most out of Promotions
Maximizing Magento: Getting the Most out of Promotionsvarien
 
Vortrag über Magento auf der InternetWorld 2008
Vortrag über Magento auf der InternetWorld 2008Vortrag über Magento auf der InternetWorld 2008
Vortrag über Magento auf der InternetWorld 2008varien
 
Selecting the 'Right' eCommerce Plaform
Selecting the 'Right' eCommerce PlaformSelecting the 'Right' eCommerce Plaform
Selecting the 'Right' eCommerce Plaformvarien
 
Magento eCommerce And The Next Generation Of PHP
Magento eCommerce And The Next Generation Of PHPMagento eCommerce And The Next Generation Of PHP
Magento eCommerce And The Next Generation Of PHPvarien
 

Más de varien (20)

Driving Business Innovation with Magento
Driving Business Innovation with MagentoDriving Business Innovation with Magento
Driving Business Innovation with Magento
 
Best Practices for Launching an Enterprise Business on Magento
Best Practices for Launching an Enterprise Business on MagentoBest Practices for Launching an Enterprise Business on Magento
Best Practices for Launching an Enterprise Business on Magento
 
Magento Imagine eCommerce, Day 1, Roy Rubin Co-Founder & CEO
Magento Imagine eCommerce, Day 1, Roy Rubin Co-Founder & CEOMagento Imagine eCommerce, Day 1, Roy Rubin Co-Founder & CEO
Magento Imagine eCommerce, Day 1, Roy Rubin Co-Founder & CEO
 
Magento Imagine Conference: With Friends Like These Who Needs Revenue?
Magento Imagine Conference: With Friends Like These Who Needs Revenue?Magento Imagine Conference: With Friends Like These Who Needs Revenue?
Magento Imagine Conference: With Friends Like These Who Needs Revenue?
 
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with MagentoMagento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
 
Magento Imagine eCommerce Conference 2011: Using Magento's Import Module
Magento Imagine eCommerce Conference 2011: Using Magento's Import ModuleMagento Imagine eCommerce Conference 2011: Using Magento's Import Module
Magento Imagine eCommerce Conference 2011: Using Magento's Import Module
 
Magento's Imagine eCommerce Conference: Do You Queue?
Magento's Imagine eCommerce Conference: Do You Queue?Magento's Imagine eCommerce Conference: Do You Queue?
Magento's Imagine eCommerce Conference: Do You Queue?
 
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...
 
Magento performancenbs
Magento performancenbsMagento performancenbs
Magento performancenbs
 
Magento Imagine eCommerce Conference February 2011: Optimizing Magento For Pe...
Magento Imagine eCommerce Conference February 2011: Optimizing Magento For Pe...Magento Imagine eCommerce Conference February 2011: Optimizing Magento For Pe...
Magento Imagine eCommerce Conference February 2011: Optimizing Magento For Pe...
 
Magento Imgine eCommerce Conference February 2011: Mashup of Magento and Sale...
Magento Imgine eCommerce Conference February 2011: Mashup of Magento and Sale...Magento Imgine eCommerce Conference February 2011: Mashup of Magento and Sale...
Magento Imgine eCommerce Conference February 2011: Mashup of Magento and Sale...
 
Getting from Here to There: How to assess your business, define an overall eC...
Getting from Here to There: How to assess your business, define an overall eC...Getting from Here to There: How to assess your business, define an overall eC...
Getting from Here to There: How to assess your business, define an overall eC...
 
Magento Imagine eCommerce, Day 2, Yoav Kutner CTO
Magento Imagine eCommerce, Day 2, Yoav Kutner CTOMagento Imagine eCommerce, Day 2, Yoav Kutner CTO
Magento Imagine eCommerce, Day 2, Yoav Kutner CTO
 
Optimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend ServerOptimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend Server
 
Magento Roy Rubin Amsterdam Presentation
Magento Roy Rubin Amsterdam PresentationMagento Roy Rubin Amsterdam Presentation
Magento Roy Rubin Amsterdam Presentation
 
Maximizing Magento: Getting the Most out of Multi-Store Management
Maximizing Magento: Getting the Most out of Multi-Store ManagementMaximizing Magento: Getting the Most out of Multi-Store Management
Maximizing Magento: Getting the Most out of Multi-Store Management
 
Maximizing Magento: Getting the Most out of Promotions
Maximizing Magento: Getting the Most out of PromotionsMaximizing Magento: Getting the Most out of Promotions
Maximizing Magento: Getting the Most out of Promotions
 
Vortrag über Magento auf der InternetWorld 2008
Vortrag über Magento auf der InternetWorld 2008Vortrag über Magento auf der InternetWorld 2008
Vortrag über Magento auf der InternetWorld 2008
 
Selecting the 'Right' eCommerce Plaform
Selecting the 'Right' eCommerce PlaformSelecting the 'Right' eCommerce Plaform
Selecting the 'Right' eCommerce Plaform
 
Magento eCommerce And The Next Generation Of PHP
Magento eCommerce And The Next Generation Of PHPMagento eCommerce And The Next Generation Of PHP
Magento eCommerce And The Next Generation Of PHP
 

Último

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Último (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

Best Practices for Magento Debugging

  • 1.
  • 2. OVERVIEW •  Environment configuration •  Common Magento development problems and how to approach them •  Using the right tools for the job: PHP debugging and profiling with Magento/ Eclipse I won’t be covering everything in minute detail. At the end of the presentation, I’ll provide a link to slideshow and link to blog posts explaining different sections in more detail.
  • 3.
  • 4. AUTO-SET DEVELOPER MODE •  Enable Mage::isDeveloperMode() on development and staging environments •  Preferably, set the MAGE_IS_DEVELOPER_MODE via .htaccess file or server configuration. Example: •  Alternatively, set the developer mode using conditional code in index.php. Example:
  • 5. SHOW ALL ERRORS IN DEVELOPER MODE •  Ensure that all errors are displayed when in developer mode:
  • 6. WHY DETAILED ERROR AND EXCEPTION BACKTRACES ROCK •  You can see all arguments passed to functions in the call stack •  You can see all local variables at the location of the error/exception •  You can customize xdebug to create links that allow you to jump to a specific line/ file in your favorite editor HOW DO I GET SUCH DETAIL? •  Install Xdebug (an Apache module) on your development/staging servers •  My recommended xdebug configuration values: http://bit.ly/gspkIK
  • 8. After Links to the location the file Fully expanded argument variables Local variables
  • 9. HACK MAGENTO (SAFELY) TO ENABLE BACKTRACES •  Modify the Mage::run() method to not catch exceptions if developer mode is on (blog post explaining how to make this modification: http://bit.ly/feJE2y)
  • 10. USING MAGE::LOG TO LOG DEBUG DATA •  Mage::log() allows you to log code to either the default var/logs/system.log file, or a custom file. •  Mage::log(‘This is a custom message’, Zend_Log::INFO, ‘customfile.log’, true) •  Pass Varien_Debug::backtrace(true, false) to Mage::log() to log a backtrace. This is helpful if you want to know what code is calling a specific section of code. This can be helpful when testing methods that are difficult to use a debugger on, such as Paypal code. •  Log the attributes of a model using Mage::log($model->debug()) The debug() method prevents Mage::log from logging the dump of all of the nested objects •  You can monitor the contents of the log files using: •  Command-line: tail –f <file_name> •  Mac: Console.app (Must have developer tools installed) •  Windows: Baretail (http://www.baremetalsoft.com/baretail/ )
  • 11. CONFIGURE EXCEPTION HANDLER TO EMAIL REPORTS •  When a user of a live site encounters an error, Magento shows them a form (NOTE: on what conditions will Magento show a form vs a generic exception page) allowing them to submit the details that happened that caused that error. That exception will also be logged to var/log/exceptions.log •  If you want to be notified about all exceptions via email, copy errors/ local.xml.template to errors/local.xml and configure it to send reports via email and enter your email.
  • 12.
  • 13. GET TO THE BOTTOM OF THE SQLSTATE ERRORS •  What do you do when Magento throws a generic SQLSTATE database error? •  An “Integrity contraint violation”, or some other SQLSTATE error, doesn’t tell you much, unless you can view the error and the backtrace •  Especially relevant for errors encountered in the admin panel •  We have to hack two files (these hacks are harmless)…
  • 14. GET TO THE BOTTOM OF THE SQLSTATE ERRORS Modify Zend_Db_Adapter_Pdo_Abstract to get backtraces for single queries
  • 15. GET TO THE BOTTOM OF THE SQLSTATE ERRORS Modify Zend_Db_Statement_Pdo to get backtraces for transactional query errors
  • 16. THINGS TO CHECK WHEN A CUSTOM MODULE DOESN’T LOAD Problem: You’ve created a basic skeleton of a module with a module xml file, config.xml file, layout file, and block, but the module isn’t showing. Here are some quick steps you can take to debug the issue: 1.  Ensure that the module’s xml file in app/etc/modules/ is being loaded. Tip: Add an error to the module’s config file and then reload the page. If the page throws an error, the file is being loaded. 2.  Ensure that the module’s config.xml file is being loaded using same technique above 3.  Ensure that the layout file is getting loaded using same technique above 4.  Ensure that caching is disabled and remove the cache directory (var/cache) manually if it isn’t 5.  If you’re not working on a case-sensitive partition, ensure the cases of your class names and xml references are correct.
  • 17. DEBUGGING BY PROCESS OF ELIMINATION Problem: You are working on a site with 5 third-party modules and 4 custom modules. You’ve heavily modified the way that products work in the system. You run into an error where products aren’t saving from the admin. •  You can either: •  Start digging into the code to determine the cause of the issue, OR: •  Isolate the cause of the issue by progressively disabling the modules on the site until you identify which module is causing the error. Most of the time, this is the better approach. •  After you identify the violating module, start commenting out different sections of the config.xml file until the issue goes away. •  After you identify the bad class/file, go through the code, progressively eliminating different sections until you narrow it down to a line of code
  • 18. ESOTERIC ERROR MESSAGE Problem: Your client tries to place an order in the admin. When doing so, they get a generic error message about the product stock quantity not being able to be saved (NOTE: replace with real example, preferably one that can be recreated easily). You check the error and exception logs, but you have nothing to work with. What do you do? •  Take the error message and search the Magento codebase for the error. •  Once you locate the error, set a breakpoint and debug the error from there.
  • 19. DISABLING A MODULE VS DISABLING BLOCK OUTPUT •  Disabling block output explained •  You can access this option in System > Configuration > Advanced •  Disabling a module’s block output makes the XXXX class not output the contents of any blocks in that module •  Why would you disable a modules block output as opposed to disabling it? •  NOTE: Fill in details •  Core Magento classes that are commonly disabled •  Mage_Poll, Mage_Review, Mage_Tag, Mage_Wishlist (NOTE: Need to verify that there are no issues disabling these module‘s block output) •  Disabling a module •  Change the <active>true</active> to false •  Remove the module’s config file from app/etc/modules
  • 20.
  • 21. QUICK TIPS: DEBUGGING SHIPPING METHOD RATES •  Problem: Your shipping rates are configured like they should be, but when you add certain items to your cart, the shipping section is showing an error message like “No shipping rates found”. Magento provides no easy way to see what errors the carriers are returning, and so these errors can be hard to debug. •  Modify the classes in app/code/core/Mage/Usa/Model/Shipping/Carrier/ <carrier_name>.php to log XML returned from carrier •  UPS: Filename, line number •  Fedex: Filename, line number •  USPS: Filename, line number •  Once you have the full XML response data from the carrier, you can determine the cause of the error. •  Common causes: •  The products in the cart have 0 weight •  NOTE: Add additional items…
  • 22. DON’T BE AFRAID TO HACK - TEMPORARILY •  Find the source of the problem •  Set a debug point, or add a Mage::log() function to log the important data
  • 23.
  • 24. OVERVIEW OF ECLIPSE DEBUGGING •  Breakpoints / conditional breakpoints •  Stepping through code •  Inspecting variables in local scope (especially relevant are the _data and _items arrays on models and collections) •  Jumping back through the Call Stack to view variables in scope at that point in the stack •  Watch expressions •  Tip: Run code in current context using “Inspect”
  • 25. BREAKPOINTS •  Purposes •  Identify that Magento is hitting a certain section of code (can also use Mage::log(__METHOD__ . ‘ ‘ . __LINE); for that) •  Determine what a certain section of code does •  Conditional breakpoints SWITCH TO ECLIPSE FOR WALKTHROUGH
  • 26. INSPECTING VARIABLES •  Inspecting variables in local scope •  Many classes in Magento have recursive properties, so if you expand all properties, you’ll get an infinite nesting •  The _data array stores all of the data present in a model •  The _items array contains all of the items loaded in a collection SWITCH TO ECLIPSE FOR WALKTHROUGH
  • 27. CALL STACK •  Shows all code that has been run up to that point •  Clicking to previous lines in the call stack changes the variables in the local scope SWITCH TO ECLIPSE FOR WALKTHROUGH
  • 28. WATCH EXPRESSIONS •  See what a certain expression would return if it was being run in the code at that point. Example: $product->getStatus(); •  Run code in current context using “Inspect” •  Use Ctl+Shift+I to run code in local scope SWITCH TO ECLIPSE FOR WALKTHROUGH
  • 30. ZEND STUDIO-ONLY FEATURES •  Comparison between PDT and Zend Studio •  For debugging, the biggest advantages of Zend Studio are: •  Profiling •  Tight Zend Server integration (helpful if Magento site is running on Zend Server in production) SWITCH TO Zend Studio FOR WALKTHROUGH