Creating Core System Libraries
Every time revIgniter runs there are several base libraries that are initialized automatically as part of the core framework. It is possible, however, to swap any of the core system libraries with your own versions or even extend the core versions.
Most users will never have any need to do this, but the option to replace or extend them does exist for those who would like to significantly alter the revIgniter core.
Note: Messing with core system libraries has a lot of implications, so make sure you know what you are doing before attempting it.
System Libraries List
The following is a list of the core system files that are invoked every time revIgniter runs:
Replacing Core Libraries
To use one of your own system libraries instead of a default one simply place your version inside your local application/libraries directory:
If this directory does not exist you can create it.
Any file named identically to one from the list above will be used instead of the one normally used.
Extending Core Library
If all you need to do is add some functionality to an existing library - perhaps add a function or two - then it's overkill to replace the entire library with your version. In this case it's better to simply extend the library. Extending a library is nearly identical to replacing a library with one exception:
- Your new library name must be prefixed with MY_ (this item is configurable. See below.).
For example, to extend the native Input library you'll create a file named application/libraries/MY_Input.livecodescript.
Note: All revIgniter script only stack files use "livecodescript" as file extension. This convention you should keep in mind when you build models, libraries, helpers etc.
Setting Your Own Prefix
To set your own sub-library prefix, open your application/config/config.lc file and look for this item:
put "MY_" into gConfig["sublibraryPrefix"]