Gallery 3 is built on top of Kohana 2.3, a lean and fast application framework. Some of the design concepts below are similar or identical to the way that Kohana works. As a result, almost all of the well documented Kohana 2.x APIs are available to the Gallery 3 module and theme developer. New developers are encouraged to familiarize themselves with the APIs that Kohana makes available.
Gallery 3 has the following top level structure:
Kohana is an opinionated framework. There is a right way to write the code and if you do it that way, then it's very easy and you don't have to write much code. One way that you'll see this is that Kohana expects certain files to be in certain places. A fully fleshed out example module would have this directory structure:
example ├── config ├── controllers ├── css ├── helpers ├── hooks ├── images ├── js ├── libraries │ └── drivers │ └── ExampleDriver ├── models ├── tests └── views
Very few modules need this many directories! If you don't have any controllers, you wouldn't bother to create a controller directory. But if you do have a controller and you put it in the controllers directory then Kohana knows exactly where to look for it. This means that you don't have to do anything other than write a few lines of controller code then name and place the file the right way and Kohana will immediately start using it. In Kohana, this feature is known as the Cascading File System, and it allows most modules to remain relatively small because they contain little to no boilerplate code.