Difference between revisions of "API/Core"

From aMember Pro Documentation
Jump to: navigation, search
Line 8: Line 8:
 
=== Directory layout ===
 
=== Directory layout ===
 
<pre>
 
<pre>
'''amember'''
+
amember
   '''application'''
+
   application
     configs/ - configuration files
+
     configs/             - configuration files
     default/ - default module
+
     default/             - default module
       controllers/ - controller files - it replaces usual PHP "pages". One controller usually represents one "traditional" PHP file
+
       controllers/       - controller files - it replaces usual PHP "pages". One controller usually represents one "traditional" PHP file
       language/ - translations
+
       language/           - translations
       models/   - models : each file represents one database file
+
       models/             - models : each file represents one database table. Contains successors to Am_Table and Am_Record classes
       plugins/
+
       plugins/          
         protect/ -  
+
         protect/         - integration plugins
         payment/
+
         payment/         - payment plugins
         misc/  
+
         misc/             - misc. plugins, for example google analytics integration plugin
       themes/
+
       themes/             - user-side themes
       themes-admin/
+
       themes-admin/       - admin-side themes
       views/
+
       views/             - templates, it is better to modify templates by creation of custom theme
       Bootstrap.php - module bootstrap file
+
       Bootstrap.php       - module bootstrap file
       db.xml       - database structure configuration file
+
       db.xml             - database structure configuration file
     newsletter/ - a "newsletter" module. Described here for example
+
     newsletter/           - a "newsletter" module. Described here for example
       controllers/ - newsletter module controllers. Accessible like http://www.example.com/am4/newsletter/subscribe
+
       controllers/       - newsletter module controllers. Accessible like http://www.example.com/am4/newsletter/subscribe
       library/     - newsletter module model classes and other libraries
+
       library/           - newsletter module model classes and other libraries
       views/       - Zend_View templates for newsletter module. All "views" folders are merged to single view path, and module can provide its own version of existing templates
+
       views/             - Zend_View templates for newsletter module. All "views" folders are merged to single view path, and module can provide its own version of existing templates
         blocks/     - template "blocks" - small page pieces that can be included/excluded/shuffled via API
+
         blocks/           - template "blocks" - small page pieces that can be included/excluded/shuffled via API
 
   data
 
   data
     cache/ - cache files
+
     cache/               - cache files
     new-rewrite/ - new-rewrite label files
+
     new-rewrite/         - new-rewrite marker files
   library - amember and third-party core libraries
+
   library                 - amember and third-party core libraries
   setup/ - setup folder
+
   setup/                 - setup folder
   bootstrap.php - initialize amember core
+
   bootstrap.php           - initialize amember core
   index.php - runs page controller and outputs content
+
   index.php               - runs page controller and outputs content
   js.php     - accelerator to pack all necessary JS libs to one file and deliver to client
+
   js.php                 - accelerator to pack all necessary JS libs to one file and deliver to client
   public.php - accelerator to provide quick access to custom files, specially configurable CSS files in themes
+
   public.php             - accelerator to provide quick access to custom files, specially configurable CSS files in themes
 
</pre>
 
</pre>

Revision as of 06:42, 28 June 2011

aMember Pro v.4 is based on Zend Framework's Zend_Controller and follow its guidelines. There is a Bootstrap class that handles all the dependencies and configuration loading.

To get all aMember Pro functions available for your custom script, just include bootstrap.php withing amember/ folder. It does not output any page, just initialises the core.

aMember Pro uses .htaccess file in root folder to route requests to pages. It is done by using of Apache's mod_rewrite by redirecting all requests for not-image files to amember/index.php . index.php runs Zend_Controller_Front routing procedures to include necessary controller class and run it.


Directory layout

amember
  application
    configs/              - configuration files
    default/              - default module
      controllers/        - controller files - it replaces usual PHP "pages". One controller usually represents one "traditional" PHP file
      language/           - translations
      models/             - models : each file represents one database table. Contains successors to Am_Table and Am_Record classes
      plugins/            
        protect/          - integration plugins
        payment/          - payment plugins
        misc/             - misc. plugins, for example google analytics integration plugin
      themes/             - user-side themes
      themes-admin/       - admin-side themes
      views/              - templates, it is better to modify templates by creation of custom theme
      Bootstrap.php       - module bootstrap file
      db.xml              - database structure configuration file
    newsletter/           - a "newsletter" module. Described here for example
      controllers/        - newsletter module controllers. Accessible like http://www.example.com/am4/newsletter/subscribe
      library/            - newsletter module model classes and other libraries
      views/              - Zend_View templates for newsletter module. All "views" folders are merged to single view path, and module can provide its own version of existing templates
        blocks/           - template "blocks" - small page pieces that can be included/excluded/shuffled via API
  data
    cache/                - cache files
    new-rewrite/          - new-rewrite marker files
  library                 - amember and third-party core libraries
  setup/                  - setup folder
  bootstrap.php           - initialize amember core
  index.php               - runs page controller and outputs content
  js.php                  - accelerator to pack all necessary JS libs to one file and deliver to client
  public.php              - accelerator to provide quick access to custom files, specially configurable CSS files in themes