SlideShare a Scribd company logo
1 of 76
Download to read offline
EE Squashed
Debugging in ExpressionEngine
Why?
The Request




GET /index.php
What’s Happening?
       Request

      index.php

   core/CodeIgniter

    controllers/EE

    libraries/Core

  libraries/Template

       Output!
CodeIgniter
     Request

    index.php

 core/CodeIgniter

  controllers/EE

  libraries/Core

libraries/Template

     Output!
ExpressionEngine
       Request

      index.php

   core/CodeIgniter

    controllers/EE

    libraries/Core

  libraries/Template

       Output!
Request

    index.php

 core/CodeIgniter

  controllers/EE

  libraries/Core

libraries/Template

     Output!
Request

    index.php        Set non-standard
                     system path
 core/CodeIgniter
                     $system_path = '../sys';


  controllers/EE

  libraries/Core     Kick off CodeIgniter
                     require_once BASEPATH.'core/
libraries/Template   CodeIgniter'.EXT;



     Output!
Run CodeIgniter
     Request         LOAD: core/Common
                     LOAD: core/Compat
                     LOAD: config/constants

    index.php        LOAD: core/Benchmark
                     LOAD: core/Hooks
                     RUN: pre-system HOOK
                     LOAD: core/Config
 core/CodeIgniter    LOAD: core/Unicode
                     LOAD: core/URI
                     LOAD: core/Router
  controllers/EE     LOAD: core/Output
                     RUN: cache_override HOOK
                     LOAD: core/Input

  libraries/Core     LOAD: core/Lang
                     LOAD: core/Base[4,5]
                     LOAD: core/Controller
                     LOAD: EE
libraries/Template   RUN: pre_controller HOOK
                     INSTANTIATE: EE
                     RUN: post_controller_constructor HOOK
     Output!         RUN: EE/index
                     RUN: post_controller HOOK
                     RENDER: output
                     RUN: post_system HOOK
Run CodeIgniter
     Request         LOAD: core/Common
                     LOAD: core/Compat
                     LOAD: config/constants

    index.php        LOAD: core/Benchmark
                     LOAD: core/Hooks
                     RUN: pre-system HOOK
                     LOAD: core/Config
 core/CodeIgniter    LOAD: core/Unicode
                     LOAD: core/URI
                     LOAD: core/Router
  controllers/EE     LOAD: core/Output
                     RUN: cache_override HOOK
                     LOAD: core/Input

  libraries/Core     LOAD: core/Lang
                     LOAD: core/Base[4,5]
                     LOAD: core/Controller
                     LOAD: EE
libraries/Template   RUN: pre_controller HOOK
                     INSTANTIATE: EE
                     RUN: post_controller_constructor HOOK
     Output!         RUN: EE/index
                     RUN: post_controller HOOK
                     RENDER: output
                     RUN: post_system HOOK
Run CodeIgniter
     Request         LOAD: core/Common
                     LOAD: core/Compat
                     LOAD: config/constants

    index.php        LOAD: core/Benchmark
                     LOAD: core/Hooks
                     RUN: pre-system HOOK
                     LOAD: core/Config
 core/CodeIgniter    LOAD: core/Unicode
                     LOAD: core/URI
                     LOAD: core/Router
  controllers/EE     LOAD: core/Output
                     RUN: cache_override HOOK
                     LOAD: core/Input

  libraries/Core     LOAD: core/Lang
                     LOAD: core/Base[4,5]
                     LOAD: core/Controller
                     LOAD: EE
libraries/Template   RUN: pre_controller HOOK
                     INSTANTIATE: EE
                     RUN: post_controller_constructor HOOK
     Output!         RUN: EE/index
                     RUN: post_controller HOOK
                     RENDER: output
                     RUN: post_system HOOK
Request

    index.php

 core/CodeIgniter
                     Kick off
  controllers/EE     ExpressionEngine
                     $this->core->_initialize_core();
  libraries/Core

libraries/Template

     Output!
Request

    index.php
                     Run ExpressionEngine
 core/CodeIgniter    LOAD: Database
                     LOAD: Site Preferences
                     LOAD: libraries/Functions
  controllers/EE     LOAD: libraries/Extensions
                     LOAD: libraries/Localize
                     LOAD: libraries/Session
  libraries/Core     LOAD: languages/english/core
                     LOAD: libraries/Template
                     RUN: template/run_template_engine
libraries/Template

     Output!
Request

    index.php
                     Run ExpressionEngine
 core/CodeIgniter    LOAD: Database
                     LOAD: Site Preferences
                     LOAD: libraries/Functions
  controllers/EE     LOAD: libraries/Extensions
                     LOAD: libraries/Localize
                     LOAD: libraries/Session
  libraries/Core     LOAD: languages/english/core
                     LOAD: libraries/Template
                     RUN: template/run_template_engine
libraries/Template

     Output!
Request

    index.php        Parse the Template
                     Parses URI
 core/CodeIgniter    Fetch template from DB
                     Fetch template from disk
                     Static check
                     Parse snippets, segments, embed:vars
  controllers/EE     Check cache
                     Parse input PHP
                     Parse simple conditionals
  libraries/Core     Parse tags
                     Parse output PHP
                     Write cache
libraries/Template   Parse advanced conditionals
                     Loop through sub-templates


     Output!
Request

    index.php        Parse the Template
                     Parses URI
 core/CodeIgniter    Fetch template from DB
                     Fetch template from disk
                     Static check
                     Parse snippets, segments, embed:vars
  controllers/EE     Check cache
                     Parse input PHP
                     Parse simple conditionals
  libraries/Core     Parse tags
                     Parse output PHP
                     Write cache
libraries/Template   Parse advanced conditionals
                     Loop through sub-templates


     Output!
Request

    index.php

 core/CodeIgniter

  controllers/EE

  libraries/Core

libraries/Template

     Output!
What’s Happening?
       Request

      index.php

   core/CodeIgniter

    controllers/EE

    libraries/Core

  libraries/Template

       Output!
Debugging
  Debugging is a methodical process of finding and
reducing the number of bugs, or defects, in a computer program or a
  piece of electronic hardware, thus making it behave as expected.
                                                           –wikipedia
Debugging
Debugging is a methodical process!
KISS


Don’t assume anything
Attack the obvious
Ask for help
Start broad
When you assume…

Don’t assume it’s an extension
Don’t assume it’s the database
Don’t assume it’s your host
Don’t assume…

   It’s much faster to determine what the problem is
             than what the problem isn’t.
Is it plugged in?


Can you SSH/FTP?
Can you access a static HTML file?
Can you access your database?
Can you access PHP info?
Help!

Xdebug Extension for PHP
http://xdebug.org/




Display Output Profiler
$config[‘show_profiler’] = TRUE;
Broad strokes

Check the application, can you log into the CP?
Check the templates, can you access other
pages?
Remove half the template, does it show up?
Remove a fourth the template, does it show up?
Rinse, repeat…
KISS Huot Style

1. Test a static file
2. Test the control panel
3. Test other templates
4. Remove the entire trouble template, replace it
   with “test”
5. Fill back in the template until it breaks
KISS Huot Style

6. Is the trouble spot fixable in the template?
7. If not open the add-on and place debugging
   lines throughout
8. Is the trouble spot in the add-on?
9. If not open the core EE files and place
   debugging lines throughout
Three Examples
1.
Data’s Gone Missing
The Problem




   4:30 pm
  on a Friday
Assumptions…
 Let’s do it all wrong.
It’s EE’s Fault



An entry was overwritten?
An entry was accidentally deleted?
An entry was set to closed?
It’s MySQL’s Fault



The database is corrupt?
Primary keys are out of order because of a
backup or import?
Now, I feel like an ass.
KISS


Don’t assume anything
Attack the obvious
Start broad
Ask for help
Is it plugged in?

Check with the client, what is really missing?
Can they tell you anything about the data?
  What channel it was in?
  What status they set it to?



                  5:58 pm
                 on a Friday
The Solution



“Don't worry Mark, they never existed in the DB. We got to
the bottom of it. I'm adding them by hand tomorrow. Sorry for
all the confusion.”


                         6:23 pm
                        on a Friday
2.
Finicky URLs
The Problem




Every listing page just stopped working.
Yesterday
Today
Background



Project rolled seven sites into one.
Each sub-site was different and contained
separate IA (navigation).
Under the Hood


Standard EE 1.x install
No custom add-ons
Not using Pages module
“Templates as controllers”
Yesterday
Assumptions…
 Let’s do it all wrong.
It’s EE’s Fault



Have the templates changed?
Was something new installed/enabled?
Is it daylight savings time?
Now, I feel like an ass.
KISS


Don’t assume anything
Attack the obvious
Start broad
Ask for help
Ask For Help
Ask For Help
Ask For Help
The Solution



For now, I’ve renamed entry.
I’m open to suggestions, please feel free to
educate me after this session with your ideas.
3.
EE Can’t Count
The Problem




Contestants aren’t sorting properly.
Under the Hood


Standard EE 2.x install
EE Members
EE Member Custom Profile Fields
Mark Huot Vote Module
Solspace User Module
All together now…


The Vote module records votes in a separate
database table.
The Vote module summarizes total votes into a
standard EE member profile field.
The User module displays users ordered by the
EE member profile field.
Assumptions…
 Let’s do it all wrong.
It’s EE’s Fault




Values are correct in
control panel.
It’s Vote’s Fault


Module code looks correct.

Correctly using
exp_member_data table.



Pulling correct custom
field, I think…
It’s User’s Fault

Nope, template appears
correct.

Sorting by other fields
works as expected
(username, other custom
fields).

Sort attribute correctly flips
the results, but keeps them
out of order.
It’s My Fault



Template looks right.

Not a CSS issue,
underlying XHTML is
wrong too.
Now, I feel like an ass.
KISS


Don’t assume anything
Attack the obvious
Start broad
Ask for help
Help!
What’d we Learn?
Don’t guess.

More Related Content

What's hot

Php 7 compliance workshop singapore
Php 7 compliance workshop singaporePhp 7 compliance workshop singapore
Php 7 compliance workshop singaporeDamien Seguy
 
Web Development with Python and Django
Web Development with Python and DjangoWeb Development with Python and Django
Web Development with Python and DjangoMichael Pirnat
 
C++ Restrictions for Game Programming.
C++ Restrictions for Game Programming.C++ Restrictions for Game Programming.
C++ Restrictions for Game Programming.Richard Taylor
 
Most Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL FeaturesMost Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL FeaturesPeter Eisentraut
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To AntRajesh Kumar
 
Compilation and Execution
Compilation and ExecutionCompilation and Execution
Compilation and ExecutionChong-Kuan Chen
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using DjangoNathan Eror
 
Positive Hack Days. Goltsev. Web Vulnerabilities: Difficult Cases
Positive Hack Days. Goltsev. Web Vulnerabilities: Difficult CasesPositive Hack Days. Goltsev. Web Vulnerabilities: Difficult Cases
Positive Hack Days. Goltsev. Web Vulnerabilities: Difficult CasesPositive Hack Days
 
Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0Quang Ngoc
 
PHP Presentation
PHP PresentationPHP Presentation
PHP PresentationNikhil Jain
 
Something About Dynamic Linking
Something About Dynamic LinkingSomething About Dynamic Linking
Something About Dynamic LinkingWang Hsiangkai
 
Mashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMatt Butcher
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat ToolKanika2885
 
Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Matthew McCullough
 
Rails vs Web2py
Rails vs Web2pyRails vs Web2py
Rails vs Web2pyjonromero
 

What's hot (19)

Php 7 compliance workshop singapore
Php 7 compliance workshop singaporePhp 7 compliance workshop singapore
Php 7 compliance workshop singapore
 
Web Development with Python and Django
Web Development with Python and DjangoWeb Development with Python and Django
Web Development with Python and Django
 
C++ Restrictions for Game Programming.
C++ Restrictions for Game Programming.C++ Restrictions for Game Programming.
C++ Restrictions for Game Programming.
 
Most Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL FeaturesMost Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL Features
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Compilation and Execution
Compilation and ExecutionCompilation and Execution
Compilation and Execution
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using Django
 
Positive Hack Days. Goltsev. Web Vulnerabilities: Difficult Cases
Positive Hack Days. Goltsev. Web Vulnerabilities: Difficult CasesPositive Hack Days. Goltsev. Web Vulnerabilities: Difficult Cases
Positive Hack Days. Goltsev. Web Vulnerabilities: Difficult Cases
 
Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Cross platform php
Cross platform phpCross platform php
Cross platform php
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Something About Dynamic Linking
Something About Dynamic LinkingSomething About Dynamic Linking
Something About Dynamic Linking
 
Mashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMashups with Drupal and QueryPath
Mashups with Drupal and QueryPath
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat Tool
 
Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3
 
Rails vs Web2py
Rails vs Web2pyRails vs Web2py
Rails vs Web2py
 

Viewers also liked

Viewers also liked (13)

Google wave
Google waveGoogle wave
Google wave
 
New repform
New repformNew repform
New repform
 
TurboTax in Social TY 2009
TurboTax in Social TY 2009TurboTax in Social TY 2009
TurboTax in Social TY 2009
 
CGS-Customer Generated Solutions at TurboTax
CGS-Customer Generated Solutions at TurboTaxCGS-Customer Generated Solutions at TurboTax
CGS-Customer Generated Solutions at TurboTax
 
Curbside Value Partnership Boot Camp Webinar: Blueprint for a successful educ...
Curbside Value Partnership Boot Camp Webinar: Blueprint for a successful educ...Curbside Value Partnership Boot Camp Webinar: Blueprint for a successful educ...
Curbside Value Partnership Boot Camp Webinar: Blueprint for a successful educ...
 
Roya3
Roya3Roya3
Roya3
 
CVP Boot Camp Webinar
CVP Boot Camp WebinarCVP Boot Camp Webinar
CVP Boot Camp Webinar
 
A MOME Könyvtár szolgáltatásai
A MOME Könyvtár szolgáltatásaiA MOME Könyvtár szolgáltatásai
A MOME Könyvtár szolgáltatásai
 
La Riforma Protestante
La Riforma ProtestanteLa Riforma Protestante
La Riforma Protestante
 
Criterios y normas para la prevención, protección y acompañamiento de menores...
Criterios y normas para la prevención, protección y acompañamiento de menores...Criterios y normas para la prevención, protección y acompañamiento de menores...
Criterios y normas para la prevención, protección y acompañamiento de menores...
 
Proyecto Presupuesto 2017
Proyecto Presupuesto 2017Proyecto Presupuesto 2017
Proyecto Presupuesto 2017
 
Noun clause
Noun clauseNoun clause
Noun clause
 
MOMEK 2.0
MOMEK 2.0MOMEK 2.0
MOMEK 2.0
 

Similar to EE Squashed

Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Hyun-Mook Choi
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Elvin Gentiles
 
Php Best Practices
Php Best PracticesPhp Best Practices
Php Best PracticesAnsar Ahmed
 
Php Best Practices
Php Best PracticesPhp Best Practices
Php Best PracticesAnsar Ahmed
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APCBen Ramsey
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariJoseph Scott
 
Алексей Колосов - Типичные ошибки разработчиков на Drupal (версии 5,6,7)
Алексей Колосов - Типичные ошибки разработчиков на Drupal (версии 5,6,7)Алексей Колосов - Типичные ошибки разработчиков на Drupal (версии 5,6,7)
Алексей Колосов - Типичные ошибки разработчиков на Drupal (версии 5,6,7)LEDC 2016
 
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 DutyLeslie Doherty
 
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNoSuchCon
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systemssosorry
 
Hadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault InjectionHadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault InjectionCloudera, Inc.
 
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilitiesVorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilitiesDefconRussia
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...Hackito Ergo Sum
 
How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.DrupalCampDN
 
Apache Commons Overview
Apache Commons OverviewApache Commons Overview
Apache Commons Overviewghessler
 

Similar to EE Squashed (20)

Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
 
Php Best Practices
Php Best PracticesPhp Best Practices
Php Best Practices
 
Php Best Practices
Php Best PracticesPhp Best Practices
Php Best Practices
 
Ext 0523
Ext 0523Ext 0523
Ext 0523
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
Алексей Колосов - Типичные ошибки разработчиков на Drupal (версии 5,6,7)
Алексей Колосов - Типичные ошибки разработчиков на Drupal (версии 5,6,7)Алексей Колосов - Типичные ошибки разработчиков на Drupal (версии 5,6,7)
Алексей Колосов - Типичные ошибки разработчиков на Drupal (версии 5,6,7)
 
presentation
presentationpresentation
presentation
 
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
 
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
 
presentation
presentationpresentation
presentation
 
Hadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault InjectionHadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault Injection
 
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilitiesVorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
 
Os Selbak
Os SelbakOs Selbak
Os Selbak
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.
 
Apache Commons Overview
Apache Commons OverviewApache Commons Overview
Apache Commons Overview
 

Recently uploaded

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Recently uploaded (20)

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

EE Squashed

  • 1. EE Squashed Debugging in ExpressionEngine
  • 4. What’s Happening? Request index.php core/CodeIgniter controllers/EE libraries/Core libraries/Template Output!
  • 5. CodeIgniter Request index.php core/CodeIgniter controllers/EE libraries/Core libraries/Template Output!
  • 6. ExpressionEngine Request index.php core/CodeIgniter controllers/EE libraries/Core libraries/Template Output!
  • 7. Request index.php core/CodeIgniter controllers/EE libraries/Core libraries/Template Output!
  • 8. Request index.php Set non-standard system path core/CodeIgniter $system_path = '../sys'; controllers/EE libraries/Core Kick off CodeIgniter require_once BASEPATH.'core/ libraries/Template CodeIgniter'.EXT; Output!
  • 9. Run CodeIgniter Request LOAD: core/Common LOAD: core/Compat LOAD: config/constants index.php LOAD: core/Benchmark LOAD: core/Hooks RUN: pre-system HOOK LOAD: core/Config core/CodeIgniter LOAD: core/Unicode LOAD: core/URI LOAD: core/Router controllers/EE LOAD: core/Output RUN: cache_override HOOK LOAD: core/Input libraries/Core LOAD: core/Lang LOAD: core/Base[4,5] LOAD: core/Controller LOAD: EE libraries/Template RUN: pre_controller HOOK INSTANTIATE: EE RUN: post_controller_constructor HOOK Output! RUN: EE/index RUN: post_controller HOOK RENDER: output RUN: post_system HOOK
  • 10. Run CodeIgniter Request LOAD: core/Common LOAD: core/Compat LOAD: config/constants index.php LOAD: core/Benchmark LOAD: core/Hooks RUN: pre-system HOOK LOAD: core/Config core/CodeIgniter LOAD: core/Unicode LOAD: core/URI LOAD: core/Router controllers/EE LOAD: core/Output RUN: cache_override HOOK LOAD: core/Input libraries/Core LOAD: core/Lang LOAD: core/Base[4,5] LOAD: core/Controller LOAD: EE libraries/Template RUN: pre_controller HOOK INSTANTIATE: EE RUN: post_controller_constructor HOOK Output! RUN: EE/index RUN: post_controller HOOK RENDER: output RUN: post_system HOOK
  • 11. Run CodeIgniter Request LOAD: core/Common LOAD: core/Compat LOAD: config/constants index.php LOAD: core/Benchmark LOAD: core/Hooks RUN: pre-system HOOK LOAD: core/Config core/CodeIgniter LOAD: core/Unicode LOAD: core/URI LOAD: core/Router controllers/EE LOAD: core/Output RUN: cache_override HOOK LOAD: core/Input libraries/Core LOAD: core/Lang LOAD: core/Base[4,5] LOAD: core/Controller LOAD: EE libraries/Template RUN: pre_controller HOOK INSTANTIATE: EE RUN: post_controller_constructor HOOK Output! RUN: EE/index RUN: post_controller HOOK RENDER: output RUN: post_system HOOK
  • 12. Request index.php core/CodeIgniter Kick off controllers/EE ExpressionEngine $this->core->_initialize_core(); libraries/Core libraries/Template Output!
  • 13. Request index.php Run ExpressionEngine core/CodeIgniter LOAD: Database LOAD: Site Preferences LOAD: libraries/Functions controllers/EE LOAD: libraries/Extensions LOAD: libraries/Localize LOAD: libraries/Session libraries/Core LOAD: languages/english/core LOAD: libraries/Template RUN: template/run_template_engine libraries/Template Output!
  • 14. Request index.php Run ExpressionEngine core/CodeIgniter LOAD: Database LOAD: Site Preferences LOAD: libraries/Functions controllers/EE LOAD: libraries/Extensions LOAD: libraries/Localize LOAD: libraries/Session libraries/Core LOAD: languages/english/core LOAD: libraries/Template RUN: template/run_template_engine libraries/Template Output!
  • 15. Request index.php Parse the Template Parses URI core/CodeIgniter Fetch template from DB Fetch template from disk Static check Parse snippets, segments, embed:vars controllers/EE Check cache Parse input PHP Parse simple conditionals libraries/Core Parse tags Parse output PHP Write cache libraries/Template Parse advanced conditionals Loop through sub-templates Output!
  • 16. Request index.php Parse the Template Parses URI core/CodeIgniter Fetch template from DB Fetch template from disk Static check Parse snippets, segments, embed:vars controllers/EE Check cache Parse input PHP Parse simple conditionals libraries/Core Parse tags Parse output PHP Write cache libraries/Template Parse advanced conditionals Loop through sub-templates Output!
  • 17. Request index.php core/CodeIgniter controllers/EE libraries/Core libraries/Template Output!
  • 18. What’s Happening? Request index.php core/CodeIgniter controllers/EE libraries/Core libraries/Template Output!
  • 19. Debugging Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected. –wikipedia
  • 20. Debugging Debugging is a methodical process!
  • 21. KISS Don’t assume anything Attack the obvious Ask for help Start broad
  • 22. When you assume… Don’t assume it’s an extension Don’t assume it’s the database Don’t assume it’s your host Don’t assume… It’s much faster to determine what the problem is than what the problem isn’t.
  • 23. Is it plugged in? Can you SSH/FTP? Can you access a static HTML file? Can you access your database? Can you access PHP info?
  • 24. Help! Xdebug Extension for PHP http://xdebug.org/ Display Output Profiler $config[‘show_profiler’] = TRUE;
  • 25. Broad strokes Check the application, can you log into the CP? Check the templates, can you access other pages? Remove half the template, does it show up? Remove a fourth the template, does it show up? Rinse, repeat…
  • 26. KISS Huot Style 1. Test a static file 2. Test the control panel 3. Test other templates 4. Remove the entire trouble template, replace it with “test” 5. Fill back in the template until it breaks
  • 27. KISS Huot Style 6. Is the trouble spot fixable in the template? 7. If not open the add-on and place debugging lines throughout 8. Is the trouble spot in the add-on? 9. If not open the core EE files and place debugging lines throughout
  • 30. The Problem 4:30 pm on a Friday
  • 31. Assumptions… Let’s do it all wrong.
  • 32. It’s EE’s Fault An entry was overwritten? An entry was accidentally deleted? An entry was set to closed?
  • 33. It’s MySQL’s Fault The database is corrupt? Primary keys are out of order because of a backup or import?
  • 34. Now, I feel like an ass.
  • 35. KISS Don’t assume anything Attack the obvious Start broad Ask for help
  • 36. Is it plugged in? Check with the client, what is really missing? Can they tell you anything about the data? What channel it was in? What status they set it to? 5:58 pm on a Friday
  • 37. The Solution “Don't worry Mark, they never existed in the DB. We got to the bottom of it. I'm adding them by hand tomorrow. Sorry for all the confusion.” 6:23 pm on a Friday
  • 39. The Problem Every listing page just stopped working.
  • 41. Today
  • 42. Background Project rolled seven sites into one. Each sub-site was different and contained separate IA (navigation).
  • 43. Under the Hood Standard EE 1.x install No custom add-ons Not using Pages module “Templates as controllers”
  • 45.
  • 46.
  • 47.
  • 48. Assumptions… Let’s do it all wrong.
  • 49. It’s EE’s Fault Have the templates changed? Was something new installed/enabled? Is it daylight savings time?
  • 50. Now, I feel like an ass.
  • 51. KISS Don’t assume anything Attack the obvious Start broad Ask for help
  • 55. The Solution For now, I’ve renamed entry. I’m open to suggestions, please feel free to educate me after this session with your ideas.
  • 57. The Problem Contestants aren’t sorting properly.
  • 58.
  • 59.
  • 60. Under the Hood Standard EE 2.x install EE Members EE Member Custom Profile Fields Mark Huot Vote Module Solspace User Module
  • 61. All together now… The Vote module records votes in a separate database table. The Vote module summarizes total votes into a standard EE member profile field. The User module displays users ordered by the EE member profile field.
  • 62. Assumptions… Let’s do it all wrong.
  • 63. It’s EE’s Fault Values are correct in control panel.
  • 64. It’s Vote’s Fault Module code looks correct. Correctly using exp_member_data table. Pulling correct custom field, I think…
  • 65. It’s User’s Fault Nope, template appears correct. Sorting by other fields works as expected (username, other custom fields). Sort attribute correctly flips the results, but keeps them out of order.
  • 66. It’s My Fault Template looks right. Not a CSS issue, underlying XHTML is wrong too.
  • 67. Now, I feel like an ass.
  • 68. KISS Don’t assume anything Attack the obvious Start broad Ask for help
  • 69. Help!
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.