Fast Gallery – Introduction for developers


This blogpost should give a quick kickstart to every developer who is interested in helping to advance Fast Gallery. The architecture is intended to have a swapable storage engine. So far I've only written one storage engine, which means that interfaces are not 100% clearly defined, but would instead need some work when actually going to be used in practice. First a quick overview over the files and what their responsibilities are.

  • fast_gallery-image-wrapper.tpl.php: template file to display the image
  • fast_gallery.admin.inc: the general admin stuff (UI), that would be used by any storage engine (setting up galleries, scanning galleries…)
  • fast_gallery.cache.class.php: incase Imagecache is not available there's a simple caching class, that creates thumbnails and caches them.
  • fast_gallery.class.php: this is the heart of the module. Here we recursively explore directories for images and send them to the storage engine or get images from the storage engine and return them to the frontend
  • fast_gallery.css: if you are developing, you should know what this is for 😉
  • fast_gallery.info: same here
  • fast_gallery.install: and same here
  • fast_gallery.module: Mostly it's just implementations of hooks and actually displaying the gallery in fast_gallery_alias()
  • fast_gallery.test: I started once writing some tests…. this really needs some work!
  • FGImage.class.php: Internally Fast Gallery treats images as objects of this class.

Ok, then we have a couple folders:

  • images: just some images
  • integrations: possible integrations into other modules. So far: features integration
  • modules: Other modules for fast gallery. I started once the Fast Gallery API module, which should provide some kind of REST API… but it's not there yet
  • storageengine: well this contains some classes and interfaces that are responsible for actually storing and retrieving images and hierarchy retrieved from directories
  • tests: just some folders that are used when doing the simpletests

Just some more info on the storageengine folder:

  • Istorage.php: contains and interface that all possible storageengines must implement.
  • default.config.inc: Well, just some UI stuff for storageeninge specific configuration
  • default.storage.inc: the actual storage engine, that stores data into the db, makes sure hierarchy is correct and returns the right images depening on the path.
  • node.config.inc, node.storage.inc: sample data to build a nodestorage, which was actually my goal at a given point…. but unfortunately not there yet 🙁

Oky, this is the first attempt. I'll write another blogpost and describe some of the important concepts in detail.