Documentation


SEARCH

TABLE OF CONTENT

    1. Getting started 2. Basic concepts 3. Request dispatching 4. Context container 5. Dual MVC 6. Component model: 7. Security 8. Configuration 9. Session handling 10. I18n 11. Cache 12. Logging 13. Error handling 14. Advanced Topics 15. API reference

      Tutorials: Frequently Asqued Questions

      See also:


      Context Container

      Table of Contents

      Introduction

      Lion framework is organized by contexts, where each context represents a concrete application. At the very high level, a context is just a space where instances collaborate together without interfering with other contexts. i.e., a context manages his own session and cache, avoiding conflicts with other contexts running at the same time.

      A context is linked to a physical directory where application's classes and configuration files are contained in, being able to handle his own configuration and classes.

      The first context that lion loads is the one representing the main application (also known as the application context).
      Getting the application context is really simple: there is a singleton instance representing it. The context also exposes some accessor to retrieve context contained instances such the session or the configuration.
      i.e.

      1. <?php
      2.  
      3. //get the application context:
      4. $application_context __ApplicationContext::getInstance();
      5.  
      6. //get the context configuration:
      7. $configuration $application_context->getConfiguration();
      8.  
      9. //get the context session:
      10. $session $application_context->getSession();
      11.  
      12. //get the context cache:
      13. $cache $application_context->getCache();