What is a library?
Libraries are simply PHP classes that can be used for whatever you need them to be used for.You can read more about CodeIgniter’s libraries in their documentation.
- template
- menu
- auth
- event
- user_panel
- location
- util
All of Nova’s available libraries can be found in the
nova/modules/core/libraries
directory.Extending libraries
In order to provide as much flexibility as possible, Nova is split up into two distinct layers: the core and the application. Any work Anodyne does on Nova lives inside “the core”. Any work that you do on your game’s site is “the application”. This is done to ensure that any update to Nova doesn’t reset the changes you’ve made to your installation of Nova.Core libraries
The “core” layer of Nova is considered anything that lives inside thenova
directory. (As an aside, this is what allows for the simplicity of only needing to replace the nova
directory when updating to the latest version.)
When it comes to libraries, you’ll find that all of Nova’s core libraries are located in the nova/modules/core/libraries
directory. To avoid naming conflicts, all of Nova’s core libraries are prefixed with nova_
.
Application libraries
The “application” layer of Nova is considered anything that lives outside of thenova
directory.
When it comes to libraries, all of Nova’s application libraries are located in the application/libraries
directory. Nova comes with all of the needed libraries out of the box, but if you want to create new libraries, you can add your own libraries here.
Customizations
When you open an application library, you’ll see a file that looks something like this:application/libraries/Auth.php
When it comes to overriding a library method, the recommended way of doing that is to copy the method from the core library and paste it into the application library. You then have a working copy of the method from which to modify whatever you want.