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)
 
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
 
presentation
presentationpresentation
presentation
 
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

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Recently uploaded (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

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.