Saturday, August 12, 2006

Preload (1)

Loglog may have been difficult sample. Important features in XOOPS Cube are Preload, Delegate and Xube_Service. You can customize the site variously by these features. At first, do learn Preload.

There are two kinds of Preload, which are Site Preload and Module Preload. Site Preload is really simple.

  1. Create XXXX.class.php in /preload directory.
  2. Define XXXX class which is the sub-class of XCube_ActionFilter.
  3. Implement preFilter() and preBlockFilter() for your purpose. These member functions are virtual function of XCube_ActionFilter.

Member functions of XCube_ActionFilter are called in the common process, which implements initial process as well as common.php of XOOPS2. In XOOPS2, there were not any methods which site owners run their code in the initial process. To do it, they have to modify(hack) source code of XOOPS2 core.

Preload and ActionFilter are solutions for that problem. Through these features, site owners can run their code in initial process without hack.

You understand that Preload File is new publication unit. Site owners may share it with their friends. And, they can release it as well as modules and themes.

You can use Preload for multi purposes.

  • Run initial code to customize.
    • Add my functions to Delegate of other modules.
    • Define Services or Delegate functions, and add it to Core for other modules.
    • Exchange objects of the core.
  • Load required libraries.

No comments: